protected void Reload_Grid_Click(object sender, DirectEventArgs e) { int thang = int.Parse(cbxMonth.SelectedItem.Value); int nam = int.Parse(spnYear.Text); DAL.DanhSachBangTongHopCong thc = new DanhSachBangTongHopCongController().GetAll(thang, nam); if (thc != null) { grpTongHopCong.Title = thc.Title; hdfIdBangTongHopCong.Text = thc.ID.ToString(); if (thc.Lock == true && thc.Nam == nam && thc.Thang == thang) { grpTongHopCong.Reload(); btnEditHangLoat.Disabled = true; btnMoKhoaBangTongHopCong.Show(); btnKhoaBangChamCong.Hide(); SetEditable(false); btnTongHopCong.Disabled = true; btnChuanBiDuLieuDauVao.Disabled = true; } else { grpTongHopCong.Reload(); btnEditHangLoat.Disabled = false; btnMoKhoaBangTongHopCong.Hide(); btnKhoaBangChamCong.Show(); SetEditable(true); btnTongHopCong.Disabled = false; btnChuanBiDuLieuDauVao.Disabled = false; } } }
protected void btnXoa_Click(object sender, DirectEventArgs e) { try { string error = string.Empty, result = string.Empty; int count = 0; SelectedRowCollection selectedRows = RowSelectionModelDanhSachBangTongHopCong.SelectedRows; foreach (var item in selectedRows) { // lấy bảng tổng hợp công được chọn DAL.DanhSachBangTongHopCong thcong = new DanhSachBangTongHopCongController().GetById(int.Parse(item.RecordID)); if (thcong != null) { // xóa dữ liệu bảng tạm //new TmpVaoRaController().DeleteByIdDanhSachBangTongHopCong(thcong.ID); // xóa dữ liệu bảng tổng hợp công new TongHopCongController().DeleteByIdDanhDachBangTongHopCong(thcong.ID); // xóa dữ liệu bảng Danh sách bảng tổng hợp công new DanhSachBangTongHopCongController().Delete(thcong.ID); count++; } else { error += "Không tìm thấy " + thcong.Title + "<br />"; } } if (count > 0) { if (count > 1) { result += "Xóa thành công " + count + " bảng tổng hợp công"; } else { result += "Xóa dữ liệu thành công"; } } if (!string.IsNullOrEmpty(error)) { result += error; } grp_danhSachBangTongHopCong.Reload(); X.Msg.Alert("Thông báo từ hệ thống", result).Show(); } catch (Exception ex) { X.Msg.Alert("Thông báo từ hệ thống", "Có lỗi xảy ra: " + ex.Message).Show(); } }
protected void btnTaoBangChamCong_Click(object sender, DirectEventArgs e) { try { if (string.IsNullOrEmpty(txtYear.Text) || string.IsNullOrEmpty(txtTenBangChamCong.Text) || string.IsNullOrEmpty(ddfDonvi.Text)) { wdTaoBangChamCong.Hide(); X.MessageBox.Alert("Thông báo", "Tạo bảng chấm công thất bại. Dữ liệu nhập vào không hợp lệ").Show(); return; } //Tạo bảng tong hop cong DAL.DanhSachBangTongHopCong bangCong = new DanhSachBangTongHopCong() { CreatedBy = CurrentUser.ID, CreatedDate = DateTime.Now, Title = txtTenBangChamCong.Text, KindOfTimeSheetBoard = "VP", Lock = false, //MaDonVi = Session["MaDonVi"].ToString(), MaDonVi = hdfMaDonVi.Text, Nam = int.Parse(txtYear.Text), Thang = int.Parse(cbMonth.SelectedItem.Value), }; int timeSheetID = new DanhSachBangTongHopCongController().Insert(bangCong); string selectedDepartment = ""; // foreach (var item in ddfDonvi.SelectedItems) // { selectedDepartment += hdfMaDonVi.Text + ","; // } DataHandler.GetInstance().ExecuteNonQuery("ChamCong_TaoBangChamCongThangExcel", "@bangChamCongID", "@donViSuDung", "@createdBy", timeSheetID, selectedDepartment, CurrentUser.ID); wdTaoBangChamCong.Hide(); // ResourceManager1.RegisterClientScriptBlock("reloadpage", "location.reload();grp_danhSachBangChamCongStore.reload();"); } catch (SqlException ex) { switch (ex.Number) { case 2627: X.MessageBox.Alert("Có lỗi xảy ra", "Bảng chấm công của <b style='color:red;'>" + hdfMaDonVi.Text + "</b> trong <b style='color:red;'>tháng " + cbMonth.SelectedItem.Value + "</b> đã được tạo rồi !").Show(); break; default: X.MessageBox.Alert("Có lỗi xảy ra", ex.Message + " number = " + ex.Number).Show(); break; } } catch (Exception ex) { X.MessageBox.Alert("Có lỗi xảy ra", ex.Message).Show(); } }
//private string loaiFileExcel = DieuKienChamCongController.EXCEL_FORMAT_NGANG; //private string phanCa = SystemConfigParameter.PHANCA_TYPE_THANG; //private static int idBangTongHopCong = 0; protected void Page_Load(object sender, EventArgs e) { if (!X.IsAjaxRequest) { // dfFilterTuNgay.SetValue("1/"+DateTime.Now.Month+"/"+DateTime.Now.Year); // dfFilterDenNgay.SetValue(DateTime.Now); cbxMonth.SetValue(DateTime.Now.Month); spnYear.SetValue(DateTime.Now.Year); //hdfMaDonVi.Text = Session["MaDonVi"].ToString(); txtYear.Text = DateTime.Now.Year.ToString(); hdfUserID.SetValue(CurrentUser.ID); hdfMenuID.SetValue(MenuID); SetEditorFirst(); new DTH.BorderLayout() { menuID = MenuID, script = "#{hdfMaDonVi}.setValue('" + DTH.BorderLayout.nodeID + "'); PagingToolbar1.pageIndex = 0; PagingToolbar1.doLoad();" }.AddDepartmentList(br, CurrentUser.ID, true); } //int thang = DateTime.Now.Month; //int nam = DateTime.Now.Year; DAL.DanhSachBangTongHopCong thc = new DanhSachBangTongHopCongController().GetAll(int.Parse(cbxMonth.SelectedItem.Value), int.Parse(spnYear.Text)); if (thc != null) { grpTongHopCong.Title = thc.Title; hdfIdBangTongHopCong.Text = thc.ID.ToString(); if (thc.Lock == true && thc.Nam == int.Parse(spnYear.Text) && thc.Thang == int.Parse(cbxMonth.SelectedItem.Value)) { grpTongHopCong.Reload(); btnMoKhoaBangTongHopCong.Show(); btnKhoaBangChamCong.Hide(); SetEditable(false); btnTongHopCong.Disabled = true; btnChuanBiDuLieuDauVao.Disabled = true; } else { grpTongHopCong.Reload(); btnMoKhoaBangTongHopCong.Hide(); btnKhoaBangChamCong.Show(); SetEditable(true); btnTongHopCong.Disabled = false; btnChuanBiDuLieuDauVao.Disabled = false; } } cmenuThemCanBo.Visible = mnuThemNhanVien.Visible; cmenuLoaiBoCanBo.Visible = mnuXoaNhanVien.Visible; SetVisibleByControlID(btnChuanBiDuLieuDauVao, btnTongHopCong, mnuLayCongLamThemGio, mnuLayCongLamThemGioDuocChon, mnuTongHopTatCa, mnuTongHopDuocChon, mnuThemNhanVien, mnuXoaNhanVien, btnEditOnGrid, btnKhoaBangChamCong, btnMoKhoaBangTongHopCong); //SetEditor(); ucChooseEmployee1.AfterClickAcceptButton += new EventHandler(ucChooseEmployee1_AfterClickAcceptButton); }
/// <summary> /// Xóa bảng chấm công /// @Lê Anh /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnBangChamCongDelete_Click(object sender, DirectEventArgs e) { try { DanhSachBangTongHopCongController controller = new DanhSachBangTongHopCongController(); foreach (var item in RowSelectionModelBangLuongChamCong.SelectedRows) { controller.Delete(int.Parse("0" + item.RecordID)); } hdfRecordID.Text = ""; grpDanhSachBangChamCong.Reload(); } catch (Exception ex) { Dialog.ShowError(ex.Message); } }
protected void btnTaoBangChamCong_Click(object sender, DirectEventArgs e) { try { string maDonVi = Session["MaDonVi"].ToString(); if (!(e.ExtraParams["Command"] == "Edit")) { DAL.DanhSachBangTongHopCong tmp = new DanhSachBangTongHopCongController().GetByInfo(maDonVi, int.Parse(cbMonth.SelectedItem.Value), int.Parse(txtYear.Text)); if (tmp != null) { X.Msg.Alert("Thông báo từ hệ thống", txtTenBangChamCong.Text + " cho tháng " + cbMonth.SelectedItem.Value + "/" + txtYear.Text + " <span style='color:red;'><b> đã tồn tại</b></span>").Show(); return; } } // tạo bảng tổng hợp công DAL.DanhSachBangTongHopCong cong = new DanhSachBangTongHopCong() { Nam = int.Parse(txtYear.Text), Thang = int.Parse(cbMonth.SelectedItem.Value), MaDonVi = maDonVi, Lock = false, FromDate = DateTime.Parse("2014/01/01"), ToDate = DateTime.Parse("2014/01/01"), Title = txtTenBangChamCong.Text, CreatedBy = CurrentUser.ID, CreatedDate = DateTime.Now }; if (e.ExtraParams["Command"] == "Edit") { cong.ID = int.Parse(hdfTmpID.Text); new DanhSachBangTongHopCongController().Update(cong); Dialog.ShowNotification("Cập nhật dữ liệu thành công"); grp_danhSachBangTongHopCong.Reload(); } else { new DanhSachBangTongHopCongController().Insert(cong); Dialog.ShowNotification("Tạo " + txtTenBangChamCong.Text + " thành công!"); } wdTaoBangTongHopCong.Hide(); } catch (Exception ex) { X.Msg.Alert("Thông báo từ hệ thống", ex.Message).Show(); } }
protected void btnMoKhoaBangTongHopCong_Click(object sender, DirectEventArgs e) { try { int thang = int.Parse(cbxMonth.SelectedItem.Value); int nam = int.Parse(spnYear.Text); DAL.DanhSachBangTongHopCong thc = new DanhSachBangTongHopCongController().GetAll(thang, nam); if (thc == null) { //X.Msg.Alert("Thông báo từ hệ thống", "Không tìm thấy bảng tổng hợp công").Show(); //return; DAL.DanhSachBangTongHopCong bthc = new DanhSachBangTongHopCong(); bthc.Title = "Bảng tổng hợp công tháng " + thang.ToString() + " năm " + nam.ToString(); bthc.CreatedDate = DateTime.Now; bthc.CreatedBy = CurrentUser.ID; bthc.Lock = false; bthc.MaDonVi = Session["MaDonVi"].ToString(); bthc.Thang = thang; bthc.Nam = nam; bthc.FromDate = DateTime.Now; bthc.ToDate = DateTime.Now; new DanhSachBangTongHopCongController().Insert(bthc); } else { int IdBangCong = int.Parse(hdfIdBangTongHopCong.Text); new TongHopCongController().Lock(int.Parse(hdfIdBangTongHopCong.Text), false); DataController.DataHandler.GetInstance().ExecuteDataTable("ChamCong_UpdateIDTongHopCong", "@IDBangCong", "@Thang", "@Nam", IdBangCong, thang, nam); } btnChuanBiDuLieuDauVao.Disabled = false; btnTongHopCong.Disabled = false; btnEditHangLoat.Disabled = false; Dialog.ShowNotification("Đã mở khóa bảng tổng hợp công"); //Response.Redirect(Request.RawUrl); btnMoKhoaBangTongHopCong.Hide(); btnKhoaBangChamCong.Show(); SetEditable(true); } catch (Exception ex) { X.Msg.Alert("Thông báo từ hệ thống", "Có lỗi xảy ra: " + ex.Message).Show(); } }
protected void btnSua_Click(object sender, DirectEventArgs e) { try { DAL.DanhSachBangTongHopCong bangthcong = new DanhSachBangTongHopCongController().GetById(int.Parse(hdfTmpID.Text)); if (bangthcong != null) { //txtYear.SetValue(bangthcong.Nam); //cbMonth.SetValue(bangthcong.Thang); txtTenBangChamCong.Text = bangthcong.Title; //txtYear.Disabled = true; //cbMonth.Disabled = true; wdTaoBangTongHopCong.Show(); } } catch (Exception ex) { X.Msg.Alert("Thông báo từ hệ thống", "Có lỗi xảy ra: " + ex.Message).Show(); } }
protected void Page_Load(object sender, EventArgs e) { if (!X.IsAjaxRequest) { hdfMaDonVi.Text = Session["MaDonVi"].ToString(); new DTH.BorderLayout() { script = "#{hdfMaDonVi}.setValue('" + DTH.BorderLayout.nodeID + "'); grpTongHopCongStore.reload();" }.AddDepartmentList(br, CurrentUser.ID, true); if (idBangTongHopCong != 0) { DAL.DanhSachBangTongHopCong thc = new DanhSachBangTongHopCongController().GetById(idBangTongHopCong); grpTongHopCong.Title = thc.Title; hdfIdBangTongHopCong.Text = idBangTongHopCong.ToString(); grpTongHopCong.Reload(); if (thc.Lock == true) { //btnTongHopCong.Disabled = true; btnEditNhanVien.Disabled = true; //btnSave.Disabled = true; btnMoKhoaBangTongHopCong.Show(); btnKhoaBangChamCong.Hide(); hdfIsLocked.Text = "true"; } else { //btnTongHopCong.Disabled = false; btnEditNhanVien.Disabled = false; //btnSave.Disabled = false; btnMoKhoaBangTongHopCong.Hide(); btnKhoaBangChamCong.Show(); hdfIsLocked.Text = "false"; } } SetEditor(); } }
/// <summary> /// Tổng hợp công cho tất cả cán bộ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void mnuTongHopTatCa_Click(object sender, DirectEventArgs e) { try { int thang = int.Parse(cbxMonth.SelectedItem.Value); int nam = int.Parse(spnYear.Text); DAL.DanhSachBangTongHopCong thc = new DanhSachBangTongHopCongController().GetAll(thang, nam); if (thc != null) { grpTongHopCong.Title = thc.Title; hdfIdBangTongHopCong.Text = thc.ID.ToString(); grpTongHopCong.Reload(); if (thc.Lock == true) { btnEditHangLoat.Disabled = true; btnMoKhoaBangTongHopCong.Show(); btnKhoaBangChamCong.Hide(); SetEditable(true); } else { btnEditHangLoat.Disabled = false; btnMoKhoaBangTongHopCong.Hide(); btnKhoaBangChamCong.Show(); SetEditable(false); } } // tổng hợp công cuối tháng DataController.DataHandler.GetInstance().ExecuteNonQuery("ChamCong_TongHopCongThang", "@Thang", "@Nam", "@SelectedId", thang, nam, null); grpTongHopCong.Reload(); } catch (Exception ex) { X.Msg.Alert("Thông báo từ hệ thống", ex.Message).Show(); } }
/// <summary> /// Tìm thứ trong tuần và tô màu ngày cuối tuần /// </summary> private void FindDayOfWeek() { try { if (string.IsNullOrEmpty(hdfIdBangChamCong.Text)) { return; } DAL.DanhSachBangTongHopCong bangChamCong = new DanhSachBangTongHopCongController().GetById(int.Parse(hdfIdBangChamCong.Text)); setDateForwdChamCongTheoKhoangThoiGian(bangChamCong); DateTime date = new DateTime(bangChamCong.Nam, bangChamCong.Thang, 1); GridPanel1.Title = bangChamCong.Title + " (Bảng công tháng " + bangChamCong.Thang + "/" + bangChamCong.Nam + ")"; string styleWeekend = ".nothing"; int totalDay = DateTime.DaysInMonth(bangChamCong.Nam, bangChamCong.Thang);//tổng số ngày trong tháng dictionaryDay = new Dictionary <string, int>(); int day = 0; foreach (var col in GridPanel1.ColumnModel.Columns) { if (col.ColumnID.StartsWith("Ngay")) { string DayOfWeek = ""; switch (date.DayOfWeek.ToString()) { case "Monday": DayOfWeek = " T2"; day = 0; break; case "Tuesday": DayOfWeek = " T3"; day = 1; break; case "Wednesday": DayOfWeek = " T4"; day = 2; break; case "Thursday": DayOfWeek = " T5"; day = 3; break; case "Friday": DayOfWeek = " T6"; day = 4; break; case "Saturday": DayOfWeek = " T7"; day = 5; break; case "Sunday": DayOfWeek = " CN"; day = 6; break; } if (col.ColumnID != "NgayHomNay") { dictionaryDay.Add(col.DataIndex, day); if (int.Parse(col.ColumnID.Replace("Ngay", "")) > totalDay) { col.Hidden = true; continue; } if (DayOfWeek.Contains("CN") || DayOfWeek.Contains("Thứ 7")) { styleWeekend += ",.x-grid3-td-Ngay" + date.Day; } date = date.AddDays(1); col.Header += DayOfWeek; } else { if (bangChamCong.Thang != DateTime.Today.Month) { col.Hidden = true; mnuToday.Visible = false; mnuChamCongHomNay.Visible = false; } else { mnuChamCongHomNay.Visible = true; } col.Header += " " + SoftCore.Util.GetInstance().GetTodayName(); } //col.Header += DayOfWeek; } } //set weekend style + today style styleWeekend += "{background-color:#e3e6eb;}.x-grid3-td-Ngay" + DateTime.Today.Day + "{background-color:#ff6600}"; ltrweekendStyle.Text = "<style type='text/css'>" + styleWeekend + "</style>"; // ltrweekendStyle.Text = "*{font-size:15px !important;}"; GridPanel1.Reload(); } catch (Exception ex) { Dialog.ShowError("SetColorWeekend = " + ex.Message); } }
/// <summary> /// Hàm tính toán tổng hợp công /// </summary> /// <param name="lists">Danh sách thông tin chấm công cần tính</param> /// <param name="isNew"><b>true</b> nếu tổng hợp mới, <b>false</b> nếu cập nhật lại</param> private string TinhToanThongTinCong(List <TongHopCongTheoThangInfo> lists, bool isNew) { try { TimeController timeController = new TimeController(); string error = ""; #region lấy các cấu hình cho tổng hợp công // lấy các ngày cuối tuần trong tháng List <string> listWeekend = timeController.GetWeekKend(Session["MaDonVi"].ToString()); // lấy danh sách chấm công đặc biệt Dictionary <string, int> dicSpecialEmployee = new Dictionary <string, int>(); List <DAL.DanhSachNhanVienChamCongDacBiet> listEmployees = new DieuKienChamCongDacBietController().GetByAll(); foreach (var item in listEmployees) { dicSpecialEmployee.Add(item.MaCB, item.SoLanChitTay); } // lấy ngày công chuẩn //double ngayCongChuan = timeController.GetNumberDayOfWork(); #endregion // lấy tháng DAL.DanhSachBangTongHopCong thcong = new DanhSachBangTongHopCongController().GetById(int.Parse(hdfIdBangTongHopCong.Text)); //int maxDays = 31;//DateTime.DaysInMonth(thcong.Nam, thcong.Thang); int tong = 0; foreach (var item in lists) { try { tong++; #region các tham biến double tongGioCongDinhMuc = 0, tongGioCongThucTe = 0; int tongPhutDiTre = 0, tongPhutVeSom = 0, tongSoPhutLamThuaGio = 0; int tongSoPhutLamThemNgayThuong = 0, tongSoPhutLamThemNgayNghi = 0, tongSoPhutLamThemNgayLe = 0; double nghiLe = 0, nghiPhep = 0, nghiCheDo = 0, nghiBu = 0, nghiKhongLuong = 0; int tongSoLamQuenQuetThe = 0, tongSoLanDiMuon = 0, tongSoLanVeSom = 0; string ngayLe = "", thongKeCaLamViec = ""; float tongCaLamViecNgayThuong = 0, tongCaLamViecNgayNghi = 0, tongCaLamViecNgayLe = 0, tongThoiGianRaNgoaiBiTruGio = 0, tongCaNghi = 0; bool isFail = false; int soLanChitTayBatBuoc = -1; if (dicSpecialEmployee.ContainsKey(item.MA_CB)) { soLanChitTayBatBuoc = dicSpecialEmployee[item.MA_CB]; } // thống kê ca làm việc định dạng MaCa1=a,MaCa2=b Dictionary <string, int> dicThongKeCaLamViec = new Dictionary <string, int>(); #endregion // tính toán các ngày nghỉ //if (soLanChitTayBatBuoc == -1) new TongHopCongController().GetNgayNghi(item.MA_CB, thcong.FromDate, thcong.ToDate, ref ngayLe, ref nghiLe, ref nghiPhep, ref nghiCheDo, ref nghiBu, ref nghiKhongLuong, Session["MaDonVi"].ToString()); DateTime day = thcong.FromDate; while (day <= thcong.ToDate) { #region tổng hợp thông tin trong một ngày try { #region các biến cục bộ double gioCongDinhMuc = 0, gioCongThucTe = 0; int soPhutDiTre = 0, soPhutVeSom = 0, soPhutDiSom = 0, soPhutVeMuon = 0; int soPhutLamThemNgayThuong = 0, soPhutLamThemNgayNghi = 0, soPhutLamThemNgayLe = 0, soPhutLamThuaGio = 0; int soLanQuenQuetThe = 0, soLanDiMuon = 0, soLanVeSom = 0; float soCaLamViecNgayThuong = 0, soCaLamViecNgayNghi = 0, soCaLamViecNgayLe = 0, thoiGianRaNgoaiBiTruGio = 0, soCaNghi = 0; string thoiGianDiFirst = "", thoiGianVeLast = ""; DAL.DanhSachCa ca = new DanhSachCa(); #endregion try { // lấy ca làm việc của cán bộ ca = new DanhSachCaController().GetByMaChamCong(item.MaChamCong, day, Session["MaDonVi"].ToString()); #region cập nhật thống kê ca làm việc if (ca == null) { continue; } #endregion // tính các tham số liên quan if (soLanChitTayBatBuoc == -1) { new TongHopCongController().GetCaLamViecTrongNgay(ngayLe.Split(','), listWeekend, item.MaChamCong, day, ca, ref dicThongKeCaLamViec, ref gioCongDinhMuc, ref gioCongThucTe, ref soPhutDiTre, ref soPhutVeSom, ref soPhutDiSom, ref soPhutVeMuon, ref soPhutLamThemNgayThuong, ref soPhutLamThemNgayNghi, ref soPhutLamThemNgayLe, ref soLanQuenQuetThe, ref soLanDiMuon, ref soLanVeSom, ref soPhutLamThuaGio, ref soCaLamViecNgayThuong, ref soCaLamViecNgayNghi, ref soCaLamViecNgayLe, ref thoiGianRaNgoaiBiTruGio, ref soCaNghi, ref thoiGianDiFirst, ref thoiGianVeLast); //new TongHopCongController().GetCaLamViecTrongNgay1(ngayLe.Split(','), listWeekend, item.MaChamCong, day, ca, ref gioCongDinhMuc, // ref gioCongThucTe, ref soPhutDiTre, ref soPhutVeSom, ref thoiGianDiFirst, ref thoiGianVeLast, ref thoiGianRaNgoaiBiTruGio, // ref soLanDiMuon, ref soLanVeSom); } else { List <DAL.VaoRaCa> dsVaoRaCa = new VaoRaCaController().GetByMaChamCongAndDay(item.MaChamCong, day); if (dsVaoRaCa.Count >= soLanChitTayBatBuoc) { //gioCongDinhMuc += ca.TongGio != null ? ca.TongGio.Value : 0; //gioCongThucTe += (ca.TongGio != null ? ca.TongGio.Value : 0) * 60; if (ca.NghiGiuaCa != "" && ca.VaoGiuaCa != "") { gioCongThucTe += 1; soCaLamViecNgayThuong += 1; } else { gioCongThucTe += 0.5; soCaLamViecNgayThuong += (float)0.5; } } } } catch (Exception ex) { isFail = true; error += ex.Message + "<br />"; } #region tính các thời gian liên quan DAL.TongHopCongTheoNgay theoNgay = new TongHopCongTheoNgay(); theoNgay.MaCa = ca.MaCa; theoNgay.MaChamCong = item.MaChamCong; theoNgay.NgayThang = day; //theoNgay.SoLanDiMuon = soLanDiMuon; //theoNgay.SoLanVeSom = soLanVeSom; //theoNgay.SoNgayCong = Math.Round((gioCongThucTe / ca.TongGio == 0 ? 1 : ca.TongGio), 1); theoNgay.SoPhutDiMuon = soPhutDiTre; //theoNgay.SoPhutDiSom = soPhutVeSom; //theoNgay.SoPhutLamThemNgayLe = soPhutLamThemNgayLe; //theoNgay.SoPhutLamThemNgayNghi = soPhutLamThemNgayNghi; //theoNgay.SoPhutLamThemNgayThuong = soPhutLamThemNgayThuong; //theoNgay.SoPhutLamThuaGio = soPhutLamThuaGio; //theoNgay.SoPhutLamViec = gioCongThucTe; //theoNgay.SoPhutRaNgoai = //tongGioCongDinhMuc += gioCongDinhMuc; //tongGioCongThucTe += gioCongThucTe; //tongPhutDiTre += soPhutDiTre; //tongPhutVeSom += soPhutVeSom; //tongSoPhutLamThemNgayThuong += soPhutLamThemNgayThuong; //tongSoPhutLamThemNgayNghi += soPhutLamThemNgayNghi; //tongSoPhutLamThemNgayLe += soPhutLamThemNgayLe; //tongSoLamQuenQuetThe += soLanQuenQuetThe; //tongSoLanDiMuon += soLanDiMuon; //tongSoLanVeSom += soLanVeSom; //tongSoPhutLamThuaGio += soPhutLamThuaGio; //tongCaLamViecNgayThuong += soCaLamViecNgayThuong; //tongCaLamViecNgayNghi += soCaLamViecNgayNghi; //tongCaLamViecNgayLe += soCaLamViecNgayLe; //tongThoiGianRaNgoaiBiTruGio += thoiGianRaNgoaiBiTruGio; //tongCaNghi += soCaNghi; #endregion day.AddDays(1); } catch (Exception ex) { error += ex.Message + "<br />"; } #endregion } // thống kê số ca làm việc của từng cán bộ if (soLanChitTayBatBuoc == -1) { thongKeCaLamViec = new TongHopCongController().GetThongKeCaLamViec(dicThongKeCaLamViec); } #region Cập nhật vào bảng tổng hợp công //DAL.TongHopCong cong = new TongHopCong() //{ // MA_CB = item.MA_CB, // IdDanhSachBangTongHopCong = int.Parse(hdfIdBangTongHopCong.Text), // SoPhutDiTre = tongPhutDiTre, // SoPhutLamThemNgayLe = tongSoPhutLamThemNgayLe, // SoPhutLamThemNgayNghi = tongSoPhutLamThemNgayNghi, // SoPhutLamThemNgayThuong = tongSoPhutLamThemNgayThuong, // GioCongThucTe = tongGioCongThucTe, // tính theo phút // GioCongDinhMuc = tongGioCongDinhMuc, // SoPhutVeSom = tongPhutVeSom, // NghiBu = nghiBu, // NghiKhongLuong = nghiKhongLuong, // NghiCheDo = nghiCheDo, // NghiLe = nghiLe, // NghiPhep = nghiPhep, // TinhToanSai = isFail, // SoLanQuenQuetThe = tongSoLamQuenQuetThe, // SoLanDiTre = tongSoLanDiMuon, // SoLanVeSom = tongSoLanVeSom, // TongThoiGianLamThuaGio = tongSoPhutLamThuaGio, // ThongKeCaLamViec = thongKeCaLamViec, // TongCaLamViecNgayThuong = tongCaLamViecNgayThuong, // TongCaLamViecNgayNghi = tongCaLamViecNgayNghi, // TongCaLamViecNgayLe = tongCaLamViecNgayLe, // ThoiGianRaNgoaiBiTru = tongThoiGianRaNgoaiBiTruGio, // TongCaNghi = tongCaNghi, //}; //if (isNew == true) //{ // new TongHopCongController().Insert(cong); //} //else //{ // cong.ID = item.ID; // new TongHopCongController().Update(cong); //} #endregion } catch (Exception ex) { error += ex.Message + "<br />"; } } X.Msg.Alert("", error).Show(); return(""); } catch (Exception ex) { X.Msg.Alert("Thông báo từ hệ thống", ex.Message).Show(); return(ex.Message); } }