public ActionResult DeleteConfirmed(int id) { BirdsType birdsType = db.BirdsTypes.Find(id); db.BirdsTypes.Remove(birdsType); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,BirdsName")] BirdsType birdsType) { if (ModelState.IsValid) { db.Entry(birdsType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(birdsType)); }
public ActionResult Create([Bind(Include = "Id,BirdsName")] BirdsType birdsType) { if (ModelState.IsValid) { db.BirdsTypes.Add(birdsType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(birdsType)); }
// GET: BirdsTypes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BirdsType birdsType = db.BirdsTypes.Find(id); if (birdsType == null) { return(HttpNotFound()); } return(View(birdsType)); }
public Birds(BirdsType type) { this.type = type; Name = type.ToString(); }