예제 #1
0
        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"));
        }
예제 #2
0
 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));
 }
예제 #3
0
        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));
        }
예제 #4
0
        // 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));
        }