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(); } }
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; } } }
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(); } }
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(); } } }