예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["account"] != null)
     {
         Models.AccountEntity accEntity = new Models.AccountEntity();
         string         email           = Session["account"].ToString();
         Models.Account account         = accEntity.FindByEmail(email);
         if (account == null || account.ACCChucNang > 1)
         {
             Response.Redirect("~/");
         }
         else if (this.Page.RouteData.Values["donvi"] != null)
         {
             try
             {
                 int donviID = Convert.ToInt32(this.Page.RouteData.Values["donvi"]);
                 Models.DonViEntity donviEntity = new Models.DonViEntity();
                 Models.DonVi       donvi       = donviEntity.Find_DonVi(donviID);
                 if (donvi == null)
                 {
                     Response.Redirect("~/DonVi");
                 }
             }
             catch (Exception)
             {
                 Response.Redirect("~/DonVi");
             }
         }
     }
     else
     {
         Response.Redirect("~/");
     }
 }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                _donviEntity.Load_DataSource_RadDropDownTree(ddtTrucThuoc);
            }

            if (this.Page.RouteData.Values["donvi"] == null)
            {
                this.CreateStatus();
            }
            else
            {
                this.UpdateStatus();
                _currentDVID = Convert.ToInt32(this.Page.RouteData.Values["donvi"]);
                if (!IsPostBack)
                {
                    Models.DonVi currentDV = _donviEntity.Find_DonVi(_currentDVID);
                    txtTen.Text                = currentDV.DVTen;
                    txtBienChe.Text            = currentDV.DVBienChe.ToString();
                    txtChucNang.Text           = currentDV.DVNoiDung;
                    rblTrangThai.SelectedValue = currentDV.DVTrangThai.ToString();
                    ddtTrucThuoc.SelectedValue = currentDV.DVTrucThuocID.ToString();
                    txtSDT.Text                = currentDV.DVSDT;
                    txtDiaChi.Text             = currentDV.DVDiaChi;
                }
            }
        }