Example #1
0
 // GET: Discounts/Create
 public ActionResult Create()
 {
     ViewData["Categories"]          = _categoryService.GetAllCategories();
     ViewData["ItemsWithNoCategory"] = _itemQueryService.GetAllItems().Where(x => x.CategoryId == null).ToList();
     return(View(new DiscountViewModel()
     {
         BeginDate = DateTime.Now, EndDate = DateTime.Now
     }));
 }
Example #2
0
        // GET: Store
        public ActionResult Index()
        {
            _logger.Info("Get all categories");

            var categories = _categoryService.GetAllCategories();

            var items = (_itemQueryService.GetAllItems()).Where(i => i.CategoryId == null).ToList();

            if (items.Count != 0)
            {
                IEnumerable <Category> noCategory = new List <Category> {
                    new Category {
                        Id = 0, Items = items, Name = "Uncategorized"
                    }
                };
                categories = categories.Concat(noCategory);
            }

            _logger.InfoFormat("Categories found : [{0}]", categories.ToList().Count);
            return(View(categories));
        }
Example #3
0
 // GET: Item
 public ActionResult Index()
 {
     return(View(_itemQueryService.GetAllItems()));
 }