Exemplo n.º 1
0
        public void GetItemsReturnsAlist()
        {
            //Act
            List <MenuItem> result;

            //Arrange
            result = menuRepo.GetItems();
            //Assert
            Assert.IsType <List <MenuItem> >(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// This non-webapi method is used for both the PB Menu controller
        /// and the module's menu list controller
        /// </summary>
        /// <returns></returns>
        public List <ItemViewModel> GetItemList(int moduleId, string cultureCode)
        {
            List <ItemViewModel> items = _repository.GetItems(moduleId)
                                         .Select(item => new ItemViewModel(item, cultureCode, _noImageFile))
                                         .ToList();

            return(items);
        }
Exemplo n.º 3
0
        public HttpResponseMessage GetList()
        {
            List <ItemViewModel> items;

            if (Globals.IsEditMode())
            {
                items = _repository.GetItems(ActiveModule.ModuleID)
                        .Select(item => new ItemViewModel(item, GetCultureCode(), GetEditUrl(item.MenuItemId)))
                        .ToList();
            }
            else
            {
                items = _repository.GetItems(ActiveModule.ModuleID)
                        .Select(item => new ItemViewModel(item, GetCultureCode(), ""))
                        .ToList();
            }

            return(Request.CreateResponse(HttpStatusCode.OK, items));
        }
Exemplo n.º 4
0
        public ActionResult Index()
        {
            string culSetting = "en-US";
            var    items      = _menuDataRepository.GetItems(CurrentModuleId);

            if (ModuleContext.Settings.ContainsKey("RestaurantMenu_CurrencyCulture"))
            {
                if (!String.IsNullOrEmpty(ModuleContext.Settings["RestaurantMenu_CurrencyCulture"].ToString()))
                {
                    culSetting = ModuleContext.Settings["RestaurantMenu_CurrencyCulture"].ToString();
                }
            }
            ViewBag.Culture = new CultureInfo(culSetting);

            return(View(items));
        }
Exemplo n.º 5
0
 public IActionResult Index()
 {
     return(View(_menuItemRepository.GetItems()));
 }