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

📄 showuserinfo.cs

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

    public class ShowUserInfo : BaseUserControl
    {
        protected HtmlTableRow Balance;
        protected HtmlTableRow EndTime;
        protected Label LblBalance;
        protected Label LblEndTime;
        protected Label LblPoint;
        protected Label LblUserExp;
        protected Label LblUserGroup;
        protected Label LblUserName;
        protected Label LblValidDays;
        protected HtmlTableRow Point;
        protected ShowPointName ShowPointName1;
        protected ShowPointName ShowPointName2;
        protected HtmlTableRow UserExp;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                PowerEasy.Model.UserManage.UserInfo userInfo = this.UserInfo;
                if (userInfo == null)
                {
                    userInfo = Users.GetUserById(DataConverter.CLng(base.Request.QueryString["UserID"]));
                    this.ViewState["UserInfo"] = userInfo;
                }
                if (userInfo.IsNull)
                {
                    BaseUserControl.WriteErrMsg("<li>找不到指定的会员!</li>");
                }
                else
                {
                    if (string.IsNullOrEmpty(userInfo.GroupName))
                    {
                        userInfo.GroupName = UserGroups.GetUserGroupById(userInfo.GroupId).GroupName;
                    }
                    this.LblUserName.Text = userInfo.UserName;
                    this.LblUserGroup.Text = userInfo.GroupName;
                    if (!SiteConfig.SiteOption.EnablePointMoneyExp)
                    {
                        this.Balance.Style.Add("display", "none");
                        this.Point.Style.Add("display", "none");
                        this.UserExp.Style.Add("display", "none");
                        this.EndTime.Style.Add("display", "none");
                    }
                    else
                    {
                        this.LblBalance.Text = userInfo.Balance.ToString("0.00");
                        this.LblPoint.Text = userInfo.UserPoint.ToString();
                        if (!userInfo.EndTime.HasValue)
                        {
                            this.LblEndTime.Text = "";
                        }
                        else
                        {
                            this.LblEndTime.Text = userInfo.EndTime.Value.ToString("yyyy-MM-dd");
                        }
                        this.LblUserExp.Text = userInfo.UserExp.ToString();
                        this.LblValidDays.Text = Users.GetValidNum(userInfo.EndTime);
                    }
                }
            }
        }

        public PowerEasy.Model.UserManage.UserInfo UserInfo
        {
            get
            {
                if (this.ViewState["UserInfo"] != null)
                {
                    return (PowerEasy.Model.UserManage.UserInfo) this.ViewState["UserInfo"];
                }
                return null;
            }
            set
            {
                this.ViewState["UserInfo"] = value;
            }
        }
    }
}

⌨️ 快捷键说明

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