Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Models.AccountEntity accEntity = new Models.AccountEntity();
     if (Session["account"] != null)
     {
         string         email   = Session["account"].ToString();
         Models.Account account = accEntity.FindByEmail(email);
         if (account == null || account.ACCChucNang > 0)
         {
             this.RedirectToIndex();
         }
         else if (this.Page.RouteData.Values["account"] != null)
         {
             try
             {
                 int accountID = Convert.ToInt32(this.Page.RouteData.Values["account"]);
                 account = accEntity.Find(accountID);
                 if (account == null || account.ACCChucNang == 0)
                 {
                     this.RedirectToIndex();
                 }
             }
             catch
             {
                 this.RedirectToIndex();
             }
         }
     }
     else
     {
         this.RedirectToIndex();
     }
 }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                Models.NhanVienEntity nvEntity = new Models.NhanVienEntity();
                nvEntity.Load_AllNhanVienDonVi_ToRadDropDownTree(ddtNhanVien);
            }

            if (this.Page.RouteData.Values["account"] != null)
            {
                this.UpdateStatus();
                _accountID = Convert.ToInt32(this.Page.RouteData.Values["account"]);
                Models.Account account = _accEntity.Find(_accountID);
                if (!this.Page.IsPostBack)
                {
                    ddtNhanVien.SelectedValue  = account.NVID.ToString();
                    txtEmail.Text              = account.ACCEmail;
                    txtPassword.Text           = account.ACCPassword;
                    rblChucNang.SelectedValue  = account.ACCChucNang.ToString();
                    rblTrangThai.SelectedValue = account.ACCStatus.ToString();
                    cbThongTinCaNhan.Checked   = account.ACCUpThongTinCaNhan;
                    cbLyLich.Checked           = account.ACCUpLyLich;
                    cbInLyLich.Checked         = account.ACCInLyLich;
                    cbInKeKhai.Checked         = account.ACCInKeKhai;
                    cbUpKeKhai.Checked         = account.ACCUpKeKhai;
                    cbInDanhGia.Checked        = account.ACCInDanhGia;
                    cbUpDanhGia.Checked        = account.ACCUpDanhGia;
                }
            }
            else
            {
                this.CreateStatus();
            }
        }