Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //lbTruyCap.Text = Application.Contents["SoNguoiTruyCap"].ToString();
            //lbTongTruyCap.Text = Application.Contents["TongTruyCap"].ToString();
            if (!IsPostBack)
            {
                lbTitle.Text = CGlobal.GetTitleAdmin();
                int num = objMyContest.GetCountNotAcceptedByCreated();
                if (num > 0)
                {
                    lbXinVaoLop.Text = " (" + num + ")";
                }
                //checkAdmin();
                //lbname.Text
            }
            long id = CGlobal.GetUserID();

            try
            {
                DataTable dt    = objUser.LoadByID(id);
                DataRow   dtRow = dt.Rows[0];
                lbUserFullName.Text     = dtRow["FullName"].ToString();
                lbUserName.Text         = dtRow["UserName"].ToString();
                lbUserCode.Text         = dtRow["UserCode"].ToString();
                imgAvatar.ImageUrl      = (dtRow["Avatar"].ToString());
                imgAvatarSlide.ImageUrl = (dtRow["Avatar"].ToString());

                if (!objUser.CheckIsAdmin(id))
                {
                    logOut();
                }
            }
            catch (Exception)
            {
                logOut();
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lbTruyCap.Text     = Application.Contents["SoNguoiTruyCap"].ToString();
            lbTongTruyCap.Text = Application.Contents["TongTruyCap"].ToString();
            getNoti();

            if (!IsPostBack)
            {
                lbTitle.Text = CGlobal.GetTitleUser();
            }
            long id = CGlobal.GetUserID();

            try
            {
                DataTable dt    = objUser.LoadByID(id);
                DataRow   dtRow = dt.Rows[0];
                lbUserFullName.Text     = dtRow["FullName"].ToString();
                lbUserName.Text         = dtRow["UserName"].ToString();
                lbUserCode.Text         = dtRow["UserCode"].ToString();
                imgAvatar.ImageUrl      = (dtRow["Avatar"].ToString());
                imgAvatarSlide.ImageUrl = (dtRow["Avatar"].ToString());

                if (objUser.CheckIsAdmin(id))
                {
                    liGoToAdmin.Visible = true;
                }
                else
                {
                    liGoToAdmin.Visible = false;
                }
            }
            catch
            {
                logOut();
            }
        }