Esempio n. 1
0
        public bool KhachHangMoi(KhachHangDTO kh)
        {
            string sql= "sp_KhachHangMoi";
            List<SqlParameter> ds = new List<SqlParameter>();
            SqlParameter ma = new SqlParameter("@ma", SqlDbType.Int);
            ma.Value = kh.MaKhachHang;
            ds.Add(ma);
            SqlParameter ten = new SqlParameter("@tenKH",SqlDbType.NVarChar);
            ten.Value = kh.TenKhachHang;
            ds.Add(ten);
            SqlParameter tenNguoiDaiDien = new SqlParameter("@tenNguoiDaiDien", SqlDbType.NVarChar);
            tenNguoiDaiDien.Value = kh.TenNguoiDaiDien;
            ds.Add(tenNguoiDaiDien);
            SqlParameter email = new SqlParameter("@email",SqlDbType.VarChar);
            email.Value = kh.Email;
            ds.Add(email);
            SqlParameter dienthoai = new SqlParameter("@dienthoai",SqlDbType.VarChar);
            dienthoai.Value = kh.DienThoai;
            ds.Add(dienthoai);
            SqlParameter fax = new SqlParameter("@fax", SqlDbType.VarChar);
            fax.Value = kh.Fax;
            ds.Add(fax);

            SqlParameter diachi = new SqlParameter("@diachi",SqlDbType.NVarChar);
            diachi.Value = kh.DiaChi;
            ds.Add(diachi);

            SqlParameter madvbh = new SqlParameter("@madvbh", SqlDbType.Int);
            madvbh.Value = kh.MaDonViBH;
            ds.Add(madvbh);

            return SqlDataAcessHelper.exNonStoreParas(sql,ds);
        }
Esempio n. 2
0
        public bool UpdateInfoPRIRFR(ClaimDTO cl, KhachHangDTO kh)
        {
            bool kq = false;
            string sql = "sp_Claim_InforPRIRFR_Update";
            List<SqlParameter> ds = new List<SqlParameter>();
            SqlParameter ma = new SqlParameter("@maclaim", SqlDbType.VarChar);
            ma.Value = cl.MaClaim;
            ds.Add(ma);

            SqlParameter date = new SqlParameter("@dateILA", SqlDbType.NVarChar);
            date.Value = cl.ILADATE;
            ds.Add(date);

            SqlParameter pono = new SqlParameter("@policyno", SqlDbType.NVarChar);
            pono.Value = cl.PolicyNo;
            ds.Add(pono);
            SqlParameter dol = new SqlParameter("@dol", SqlDbType.NVarChar);
            dol.Value = cl.Dol;
            ds.Add(dol);
            SqlParameter sc = new SqlParameter("@sortcause", SqlDbType.NVarChar);
            sc.Value = cl.SortCause;
            ds.Add(sc);

            SqlParameter pv = new SqlParameter("@phamvitt", SqlDbType.NVarChar);
            pv.Value = cl.PhamViTonThat;
            ds.Add(pv);

            SqlParameter napo = new SqlParameter("@namepolicy", SqlDbType.NVarChar);
            napo.Value = cl.NamePolicy;
            ds.Add(napo);

            SqlParameter sum = new SqlParameter("@suminsured", SqlDbType.NVarChar);
            sum.Value = cl.SumInsured;
            ds.Add(sum);

            SqlParameter eff = new SqlParameter("@effective", SqlDbType.NVarChar);
            eff.Value = cl.Effective;
            ds.Add(eff);

            SqlParameter deduc = new SqlParameter("@deductible", SqlDbType.NVarChar);
            deduc.Value = cl.MucMienThuong;
            ds.Add(deduc);

            SqlParameter dkbs = new SqlParameter("@dkbs", SqlDbType.NVarChar);
            dkbs.Value = cl.DKBS;
            ds.Add(dkbs);

            SqlParameter kn = new SqlParameter("@khieunai", SqlDbType.NVarChar);
            kn.Value = cl.KhieuNai;
            ds.Add(kn);

            SqlParameter duphong = new SqlParameter("@duphongboithuong", SqlDbType.NVarChar);
            duphong.Value = cl.DuPhongBoiThuong;
            ds.Add(duphong);

            SqlParameter makh = new SqlParameter("@makhachhang", SqlDbType.Int);
            makh.Value = kh.MaKhachHang;
            ds.Add(makh);

            SqlParameter trade = new SqlParameter("@trade", SqlDbType.NVarChar);
            trade.Value = kh.LinhVucKinhDoanh;
            ds.Add(trade);
            kq = SqlDataAcessHelper.exNonStoreParas(sql, ds);
            return kq;
        }
Esempio n. 3
0
        public bool UpdateInfo(ClaimDTO cl, KhachHangDTO kh)
        {
            bool kq = false;
            string sql = "sp_Claim_KhachHang_UpdateInfo";
            List<SqlParameter> ds = new List<SqlParameter>();
            SqlParameter ma = new SqlParameter("@idclaim", SqlDbType.VarChar);
            ma.Value = cl.MaClaim;
            ds.Add(ma);
            SqlParameter tenclaim = new SqlParameter("@tenclaim", SqlDbType.VarChar);
            tenclaim.Value = cl.TenClaim;
            ds.Add(tenclaim);

            SqlParameter pres = new SqlParameter("@presmises", SqlDbType.NVarChar);
            pres.Value = cl.Premises;
            ds.Add(pres);
            SqlParameter pono = new SqlParameter("@policyno", SqlDbType.NVarChar);
            pono.Value = cl.PolicyNo;
            ds.Add(pono);
            SqlParameter eff = new SqlParameter("@effective", SqlDbType.NVarChar);
            eff.Value = cl.Effective;
            ds.Add(eff);

            SqlParameter typo = new SqlParameter("@typepolicy", SqlDbType.VarChar);
            typo.Value = cl.TypePolicy;
            ds.Add(typo);
            SqlParameter dol = new SqlParameter("@dateofloss", SqlDbType.VarChar);
            dol.Value = cl.Dol;
            ds.Add(dol);

            SqlParameter tenndbh = new SqlParameter("@ndbh",SqlDbType.NVarChar);
            tenndbh.Value= kh.TenKhachHang;
            ds.Add(tenndbh);
            SqlParameter nguoilienhe = new SqlParameter("@contactpersonkh", SqlDbType.NVarChar);
            nguoilienhe.Value = kh.TenNguoiDaiDien;
            ds.Add(nguoilienhe);
            SqlParameter fax = new SqlParameter("@faxkh", SqlDbType.VarChar);
            fax.Value = kh.Fax;
            ds.Add(fax);
            SqlParameter dienthoai = new SqlParameter("@dienthoaikh", SqlDbType.VarChar);
            dienthoai.Value = kh.DienThoai;
            ds.Add(dienthoai);
            SqlParameter email = new SqlParameter("@emailkh", SqlDbType.VarChar);
            email.Value = kh.Email; ;
            ds.Add(email);
            SqlParameter diachi = new SqlParameter("@diachikh", SqlDbType.NVarChar);
            diachi.Value = kh.DiaChi;
            ds.Add(diachi);
            kq = SqlDataAcessHelper.exNonStoreParas(sql, ds);
            return kq;
        }
Esempio n. 4
0
 void KhachHangMoiTuKhaoSatRuiRo()
 {
     try
     {
         KhachHangDTO khdto = new KhachHangDTO();
         KhachHangDAO khdao = new KhachHangDAO();
         if (txtNguoiDuocBH.Text != null)
             khdto.TenKhachHang = txtNguoiDuocBH.Text;
         else
             khdto.TenKhachHang = "";
         if (txtNguoiLienHe.Text != null)
             khdto.TenNguoiDaiDien = txtNguoiLienHe.Text;
         else
             khdto.TenNguoiDaiDien = "";
         if (txtSoFax.Text != null)
             khdto.Fax = txtSoFax.Text;
         else
             khdto.Fax = "";
         if (txtDienThoai.Text != null)
             khdto.DienThoai = txtDienThoai.Text;
         else
             khdto.DienThoai = "";
         if (txtDiaChi.Text != null)
             khdto.DiaChi = txtDiaChi.Text;
         else
             khdto.DiaChi = "";
         if (txtEmail.Text != null)
             khdto.Email = txtEmail.Text;
         else
             khdto.Email = "";
         khdto.ChucVu = "__";
         khdto.MaLoaiKhachHang = 1;
         khdto.MaLVKD = 7;
         khdao.KhachHangMoi(khdto);
     }
     catch (Exception ex)
     {
         lblThongBaoCapNhatYKienGDV.Text = ex.Message;
     }
 }
 protected void LoadKhachHang(string maclaim)
 {
     KhachHangDTO kh = new KhachHangDTO();
     kh = khdao.LayInfo(maclaim);
     txtInsured.Text = kh.TenKhachHang.ToString();
     lblinsured.Text = kh.TenKhachHang.ToString();
     txtContactPerson.Text = kh.TenNguoiDaiDien.ToString();
     txtAddress.Text = kh.DiaChi.ToString();
     txtPhone.Text = kh.DienThoai.ToString();
     txtFaxno.Text = kh.Fax.ToString();
     txtEmail.Text = kh.Email.ToString();
 }
 protected void btnCapNhatInfoBasic_Click(object sender, EventArgs e)
 {
     KhachHangDTO khm1 = new KhachHangDTO();
         ClaimDTO clm1 = new ClaimDTO();
         string maclaim = cldao.LayMaTheoTen(lblThamChieuHead.Text);
         if (maclaim != null)
         {
             clm1.MaClaim = maclaim;
             clm1.TenClaim = txtReferencenumber.Text;
             clm1.Premises = txtPremises.Text;
             clm1.PolicyNo = txtPolicyNo.Text;
             clm1.Effective = txtEffective.Text;
             clm1.TypePolicy = txtTypeOfloss.Text;
             khm1.TenKhachHang = txtInsured.Text;
             khm1.TenNguoiDaiDien = txtContactPerson.Text;
             khm1.Fax = txtFaxno.Text;
             khm1.DienThoai = txtPhone.Text;
             khm1.Email = txtEmail.Text;
             khm1.DiaChi = txtAddress.Text;
             clm1.Dol = txtDateofloss.Text;
             bool up = cldao.UpdateInfo(clm1, khm1);
             if (up == true)
             {
                 string m=sm.CapNhatInfoBasic(clm1, khm1);
                 Response.Write("<script>alert('Updated!');</script>");
             }
         }
 }
Esempio n. 7
0
        public bool UpdateKHBasic(KhachHangDTO kh)
        {
            string sql = "sp_KhachHang_UpdateKH";

            List<SqlParameter> ds = new List<SqlParameter>();
            SqlParameter makh = new SqlParameter("@maKH", SqlDbType.Int);
            makh.Value = kh.MaKhachHang;
            ds.Add(makh);
            SqlParameter insured = new SqlParameter("@tenndbh", SqlDbType.NVarChar);
            insured.Value = kh.TenKhachHang;
            ds.Add(insured);
            SqlParameter adress = new SqlParameter("@diachi", SqlDbType.NVarChar);
            adress.Value = kh.DiaChi;
            ds.Add(adress);
            SqlParameter daidien = new SqlParameter("@tendaidien", SqlDbType.NVarChar);
            daidien.Value = kh.TenNguoiDaiDien;
            ds.Add(daidien);
            SqlParameter phone = new SqlParameter("@dienthoai", SqlDbType.VarChar);
            phone.Value = kh.DienThoai;
            ds.Add(phone);
            SqlParameter fax = new SqlParameter("@fax", SqlDbType.VarChar);
            fax.Value = kh.Fax;
            ds.Add(fax);
            SqlParameter trade = new SqlParameter("@trade", SqlDbType.NVarChar);
            trade.Value = kh.LinhVucKinhDoanh;
            ds.Add(trade);
            SqlParameter email = new SqlParameter("@email", SqlDbType.NVarChar);
            email.Value = kh.Email;
            ds.Add(email);

            return SqlDataAcessHelper.exNonStoreParas(sql, ds);
        }
Esempio n. 8
0
 public KhachHangDTO LayInfo(string maclaim)
 {
     KhachHangDTO kh = new KhachHangDTO();
     string sql = "sp_KhachHang_select";
     List<SqlParameter> ds = new List<SqlParameter>();
     SqlParameter macl = new SqlParameter("@maclaim", SqlDbType.VarChar);
     macl.Value = maclaim;
     ds.Add(macl);
     DataTable dt = new DataTable();
     dt = SqlDataAcessHelper.exStoreParas(sql, ds);
     if (dt.Rows.Count > 0)
     {
         DataRow dr= dt.Rows[0];
         kh.TenKhachHang = dr[0].ToString();
         kh.TenNguoiDaiDien = dr[1].ToString();
         kh.DiaChi = dr[2].ToString();
         kh.DienThoai = dr[3].ToString();
         kh.Fax = dr[5].ToString();
         kh.Email = dr[4].ToString();
     }
     return kh;
 }
Esempio n. 9
0
        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>");
                }
            }
        }