public ActionResult DeleteConfirmed(int id) { PET_GROUP pET_GROUP = db.PET_GROUP.Find(id); db.PET_GROUP.Remove(pET_GROUP); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID_PK,NAME")] PET_GROUP pET_GROUP) { if (ModelState.IsValid) { db.Entry(pET_GROUP).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pET_GROUP)); }
public ActionResult Create([Bind(Include = "ID_PK,NAME")] PET_GROUP pET_GROUP) { if (ModelState.IsValid) { db.PET_GROUP.Add(pET_GROUP); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pET_GROUP)); }
// GET: PET_GROUP/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PET_GROUP pET_GROUP = db.PET_GROUP.Find(id); if (pET_GROUP == null) { return(HttpNotFound()); } return(View(pET_GROUP)); }