public ActionResult Create(ProductCategories productCategories) { try { service.Save(productCategories); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Edit(ProductCategories productCategories) { try { // TODO: Add update logic here service.Save(productCategories); return RedirectToAction("Index"); } catch { return View(); } }
// // GET: /ProductCategories/Create public ActionResult Create() { var count = service.GetCount(); var productCategories = new ProductCategories { Id = count, Code = "C" + (count + 1) }; return View(productCategories); }