view for DistributionDeliveryDispatchch view and Wrapping filtering criteria objects
Ejemplo n.º 1
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 public ActionResult DistributionDeliveryDispatch()
 {
     var user = _userProfileService.GetUser(User.Identity.Name);
     var stores = _hubService.GetAllStoreByUser(user);
     var areas = _adminUnitService.GetAllAreasForReport();
     var codes = ConstantsService.GetAllCodes();
     var commodityTypes = _commodityTypeService.GetAllCommodityTypeForReprot();
     var programs = _programService.GetAllProgramsForReport();
     var viewModel = new DistributionDeliveryDispatchViewModel(codes, commodityTypes, programs, stores, areas);
     return View(viewModel);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="viewModel"></param>
 /// <returns></returns>
 public ActionResult DistributionDeliveryDispatchReport(DistributionDeliveryDispatchViewModel viewModel)
 {
     ViewBag.Program = viewModel.ProgramId == null ? "All" : _programService.GetAllProgram().Where(c => c.ProgramID == viewModel.ProgramId).Select(c => c.Name).Single();
     ViewBag.CommodityTypes = viewModel.CommodityTypeId == 0 ? "All" : _commodityTypeService.GetAllCommodityType().Where(c => c.CommodityTypeID == viewModel.CommodityTypeId).Select(c => c.Name).Single();
     return PartialView();
 }
Ejemplo n.º 3
0
        public void CanBackPostDistributionDeliveryDispatchReport()
        {
            //ACT
            //TODO: Seed data into DistributionDeliveryDispatchViewModel before proceding with testing
            var viewModel = new DistributionDeliveryDispatchViewModel { };
            var viewResult = _stockManagementController.DistributionDeliveryDispatchReport(viewModel) as ViewResult;

            //ASSERT
            Assert.NotNull(viewResult);
            Assert.IsInstanceOf<IEnumerable<Program>>(viewResult.ViewBag.Program);
            Assert.IsInstanceOf<IEnumerable<CommodityType>>(viewResult.ViewBag.CommodityTypes);
        }