protected void btnCapNhat_Click(object sender, DirectEventArgs e) { BHQUYDINHBIENDONGInfo obj = new BHQUYDINHBIENDONGInfo(); BHQUYDINHBIENDONGController ctr = new BHQUYDINHBIENDONGController(); obj.MaBienDong = txtMaBienDong.Text; obj.TenBienDong = txtTenBienDong.Text; obj.LoaiAnhHuong = cboloaianhhuong.Value.ToString(); if (!string.IsNullOrEmpty(cboCheDoBH.Text)) { if (cboCheDoBH.Text == "NULL") { obj.IDCheDoBaoHiem = null; } else { obj.IDCheDoBaoHiem = Convert.ToInt32(cboCheDoBH.Value); } } obj.IsBHXH = chkIsIsBHXH.Checked; obj.IsBHYT = chkIsIsBHYT.Checked; obj.IsBHTN = chkIsIsBHTN.Checked; obj.DangSuDung = chkIsDangSuDung.Checked; obj.UserID = CurrentUser.ID; obj.DateCreate = DateTime.Now; obj.MaDonVi = Session["MaDonVi"].ToString(); if (e.ExtraParams["Command"] == "Edit") { if (!string.IsNullOrEmpty(hdfRecordID.Text)) { obj.IDQuyDinhBienDong = Convert.ToInt32(hdfRecordID.Text); } ctr.Update(obj); wdAddWindow.Hide(); } else { DataTable dt = DataController.DataHandler.GetInstance().ExecuteDataTable("GetBienDongBaoHiem_ByMaBienDong", "@MaBienDong", txtMaBienDong.Text); if (dt.Rows.Count > 0) { X.MessageBox.Alert("Thông báo", "Mã quy định biến động đã tồn tại").Show(); txtMaBienDong.Focus(); return; } else { ctr.Insert(obj); } if (e.ExtraParams["Close"] == "True") { wdAddWindow.Hide(); } // RM.RegisterClientScriptBlock("fd", string.Format("addRecord('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}', '{10}', '{11}')", txtIDQuyDinhBienDong.Text, txtMaBienDong.Text, txtTenBienDong.Text, txtLoaiAnhHuong.Text, txtIDCheDoBaoHiem.Text, chkIsIsBHXH.Checked, chkIsIsBHYT.Checked, chkIsIsBHTN.Checked, chkIsDangSuDung.Checked, txtUserID.Text, txtDateCreate.Text, txtMaDonVi.Text)); } GridPanel1.Reload(); }
public void btnTTDongYClick() { decimal tongluongpccu = (txtTTLuongBHCu.Text == "" ? 0 : decimal.Parse(txtTTLuongBHCu.Text)) + (txtTTPCTNNCu.Text == "" ? 0 : decimal.Parse(txtTTPCTNNCu.Text)) + (txtTTPCTNVKCu.Text == "" ? 0 : decimal.Parse(txtTTPCTNVKCu.Text)) + (txtTTPhuCapCVCu.Text == "" ? 0 : decimal.Parse(txtTTPhuCapCVCu.Text)); decimal tongluongpcmoi = (txtTTLuongBHMoi.Text == "" ? 0 : decimal.Parse(txtTTLuongBHMoi.Text)) + (txtTTPCTNNMoi.Text == "" ? 0 : decimal.Parse(txtTTPCTNNMoi.Text)) + (txtTTPCTNVKMoi.Text == "" ? 0 : decimal.Parse(txtTTPCTNVKMoi.Text)) + (txtTTPhuCapCVMoi.Text == "" ? 0 : decimal.Parse(txtTTPhuCapCVMoi.Text)); if (tongluongpccu == tongluongpcmoi) { Dialog.ShowNotification("Thông báo", "Lương và phụ cấp hiện tại hiện đang bằng mức lương mới nhất"); wdThayDoiLuongPhuCap.Hide(); return; } if (tongluongpccu > tongluongpcmoi) { hdfLoaiBienDong.Text = new BHQUYDINHBIENDONGController().LayIDBienDongByMa("GMD").ToString(); Dialog.ShowNotification("Thông báo", "Quyết định lương mới nhất làm giảm mức đóng"); } else { hdfLoaiBienDong.Text = new BHQUYDINHBIENDONGController().LayIDBienDongByMa("TMD").ToString(); Dialog.ShowNotification("Thông báo", "Quyết định lương mới nhất làm tăng mức đóng"); } //fix vậy đã //thay đổi thông tin lương mới txtLuongDongBHXHMoi1.Text = txtTTLuongBHMoi.Text; txtPhuCapCVMoi1.Text = txtTTPhuCapCVMoi.Text; txtPhuCapTNVKMoi1.Text = txtTTPCTNVKMoi.Text; txtPhuCapTNNMoi1.Text = txtTTPCTNNMoi.Text; txtDienGiai1.Text = "QĐ số: " + txtTTSoQD.Text; dfTuNgay1.SelectedDate = dfTTNgayHieuLuc.SelectedDate; DAL.BHQUYDINHBIENDONG qdbd = new BHQUYDINHBIENDONGController().Lay1QuyDinhBienDong(Convert.ToInt32(hdfLoaiBienDong.Text)); tgfChonBienDong1.Text = qdbd.TenBienDong; hdfMaLoaiBienDong.Text = qdbd.MaBienDong; if (qdbd.IDCheDoBaoHiem != null) { hdfIDLoaiCheDo.Text = qdbd.IDCheDoBaoHiem.ToString(); // RM.RegisterClientScriptBlock("rlst", "#{cbbLoaiCheDo1_Store}.reload();"); } hdfIDQuyDinhBienDong.Text = qdbd.IDQuyDinhBienDong.ToString(); // dt.Rows[0]["IDQuyDinhBienDong"].ToString(); RM.RegisterClientScriptBlock("rl6", "#{pnlThongTinLuong1}.enable();"); //#{tabPanel1}.addTab(#{pnlThongTinLuong1}); if (qdbd.LoaiAnhHuong == "TruyThu" || qdbd.LoaiAnhHuong == "ThoaiThu") { RM.RegisterClientScriptBlock("r8", "#{pnlTruyThoaithu1}.enable();");//#{tabPanel1}.addTab(#{pnlThongTinLuong1}); } else { RM.RegisterClientScriptBlock("rl9", "#{pnlTruyThoaithu1}.disable();");//#{tabPanel1}.closeTab(#{pnlThongTinLuong1}, 'hide'); //RM.RegisterClientScriptBlock("rl4", "#{tabPanel}.closeTab(#{pnlTruyThoaithu}, 'hide');"); } wdThayDoiLuongPhuCap.Hide(); // RM.RegisterClientScriptBlock("abcd", "ClearControlThongTin();"); }
protected void btnEdit_Click(object sender, DirectEventArgs e) { try { DataTable record = new BHQUYDINHBIENDONGController().GetByPrkey(Convert.ToInt32(hdfRecordID.Text)); txtMaBienDong.Text = record.Rows[0]["MaBienDong"].ToString(); txtTenBienDong.Text = record.Rows[0]["TenBienDong"].ToString(); string id = record.Rows[0]["IDCheDoBaoHiem"].ToString(); if (record.Rows[0]["IDCheDoBaoHiem"].ToString() != "") { LoadCha(Convert.ToInt32(record.Rows[0]["IDCheDoBaoHiem"])); } string loaianhhuong = record.Rows[0]["LoaiAnhHuong"].ToString(); string tenanhhuong = ""; switch (loaianhhuong) { case "TLD": tenanhhuong = "Tăng lao động"; break; case "GLD": tenanhhuong = "Giảm lao động"; break; case "TMD": tenanhhuong = "Tăng mức đóng"; break; case "GMD": tenanhhuong = "Giảm mức đóng"; break; case "TruyThu": tenanhhuong = "Truy thu"; break; case "ThoaiThu": tenanhhuong = "Thoái thu"; break; } cboloaianhhuong.Text = tenanhhuong; cboloaianhhuong.Value = loaianhhuong; //txtLoaiAnhHuong.Text = record.Rows[0]["LoaiAnhHuong"].ToString(); //txtIDCheDoBaoHiem.Text = record.Rows[0]["IDCheDoBaoHiem"].ToString(); chkIsIsBHXH.Checked = (bool)record.Rows[0]["IsBHXH"]; chkIsIsBHYT.Checked = (bool)record.Rows[0]["IsBHYT"]; chkIsIsBHTN.Checked = (bool)record.Rows[0]["IsBHTN"]; chkIsDangSuDung.Checked = (bool)record.Rows[0]["DangSuDung"]; hdfCommand.Text = "Update"; wdAddWindow.Icon = Icon.Pencil; wdAddWindow.Title = "Sửa quy định biến động bảo hiểm"; wdAddWindow.Show(); } catch { } }
protected void btnOK_Click(object sender, DirectEventArgs e) { DataTable record = new BHQUYDINHBIENDONGController().GetByPrkey(Convert.ToInt32(txtmaloaihdcoppy.Text)); if (record.Rows.Count > 0) { Dialog.ShowNotification("Mã đã tồn tại"); } else { record = new BHQUYDINHBIENDONGController().GetByPrkey(Convert.ToInt32(hdfRecordID.Text)); record.Rows[0]["IDQuyDinhBienDong"] = int.Parse(txtmaloaihdcoppy.Text); if (record != null) { BHQUYDINHBIENDONGInfo item = new BHQUYDINHBIENDONGInfo() { IDQuyDinhBienDong = int.Parse(record.Rows[0]["IDQuyDinhBienDong"].ToString()), MaBienDong = record.Rows[0]["MaBienDong"].ToString(), TenBienDong = record.Rows[0]["TenBienDong"].ToString(), LoaiAnhHuong = record.Rows[0]["LoaiAnhHuong"].ToString(), IDCheDoBaoHiem = int.Parse(record.Rows[0]["IDCheDoBaoHiem"].ToString()), IsBHXH = (bool)record.Rows[0]["IsBHXH"], IsBHYT = (bool)record.Rows[0]["IsBHYT"], IsBHTN = (bool)record.Rows[0]["IsBHTN"], DangSuDung = (bool)record.Rows[0]["DangSuDung"], UserID = int.Parse(record.Rows[0]["UserID"].ToString()), DateCreate = DateTime.Parse(record.Rows[0]["DateCreate"].ToString()), MaDonVi = record.Rows[0]["MaDonVi"].ToString(), }; new BHQUYDINHBIENDONGController().Insert(item); GridPanel1.Reload(); wdInputNewPrimaryKey.Hide(); } } }
[DirectMethod] //khi kích vào nút sửa, tự động load dữ liệu biến động public void loadThongTinBienDong() { // thay đổi title icon windown wdThemSuaBienDongNhanVien.Title = "Sửa biến động cho nhân viên"; wdThemSuaBienDongNhanVien.Icon = Icon.Pencil; ChiTietNhanVienBienDongInfo bdbh = new QuanLyBienDongBaoHiemController().GetByIDBienDongBaoHiem(int.Parse(hdfChiTietID.Text)); txtMaCanBo1.Text = bdbh.MaNhanVien; txtHoTen1.Text = bdbh.HoTen; dfNgaySinh1.Value = bdbh.NgaySinh; txtSoSoBHXH1.Text = bdbh.MaSo; // thông tin về truy thu thoái thu nfTruyThuBHXH.Text = bdbh.TruyThuBHXH.ToString(); nfTruyThuBHYT.Text = bdbh.TruyThuBHYT.ToString(); nfThoaiThuBHXH.Text = bdbh.ThoaiThuBHXH.ToString(); nfThoaiThuBHYT.Text = bdbh.ThoaiThuBHYT.ToString(); //thong tin nhan vien DAL.BHNHANVIEN_BAOHIEM hs = new NhanVien_BaoHiemController().GetNhanVien_BaoHiemByMaNhanVien(hdfMaNhanVien.Value.ToString()); txtLuongDongBH1.Text = hs.LuongBaoHiem.ToString(); txtThoiGianDongBHXH1.Text = new BaoHiemController().ChuyenSoThangDongBH((int)hs.ThoiGianDongBaoHiem); // check chkBHTN1.SetValue(hs.DangDongBHTN); chkBHYT1.SetValue(hs.DangDongBHYT); chkBHXH1.SetValue(hs.DangDongBHXH); hdfIsBHXH.Text = hs.DangDongBHXH.ToString(); hdfIsBHYT.Text = hs.DangDongBHYT.ToString(); hdfIsBHTN.Text = hs.DangDongBHTN.ToString(); //thông tin quy định biến động DAL.BHQUYDINHBIENDONG qdbd = new BHQUYDINHBIENDONGController().Lay1QuyDinhBienDong(bdbh.IDQuyDinhBienDong); //set 1 số id cho hiddenfield hdfIdNhanVien_BaoHiem.Text = hs.IDNhanVien_BaoHiem.ToString(); hdfIDQuyDinhBienDong.Text = qdbd.IDQuyDinhBienDong.ToString(); hdfIDLoaiCheDo.Text = qdbd.IDCheDoBaoHiem.ToString(); hdfMaLoaiBienDong.Text = qdbd.MaBienDong; tgfChonBienDong1.Text = qdbd.TenBienDong; //dt.Rows[0]["TenBienDong"].ToString(); hdfMaLoaiBienDong.Text = qdbd.MaBienDong; chkBHXH1.Checked = (bool)qdbd.IsBHXH; // (bool)dt.Rows[0]["IsBHXH"]; chkBHYT1.Checked = (bool)qdbd.IsBHYT; // (bool)dt.Rows[0]["IsBHYT"]; chkBHTN1.Checked = (bool)qdbd.IsBHTN; // (bool)dt.Rows[0]["IsBHTN"]; if (qdbd.IDCheDoBaoHiem != null) { hdfIDLoaiCheDo.Text = qdbd.IDCheDoBaoHiem.ToString(); // RM.RegisterClientScriptBlock("rlst", "#{cbbLoaiCheDo1_Store}.reload();"); } hdfIDQuyDinhBienDong.Text = qdbd.IDQuyDinhBienDong.ToString();// dt.Rows[0]["IDQuyDinhBienDong"].ToString(); txtLuongDongBHXHCu1.Text = bdbh.TienLuongCu.ToString(); txtPhuCapTNVKCu1.Text = bdbh.PhuCapTNVKCu.ToString(); txtPhuCapTNNCu1.Text = bdbh.PhuCapNgheCu.ToString(); txtPhuCapCVCu1.Text = bdbh.PhuCapCVCu.ToString(); txtLuongDongBHXHMoi1.Text = bdbh.TienLuongMoi.ToString(); txtPhuCapCVMoi1.Text = bdbh.PhuCapCVMoi.ToString(); txtPhuCapTNNMoi1.Text = bdbh.PhuCapTNNgheMoi.ToString(); txtPhuCapTNVKMoi1.Text = bdbh.PhuCapTNVKMoi.ToString(); txtLuongDongBHXHMoi1.Text = bdbh.TienLuongMoi.ToString(); //if (qdbd.LoaiAnhHuong == "TMD" || qdbd.LoaiAnhHuong == "GMD") //{ // RM.RegisterClientScriptBlock("rl10", "#{pnlThongTinLuong1}.enable();");//#{tabPanel1}.addTab(#{pnlThongTinLuong1}); //} //else //{ // RM.RegisterClientScriptBlock("rl11", "#{pnlThongTinLuong1}.disable();");//#{tabPanel1}.closeTab(#{pnlThongTinLuong1}, 'hide'); //} //if (qdbd.LoaiAnhHuong == "TruyThu" || qdbd.LoaiAnhHuong == "ThoaiThu") //{ // RM.RegisterClientScriptBlock("rl2", "#{pnlTruyThoaithu1}.enable();");//#{tabPanel1}.addTab(#{pnlThongTinLuong1}); //} //else //{ // RM.RegisterClientScriptBlock("rl13", "#{pnlTruyThoaithu1}.disable();");//#{tabPanel1}.closeTab(#{pnlThongTinLuong1}, 'hide'); // //RM.RegisterClientScriptBlock("rl4", "#{tabPanel}.closeTab(#{pnlTruyThoaithu}, 'hide');"); //} dfTuNgay1.Value = bdbh.TuNgay.Value; if (bdbh.DenNgay != null) { dfDenNgay1.Value = bdbh.DenNgay; } if (bdbh.ThangDangKy.HasValue) { dfNgayDangKyVoiCQBH.Value = bdbh.ThangDangKy.Value; } chkDaCoSo.Checked = (bool)bdbh.DaCoSo; chkKhongTraThe.Checked = (bool)bdbh.KhongTraThe; txtDienGiai1.Text = bdbh.DienGiai; //Thông tin chế độ. }
//sự kiện cập nhật sửa protected void btnCapNhatSua_Click(object sender, DirectEventArgs e) { QuanLyBienDongBaoHiemController qlbd = new QuanLyBienDongBaoHiemController(); BHBIENDONGBAOHIEM bdbh = qlbd.GetBienDongBaoHiemByID(int.Parse(hdfChiTietID.Text)); bdbh.IDQuyDinhBienDong = int.Parse(hdfIDQuyDinhBienDong.Text); bdbh.TuNgay = (DateTime)dfTuNgay1.Value; if (!SoftCore.Util.GetInstance().IsDateNull(dfDenNgay1.SelectedDate)) { bdbh.DenNgay = (DateTime)dfDenNgay1.Value; } if (!SoftCore.Util.GetInstance().IsDateNull(dfNgayDangKyVoiCQBH.SelectedDate)) { bdbh.ThangDangKy = (DateTime)dfNgayDangKyVoiCQBH.Value; } DAL.BHQUYDINHBIENDONG qdbd = new BHQUYDINHBIENDONGController().Lay1QuyDinhBienDong(bdbh.IDQuyDinhBienDong); bdbh.Loai = qdbd.LoaiAnhHuong; BHNHANVIEN_BAOHIEM hs = new NhanVien_BaoHiemController().GetNhanVien_BaoHiemByMaNhanVien(hdfMaNhanVien.Value.ToString()); if (!string.IsNullOrEmpty(hs.LuongBaoHiem.ToString())) { txtLuongDongBHXHCu1.Text = hs.LuongBaoHiem.ToString(); txtLuongDongBHXHMoi1.Text = txtLuongDongBHXHCu1.Text; } if (!string.IsNullOrEmpty(hs.PhuCapCV.ToString())) { txtPhuCapCVCu1.Text = hs.PhuCapCV.ToString(); txtPhuCapCVMoi1.Text = txtPhuCapCVCu1.Text; } if (!string.IsNullOrEmpty(hs.PhuCapTNVK.ToString())) { txtPhuCapTNVKCu1.Text = hs.PhuCapTNVK.ToString(); txtPhuCapTNVKMoi1.Text = txtPhuCapTNVKCu1.Text; } if (!string.IsNullOrEmpty(hs.PhuCapTNN.ToString())) { txtPhuCapTNNCu1.Text = hs.PhuCapTNN.ToString(); txtPhuCapTNNMoi1.Text = txtPhuCapTNNCu1.Text; } if (qdbd.LoaiAnhHuong == "TMD" || qdbd.LoaiAnhHuong == "GMD") { bdbh.TienLuongCu = txtLuongDongBHXHCu1.Text == "" ? 0 : Convert.ToDecimal(txtLuongDongBHXHCu1.Text.Replace('.', ',')); bdbh.PhuCapTNVKCu = txtPhuCapTNVKCu1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapTNVKCu1.Text.Replace('.', ',')); bdbh.PhuCapNgheCu = txtPhuCapTNNCu1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapTNNCu1.Text.Replace('.', ',')); bdbh.PhuCapCVCu = txtPhuCapCVCu1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapCVCu1.Text.Replace('.', ',')); bdbh.TienLuongMoi = txtLuongDongBHXHMoi1.Text == "" ? 0 : Convert.ToDecimal(txtLuongDongBHXHMoi1.Text.Replace('.', ',')); bdbh.PhuCapCVMoi = txtPhuCapCVMoi1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapCVMoi1.Text.Replace('.', ',')); bdbh.PhuCapTNNgheMoi = txtPhuCapTNNMoi1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapTNNMoi1.Text.Replace('.', ',')); bdbh.PhuCapTNVKMoi = txtPhuCapTNVKMoi1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapTNVKMoi1.Text.Replace('.', ',')); bdbh.TienLuongMoi = txtLuongDongBHXHMoi1.Text == "" ? 0 : Convert.ToDecimal(txtLuongDongBHXHMoi1.Text.Replace('.', ',')); if (e.ExtraParams["Command"] == "Insert") { if (hdfMaLoaiBienDong.Text == "TMD" || hdfMaLoaiBienDong.Text == "GMD") { UpdateNguocNhanVien_BaoHiem(); } } } else if (qdbd.LoaiAnhHuong == "TruyThu") { bdbh.TruyThuBHXH = nfTruyThuBHXH.Text == "" ? 0 : Convert.ToDecimal(nfTruyThuBHXH.Text.Replace('.', ',')); bdbh.TruyThuBHYT = nfTruyThuBHYT.Text == "" ? 0 : Convert.ToDecimal(nfTruyThuBHYT.Text.Replace('.', ',')); } else if (qdbd.LoaiAnhHuong == "ThoaiThu") { bdbh.ThoaiThuBHYT = nfThoaiThuBHYT.Text == "" ? 0 : Convert.ToDecimal(nfThoaiThuBHYT.Text.Replace('.', ',')); bdbh.ThoaiThuBHXH = nfThoaiThuBHXH.Text == "" ? 0 : Convert.ToDecimal(nfThoaiThuBHXH.Text.Replace('.', ',')); } else { bdbh.TienLuongCu = txtLuongDongBHXHCu1.Text == "" ? 0 : Convert.ToDecimal(txtLuongDongBHXHCu1.Text.Replace('.', ',')); bdbh.PhuCapTNVKCu = txtPhuCapTNVKCu1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapTNVKCu1.Text.Replace('.', ',')); bdbh.PhuCapNgheCu = txtPhuCapTNNCu1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapTNNCu1.Text.Replace('.', ',')); bdbh.PhuCapCVCu = txtPhuCapCVCu1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapCVCu1.Text.Replace('.', ',')); bdbh.TienLuongMoi = txtLuongDongBHXHMoi1.Text == "" ? 0 : Convert.ToDecimal(txtLuongDongBHXHMoi1.Text.Replace('.', ',')); bdbh.PhuCapCVMoi = txtPhuCapCVMoi1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapCVMoi1.Text.Replace('.', ',')); bdbh.PhuCapTNNgheMoi = txtPhuCapTNNMoi1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapTNNMoi1.Text.Replace('.', ',')); bdbh.PhuCapTNVKMoi = txtPhuCapTNVKMoi1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapTNVKMoi1.Text.Replace('.', ',')); bdbh.TienLuongMoi = txtLuongDongBHXHMoi1.Text == "" ? 0 : Convert.ToDecimal(txtLuongDongBHXHMoi1.Text.Replace('.', ',')); } bdbh.KhongTraThe = chkKhongTraThe.Checked; bdbh.DaCoSo = chkDaCoSo.Checked; bdbh.DienGiai = txtDienGiai1.Text; qlbd.UpdateBienDongBaoHiem(bdbh); //update tinh trangg dong cho nhan vien BHNHANVIEN_BAOHIEM nvbh = new NhanVien_BaoHiemController().GetNhanVien_BaoHiemByMaNhanVien(Convert.ToInt32(hdfIdNhanVien_BaoHiem.Text)); nvbh.IDNhanVien_BaoHiem = Convert.ToInt32(hdfIdNhanVien_BaoHiem.Text); nvbh.DangDongBHXH = chkBHXH1.Checked; nvbh.DangDongBHYT = chkBHYT1.Checked; nvbh.DangDongBHTN = chkBHTN1.Checked; new NhanVien_BaoHiemController().UpdateNhanVien_BaoHiem(nvbh); Dialog.ShowNotification("Thông báo", "Đã cập nhật thành công"); if (e.ExtraParams["Close"] == "True") { wdThemSuaBienDongNhanVien.Hide(); } grpChiTietNhanVien.Reload(); grpBienDongBaoHiem.Reload(); }
// sự kiện nút lưu thêm protected void bt_addclick(object sender, DirectEventArgs e) { //get usercontrol all DAL.BHBIENDONGBAOHIEM bdbh = new DAL.BHBIENDONGBAOHIEM(); bdbh.MaNhanVien = txtMaCanBo1.Text; bdbh.HoTen = txtHoTen1.Text; bdbh.NgaySinh = Convert.ToDateTime(dfNgaySinh1.Value); bdbh.MaSo = txtSoSoBHXH1.Text; bdbh.IDQuyDinhBienDong = Convert.ToInt32(hdfIDQuyDinhBienDong.Text); bdbh.IDNhanVien_BaoHiem = Convert.ToInt32(hdfIdNhanVien_BaoHiem.Text); bdbh.TuNgay = Convert.ToDateTime(dfTuNgay1.Value); if (Radio1.Checked == true) { bdbh.TruyThuBHXH = decimal.Parse("0" + NumberField2.Text); bdbh.TruyThuBHYT = decimal.Parse("0" + NumberField3.Text); } else if (Radio2.Checked == true) { bdbh.ThoaiThuBHXH = decimal.Parse("0" + NumberField2.Text); bdbh.ThoaiThuBHYT = decimal.Parse("0" + NumberField3.Text); } if (!new SoftCore.Util().IsDateNull(dfDenNgay1.SelectedDate)) { bdbh.DenNgay = Convert.ToDateTime(dfDenNgay1.Value); } DAL.BHQUYDINHBIENDONG qdbd = new BHQUYDINHBIENDONGController().Lay1QuyDinhBienDong(bdbh.IDQuyDinhBienDong); BHNHANVIEN_BAOHIEM hs = new NhanVien_BaoHiemController().GetNhanVien_BaoHiemByMaNhanVien(hdfMaNhanVien.Value.ToString()); if (!string.IsNullOrEmpty(hs.LuongBaoHiem.ToString())) { txtLuongDongBHXHCu1.Text = hs.LuongBaoHiem.ToString(); txtLuongDongBHXHMoi1.Text = txtLuongDongBHXHCu1.Text; } if (!string.IsNullOrEmpty(hs.PhuCapCV.ToString())) { txtPhuCapCVCu1.Text = hs.PhuCapCV.ToString(); txtPhuCapCVMoi1.Text = txtPhuCapCVCu1.Text; } if (!string.IsNullOrEmpty(hs.PhuCapTNVK.ToString())) { txtPhuCapTNVKCu1.Text = hs.PhuCapTNVK.ToString(); txtPhuCapTNVKMoi1.Text = txtPhuCapTNVKCu1.Text; } if (!string.IsNullOrEmpty(hs.PhuCapTNN.ToString())) { txtPhuCapTNNCu1.Text = hs.PhuCapTNN.ToString(); txtPhuCapTNNMoi1.Text = txtPhuCapTNNCu1.Text; } if (qdbd.LoaiAnhHuong == "TMD" || qdbd.LoaiAnhHuong == "GMD") { bdbh.TienLuongCu = txtLuongDongBHXHCu1.Text == "" ? 0 : Convert.ToDecimal(txtLuongDongBHXHCu1.Text.Replace('.', ',')); bdbh.PhuCapTNVKCu = txtPhuCapTNVKCu1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapTNVKCu1.Text.Replace('.', ',')); bdbh.PhuCapNgheCu = txtPhuCapTNNCu1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapTNNCu1.Text.Replace('.', ',')); bdbh.PhuCapCVCu = txtPhuCapCVCu1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapCVCu1.Text.Replace('.', ',')); bdbh.TienLuongMoi = txtLuongDongBHXHMoi1.Text == "" ? 0 : Convert.ToDecimal(txtLuongDongBHXHMoi1.Text.Replace('.', ',')); bdbh.PhuCapCVMoi = txtPhuCapCVMoi1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapCVMoi1.Text.Replace('.', ',')); bdbh.PhuCapTNNgheMoi = txtPhuCapTNNMoi1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapTNNMoi1.Text.Replace('.', ',')); bdbh.PhuCapTNVKMoi = txtPhuCapTNVKMoi1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapTNVKMoi1.Text.Replace('.', ',')); bdbh.TienLuongMoi = txtLuongDongBHXHMoi1.Text == "" ? 0 : Convert.ToDecimal(txtLuongDongBHXHMoi1.Text.Replace('.', ',')); } if (qdbd.LoaiAnhHuong == "TLD") { bdbh.TienLuongCu = 0; bdbh.PhuCapTNVKCu = 0; bdbh.PhuCapNgheCu = 0; bdbh.PhuCapCVCu = 0; bdbh.TienLuongMoi = txtLuongDongBHXHMoi1.Text == "" ? 0 : Convert.ToDecimal(txtLuongDongBHXHMoi1.Text.Replace('.', ',')); bdbh.PhuCapCVMoi = txtPhuCapCVMoi1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapCVMoi1.Text.Replace('.', ',')); bdbh.PhuCapTNNgheMoi = txtPhuCapTNNMoi1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapTNNMoi1.Text.Replace('.', ',')); bdbh.PhuCapTNVKMoi = txtPhuCapTNVKMoi1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapTNVKMoi1.Text.Replace('.', ',')); bdbh.TienLuongMoi = txtLuongDongBHXHMoi1.Text == "" ? 0 : Convert.ToDecimal(txtLuongDongBHXHMoi1.Text.Replace('.', ',')); } if (qdbd.LoaiAnhHuong == "GLD") { bdbh.TienLuongCu = txtLuongDongBHXHCu1.Text == "" ? 0 : Convert.ToDecimal(txtLuongDongBHXHCu1.Text.Replace('.', ',')); bdbh.PhuCapTNVKCu = txtPhuCapTNVKCu1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapTNVKCu1.Text.Replace('.', ',')); bdbh.PhuCapNgheCu = txtPhuCapTNNCu1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapTNNCu1.Text.Replace('.', ',')); bdbh.PhuCapCVCu = txtPhuCapCVCu1.Text == "" ? 0 : Convert.ToDecimal(txtPhuCapCVCu1.Text.Replace('.', ',')); bdbh.TienLuongMoi = 0; bdbh.PhuCapCVMoi = 0; bdbh.PhuCapTNNgheMoi = 0; bdbh.PhuCapTNVKMoi = 0; bdbh.TienLuongMoi = 0; } if (qdbd.LoaiAnhHuong.Contains("TruyThu")) { bdbh.TruyThuBHXH = nfTruyThuBHXH.Text == "" ? 0 : Convert.ToDecimal(nfTruyThuBHXH.Text.Replace('.', ',')); bdbh.TruyThuBHYT = nfTruyThuBHYT.Text == "" ? 0 : Convert.ToDecimal(nfTruyThuBHYT.Text.Replace('.', ',')); } if (qdbd.LoaiAnhHuong.Contains("ThoaiThu")) { bdbh.ThoaiThuBHXH = nfThoaiThuBHXH.Text == "" ? 0 : Convert.ToDecimal(nfThoaiThuBHXH.Text.Replace('.', ',')); bdbh.ThoaiThuBHYT = nfThoaiThuBHYT.Text == "" ? 0 : Convert.ToDecimal(nfThoaiThuBHYT.Text.Replace('.', ',')); } bdbh.DaCoSo = chkDaCoSo.Checked; bdbh.KhongTraThe = chkKhongTraThe.Checked; bdbh.DienGiai = txtDienGiai1.Text; bdbh.UserID = CurrentUser.ID; bdbh.MaDonVi = Session["MaDonVi"].ToString(); bdbh.DateCreate = DateTime.Now; //bdbh.ThangDangKy = DateTime.Now; if (!SoftCore.Util.GetInstance().IsDateNull(dfNgayDangKyVoiCQBH.SelectedDate)) { bdbh.ThangDangKy = (DateTime)dfNgayDangKyVoiCQBH.Value; } bdbh.ChucVu = ""; //update tinh trangg dong cho nhan vien BHNHANVIEN_BAOHIEM nvbh = new NhanVien_BaoHiemController().GetNhanVien_BaoHiemByMaNhanVien(Convert.ToInt32(hdfIdNhanVien_BaoHiem.Text)); nvbh.IDNhanVien_BaoHiem = Convert.ToInt32(hdfIdNhanVien_BaoHiem.Text); nvbh.DangDongBHXH = chkBHXH1.Checked; nvbh.DangDongBHYT = chkBHYT1.Checked; nvbh.DangDongBHTN = chkBHTN1.Checked; bdbh.NgaySinh = nvbh.NgaySinh; bdbh.GioiTinh = nvbh.GioiTinh ?? true; bdbh.Loai = qdbd.LoaiAnhHuong; new QuanLyBienDongBaoHiemController().InsertBienDongBaoHiem(bdbh); new NhanVien_BaoHiemController().UpdateNhanVien_BaoHiem(nvbh); Dialog.ShowNotification("Thông báo", "Đã cập nhật thành công"); if (e.ExtraParams["Command"] == "Insert") { if (hdfMaLoaiBienDong.Text == "TMD" || hdfMaLoaiBienDong.Text == "GMD") { UpdateNguocNhanVien_BaoHiem(); } } if (e.ExtraParams["Close"] == "True") { //wdThemSuaBienDongNhanVien.Hide(); wdThemSuaBienDongNhanVien.Hide(); } grpChiTietNhanVien.Reload(); grpBienDongBaoHiem.Reload(); // update ngược lại bảng NHANVIEN_BAOHIEM }
protected void bt_click(object sender, DirectEventArgs e) { if (!string.IsNullOrEmpty(hdfLoaiBienDong.Text)) { DAL.BHQUYDINHBIENDONG qdbd = new BHQUYDINHBIENDONGController().Lay1QuyDinhBienDong(Convert.ToInt32(hdfLoaiBienDong.Text)); tgfChonBienDong1.Text = qdbd.TenBienDong; hdfMaLoaiBienDong.Text = qdbd.MaBienDong; bool bhxh, bhyt, bhtn; string tenloaihdong; new QuanLyThongTinBaoHiemController().GetHoSoHopDong(int.Parse(hdfIdNhanVien_BaoHiem.Text), out bhxh, out bhyt, out bhtn, out tenloaihdong); if (bhxh) { if (qdbd.IsBHXH != null) { chkBHXH1.Checked = (bool)qdbd.IsBHXH ^ bool.Parse(hdfIsBHXH.Text); } } if (bhyt) { if (qdbd.IsBHYT != null) { chkBHYT1.Checked = (bool)qdbd.IsBHYT ^ bool.Parse(hdfIsBHYT.Text); } } if (bhtn) { if (qdbd.IsBHTN != null) { chkBHTN1.Checked = (bool)qdbd.IsBHTN ^ bool.Parse(hdfIsBHTN.Text); } } if (qdbd.IDCheDoBaoHiem != null) { hdfIDLoaiCheDo.Text = qdbd.IDCheDoBaoHiem.ToString(); // RM.RegisterClientScriptBlock("rlst", "#{cbbLoaiCheDo1_Store}.reload();"); } hdfIDQuyDinhBienDong.Text = qdbd.IDQuyDinhBienDong.ToString();// dt.Rows[0]["IDQuyDinhBienDong"].ToString(); // string Id = dt.Rows[0][0].ToString(); if (qdbd.LoaiAnhHuong == "TMD" || qdbd.LoaiAnhHuong == "GMD") { //tabPanel.Add(pnlThongTinLuong); //pnlThongTinLuong.Hidden = false; //pnlThongTinLuong.Show(); //tabPanel.Add(pnlTruyThoaithu); //pnlTruyThoaithu.Hidden = false; //pnlTruyThoaithu.Show(); txtDienGiai1.Text = "QĐ số: " + txtTTSoQD.Text; RM.RegisterClientScriptBlock("rl6", "#{pnlThongTinLuong1}.enable();");//#{tabPanel1}.addTab(#{pnlThongTinLuong1}); //RM.RegisterClientScriptBlock("rl2", "#{pnlTruyThoaithu}.show();#{tabPanel}.addTab(#{pnlTruyThoaithu});"); // RM.RegisterClientScriptBlock("rl5", "#{tabPanel1}.setActiveTab(#{pnlThongTinChung1});"); } else { if (qdbd.MaBienDong == "TDMBH") { txtDienGiai1.Text = "HĐ số: " + tenloaihdong.Replace("Hợp đồng lao động", "HĐLĐ").Replace("Hợp đồng", "HĐ"); } else { txtDienGiai1.Text = ""; } RM.RegisterClientScriptBlock("rl7", "#{pnlThongTinLuong1}.disable();");//#{tabPanel1}.closeTab(#{pnlThongTinLuong1}, 'hide'); //RM.RegisterClientScriptBlock("rl4", "#{tabPanel}.closeTab(#{pnlTruyThoaithu}, 'hide');"); } if (qdbd.LoaiAnhHuong.Contains("TruyThu")) { //RM.RegisterClientScriptBlock("r8", "#{pnlTruyThoaithu1}.enable();");//#{tabPanel1}.addTab(#{pnlThongTinLuong1}); RM.RegisterClientScriptBlock("fr", "hideThoaiThu(); showTruyThu();"); } else { //RM.RegisterClientScriptBlock("rl9", "#{pnlTruyThoaithu1}.disable();");//#{tabPanel1}.closeTab(#{pnlThongTinLuong1}, 'hide'); RM.RegisterClientScriptBlock("rl4", "hideTruyThu(); hideThoaiThu();"); } if (qdbd.LoaiAnhHuong.Contains("ThoaiThu")) { RM.RegisterClientScriptBlock("fr", "hideTruyThu(); showThoaiThu();"); } else { RM.RegisterClientScriptBlock("fr", "hideThoaiThu(); hideTruyThu();"); } } }