public void TestGetUserWeekOrder() { WeekYearDto wyDto = new WeekYearDto { Week = 19, Year = 2016 }; User user = _userManager.FindByName("employee"); //WeekOrderMenu ordmenu = _weekOrderMenuService.FindByUserIdWeekYear(user.Id, wyDto); WeekPaiment weekPaiment = _weekPaimentService.GetByUseridWeekYear(user.Id, wyDto); EmployeeWeekOrderDto model = EmployeeWeekOrderDto.MapDto(_unitOfWork.GetContext(), weekPaiment, wyDto); Assert.IsNotNull(model); }
public async Task <IHttpActionResult> GetUserWeekOrderDto([FromBody] WeekYearDto wyDto) { string userid = RequestContext.Principal.Identity.GetUserId(); if (wyDto == null) { wyDto = YearWeekHelp.GetCurrentWeekYearDto(); } WeekPaiment weekPaiment = _weekPaimentService.GetByUseridWeekYear(userid, wyDto); EmployeeWeekOrderDto model = null; if (weekPaiment != null) { model = EmployeeWeekOrderDto.MapDto(_db, weekPaiment, wyDto); } return(Ok(model)); }