예제 #1
0
 // GET: Categories/Delete/5
 public ActionResult Delete(int id)
 {
     try
     {
         using (ContextBll ctx = new ContextBll())
         {
             ctx.DeleteCategories(id);
         }
     }
     catch (Exception ex)
     {
         ViewBag.Exception = ex;
         return(View("Error"));
     }
     return(RedirectToAction("Index"));
 }
예제 #2
0
        public ActionResult Delete(int id, BusinessLogicLayer.CategorieBLL collection)
        {
            try
            {
                using (ContextBll ctx = new ContextBll())
                {
                    ctx.DeleteCategories(id);
                }

                return(RedirectToAction("Index"));
            }
            catch (Exception Ex)
            {
                ViewBag.Exception = Ex;
                return(View("Error"));
            }
        }