Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                Models.AccountEntity accEntity = new Models.AccountEntity();
                accEntity.Load_AllAccount_ToRadComboBox(cbbAccount);

                Models.DonViEntity dvEntity = new Models.DonViEntity();
                dvEntity.Load_DataSource_RadDropDownTree(ddtDonVi);
            }

            if (_phutrach != null)
            {
                this.UpdateStatus();
                if (!this.Page.IsPostBack)
                {
                    cbbAccount.SelectedValue   = _phutrach.ACCID.ToString();
                    ddtDonVi.SelectedValue     = _phutrach.DVID.ToString();
                    rblTrangThai.SelectedValue = _phutrach.PCCCStatus.ToString();
                }
            }
            else
            {
                this.CreateStatus();
            }
        }
Esempio n. 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["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("~/");
     }
 }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _donviID  = 0;
            _lamviecs = _lvEntity.FindByDenNgayYear(DateTime.Now.Year);
            _nam      = DateTime.Now.Year;

            if (!this.Page.IsPostBack)
            {
                Models.DonViEntity dvEntity = new Models.DonViEntity();
                dvEntity.Load_DataSource_RadDropDownTree(ddtDonVi);
                this.LoadYearToDropDownList();
                ddlNam.SelectedValue = DateTime.Now.Year.ToString();
            }
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                Models.DonViEntity dvEntity = new Models.DonViEntity();
                dvEntity.Load_DataSource_RadDropDownTree(ddtDonVi);

                Models.ChucVuEntity cvEntity = new Models.ChucVuEntity();
                cvEntity.Load_AllChucVu_RadComboBox(cbbChucVu);

                Models.HeSoLuongEntity hslEntity = new Models.HeSoLuongEntity();
                hslEntity.Load_DataSource_ComboBox(cbbHeSoLuong);

                dpkTuNgay.SelectedDate = DateTime.Now;
            }

            if (this.Page.RouteData.Values["lamviec"] != null)
            {
                this.UpdateStatus();
                _lamviecID = Convert.ToInt32(this.Page.RouteData.Values["lamviec"]);
                Models.LamViec lamviec = _lvEntity.Find(_lamviecID);
                _nhanvienID = lamviec.NVID;
                if (!this.Page.IsPostBack)
                {
                    ddtDonVi.SelectedValue  = lamviec.DVID.ToString();
                    cbbChucVu.SelectedValue = lamviec.CVID.ToString();
                    dpkTuNgay.SelectedDate  = lamviec.LVTuNgay;
                    if (lamviec.LVDenNgay != null && lamviec.LVDenNgay != DateTime.MinValue)
                    {
                        dpkDenNgay.SelectedDate = lamviec.LVDenNgay;
                    }
                    cbbHeSoLuong.SelectedValue = lamviec.HSLID.ToString();
                    if (lamviec.LVLuongCoBan % 1 == 0)
                    {
                        txtLuongCoBan.Text = lamviec.LVLuongCoBan.ToString("###");
                    }
                    else
                    {
                        txtLuongCoBan.Text = lamviec.LVLuongCoBan.ToString();
                    }
                    txtNgheNghiep.Text      = lamviec.LVNhiemVu;
                    txtPhuCapChucVu.Text    = lamviec.LVPhuCapChucVu.ToString();
                    txtPhuCapCongVu.Text    = lamviec.LVPhuCapCongVu.ToString();
                    txtPhuCapKiemNhiem.Text = lamviec.LVPhuCapKiemNhiem.ToString();
                    txtPhuCapNghe.Text      = lamviec.LVPhuCapNghe.ToString();
                    txtPhuCapThamNien.Text  = lamviec.LVPhuCapThamNienNghe.ToString();
                    txtPhuCapVuotKhung.Text = lamviec.LVPhuCapVuotKhung.ToString();
                    txtPhuCapDocHai.Text    = lamviec.LVPhuCapVuotKhung.ToString();
                    txtTyLe.Text            = lamviec.LVTyLe.ToString();
                    txtSoNgayPhep.Text      = lamviec.LVSoNgayPhep.ToString();
                    txtSoHopDong.Text       = lamviec.LVSoHopDong;
                    if (lamviec.LVNgayHopDong != null && lamviec.LVNgayHopDong != DateTime.MinValue)
                    {
                        dpkNgayHopDong.SelectedDate = Convert.ToDateTime(lamviec.LVNgayHopDong);
                    }
                }
            }
            else
            {
                this.CreateStatus();
                _nhanvienID = Convert.ToInt32(this.Page.RouteData.Values["nhanvien"]);
                Models.NhanVienEntity nvEntity = new Models.NhanVienEntity();
                Models.NhanVien       nhanvien = nvEntity.Find_NhanVien(_nhanvienID);
                Models.LamViec        lamviec  = nhanvien.LamViecs.OrderByDescending(x => x.LVID).FirstOrDefault();
                if (lamviec != null && !this.Page.IsPostBack)
                {
                    ddtDonVi.SelectedValue  = lamviec.DVID.ToString();
                    cbbChucVu.SelectedValue = lamviec.CVID.ToString();
                    dpkTuNgay.SelectedDate  = lamviec.LVTuNgay;
                    if (lamviec.LVDenNgay != null && lamviec.LVDenNgay != DateTime.MinValue)
                    {
                        dpkDenNgay.SelectedDate = lamviec.LVDenNgay;
                    }
                    cbbHeSoLuong.SelectedValue = lamviec.HSLID.ToString();
                    if (lamviec.LVLuongCoBan % 1 == 0)
                    {
                        txtLuongCoBan.Text = lamviec.LVLuongCoBan.ToString("###");
                    }
                    else
                    {
                        txtLuongCoBan.Text = lamviec.LVLuongCoBan.ToString();
                    }
                    txtNgheNghiep.Text      = lamviec.LVNhiemVu;
                    txtPhuCapChucVu.Text    = lamviec.LVPhuCapChucVu.ToString();
                    txtPhuCapCongVu.Text    = lamviec.LVPhuCapCongVu.ToString();
                    txtPhuCapKiemNhiem.Text = lamviec.LVPhuCapKiemNhiem.ToString();
                    txtPhuCapNghe.Text      = lamviec.LVPhuCapNghe.ToString();
                    txtPhuCapThamNien.Text  = lamviec.LVPhuCapThamNienNghe.ToString();
                    txtPhuCapVuotKhung.Text = lamviec.LVPhuCapVuotKhung.ToString();
                    txtPhuCapDocHai.Text    = lamviec.LVPhuCapVuotKhung.ToString();
                    txtTyLe.Text            = lamviec.LVTyLe.ToString();
                    txtSoNgayPhep.Text      = lamviec.LVSoNgayPhep.ToString();
                }
            }
        }