コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Arthropod arthropod = db.Arthropods.Find(id);

            db.Arthropods.Remove(arthropod);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Animal,HasFur,Pop,Dietry,ArthropodsID")] Arthropod arthropod)
 {
     if (ModelState.IsValid)
     {
         db.Entry(arthropod).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(arthropod));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "Animal,HasFur,Pop,Dietry,ArthropodsID")] Arthropod arthropod)
        {
            if (ModelState.IsValid)
            {
                db.Arthropods.Add(arthropod);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(arthropod));
        }
コード例 #4
0
 public ActionResult Edit([Bind(Include = "arthropodsID,arthropodsName,arthropodsType,animalSpecies_animalID,DietryType,PopulationNumber")] Arthropod arthropod)
 {
     if (ModelState.IsValid)
     {
         db.Entry(arthropod).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.animalSpecies_animalID = new SelectList(db.animals, "animalID", "animalID", arthropod.animalSpecies_animalID);
     return(View(arthropod));
 }
コード例 #5
0
        // GET: Arthropods/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Arthropod arthropod = db.Arthropods.Find(id);

            if (arthropod == null)
            {
                return(HttpNotFound());
            }
            return(View(arthropod));
        }
コード例 #6
0
        // GET: Arthropods/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Arthropod arthropod = db.Arthropods.Find(id);

            if (arthropod == null)
            {
                return(HttpNotFound());
            }
            ViewBag.animalSpecies_animalID = new SelectList(db.animals, "animalID", "animalID", arthropod.animalSpecies_animalID);
            return(View(arthropod));
        }