protected void Page_Load(object sender, EventArgs e) { if (this.Page.RouteData.Values["kekhai"] != null) { this.UpdateStatus(); _kekhaiID = Convert.ToInt32(this.Page.RouteData.Values["kekhai"]); Models.KeKhai kekhai = _kkEntity.Find(_kekhaiID); _nhanvienID = kekhai.NVID; if (!this.Page.IsPostBack) { txtNam.Text = kekhai.KKNam.ToString(); dpkNgayKeKhai.SelectedDate = kekhai.KKNgayKeKhai; dpkNgayNhap.SelectedDate = kekhai.KKNgayNhap; txtChucVu.Text = kekhai.KKChucVu; txtCoQuan.Text = kekhai.KKCoQuan; txtHoKhau.Text = kekhai.KKHoKhau; txtChoO.Text = kekhai.KKChoO; txtVoChong.Text = kekhai.KKVoChong; dpkVCDOB.SelectedDate = kekhai.KKVCDOB; txtVCChucVu.Text = kekhai.KKVCChucVu; txtVCCoQuan.Text = kekhai.KKVCCoQuan; txtVCHoKhau.Text = kekhai.KKVCHoKhau; txtVCChoO.Text = kekhai.KKVCChoO; } } else { this.CreateStatus(); _nhanvienID = Convert.ToInt32(this.Page.RouteData.Values["nhanvien"]); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["account"] != null) { string email = Session["account"].ToString(); Models.AccountEntity accEntity = new Models.AccountEntity(); Models.Account account = accEntity.FindByEmail(email); if (account == null) { this.RedirectToIndex(); } else if (account.ACCChucNang > 1) { if (!account.ACCUpKeKhai) { this.RedirectToIndex(); } else if (this.Page.RouteData.Values["giaitrinh"] != null) { try { int concaiID = Convert.ToInt32(this.Page.RouteData.Values["giaitrinh"]); Models.GiaiTrinhEntity gtEntity = new Models.GiaiTrinhEntity(); Models.GiaiTrinh giaitrinh = gtEntity.Find(concaiID); if (giaitrinh == null) { this.RedirectToIndex(); } else if (giaitrinh.KeKhai.NVID != account.NVID) { this.RedirectToIndex(); } } catch { this.RedirectToIndex(); } } else if (this.Page.RouteData.Values["kekhai"] != null) { try { int kekhaiID = Convert.ToInt32(this.Page.RouteData.Values["kekhai"]); Models.KeKhaiEntity kkEntity = new Models.KeKhaiEntity(); Models.KeKhai kekhai = kkEntity.Find(kekhaiID); if (kekhai == null) { this.RedirectToIndex(); } else if (kekhai.NVID != account.NVID) { this.RedirectToIndex(); } } catch { this.RedirectToIndex(); } } else { this.RedirectToIndex(); } } else if (this.Page.RouteData.Values["giaitrinh"] != null) { try { int concaiID = Convert.ToInt32(this.Page.RouteData.Values["giaitrinh"]); Models.GiaiTrinhEntity gtEntity = new Models.GiaiTrinhEntity(); Models.GiaiTrinh giaitrinh = gtEntity.Find(concaiID); if (giaitrinh == null) { this.RedirectToIndex(); } } catch { this.RedirectToIndex(); } } else if (this.Page.RouteData.Values["kekhai"] != null) { try { int kekhaiID = Convert.ToInt32(this.Page.RouteData.Values["kekhai"]); Models.KeKhaiEntity kkEntity = new Models.KeKhaiEntity(); Models.KeKhai kekhai = kkEntity.Find(kekhaiID); if (kekhai == null) { this.RedirectToIndex(); } } catch { this.RedirectToIndex(); } } else { this.RedirectToIndex(); } } else { this.RedirectToIndex(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["account"] != null) { string email = Session["account"].ToString(); Models.AccountEntity accEntity = new Models.AccountEntity(); Models.Account account = accEntity.FindByEmail(email); if (account == null) { this.RedirectToIndex(); } else if (account.ACCChucNang > 1) { if (!account.ACCUpKeKhai) { this.RedirectToIndex(); } else if (this.Page.RouteData.Values["taisan"] != null) { try { int taisanID = Convert.ToInt32(this.Page.RouteData.Values["taisan"]); Models.TaiSanNuocNgoaiEntity tsEntity = new Models.TaiSanNuocNgoaiEntity(); Models.TaiSanNuocNgoai taisan = tsEntity.Find(taisanID); if (taisan == null) { this.RedirectToIndex(); } else if (taisan.KeKhai.NVID != account.NVID) { this.RedirectToIndex(); } } catch { this.RedirectToIndex(); } } else if (this.Page.RouteData.Values["kekhai"] != null) { try { int kekhaiID = Convert.ToInt32(this.Page.RouteData.Values["kekhai"]); Models.KeKhaiEntity kkEntity = new Models.KeKhaiEntity(); Models.KeKhai kekhai = kkEntity.Find(kekhaiID); if (kekhai == null) { this.RedirectToIndex(); } else if (kekhai.NVID != account.NVID) { this.RedirectToIndex(); } } catch { this.RedirectToIndex(); } } else { this.RedirectToIndex(); } } else if (this.Page.RouteData.Values["taisan"] != null) { try { int taisanID = Convert.ToInt32(this.Page.RouteData.Values["taisan"]); Models.TaiSanNuocNgoaiEntity tsEntity = new Models.TaiSanNuocNgoaiEntity(); Models.TaiSanNuocNgoai taisan = tsEntity.Find(taisanID); if (taisan == null) { this.RedirectToIndex(); } } catch { this.RedirectToIndex(); } } else if (this.Page.RouteData.Values["kekhai"] != null) { try { int kekhaiID = Convert.ToInt32(this.Page.RouteData.Values["kekhai"]); Models.KeKhaiEntity kkEntity = new Models.KeKhaiEntity(); Models.KeKhai kekhai = kkEntity.Find(kekhaiID); if (kekhai == null) { this.RedirectToIndex(); } } catch { this.RedirectToIndex(); } } else { this.RedirectToIndex(); } } else { this.RedirectToIndex(); } }
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) //validate đăng nhập { this.RedirectToIndex(); } else if (account.ACCChucNang > 1) // nhân viên { if (!account.ACCUpKeKhai) { this.RedirectToIndex(); } else if (this.Page.RouteData.Values["kekhai"] != null) { try { _kekhaiID = Convert.ToInt32(this.Page.RouteData.Values["kekhai"]); Models.KeKhaiEntity kkEntity = new Models.KeKhaiEntity(); Models.KeKhai kekhai = kkEntity.Find(_kekhaiID); if (kekhai == null) { this.RedirectToIndex(); } else if (kekhai.NVID != account.NVID) { this.RedirectToIndex(); } else { pnlContent.Visible = true; } } catch { this.RedirectToIndex(); } } else if (this.Page.RouteData.Values["nhanvien"] != null) { try { int nhanvienID = Convert.ToInt32(this.Page.RouteData.Values["nhanvien"]); if (nhanvienID != account.NVID) { this.RedirectToIndex(); } else { 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 if (this.Page.RouteData.Values["kekhai"] != null) { try { _kekhaiID = Convert.ToInt32(this.Page.RouteData.Values["kekhai"]); Models.KeKhaiEntity kkEntity = new Models.KeKhaiEntity(); Models.KeKhai kekhai = kkEntity.Find(_kekhaiID); if (kekhai == null) { this.RedirectToIndex(); } else { pnlContent.Visible = true; } } 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 { Response.Redirect("~/"); } }