⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 signin.aspx.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
字号:
namespace PowerEasy.WebSite.User.Contents
{
    using PowerEasy.Common;
    using PowerEasy.CommonModel;
    using PowerEasy.Components;
    using PowerEasy.Contents;
    using PowerEasy.Controls;
    using PowerEasy.ExtendedControls;
    using PowerEasy.Model.Contents;
    using PowerEasy.ModelControls;
    using PowerEasy.Web.UI;
    using PowerEasy.WebSite.Controls;
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Text;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class Signin : DynamicPage
    {
        protected ExtendedNodeButton EBtnSignin;
        protected ExtendedGridView EgvContentSignin;
        protected HtmlForm form1;
        protected HiddenField HdnListType;
        protected Dictionary<int, string> m_NodeNameDictionary = new Dictionary<int, string>();
        protected ObjectDataSource OdsContents;
        protected UserNavigation UserCenterNavigation;
        protected ExtendedSiteMapPath YourPosition;

        protected void EBtnSignin_Click(object sender, EventArgs e)
        {
            bool flag = true;
            StringBuilder selectList = this.EgvContentSignin.SelectList;
            if (selectList.Length < 1)
            {
                DynamicPage.WriteUserErrMsg("请选择要签收的项目!");
            }
            else
            {
                for (int i = 0; i < selectList.Length; i++)
                {
                    if (!SigninLog.Signin(selectList[i], PEContext.Current.User.UserName, true, PEContext.Current.UserHostAddress))
                    {
                        flag = false;
                        break;
                    }
                }
            }
            if (flag)
            {
                DynamicPage.WriteUserSuccessMsg("<li>签收成功!</li>", "ContentSignin.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
            }
            else
            {
                DynamicPage.WriteUserErrMsg("<li>签收失败!</li>");
            }
        }

        protected void EgvContentSignin_RowCommand(object sender, CommandEventArgs e)
        {
            if (e.CommandName == "Signin")
            {
                if (SigninLog.Signin(DataConverter.CLng(e.CommandArgument.ToString()), PEContext.Current.User.UserName, true, PEContext.Current.UserHostAddress))
                {
                    DynamicPage.WriteUserSuccessMsg("<li>签收成功!</li>", "Signin.aspx?NodeID=" + BasePage.RequestInt32("NodeID"));
                }
                else
                {
                    DynamicPage.WriteUserErrMsg("<li>签收失败!</li>");
                }
            }
        }

        protected void EgvContentSignin_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                DataRowView dataItem = (DataRowView) e.Row.DataItem;
                int key = BasePage.RequestInt32("NodeID");
                string nodeName = "";
                LinkImage image = e.Row.FindControl("LinkImageModel") as LinkImage;
                string itemIcon = ModelManager.GetCacheModelById(DataConverter.CLng(dataItem["ModelId"].ToString())).ItemIcon;
                if (string.IsNullOrEmpty(itemIcon))
                {
                    itemIcon = "Default.gif";
                }
                image.Icon = itemIcon;
                if (dataItem["LinkType"].ToString() != "0")
                {
                    image.IsShowLink = true;
                }
                if (DataConverter.CLng(dataItem["NodeID"].ToString()) != key)
                {
                    key = DataConverter.CLng(dataItem["NodeID"].ToString());
                    if (this.m_NodeNameDictionary.ContainsKey(key))
                    {
                        nodeName = this.m_NodeNameDictionary[key];
                    }
                    else
                    {
                        NodeInfo cacheNodeById = PowerEasy.Contents.Nodes.GetCacheNodeById(key);
                        if (!cacheNodeById.IsNull)
                        {
                            nodeName = cacheNodeById.NodeName;
                            this.m_NodeNameDictionary.Add(key, nodeName);
                        }
                    }
                    Label label = e.Row.FindControl("LblNodeLink") as Label;
                    label.Text = "<strong>[<a href=\"Signin.aspx?NodeID=" + dataItem["NodeID"].ToString() + "\">" + nodeName + "</a>]</strong>";
                }
                Label label2 = e.Row.FindControl("LblSigninStatus") as Label;
                LinkButton button = e.Row.FindControl("ELbtnContentSignin") as LinkButton;
                if (DataConverter.CBool(dataItem["IsSignin"].ToString()))
                {
                    label2.Text = "<span style=\"color:Green\">已签收</span>";
                    button.Enabled = false;
                }
                else
                {
                    label2.Text = "<span style=\"color:Red\">未签收</span>";
                    button.Enabled = true;
                }
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.OdsContents.SelectParameters["UserName"].DefaultValue = PEContext.Current.User.UserName;
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -