コード例 #1
0
        // 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));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 // GET: Categories
 public ActionResult Index()
 {
     ViewBag.Categories = _categoriesManager.Get().Entity;
     return(View());
 }