예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            UO_Category uO_Category = db.Category.Find(id);

            db.Category.Remove(uO_Category);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "UO_CategoryID,DescriptionCategory")] UO_Category uO_Category)
 {
     if (ModelState.IsValid)
     {
         db.Entry(uO_Category).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(uO_Category));
 }
예제 #3
0
        public ActionResult Create([Bind(Include = "UO_CategoryID,DescriptionCategory")] UO_Category uO_Category)
        {
            if (ModelState.IsValid)
            {
                db.Category.Add(uO_Category);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(uO_Category));
        }
예제 #4
0
        // GET: UO_Category/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UO_Category uO_Category = db.Category.Find(id);

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