Пример #1
0
 public ActionResult Edit(int id, ASF.Entities.Category category)
 {
     try
     {
         categoryProcess.EditCategory(category);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Пример #2
0
        //
        // GET: /Dealer/Dealer/Delete/5
        public ActionResult Delete(int id)
        {
            try
            {
                var category = new ASF.Entities.Category();
                category.Id = id;

                categoryProcess.Remove(category);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }



            return(RedirectToAction("Index"));
        }
Пример #3
0
        public ActionResult Create(ASF.Entities.Category category)
        {
            try
            {
                // TODO: Add insert logic here



                //var category = CustomConverterUtils.MapFormCollection<ASF.Entities.Category>(collection);

                categoryProcess.SaveCategory(category);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }