public MasterReportBound GetOffloading(DispatchesViewModel dispatchesViewModel) { BLL.UserProfile user = _userProfileService.GetUser(User.Identity.Name); OffloadingReportMain main = new OffloadingReportMain(); List <OffloadingReport> reports = _transactionService.GetOffloadingReport(user.DefaultHub.HubID, dispatchesViewModel); main.reports = reports; main.PreparedBy = user.GetFullName(); main.HubName = user.DefaultHub.HubNameWithOwner; main.ReportDate = DateTime.Now; main.ReportName = "OffloadingReport"; main.ReportTitle = "Offloading"; List <OffloadingReportMain> coll = new List <OffloadingReportMain>(); coll.Add(main); OffLoadingReport rpt = new OffLoadingReport() { DataSource = reports }; // XtraReport1 rpt = new XtraReport1() { DataSource = freestockreport.Programs[2].Details }; MasterReportBound report = new MasterReportBound() { Name = "Offloading Report " + DateTime.Now.ToShortDateString(), DataSource = coll }; report.rptSubReport.ReportSource = rpt; return(report); }
public void ShouldDisplayOffloadingReportPartial() { //Act var filter = new DispatchesViewModel(); var result = _reportsController.OffloadingReportPartial(filter); //Assert Assert.IsInstanceOf <PartialViewResult>(result); }
public void CanBackPostDispatchesReport() { //ACT //TODO: Seed data into DispatchesViewModel before proceding with testing var viewModel = new DispatchesViewModel { }; var viewResult = _stockManagementController.DispatchesReport(viewModel) as ViewResult; //ASSERT Assert.NotNull(viewResult); Assert.IsInstanceOf <IEnumerable <Program> >(viewResult.ViewBag.Program); Assert.IsInstanceOf <IEnumerable <CommodityType> >(viewResult.ViewBag.CommodityTypes); }
/// <summary> /// /// </summary> /// <returns></returns> public ActionResult Dispatches() { var user = _userProfileService.GetUser(User.Identity.Name); var codesViewModels = ConstantsService.GetAllCodes(); var commodityTypeViewModels = _commodityTypeService.GetAllCommodityTypeForReprot(); var programViewModels = _programService.GetAllProgramsForReport(); var storeViewModels = _hubService.GetAllStoreByUser(user); var areaViewModels = _adminUnitService.GetAllAreasForReport(); var bidRefViewModels = _dispatchAllocationService.GetAllBidRefsForReport(); var viewModel = new DispatchesViewModel(codesViewModels, commodityTypeViewModels, programViewModels, storeViewModels, areaViewModels, bidRefViewModels); return(View(viewModel)); }
public ActionResult OffloadingReport() { MasterReportBound report = GetOffloading(new DispatchesViewModel()); UserProfile user = _userProfileService.GetUser(User.Identity.Name); var codes = ConstantsService.GetAllCodes(); var commodityTypes = _commodityTypeService.GetAllCommodityTypeForReprot();; var programs = _programService.GetAllProgramsForReport(); var stores = _hubService.GetAllStoreByUser(user); var areas = _adminUnitService.GetAllAreasForReport(); var bidRefs = _dispatchAllocationService.GetAllBidRefsForReport(); DispatchesViewModel ViewModel = new DispatchesViewModel(codes, commodityTypes, programs, stores, areas, bidRefs); ViewBag.Filters = ViewModel; return(View(report)); }
public ActionResult OffloadingReportViewerExportTo(DispatchesViewModel dispatchesViewModel) { Cats.Web.Hub.Reports.MasterReportBound rep = GetOffloading(dispatchesViewModel); //TODO:Install DevexpressV11 return DevExpress.Web.Mvc.ReportViewerExtension.ExportTo(rep); return View(); }
public ActionResult OffloadingReportPartial(DispatchesViewModel dispatchesViewModel) { MasterReportBound report = GetOffloading(dispatchesViewModel); return PartialView("OffloadingReportPartial", report); }
public ActionResult OffloadingReport() { MasterReportBound report = GetOffloading(new DispatchesViewModel()); UserProfile user = _userProfileService.GetUser(User.Identity.Name); var codes =ConstantsService.GetAllCodes(); var commodityTypes =_commodityTypeService.GetAllCommodityTypeForReprot();; var programs =_programService.GetAllProgramsForReport(); var stores =_hubService.GetAllStoreByUser(user); var areas = _adminUnitService.GetAllAreasForReport(); var bidRefs = _dispatchAllocationService.GetAllBidRefsForReport(); DispatchesViewModel ViewModel = new DispatchesViewModel(codes,commodityTypes,programs,stores,areas,bidRefs); ViewBag.Filters = ViewModel; return View(report); }
public MasterReportBound GetOffloading(DispatchesViewModel dispatchesViewModel) { UserProfile user = _userProfileService.GetUser(User.Identity.Name); OffloadingReportMain main = new OffloadingReportMain(); List<OffloadingReport> reports = _transactionService.GetOffloadingReport(user.DefaultHub.HubID, dispatchesViewModel); main.reports = reports; main.PreparedBy = user.GetFullName(); main.HubName = user.DefaultHub.HubNameWithOwner; main.ReportDate = DateTime.Now; main.ReportName = "OffloadingReport"; main.ReportTitle = "Offloading"; List<OffloadingReportMain> coll = new List<OffloadingReportMain>(); coll.Add(main); OffLoadingReport rpt = new OffLoadingReport() { DataSource = reports }; // XtraReport1 rpt = new XtraReport1() { DataSource = freestockreport.Programs[2].Details }; MasterReportBound report = new MasterReportBound() { Name = "Offloading Report " + DateTime.Now.ToShortDateString(), DataSource = coll }; report.rptSubReport.ReportSource = rpt; return report; }
/// <summary> /// /// </summary> /// <param name="viewModel"></param> /// <returns></returns> public ActionResult DispatchesReport(DispatchesViewModel viewModel) { ViewBag.Program = viewModel.ProgramId == null ? "All" : _programService.GetAllProgram().Where(c => c.ProgramID == viewModel.ProgramId).Select(c => c.Name).Single(); ViewBag.CommodityTypes = viewModel.CommodityTypeId == null ? "All" : _commodityTypeService.GetAllCommodityType().Where(c => c.CommodityTypeID == viewModel.CommodityTypeId).Select(c => c.Name).Single(); return(PartialView()); }
public ActionResult OffloadingReportViewerExportTo(DispatchesViewModel dispatchesViewModel) { DRMFSS.Web.Reports.MasterReportBound rep = GetOffloading(dispatchesViewModel); return(DevExpress.Web.Mvc.ReportViewerExtension.ExportTo(rep)); }
public ActionResult OffloadingReportPartial(DispatchesViewModel dispatchesViewModel) { MasterReportBound report = GetOffloading(dispatchesViewModel); return(PartialView("OffloadingReportPartial", report)); }
public ActionResult OffloadingReportViewerExportTo(DispatchesViewModel dispatchesViewModel) { Cats.Web.Hub.Reports.MasterReportBound rep = GetOffloading(dispatchesViewModel); //TODO:Install DevexpressV11 return DevExpress.Web.Mvc.ReportViewerExtension.ExportTo(rep); return(View()); }