using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TopWinCMS.BLL;
using TopWinCMS.Model;
using TopWinCMS.Common;
public partial class Member_Default : TopWinCMS.BLL.PageFactory.Pages.ClientPublicPage
{

    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = Config.SiteName + " → 会员中心";
        if (!IsPostBack)
        {
            Public_Member MyClassBLL = new Public_Member(false);
            if (MemberRightsCheck.IsLogined == false)
            {
                MsgBox.Alert("登录超时，请重新登录。", "Login.aspx");
            }
            else
            {
                string UserName = MemberLoginInfo.UserName;
                if (string.IsNullOrEmpty(UserName) == false)
                {
                    string Err = null;
                    MemberInfo model = new MemberManage().GetInfo(UserName, ref Err);

                    if (model == null)
                    {
                        MyClassBLL.MemberLogout(MemberLoginInfo.UserName);
                        MsgBox.Alert("登录失效，请重新登录。", "Login.aspx");

                        return;
                    }
                    LB_Name.Text = model.Name;
                    LB_RoleName.Text = model.RoleName;

                    LB_PetName.Text = model.PetName;

                    LB_Coin.Text = model.Coin.ToString();
                    LB_Point.Text = model.Point.ToString();
                    LB_Experience.Text = model.Experience.ToString();

                    LB_RegTime.Text = model.RegTime.ToShortDateString();
                    LB_MessageCount.Text = new MessageManage().Count(MemberLoginInfo.UserName);
                }
                else
                {
                    MsgBox.Alert("登录失效，请重新登录。", "Login.aspx");
                }
            }
        }
    }
}