Beispiel #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"));
        }
Beispiel #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));
 }
Beispiel #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));
        }
Beispiel #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));
        }