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