public ActionResult UpdCategory(GetAllCategory_Result updCategory, string submit) { if (submit == "SaveUpd" && action[0] == "UpdCa") { using (var ef = new LibraryEntities()) { ef.UpdCategory(Convert.ToInt32(action[1]), updCategory.name); } } return(RedirectToAction("Categories", "Category")); }
public ActionResult NewCategory(GetAllCategory_Result newCategory, string submit) { if (submit == "SaveNew") { using (var ef = new LibraryEntities()) { ef.InsCategory(newCategory.name); } } return(RedirectToAction("Categories", "Category")); }
public ActionResult UpdCategory() { if (action != null) { var updCategory = new GetAllCategory_Result(); updCategory = lstCategories.Find(f => f.idCategory == Convert.ToInt32(action[1])); return(View(updCategory)); } return(RedirectToAction("Categories", "Category")); }