//
 // GET: /Add/
 public ActionResult Add(int id = 0)
 {
     var model = new Category();
     var list = CategoryService.GetList();
     ViewData["Parent"] = new SelectList(list, "ID", "Name");
     if (id > 0)
     {
         model = CategoryService.Get(id);
     }
     return View(model);
 }
 public ActionResult Add(Category category)
 {
     if (ModelState.IsValid)
     {
         if (category.ID != 0)
         {
             CategoryService.Update(category);
         }
         else
         {
             CategoryService.Add(category);
         }
         return RedirectToAction("List");
     }
     return View(category);
 }