Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Pet4 pet4 = db.Pet4.Find(id);

            db.Pet4.Remove(pet4);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "PetID,Type,Breed,Age,Gender,PetName,Photo")] Pet4 pet4)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pet4).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(pet4));
 }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "PetID,Type,Breed,Age,Gender,PetName,Photo")] Pet4 pet4)
        {
            if (ModelState.IsValid)
            {
                db.Pet4.Add(pet4);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(pet4));
        }
Esempio n. 4
0
        // GET: Pet4/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Pet4 pet4 = db.Pet4.Find(id);

            if (pet4 == null)
            {
                return(HttpNotFound());
            }
            return(View(pet4));
        }