public ActionResult DeleteConfirmed(int id) { GskModel gskModel = db.GskModels.Find(id); db.GskModels.Remove(gskModel); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Name,IssueDate,ExpiryDate,Price")] GskModel gskModel) { if (ModelState.IsValid) { db.Entry(gskModel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(gskModel)); }
public ActionResult Create([Bind(Include = "ID,Name,IssueDate,ExpiryDate,Price")] GskModel gskModel) { if (ModelState.IsValid) { db.GskModels.Add(gskModel); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(gskModel)); }
// GET: Gsk/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GskModel gskModel = db.GskModels.Find(id); if (gskModel == null) { return(HttpNotFound()); } return(View(gskModel)); }