public void UpdateNhanVien_BaoHiem(BHNHANVIEN_BAOHIEM nvbh) { BHNHANVIEN_BAOHIEM item = dataContext.BHNHANVIEN_BAOHIEMs.Where(p => p.IDNhanVien_BaoHiem == nvbh.IDNhanVien_BaoHiem).SingleOrDefault(); //item = nvbh; item.DangDongBHTN = nvbh.DangDongBHTN; item.DangDongBHXH = nvbh.DangDongBHXH; item.DangDongBHYT = nvbh.DangDongBHYT; item.LuongBaoHiem = nvbh.LuongBaoHiem; item.PhuCapCV = nvbh.PhuCapCV; item.PhuCapKhac = nvbh.PhuCapKhac; item.PhuCapTNN = nvbh.PhuCapTNN; item.PhuCapTNVK = nvbh.PhuCapTNVK; item.DaNghi = nvbh.DaNghi; item.TrangThaiCapTheBHYT = nvbh.TrangThaiCapTheBHYT; item.TrangThaiCapSoBHXH = nvbh.TrangThaiCapSoBHXH; Save(); HOSO hs = dataContext.HOSOs.Where(p => p.PR_KEY == (decimal)item.IDNhanVien_BaoHiem).SingleOrDefault(); hs.SOTHE_BHXH = nvbh.SoSoBHXH; hs.SOTHE_BHYT = nvbh.SoTheBHYT; hs.NGAY_DONGBH = nvbh.TuThangBHYT; hs.NGAY_HETHAN_BHYT = nvbh.DenThangBHYT; hs.MA_NOI_KCB = nvbh.NoiDangKyKCB; hs.NGAYCAP_BHXH = nvbh.NgayDangKyBHXH; hs.MA_NOICAP_BHXH = nvbh.NoiCapSoBHXH; Save(); }
public void updateLuong(HOSO hs) { DAL.HOSO tmp = GetByMaCB(hs.MA_CB); tmp.MA_CHUCVU = hs.MA_CHUCVU; //tmp.HS_LUONG = hs.HS_LUONG; tmp.MA_NGACH = hs.MA_NGACH; tmp.MA_CONGVIEC = hs.MA_CONGVIEC; Save(); }
public void UpdateLoaiHopDong(string maLoaiHopDong, decimal prkey) { HOSO hs = dataContext.HOSOs.Single(t => t.PR_KEY == prkey); if (hs != null) { hs.MA_LOAI_HDONG = maLoaiHopDong; Save(); } }
public bool UpdateImageBySoCMND(string SoCMND, string ImageUrl) { HOSO hs = dataContext.HOSOs.Where(t => t.SO_CMND == SoCMND).FirstOrDefault(); if (hs != null) { hs.PHOTO = ImageUrl; Save(); return(true); } return(false); }
/// <summary> /// Cập nhật ảnh theo mã cán bộ /// </summary> /// <param name="MaCB">Mã cán bộ</param> /// <param name="ImageUrl">Đường dẫn ảnh</param> /// <returns><b>true</b> nếu cập nhật ảnh thành công. <b>false</b> nếu cập nhật ảnh thất bại</returns> public bool UpdateImage(string MaCB, string ImageUrl) { HOSO hs = dataContext.HOSOs.Where(t => t.MA_CB == MaCB).FirstOrDefault();//GetByMaCB(MaCB); if (hs != null) { hs.PHOTO = ImageUrl; Save(); return(true); } return(false); }
public void UpDateHoSoBaoHiem(HOSO hs) { HOSO item = dataContext.HOSOs.Where(p => p.PR_KEY == hs.PR_KEY).SingleOrDefault(); if (item != null) { if (!string.IsNullOrEmpty(hs.HO_TEN)) { item.HO_TEN = hs.HO_TEN; item.TEN_CB = hs.TEN_CB; } if (hs.NGAY_SINH != null) { item.NGAY_SINH = hs.NGAY_SINH; } if (!string.IsNullOrEmpty(hs.MA_GIOITINH)) { item.MA_GIOITINH = hs.MA_GIOITINH; } if (!string.IsNullOrEmpty(hs.SO_CMND)) { item.SO_CMND = hs.SO_CMND; } if (!string.IsNullOrEmpty(hs.MA_NOICAP_CMND)) { item.MA_NOICAP_CMND = hs.MA_NOICAP_CMND; } if (hs.NGAYCAP_CMND != null) { item.NGAYCAP_CMND = hs.NGAYCAP_CMND; } if (!string.IsNullOrEmpty(hs.SOTHE_BHXH)) { item.SOTHE_BHXH = hs.SOTHE_BHXH; } if (!string.IsNullOrEmpty(hs.SOTHE_BHYT)) { item.SOTHE_BHYT = hs.SOTHE_BHYT; } if (hs.NGAY_DONGBH != null) { item.NGAY_DONGBH = hs.NGAY_DONGBH; } if (hs.NGAY_HETHAN_BHYT != null) { item.NGAY_HETHAN_BHYT = hs.NGAY_HETHAN_BHYT; } Save(); } }
public void UpdateImage(decimal pr_key, string ImageUrl) { HOSO hs = dataContext.HOSOs.Where(t => t.PR_KEY == pr_key).FirstOrDefault();//GetByMaCB(MaCB); if (hs != null) { hs.PHOTO = ImageUrl; Save(); } else { X.Msg.Alert("Thông báo", "Không tìm thấy cán bộ").Show(); } }
/// <summary> /// Thêm nhân viên vào bảng cán bộ được đánh giá /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ucChooseEmployee1_AfterClickAcceptButton(object sender, EventArgs e) { try { string chonCB = hdfChonCanBo.Text; switch (chonCB) { case "1": SelectedRowCollection SelectedRow = ucChooseEmployee1.SelectedRow; HoSoController dmcbController = new HoSoController(); string str = ""; foreach (var item in SelectedRow) { HOSO emp = dmcbController.GetByMaCB(item.RecordID); if (emp != null) { if (new CanBoDuocDanhGiaController().CheckExistMaCBDuocDanhGia(emp.MA_CB, hdfRecordID.Text) == false) { CanBoDuocDanhGiaInfo cbo = new CanBoDuocDanhGiaInfo() { MaCB = emp.MA_CB, MaDotDanhGia = hdfRecordID.Text, CreatedBy = CurrentUser.ID, CreatedDate = DateTime.Now }; int id = new CanBoDuocDanhGiaController().Insert(cbo); cbo.ID = id; // tạo bản đánh giá trống //CreateKetQuaDanhGiaByMaCB(cbo.MaCB); } else { str += emp.HO_TEN + "(" + item.RecordID + "), "; } } } RM.RegisterClientScriptBlock("reloadst", "#{grp_CanBoDuocDanhGia_Store}.reload();"); if (!string.IsNullOrEmpty(str)) { X.MessageBox.Alert("Thông báo", "Các nhân viên sau đã tồn tại: " + str).Show(); } else { X.MessageBox.Alert("Thông báo", "Đã thêm cán bộ thành công"); } break; case "0": SelectedRowCollection SelectedRow1 = ucChooseEmployee1.SelectedRow; HoSoController dmcbController1 = new HoSoController(); string str1 = ""; foreach (var item in SelectedRow1) { HOSO emp = dmcbController1.GetByMaCB(item.RecordID); if (emp != null) { if (new CanBoThamGiaDanhGiaController().CheckExistMaCBThamGiaDanhGia(hdfCanBoDuocDanhGiaID.Text, emp.MA_CB, hdfRecordID.Text) == false) { CanBoThamGiaDanhGiaInfo cbo = new CanBoThamGiaDanhGiaInfo() { MaCBDanhGia = emp.MA_CB, MaDotDanhGia = hdfRecordID.Text, MaCBBiDanhGia = "", CreatedBy = CurrentUser.ID, CreatedDate = DateTime.Now }; new CanBoThamGiaDanhGiaController().Insert(cbo); } else { str1 += emp.HO_TEN + "(" + item.RecordID + "), "; } } } RM.RegisterClientScriptBlock("reloadst1", "#{grp_CanBoThamGiaDanhGia_Store}.reload();"); if (!string.IsNullOrEmpty(str1)) { X.MessageBox.Alert("Thông báo", "Các nhân viên sau đã tồn tại: " + str1).Show(); } else { X.MessageBox.Alert("Thông báo", "Đã thêm cán bộ thành công"); } break; } } catch (Exception ex) { X.MessageBox.Alert("Có lỗi xảy ra", ex.Message).Show(); } }