public async Task <IHttpActionResult> CanCreateOrderOnNextWeek()
        {
            WeekYearDto curWeekYearDto  = YearWeekHelp.GetCurrentWeekYearDto();
            WeekYearDto nextWeekYearDto = YearWeekHelp.GetNextWeekYear(curWeekYearDto);
            MenuForWeek nextWeekMenu    = _weekMenuService.GetWeekMenuByWeekYear(nextWeekYearDto);

            return(Ok(nextWeekMenu != null && nextWeekMenu.OrderCanBeCreated));
        }
Exemple #2
0
        public Task <bool> IsNexWeekMenuExist()
        {
            WeekYearDto curWeekYear     = YearWeekHelp.GetCurrentWeekYearDto();
            WeekYearDto nextWeekYearDto = YearWeekHelp.GetNextWeekYear(curWeekYear);
            MenuForWeek nextWeek        =
                _weekmenuService.GetWeekMenuByWeekYear(nextWeekYearDto);

            return(Task.FromResult(nextWeek != null));
        }
Exemple #3
0
        public void TestWeekMenuDelete()
        {
            WeekMenuController weekMenuApi = new WeekMenuController(_unitOfWork);
            WeekYearDto        wyDto       = new WeekYearDto
            {
                Week = 18,
                Year = 2016
            };
            MenuForWeek weekmenu = _menuForWeekService.GetWeekMenuByWeekYear(wyDto);

            if (weekmenu == null)
            {
                WeekMenuDto dto = weekMenuApi.GetWeekMenu(wyDto).Result;
                weekmenu = _menuForWeekService.GetWeekMenuByWeekYear(wyDto);
            }
            var res = weekMenuApi.DeleteMenuForWeek(weekmenu.ID).Result;

            weekmenu = _menuForWeekService.GetWeekMenuByWeekYear(wyDto);

            Assert.IsNull(weekmenu);
        }