Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            BirdsType birdsType = db.BirdsTypes.Find(id);

            db.BirdsTypes.Remove(birdsType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 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));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "Id,BirdsName")] BirdsType birdsType)
        {
            if (ModelState.IsValid)
            {
                db.BirdsTypes.Add(birdsType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(birdsType));
        }
Example #4
0
        // 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));
        }
Example #5
0
 public Birds(BirdsType type)
 {
     this.type = type;
     Name      = type.ToString();
 }