public void xoa(string id) { donvi dv = (from d in db.donvis select d).Single(t => t.id == id); db.donvis.DeleteOnSubmit(dv); db.SubmitChanges(); }
public void sua(string id, string ten, string nhom, string dvql) { donvi dv = (from d in db.donvis select d).Single(t => t.id == id); dv.tendonvi = ten; dv.nhomdonvi = nhom; dv.iddv = dvql; db.SubmitChanges(); }
public void moi(string id, string ten, string nhom, string dvql) { donvi dv = new donvi(); dv.id = id; dv.tendonvi = ten; dv.nhomdonvi = nhom; dv.iddv = dvql; db.donvis.InsertOnSubmit(dv); db.SubmitChanges(); }
public bool edit_don_vi(int id, donvi dv) { string msgError = ""; try { var result = _Helper.ExecuteScalarSProcedureWithTransaction(out msgError, "update_don_vi", "@madv", id, "@tendonvi", dv.tendonvi, "@tyle", dv.tyle, "@ghichu", dv.ghichu); //if ((!string.IsNullOrEmpty(msgError)) || (!string.IsNullOrEmpty(result.ToString()) && result != null)) // throw new Exception(msgError); return(true); } catch (Exception ex) { throw ex; } }
public void moi(string id, string ten, string nhom, string dvql) { var dv = db.donvis.FirstOrDefault(t => t.id == id); if (dv == null) { dv = new donvi(); dv.id = id; dv.tendonvi = ten; dv.nhomdonvi = nhom; dv.iddv = dvql; db.donvis.InsertOnSubmit(dv); db.SubmitChanges(); } else { dv.tendonvi = ten; dv.nhomdonvi = nhom; dv.iddv = dvql; db.SubmitChanges(); } }
public bool edit_don_vi(int id, [FromBody] donvi dv) { return(_Buss.edit_don_vi(id, dv)); }
public bool create_don_vi([FromBody] donvi dv) { return(_Buss.create_don_vi(dv)); }
public bool edit_don_vi(int id, donvi dv) { return(_Respo.edit_don_vi(id, dv)); }
public bool create_don_vi(donvi dv) { return(_Respo.create_don_vi(dv)); }