예제 #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();
     }
 }
예제 #2
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["quatrinhdaotao"] != null)
         {
             try
             {
                 int qtdtID = Convert.ToInt32(this.Page.RouteData.Values["quatrinhdaotao"]);
                 Models.QuaTrinhDaoTaoEntity qtdtEntity = new Models.QuaTrinhDaoTaoEntity();
                 Models.QuaTrinhDaoTao       qtdt       = qtdtEntity.Find(qtdtID);
                 if (qtdt == null)
                 {
                     Response.Redirect("~/");
                 }
                 else
                 {
                     lblNhanVien.Text = qtdt.NhanVien.NVTen;
                 }
             }
             catch (Exception)
             {
                 Response.Redirect("~/");
             }
         }
         else if (this.Page.RouteData.Values["nhanvien"] != null)
         {
             try
             {
                 int nhanvienID = Convert.ToInt32(this.Page.RouteData.Values["nhanvien"]);
                 Models.NhanVienEntity nhanvienEntity = new Models.NhanVienEntity();
                 Models.NhanVien       nhanvien       = nhanvienEntity.Find_NhanVien(nhanvienID);
                 if (nhanvien == null)
                 {
                     Response.Redirect("~/");
                 }
                 else
                 {
                     lblNhanVien.Text = nhanvien.NVTen;
                 }
             }
             catch (Exception) { }
         }
         else
         {
             Response.Redirect("~/");
         }
     }
     else
     {
         Response.Redirect("~/");
     }
 }
예제 #3
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("~/");
     }
 }
예제 #4
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["ctxh"] != null)
         {
             try
             {
                 int ctxhID = Convert.ToInt32(this.Page.RouteData.Values["ctxh"]);
                 Models.ChinhTriXaHoiEntity ctxhEntity = new Models.ChinhTriXaHoiEntity();
                 Models.ChinhTriXaHois      ctxh       = ctxhEntity.Find(ctxhID);
                 if (ctxh == null)
                 {
                     Response.Redirect("~/");
                 }
             }
             catch (Exception)
             {
                 Response.Redirect("~/");
             }
         }
     }
     else
     {
         Response.Redirect("~/");
     }
 }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string email = Session["account"].ToString();

            Models.AccountEntity accEntity = new Models.AccountEntity();
            Models.Account       loginACC  = accEntity.FindByEmail(email);

            lblNguoiChamCong.Text = loginACC.NhanVien.NVTen;

            _ngaychamcong = DateTime.Now;

            Models.DonVi donvichamcong = new Models.DonVi();
            if (loginACC.ACCChucNang != 0)
            {
                donvichamcong = loginACC.PhuTrachChamCongs.FirstOrDefault().DonVi;
            }
            else
            {
                Models.LamViec lamviec = loginACC.NhanVien.LamViecs.OrderByDescending(x => x.LVTuNgay).FirstOrDefault();
                donvichamcong = (lamviec != null) ? lamviec.DonVi : null;
            }
            _lamviecs        = (donvichamcong != null) ? donvichamcong.LamViecs : null;
            _donvichamcongID = (donvichamcong != null) ? donvichamcong.DVID : 0;

            if (!this.Page.IsPostBack)
            {
                _ccEntity.Load_DonViChamCongList_ToRadComboBox(cbbDonVi, loginACC);
                cbbDonVi.SelectedValue    = (donvichamcong != null) ? donvichamcong.DVID.ToString() : "";
                dpkNgayThang.SelectedDate = DateTime.Now;
            }
        }
예제 #6
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();
     }
 }
예제 #7
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["trinhdotinhoc"] != null)
         {
             try
             {
                 int tinhocID = Convert.ToInt32(this.Page.RouteData.Values["trinhdotinhoc"]);
                 Models.TrinhDoTinHocEntity thEntity = new Models.TrinhDoTinHocEntity();
                 Models.TrinhDoTinHoc       tinhoc   = thEntity.Find(tinhocID);
                 if (tinhoc == null)
                 {
                     Response.Redirect("~/");
                 }
             }
             catch
             {
                 Response.Redirect("~/");
             }
         }
         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)
                 {
                     Response.Redirect("~/");
                 }
             }
             catch
             {
                 Response.Redirect("~/");
             }
         }
         else
         {
             Response.Redirect("~/");
         }
     }
     else
     {
         Response.Redirect("~/");
     }
 }
예제 #8
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["chinhsach"] != null)
         {
             try
             {
                 int chinhsachID = Convert.ToInt32(this.Page.RouteData.Values["chinhsach"]);
                 Models.ChinhSachEntity csEntity  = new Models.ChinhSachEntity();
                 Models.ChinhSach       chinhsach = csEntity.Find(chinhsachID);
                 if (chinhsach == 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
     {
         Response.Redirect("~/");
     }
 }
예제 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string email = Session["account"].ToString();

            Models.AccountEntity accEntity = new Models.AccountEntity();
            _loginACC = accEntity.FindByEmail(email);
            if (_loginACC.ACCChucNang > 0)
            {
                Response.Redirect("~/");
            }
        }
예제 #10
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["nhanvien"] != null)
         {
             try
             {
                 _nhanvienID = Convert.ToInt32(this.Page.RouteData.Values["nhanvien"]);
                 Models.NhanVienEntity nhanvienEntity = new Models.NhanVienEntity();
                 Models.NhanVien       nhanvien       = nhanvienEntity.Find_NhanVien(_nhanvienID);
                 if (nhanvien == null)
                 {
                     Response.Redirect("~/NhanSu");
                 }
                 else
                 {
                     pnlExtraInforamtion.Visible = true;
                     CUDForm.NhanVienID          = _nhanvienID;
                     LVRadGrid.NhanVienID        = _nhanvienID;
                     CTXHRadGrid.NhanVienID      = _nhanvienID;
                     DTRadGrid.NhanVienID        = _nhanvienID;
                     QHRadGrid.NhanVienID        = _nhanvienID;
                     TDNNRadGrid.NhanVienID      = _nhanvienID;
                     TDTHRadGrid.NhanVienID      = _nhanvienID;
                     PTDHRadGrid.NhanVienID      = _nhanvienID;
                     KTRadGrid.NhanVienID        = _nhanvienID;
                     KLRadGrid.NhanVienID        = _nhanvienID;
                     DGRadGrid.NhanVienID        = _nhanvienID;
                     CSRadGrid.NhanVienID        = _nhanvienID;
                     KKRadGrid.NhanVienID        = _nhanvienID;
                     DGLDRadGrid.NhanVienID      = _nhanvienID;
                     DGVCRadGrid.NhanVienID      = _nhanvienID;
                 }
             }
             catch (Exception)
             {
                 Response.Redirect("~/NhanSu");
             }
         }
     }
     else
     {
         Response.Redirect("~/");
     }
 }
예제 #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!_quanly)
            {
                string email = Session["account"].ToString();
                Models.AccountEntity accEntity = new Models.AccountEntity();
                _loginACC = accEntity.FindByEmail(email);
            }

            if (!this.Page.IsPostBack)
            {
                _tinhocEntity.Load_AllTrinhDoTinHocOfNhanVien_ToRadGrid(rgTrinhDoTinHoc, _nhanvienID);
            }
        }
예제 #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!_quanly)
            {
                Models.AccountEntity accEntity = new Models.AccountEntity();
                string email = Session["account"].ToString();
                _loginACC = accEntity.FindByEmail(email);
            }

            if (this.Page.IsPostBack)
            {
                _dgEntity.Load_AllDanhGiaOfNhanVien_ToRadGrid(rgDGDV, _nhanvienID);
            }
        }
예제 #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!_quanly)
            {
                string email = Session["account"].ToString();
                Models.AccountEntity accEntity = new Models.AccountEntity();
                _loginACC = accEntity.FindByEmail(email);
            }

            if (!IsPostBack)
            {
                _qtdtEntity.Load_DataSource_RadGrid(RadGridQuaTrinhDaoTao, _nhanvienID);
            }
        }
예제 #14
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["phongtangdanhhieu"] != null)
         {
             try
             {
                 int danhhieuID = Convert.ToInt32(this.Page.RouteData.Values["phongtangdanhhieu"]);
                 Models.PhongTangDanhHieuEntity dhEntity = new Models.PhongTangDanhHieuEntity();
                 Models.PhongTangDanhHieu       danhhieu = dhEntity.Find(danhhieuID);
                 if (danhhieu == null)
                 {
                     this.RedirectToIndex();
                 }
             }
             catch
             {
                 this.RedirectToIndex();
             }
         }
         else if (this.Page.RouteData.Values["nhanvien"] != null)
         {
             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();
             }
         }
         else
         {
             this.RedirectToIndex();
         }
     }
     else
     {
         Response.Redirect("~/");
     }
 }
예제 #15
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
     {
         Response.Redirect("~/");
     }
 }
예제 #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string email = Session["account"].ToString();

            Models.AccountEntity accEntity = new Models.AccountEntity();
            _loginACC = accEntity.FindByEmail(email);

            if (_loginACC.ACCChucNang > 0 && _loginACC.PhuTrachChamCongs.Where(x => x.PCCCStatus == true).Count() == 0)
            {
                Response.Redirect("~/");
            }
            else if (_loginACC.ACCChucNang > 0)
            {
                btThongKe.Visible          = false;
                btPhuTrachChamCong.Visible = false;
            }
        }
예제 #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string email = Session["account"].ToString();

            Models.AccountEntity accEntity = new Models.AccountEntity();
            Models.Account       loginACC  = accEntity.FindByEmail(email);

            if (loginACC.ACCChucNang > 0 && loginACC.PhuTrachChamCongs.Where(x => x.PCCCStatus == true).Count() == 0)
            {
                RedirectToHomePage();
            }
            else if (this.Page.RouteData.Values["lamviec"] != null && this.Page.RouteData.Values["ngaythang"] != null)
            {
                try
                {
                    int      lamviecID = Convert.ToInt32(this.Page.RouteData.Values["lamviec"]);
                    DateTime ngaythang = Convert.ToDateTime(this.Page.RouteData.Values["ngaythang"]);

                    Models.LamViecEntity lvEntiy = new Models.LamViecEntity();
                    Models.LamViec       lamviec = lvEntiy.Find(lamviecID);

                    if (lamviec != null)
                    {
                        CCForm.LamViec      = lamviec;
                        CCForm.NgayChamCong = ngaythang;
                    }
                    else
                    {
                        this.RedirectToHomePage();
                    }
                }
                catch
                {
                    this.RedirectToHomePage();
                }
            }
            else
            {
                this.RedirectToHomePage();
            }
        }
예제 #18
0
        private void CaNhanStatus()
        {
            string email = Session["account"].ToString();

            Models.AccountEntity accEntity = new Models.AccountEntity();
            Models.Account       account   = accEntity.FindByEmail(email);
            if (account.ACCUpThongTinCaNhan)
            {
                CheckBoxUseImage.Visible = true;
                ButtonUpdate.Visible     = true;
            }
            else
            {
                CheckBoxUseImage.Visible = false;
                ButtonUpdate.Visible     = false;
            }

            ButtonCreate.Visible = false;
            ButtonDelete.Visible = false;
            ButtonBack.Visible   = false;
        }
예제 #19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["account"] != null)
     {
         try
         {
             string email = Session["account"].ToString();
             Models.AccountEntity accEntity = new Models.AccountEntity();
             Models.Account       account   = accEntity.FindByEmail(email);
             if (account == null)
             {
                 this.RedirectToIndex();
             }
             else
             {
                 btLoginAccount.Text = "Xin chào " + email + " !...";
                 if (account.ACCChucNang < 1)
                 {
                     btNhanSu.Visible   = true;
                     btLuong.Visible    = true;
                     btTaiKhoan.Visible = true;
                 }
                 else
                 {
                     btChamCong.Visible = (account.PhuTrachChamCongs.Where(x => x.PCCCStatus == true).Count() > 0 ? true : false);
                 }
             }
         }
         catch
         {
             this.RedirectToIndex();
         }
     }
     else
     {
         this.RedirectToIndex();
     }
 }
예제 #20
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)
                {
                    this.RedirectToIndex();
                }
                else if (account.ACCChucNang > 1)
                {
                    if (!account.ACCUpDanhGia)
                    {
                        this.RedirectToIndex();
                    }
                    else if (this.Page.RouteData.Values["danhgia"] != null)
                    {
                        try
                        {
                            int danhgiaID = Convert.ToInt32(this.Page.RouteData.Values["danhgia"]);
                            Models.DanhGiaVienChucEntity dgEntity = new Models.DanhGiaVienChucEntity();
                            Models.DanhGiaVienChuc       danhgia  = dgEntity.Find(danhgiaID);
                            if (danhgia == null)
                            {
                                this.RedirectToIndex();
                            }
                            else if (danhgia.NVID == account.NVID)
                            {
                                this.RedirectToIndex();
                            }
                            else
                            {
                                btExport.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["danhgia"] != null)
                {
                    try
                    {
                        int danhgiaID = Convert.ToInt32(this.Page.RouteData.Values["danhgia"]);
                        Models.DanhGiaVienChucEntity dgEntity = new Models.DanhGiaVienChucEntity();
                        Models.DanhGiaVienChuc       danhgia  = dgEntity.Find(danhgiaID);
                        if (danhgia == null)
                        {
                            this.RedirectToIndex();
                        }
                        else
                        {
                            btExport.Visible = true;
                        }
                    }
                    catch
                    {
                        this.RedirectToIndex();
                    }
                }
                else if (this.Page.RouteData.Values["nhanvien"] != null)
                {
                    try
                    {
                        int nhanvienID = Convert.ToInt32(this.Page.RouteData.Values["nhanvien"] != null);
                        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();
            }
        }
예제 #21
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)
                {
                    this.RedirectToIndex();
                }
                else if (account.ACCChucNang > 1)
                {
                    if (!account.ACCUpLyLich)
                    {
                        this.RedirectToIndex();
                    }
                    else if (this.Page.RouteData.Values["quanhe"] != null)
                    {
                        try
                        {
                            int quanheID = Convert.ToInt32(this.Page.RouteData.Values["quanhe"]);
                            Models.QuanHeEntity qhEntity = new Models.QuanHeEntity();
                            Models.QuanHe       quanhe   = qhEntity.Find(quanheID);
                            if (quanhe == null)
                            {
                                this.RedirectToIndex();
                            }
                            else if (quanhe.NVID != account.NVID)
                            {
                                this.RedirectToIndex();
                            }
                            else
                            {
                                pnlExtraInformation.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["quanhe"] != null)
                {
                    try
                    {
                        int quanheID = Convert.ToInt32(this.Page.RouteData.Values["quanhe"]);
                        Models.QuanHeEntity qhEntity = new Models.QuanHeEntity();
                        Models.QuanHe       quanhe   = qhEntity.Find(quanheID);
                        if (quanhe == null)
                        {
                            this.RedirectToIndex();
                        }
                        else
                        {
                            pnlExtraInformation.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
            {
                this.RedirectToIndex();
            }
        }
예제 #22
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) //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("~/");
     }
 }
예제 #23
0
 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();
     }
 }
예제 #24
0
        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.ACCUpLyLich)
                    {
                        this.RedirectToIndex();
                    }
                    else if (this.Page.RouteData.Values["quanhecongtac"] != null)
                    {
                        try
                        {
                            int congtacID = Convert.ToInt32(this.Page.RouteData.Values["quanhecongtac"]);
                            Models.QuanHeCongTacEntity congtacEntity = new Models.QuanHeCongTacEntity();
                            Models.QuanHeCongTac       congtac       = congtacEntity.Find(congtacID);
                            if (congtac == null)
                            {
                                this.RedirectToIndex();
                            }
                            else if (congtac.QuanHe.NVID != account.NVID)
                            {
                                this.RedirectToIndex();
                            }
                            else
                            {
                                lblNhanVien.Text = congtac.QuanHe.QHTen;
                            }
                        }
                        catch
                        {
                            this.RedirectToIndex();
                        }
                    }
                    else if (this.Page.RouteData.Values["quanhe"] != null)
                    {
                        try
                        {
                            int quanheID = Convert.ToInt32(this.Page.RouteData.Values["quanhe"]);
                            Models.QuanHeEntity quanheEntity = new Models.QuanHeEntity();
                            Models.QuanHe       quanhe       = quanheEntity.Find(quanheID);
                            if (quanhe == null)
                            {
                                this.RedirectToIndex();
                            }
                            else if (quanhe.NVID != account.NVID)
                            {
                                this.RedirectToIndex();
                            }
                            else
                            {
                                lblNhanVien.Text = quanhe.QHTen;
                            }
                        }
                        catch
                        {
                            this.RedirectToIndex();
                        }
                    }
                    else
                    {
                        this.RedirectToIndex();
                    }
                }
                else if (this.Page.RouteData.Values["quanhecongtac"] != null)
                {
                    try
                    {
                        int congtacID = Convert.ToInt32(this.Page.RouteData.Values["quanhecongtac"]);
                        Models.QuanHeCongTacEntity congtacEntity = new Models.QuanHeCongTacEntity();
                        Models.QuanHeCongTac       congtac       = congtacEntity.Find(congtacID);
                        if (congtac == null)
                        {
                            this.RedirectToIndex();
                        }
                        else
                        {
                            lblNhanVien.Text = congtac.QuanHe.QHTen;
                        }
                    }
                    catch (Exception)
                    {
                        this.RedirectToIndex();
                    }
                }
                else if (this.Page.RouteData.Values["quanhe"] != null)
                {
                    try
                    {
                        int quanheID = Convert.ToInt32(this.Page.RouteData.Values["quanhe"]);
                        Models.QuanHeEntity quanheEntity = new Models.QuanHeEntity();
                        Models.QuanHe       quanhe       = quanheEntity.Find(quanheID);
                        if (quanhe == null)
                        {
                            this.RedirectToIndex();
                        }
                        else
                        {
                            lblNhanVien.Text = quanhe.QHTen;
                        }
                    }
                    catch (Exception) { }
                }
                else
                {
                    this.RedirectToIndex();
                }
            }
            else
            {
                this.RedirectToIndex();
            }
        }
예제 #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string email = Session["account"].ToString();

            Models.AccountEntity accEntity = new Models.AccountEntity();
            Models.Account       account   = accEntity.FindByEmail(email);
            _nhanvienID        = account.NVID;
            CUDForm.NhanVienID = _nhanvienID;
            CUDForm.QuanLy     = false;

            LVRadGrid.NhanVienID = _nhanvienID;
            LVRadGrid.QuanLy     = false;

            CTXHRadGrid.NhanVienID = _nhanvienID;
            CTXHRadGrid.QuanLy     = false;

            DTRadGrid.NhanVienID = _nhanvienID;
            DTRadGrid.QuanLy     = false;

            QHRadGrid.NhanVienID = _nhanvienID;
            QHRadGrid.QuanLy     = false;

            TDNNRadGrid.NhanVienID = _nhanvienID;
            TDNNRadGrid.QuanLy     = false;

            TDTHRadGrid.NhanVienID = _nhanvienID;
            TDTHRadGrid.QuanLy     = false;

            PTDHRadGrid.NhanVienID = _nhanvienID;
            PTDHRadGrid.QuanLy     = false;

            KTRadGrid.NhanVienID = _nhanvienID;
            KTRadGrid.QuanLy     = false;

            KLRadGrid.NhanVienID = _nhanvienID;
            KLRadGrid.QuanLy     = false;

            DGRadGrid.NhanVienID = _nhanvienID;
            DGRadGrid.QuanLy     = false;

            CSRadGrid.NhanVienID = _nhanvienID;
            CSRadGrid.QuanLy     = false;

            KKRadGrid.NhanVienID = _nhanvienID;
            KKRadGrid.QuanLy     = false;

            DGLDRadGrid.NhanVienID = _nhanvienID;
            DGLDRadGrid.QuanLy     = false;

            DGVCRadGrid.NhanVienID = _nhanvienID;
            DGVCRadGrid.QuanLy     = false;

            DGDVRadGrid.NhanVienID = _nhanvienID;
            DGDVRadGrid.QuanLy     = false;

            if (!account.ACCInLyLich)
            {
                btLamViecNew.Visible    = false;
                btCTXHNew.Visible       = false;
                btDaoTaoNew.Visible     = false;
                btQuanHeNew.Visible     = false;
                btNgoaiNguNew.Visible   = false;
                btTinHocNew.Visible     = false;
                btDanhHieuNew.Visible   = false;
                btKhenThuongNew.Visible = false;
                btKyLuatNew.Visible     = false;
                btDanhGiaNew.Visible    = false;
                btChinhSachNew.Visible  = false;
            }

            if (!account.ACCInKeKhai)
            {
                btKeKhaiNew.Visible = false;
            }

            if (!account.ACCInDanhGia)
            {
                btDanhGiaDangVienNew.Visible = false;
                btDanhGiaLaoDongNew.Visible  = false;
                btDanhGiaVienChucNew.Visible = false;
            }
        }
예제 #26
0
 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();
     }
 }