public void DeleteStudent(int id) { var db = new QLBHEntities(); var good = db.Goods.Find(id); db.Goods.Remove(good); db.SaveChanges(); }
public void UpdateStudent(int id, string name, int number, DateTime date, string status) { var db = new QLBHEntities(); var Good = db.Goods.Find(id); Good.name = name; Good.number = number; Good.date_add = date; Good.status = status; db.Entry(Good).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); }
public void CreateGood(string code, string name, int number, DateTime date, string status) { var newGood = new Goods(); newGood.code = code; newGood.name = name; newGood.number = number; newGood.date_add = date; newGood.status = status; var db = new QLBHEntities(); db.Goods.Add(newGood); db.SaveChanges(); }
public Goods[] GetClasses() { var db = new QLBHEntities(); return(db.Goods.ToArray()); }
public Goods GetStudent(int id) { var db = new QLBHEntities(); return(db.Goods.Find(id)); }