protected void btnUpdate_Click(object sender, EventArgs e) { ClaimDTO cldto = new ClaimDTO(); KhachHangDAO kh = new KhachHangDAO(); KhachHangDTO khdto = new KhachHangDTO(); GiamDinhVienDAO gd = new GiamDinhVienDAO(); int maGDV = int.Parse(Request.Cookies["MaGDV"].Value); string tengd = gd.LayTenTheoMa(maGDV); string ma = Session["ThamChieu"].ToString(); int idkhach = cldao.ClaimMaKH(ma); //khdto.MaKhachHang = idkhach; //update custumer string ten = txtTenInsured.Text; khdto.TenKhachHang = ten; string diachi = txtDiaChi.Text; khdto.DiaChi = diachi; string linhvuckd = txtLinhVucKinhDoanh.Text; khdto.LinhVucKinhDoanh = linhvuckd; bool upkh = kh.Updatecover(idkhach, ten, diachi, linhvuckd); //update claim cldto.MaClaim = ma; cldto.BaoCaoTruoc = txtBaoCaoTruoc.Text; cldto.PolicyNo = txtHDBH.Text; cldto.Premises = txtDiaDiemTonThat.Text; cldto.Dol = txtNgayTonThat.Text; cldto.SortCause = txtNguyenNhan.Text; cldto.PhamViTonThat = txtPhamViTT.Text; cldto.SumInsured = txtSumInsured.Text; cldto.Effective = txtThoiHanBH.Text; cldto.MucMienThuong = txtMucMienThuong.Text; cldto.DKBS = txtDieuKhoanBoSung.Text; cldto.KhieuNai = txtKhieuNaiNDBH.Text; cldto.DuPhongBoiThuong = txtDuPhongBoiThuong.Text; cldto.DieuChinh = txtTinhToanDieuChinh.Text; cldto.TruMienThuong = txtTruMucMienThuong.Text; cldto.BoiThuong = txtDeXuatBoiThuong.Text; cldto.NamePolicy = txtTypePolicy.Text; bool kq = cldao.UpdateClaimCover(cldto); if (kq == true && upkh == true) { string cn = CapNhatInfoBasic(cldto, khdto, tengd); Response.Write("<script> alert('Updated!');</script>"); loadCover(ma); } }
protected void btnUpdate_Click(object sender, EventArgs e) { maclaim = Session["ThamChieu"].ToString(); cldto.MaClaim = maclaim; string policy = txtPolicyNo.Text.Trim(); if (policy != "") { cldto.PolicyNo = policy; } else { cldto.PolicyNo = ""; } string hieuluc = txtPeriodfrom.Text.Trim(); if (hieuluc != "") { cldto.Effective = hieuluc; } else { cldto.Effective = ""; } string ddtt = txtPremises.Text.Trim(); if (ddtt != "") { cldto.Premises = ddtt; } else { cldto.Premises = ""; } string dol = txtDateofloss.Text.Trim(); if (dol != "") { cldto.Dol = dol; } else { cldto.Dol = ""; } int maKH = cl.ClaimMaKH(maclaim); if (maKH != 0) { khdto.MaKhachHang = maKH; } else { Response.Write("<script> alert('Error ID Insured!');</script>"); } string tenkh = txtTenKhachHang.Text.Trim(); if (tenkh != "") { khdto.TenKhachHang = tenkh; } else { khdto.TenKhachHang = ""; } string diachi = txtDiaChi.Text.Trim(); if (diachi != "") { khdto.DiaChi = diachi; } else { khdto.DiaChi = ""; } string trade = txtKinhDoanh.Text.Trim(); if (trade != "") { khdto.LinhVucKinhDoanh = trade; } else { khdto.LinhVucKinhDoanh = ""; } string daidien = txtNguoiDaiDien.Text.Trim(); if (daidien != "") { khdto.TenNguoiDaiDien = daidien; } else { khdto.TenNguoiDaiDien = ""; } string dienthoai = txtPhone.Text.Trim(); if (dienthoai != "") { khdto.DienThoai = dienthoai; } else { khdto.DienThoai = ""; } string fax = txtFax.Text.Trim(); if (fax != "") { khdto.Fax = fax; } else { khdto.Fax = ""; } string email = txtEmail.Text.Trim(); if (email != "") { khdto.Email = email; } else { khdto.Email = ""; } bool up = false; if (drloaihinhtonthat.Visible == true) { int idlhtt = int.Parse(drloaihinhtonthat.SelectedItem.Value.ToString()); UpdateLHTT(maclaim, idlhtt); } if (btnChangeInsurer.Visible == true) { up = cl.UpdateBasicInforNotInsurer(cldto); } else { cldto.MaDonVi = int.Parse(drDonvi.SelectedItem.Value.ToString()); up = cl.UpdateBasicInforInsure(cldto); } bool upkh = kh.UpdateKHBasic(khdto); int maGDV = int.Parse(Request.Cookies["MaGDV"].Value); if (up == true && upkh == true) { sm.CapNhatInfoBasicFR(cldto); string noidung = gdv.LayTenTheoMa(maGDV) + " edited cover site survey report of case " + maclaim + " ."; SaveLogTracking(maGDV, noidung, maclaim); Response.Write("<script>window.parent.location = '../Pages/Layout.aspx'</script>"); sm.CapNhatInfoBasic(cldto, khdto); } if (up == true && upkh == false) { string noidung = gdv.LayTenTheoMa(maGDV) + " failed to edit Insured of site survey report of case " + maclaim + " ."; SaveLogTracking(maGDV, noidung, maclaim); Response.Write("<script> alert('Error Update Isured!');</script>"); } if (up == false && upkh == true) { Response.Write("<script> alert('Error ID Claim Infor!');</script>"); } if (up == false && upkh == false) { string noidung = gdv.LayTenTheoMa(maGDV) + " failed to edit cover site survey report of case " + maclaim + " ."; SaveLogTracking(maGDV, noidung, maclaim); Response.Write("<script> alert('Error Update!');</script>"); } }
protected void btnUpdate_Click(object sender, EventArgs e) { ClaimDTO cldto = new ClaimDTO(); KhachHangDTO khdto = new KhachHangDTO(); string id = Session["ThamChieu"].ToString(); if (id != "") { cldto.MaClaim = id; cldto.TenClaim = txtTenClaim.Text; string iladate = txtDateILA.Text.Trim(); if (iladate != "") { cldto.ILADATE = iladate; } else { cldto.ILADATE = ""; } string nameP = txtPolicyNo.Text.Trim(); if (nameP != "") { cldto.PolicyNo = nameP; } else { cldto.PolicyNo = ""; } string dol = txtDOL.Text.Trim(); if (dol != "") { cldto.Dol = dol; } else { cldto.Dol = ""; } string cause = txtCauseloss.Text.Trim(); if (cause != "") { cldto.SortCause = cause; } else { cldto.SortCause = ""; } string pvtt = txtExtendofloss.Text.Trim(); if (pvtt != "") { cldto.PhamViTonThat = pvtt; } else { cldto.PhamViTonThat = ""; } string nametypo = txtTypepolicy.Text.Trim(); if (nametypo != "") { cldto.NamePolicy = nametypo; } else { cldto.NamePolicy = ""; } string sumI = txtSuminsured.Text.Trim(); if (sumI != "") { cldto.SumInsured = sumI; } else { cldto.SumInsured = ""; } string gd = txtperiod.Text.Trim(); if (gd != "") { cldto.Effective = gd; } else { cldto.Effective = ""; } string mmt = txtDeductible.Text.Trim(); if (mmt != "") { cldto.MucMienThuong = mmt; } else { cldto.MucMienThuong = ""; } string dkbs = txtExtensionclaise.Text.Trim(); if (dkbs != "") { cldto.DKBS = dkbs; } else { cldto.DKBS = ""; } string kn = txtKhieuNai.Text.Trim(); if (kn != "") { cldto.KhieuNai = kn; } else { cldto.KhieuNai = ""; } string dpbt = txtInterimreserve.Text; if (dpbt != "") { cldto.DuPhongBoiThuong = dpbt; } else { cldto.DuPhongBoiThuong = ""; } int maKH = cl.ClaimMaKH(id); if (maKH != 0) { khdto.MaKhachHang = maKH; } khdto.LinhVucKinhDoanh = txtTrade.Text.Trim(); bool up = cl.UpdateInfoPRIRFR(cldto, khdto); int maGDV = int.Parse(Request.Cookies["MaGDV"].Value); if (up == true) { sm.CapNhatInfoBasicPR(cldto, khdto); sm.CapNhatInfoBasicFR(cldto); string noidung = gdv.LayTenTheoMa(maGDV) + " edited cover preliminary report of case " + id + " ."; SaveLogTracking(maGDV, noidung, id); Response.Write("<script>parent.closeDialog();</script>"); Response.Write("<script>parent.reloaData();</script>"); } else { string noidung = gdv.LayTenTheoMa(maGDV) + " faild to edit cover preliminary report of case " + id + " ."; SaveLogTracking(maGDV, noidung, id); Response.Write("<script> alert('Error Update!');</script>"); } } }