public static int Add(Procude pr) { DbContext db = new DbContext(); db.ProductBase.Add(pr); return(db.SaveChanges()); }
public ActionResult DeleteConfirmed(int id) { Procude procude = db.ProductBase.Find(id); db.ProductBase.Remove(procude); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult AddSave(Procude p) { if (ModelState.IsValid) { ProcudeDAL.Add(p); } return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,Sex,Age")] Procude procude) { if (ModelState.IsValid) { db.Entry(procude).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(procude)); }
public ActionResult Create([Bind(Include = "Id,Name,Sex,Age")] Procude procude) { if (ModelState.IsValid) { db.ProductBase.Add(procude); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(procude)); }
// GET: Procudes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Procude procude = db.ProductBase.Find(id); if (procude == null) { return(HttpNotFound()); } return(View(procude)); }
public int Add(Procude pr) { db.ProductBase. }