Exemplo n.º 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)
         {
             this.RedirectToIndex();
         }
         else if (this.Page.RouteData.Values["trinhdongoaingu"] != null)
         {
             try
             {
                 int ngoainguID = Convert.ToInt32(this.Page.RouteData.Values["trinhdongoaingu"]);
                 Models.TrinhDoNgoaiNguEntity nnEntity = new Models.TrinhDoNgoaiNguEntity();
                 Models.TrinhDoNgoaiNgu       ngoaingu = nnEntity.Find(ngoainguID);
                 if (ngoaingu == null)
                 {
                     this.RedirectToIndex();
                 }
             }
             catch
             {
                 this.RedirectToIndex();
             }
         }
         else if (this.Page.RouteData.Values["nhanvien"] != null)
         {
             try
             {
                 int nhanvienID = Convert.ToInt32(this.Page.RouteData.Values["nhanvien"]);
                 Models.NhanVienEntity nvEntity = new Models.NhanVienEntity();
                 Models.NhanVien       nhanvien = nvEntity.Find_NhanVien(nhanvienID);
                 if (nhanvien == null)
                 {
                     this.RedirectToIndex();
                 }
             }
             catch
             {
                 this.RedirectToIndex();
             }
         }
         else
         {
             this.RedirectToIndex();
         }
     }
     else
     {
         this.RedirectToIndex();
     }
 }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Page.RouteData.Values["trinhdongoaingu"] != null)
     {
         this.UpdateStatus();
         _ngoainguID = Convert.ToInt32(this.Page.RouteData.Values["trinhdongoaingu"]);
         Models.TrinhDoNgoaiNgu ngoaingu = _nnEntity.Find(_ngoainguID);
         _nhanvienID = ngoaingu.NVID;
         if (!this.Page.IsPostBack)
         {
             txtTen.Text = ngoaingu.TDNNTen;
             rblChungChi.SelectedValue    = ngoaingu.TDNNChungChi.ToString();
             rblTiengDanToc.SelectedValue = ngoaingu.TDNNTiengDanToc.ToString();
         }
     }
     else
     {
         this.CreateStatus();
         _nhanvienID = Convert.ToInt32(this.Page.RouteData.Values["nhanvien"]);
     }
 }