public RedirectToRouteResult EditCategory(Category[] arr) { using (SSISdbEntities e = new SSISdbEntities()) { DAL.CategoryRepositoryImpl dal = new DAL.CategoryRepositoryImpl(e); dal.UpdateCategory(arr[0]); e.SaveChanges(); Session["MaintenanceCategoriesPage"] = "1"; return(RedirectToAction("Maintenance", "Store")); } }
public RedirectToRouteResult AddNewCategory(Category cat) { using (SSISdbEntities e = new SSISdbEntities()) { string categoryCount = (e.Categories.Count() + 1).ToString(); cat.CategoryID = "C" + categoryCount; cat.Active = 1; DAL.CategoryRepositoryImpl dal = new DAL.CategoryRepositoryImpl(e); dal.InsertCategory(cat); e.SaveChanges(); return(RedirectToAction("Maintenance", "Store")); } }