// GET: Articles public ActionResult Insert() { var model = new ArticleViewModel(); model.Operation = "I"; model.Type = "ARTICLE"; ViewBag.ContentItemTypes = _enumManager.GetContentItemList(); ViewBag.Categories = _categoriesManager.Get().Entity; return(View("InsertEdit", model)); }
public CategoryModel Get(int id, int?page = null, int?count = null) { CategoryModel res = null; try { int?start = null; if (page != null && count != null && page > 0 && count >= 0) { start = (page - 1) * count; } var category = _categoriesManager.Get(id); res = new CategoryModel() { Total = category.Total, Products = _productsManager.Get(category, start, count) }; } catch (Exception exc) { res = new CategoryModel() { Total = 0, Products = null }; } return(res); }
// GET: Categories public ActionResult Index() { ViewBag.Categories = _categoriesManager.Get().Entity; return(View()); }