public bool Delete(int id) { if (id == null) { return(false); } // db.Entry(db.TaiKhoans).State = System.Data.Entity.EntityState.Deleted; db.NhomSanPhams.Remove(db.NhomSanPhams.Find(id)); db.SaveChanges(); return(true); }
public bool Delete(int id) { if (!(id >= 0)) { return(false); } db.Entry(db.LoaiSanPhams).State = EntityState.Modified; db.LoaiSanPhams.Remove(db.LoaiSanPhams.Find(id)); db.SaveChanges(); return(true); }
public bool Delete(string id) { if (string.IsNullOrEmpty(id)) { return(false); } // db.Entry(db.TaiKhoans).State = System.Data.Entity.EntityState.Deleted; db.TaiKhoans.Remove(db.TaiKhoans.Find(id)); db.SaveChanges(); return(true); }