public ActionResult DeleteConfirmed(int id)
        {
            ItemCatGroup itemCatGroup = db.ItemCatGroups.Find(id);

            db.ItemCatGroups.Remove(itemCatGroup);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            ItemCatGroup itemCatGroup = store.AdminMgr.GetItemCatGroup((int)id);

            if (store.AdminMgr.RemoveItemCatGroup(itemCatGroup))
            {
                return(RedirectToAction("Index"));
            }
            return(View(itemCatGroup));
        }
 public ActionResult Edit([Bind(Include = "Id,Name,SortOrder")] ItemCatGroup itemCatGroup)
 {
     if (ModelState.IsValid)
     {
         db.Entry(itemCatGroup).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(itemCatGroup));
 }
 public ActionResult Edit([Bind(Include = "Id,Name,SortOrder")] ItemCatGroup itemCatGroup)
 {
     if (ModelState.IsValid)
     {
         if (store.AdminMgr.EditItemCatGroup(itemCatGroup))
         {
             return(RedirectToAction("Index"));
         }
     }
     return(View(itemCatGroup));
 }
Example #5
0
 public bool RemoveItemCatGroup(ItemCatGroup itemCatGroup)
 {
     try
     {
         return(adminDb.RemoveItemCatGroup(itemCatGroup));
     }
     catch
     {
         return(false);
     }
 }
Example #6
0
 public bool EditItemCatGroup(ItemCatGroup itemCatGroup)
 {
     try
     {
         return(adminDb.EditItemCatGroup(itemCatGroup));
     }
     catch
     {
         return(false);
     }
 }
        public ActionResult Create([Bind(Include = "Id,Name,SortOrder")] ItemCatGroup itemCatGroup)
        {
            if (ModelState.IsValid)
            {
                db.ItemCatGroups.Add(itemCatGroup);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(itemCatGroup));
        }
Example #8
0
 public bool RemoveItemCatGroup(ItemCatGroup itemCatGroup)
 {
     try
     {
         db.ItemCatGroups.Remove(itemCatGroup);
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Example #9
0
 public bool EditItemCatGroup(ItemCatGroup itemCatGroup)
 {
     try
     {
         db.Entry(itemCatGroup).State = EntityState.Modified;
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
        // GET: Admin/ItemCatGroups/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ItemCatGroup itemCatGroup = store.AdminMgr.GetItemCatGroup((int)id);

            if (itemCatGroup == null)
            {
                return(HttpNotFound());
            }
            return(View(itemCatGroup));
        }
        // GET: Admin/ItemCatGroups/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ItemCatGroup itemCatGroup = db.ItemCatGroups.Find(id);

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