private bool SaveData()
 {
     try
     {
         KT_DTPN obj = new KT_DTPN();
         obj.MA_DTPN = txtMaDT.Text;
         obj.TEN_DTPN = txtTenDT.Text;
         obj.MA_SO_THUE = txtMST.Text;
         obj.DIA_CHI = txtDiaChi.Text;
         obj.DIEN_THOAI = txtDienThoai.Text;
         if (chkInfo.Checked)
         {
             obj.TK_NH = txtSoTKNganHang.Text;
             obj.TEN_TKNH = txtTenTKNganHang.Text;
             obj.MA_TT = txtMaNVTiepThi.Text;
             obj.TEN_TT = txtTenNVTiepThi.Text;
             obj.DIA_CHI_GH = txtDiaChiGiaoHang.Text;
             obj.LIEN_HE = txtLienHe.Text;
             obj.MA_NHOM = cboMaNhom.Text;
             obj.TEN_NHOM = txtTenNhom.Text;
             obj.CK_PT = Utils.CDblDef(txtChietKhau, 0);
         }
         _KTDTPNRepo.Create(obj);
         return true;
     }
     catch { return false; }
 }
Esempio n. 2
0
 public virtual void Remove(KT_DTPN user)
 {
     try
     {
         db.KT_DTPNs.DeleteOnSubmit(user);
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Esempio n. 3
0
 public virtual void Create(KT_DTPN user)
 {
     try
     {
         this.db.KT_DTPNs.InsertOnSubmit(user);
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Esempio n. 4
0
 public virtual void Update(KT_DTPN user)
 {
     try
     {
         KT_DTPN userOld = this.GetById(user.ID);
         userOld = user;
         db.SubmitChanges();
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Esempio n. 5
0
 public virtual int Delete(KT_DTPN user)
 {
     try
     {
         //user.IsDelete = true;
         db.SubmitChanges();
         return 0;
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }