public virtual void Remove(KT_CNDT user) { try { db.KT_CNDTs.DeleteOnSubmit(user); db.SubmitChanges(); } catch (Exception e) { throw new Exception(e.Message); } }
public virtual void Create(KT_CNDT user) { try { this.db.KT_CNDTs.InsertOnSubmit(user); db.SubmitChanges(); } catch (Exception e) { throw new Exception(e.Message); } }
public virtual void Update(KT_CNDT user) { try { KT_CNDT userOld = this.GetById(user.ID); userOld = user; db.SubmitChanges(); } catch (Exception e) { throw new Exception(e.Message); } }
private void btnTiep_Click(object sender, EventArgs e) { if (cboTaikhoan.SelectedIndex < 0) { MessageBox.Show("Chưa chọn Tài khoản!", "Thông báo"); return; } if (cboMaDT.SelectedIndex < 0) { MessageBox.Show("Chưa chọn mã ĐT!", "Thông báo"); return; } KT_CNDT CNDT = new KT_CNDT(); CNDT.MA_TK = cboTaikhoan.Text; CNDT.MA_DTPN = cboMaDT.Text; CNDT.TEN_DTPN = txtTenDT.Text; CNDT.DUNO_VND = Utils.CDblDef(txtDuNoVnd.Text.Replace(",", ""), 0); CNDT.DUNO_USD = Utils.CDblDef(txtDuNoUsd.Text.Replace(",", ""), 0); CNDT.DUCO_VND = Utils.CDblDef(txtDuCoVnd.Text.Replace(",", ""), 0); CNDT.DUCO_USD = Utils.CDblDef(txtDuCoUsd.Text.Replace(",", ""), 0); _listCNDT.Add(CNDT); LoadGrid(); }
public virtual int Delete(KT_CNDT user) { try { //user.IsDelete = true; db.SubmitChanges(); return 0; } catch (Exception e) { throw new Exception(e.Message); } }