Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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);
 }