public bool Delete(string ma) { tbl_BP tbl = db.tbl_BP.Find(ma); db.tbl_BP.Remove(tbl); db.SaveChanges(); return(true); }
public bool Update(DepartmentModel model) { try { tbl_BP tbl = db.tbl_BP.Find(model.Ma_BP); tbl.Ten_BP = model.Ten_BP; db.SaveChanges(); return(true); } catch { return(false); } }
public bool Save(DepartmentModel model) { try { tbl_BP tbl = new tbl_BP(); tbl.Ma_BP = model.Ma_BP; tbl.Ten_BP = model.Ten_BP; db.tbl_BP.Add(tbl); db.SaveChanges(); return(true); } catch { return(false); } }