コード例 #1
0
 protected void btnCreatnew_Click(object sender, EventArgs e)
 {
     if (IsPostBack)
     {
         string       id       = cl.LayMaTheoTen(lblThamChieu.Text);
         string       dienbien = ckDienBienTonThat.Text;
         string       phamvi   = ckExtentofloss.Text;
         string       duphong  = txtintitialreserve.Text;
         string       dephong  = ckDePhongTonThatVaKhuyenCao.Text;
         string       ykien    = ckYKienGDV.Text;
         string       tendd    = txtTenNguoiLienHe.Text;
         string       dienT    = txtDienThoai.Text;
         string       email    = txtEmail.Text;
         int          makh     = int.Parse(lblIDKH.Text);
         KhachHangDAO kh       = new KhachHangDAO();
         bool         upkh     = kh.CapNhatDaiDien(makh, tendd, dienT, email);
         bool         up       = cl.CapNhatBCDT(id, dienbien, phamvi, duphong, dephong, ykien);
         if (up == true && upkh == true)
         {
             Session["ThamChieu"] = id;
             Response.Redirect("~/Pages/reportILA.aspx");
         }
         else
         {
             Response.Write("<script>alert('Error!');</script>");
         }
     }
 }