示例#1
0
        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);
        }
示例#2
0
        public void ShouldDisplayOffloadingReportPartial()
        {
            //Act
            var filter = new DispatchesViewModel();
            var result = _reportsController.OffloadingReportPartial(filter);

            //Assert

            Assert.IsInstanceOf <PartialViewResult>(result);
        }
示例#3
0
        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);
        }
示例#4
0
        /// <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));
        }
示例#5
0
        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));
        }
示例#6
0
 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();
 }
示例#7
0
 public ActionResult OffloadingReportPartial(DispatchesViewModel dispatchesViewModel)
 {
     MasterReportBound report = GetOffloading(dispatchesViewModel);
        return PartialView("OffloadingReportPartial", report);
 }
示例#8
0
        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);
        }
示例#9
0
 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;
 }
示例#10
0
 /// <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());
 }
示例#11
0
 public ActionResult OffloadingReportViewerExportTo(DispatchesViewModel dispatchesViewModel)
 {
     DRMFSS.Web.Reports.MasterReportBound rep = GetOffloading(dispatchesViewModel);
     return(DevExpress.Web.Mvc.ReportViewerExtension.ExportTo(rep));
 }
示例#12
0
        public ActionResult OffloadingReportPartial(DispatchesViewModel dispatchesViewModel)
        {
            MasterReportBound report = GetOffloading(dispatchesViewModel);

            return(PartialView("OffloadingReportPartial", report));
        }
示例#13
0
 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());
 }