public void CreateCategoryType(CategoryType categorytype) { CategoryType newcategory = categorytype; dbcontex.CategoryTypes.Add(categorytype); dbcontex.SaveChanges(); }
public void SaveEditedCategoryType(CategoryType categorytype) { CategoryType newcategorytype = FindCategoryType(categorytype.Id); newcategorytype.Title = categorytype.Title; newcategorytype.Description = categorytype.Description; dbcontex.Entry(newcategorytype).State = EntityState.Modified; dbcontex.SaveChanges(); }
public ActionResult CreateCategoryType(CategoryType categorytype) { repository.CreateCategoryType(categorytype); // перенаправляем на главную страницу return RedirectToAction("CategoryTypesList"); }
public ActionResult CreateCategoryType() { CategoryType newitem = new CategoryType(); return PartialView("PartialCreateCategoryType", newitem); }
public ActionResult EditCategoryType(CategoryType categorytype) { repository.SaveEditedCategoryType(categorytype); return RedirectToAction("CategoryTypesList"); }
public void DeleteCategoryType(CategoryType categorytype) { dbcontex.CategoryTypes.Remove(categorytype); dbcontex.SaveChanges(); }