示例#1
0
        public ActionResult Index(IndexViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var dateType      = ReportEnumParser.TryParse <FOIReportDates>(model.InputParameters.SelectedDate);
            var textFieldType = ReportEnumParser.TryParse <FOIReportTextFields>(model.InputParameters.SelectedTextField);
            var operatorType  = ReportEnumParser.TryParse <TextFieldOperator>(model.InputParameters.SelectedOperator);

            return(RedirectToAction("ColumnSelection", new
            {
                dateType,
                From = model.InputParameters.FromDate.AsDateTime().Value,
                To = model.InputParameters.ToDate.AsDateTime().Value,
                textFieldType,
                operatorType,
                model.InputParameters.TextSearch
            }));
        }
示例#2
0
        public async Task <ActionResult> Index(IndexViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var from = model.From.AsDateTime().Value;
            var to   = model.To.AsDateTime().Value.AddDays(1);

            var organisationType = ReportEnumParser.TryParse <OrganisationFilterOptions>(model.SelectedOrganistationFilter);

            string organisationName = organisationType == null ? null : model.OrganisationName;

            var report = await mediator.SendAsync(new GetExportMovementsReport(from, to, organisationType, organisationName));

            var filename = string.Format("export-movement-documents-input-{0}-{1}.xlsx",
                                         from.ToShortDateString(),
                                         to.ToShortDateString());

            return(new XlsxActionResult <ExportMovementsData>(new[] { report }, filename));
        }
示例#3
0
        public ActionResult ColumnSelection(ColumnSelectionViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var columnsToHide = model.FOIReportColumns.GetColumnsToHide();
            var dateType      = ReportEnumParser.TryParse <FOIReportDates>(model.FOIReportColumns.DateType);
            var textFieldType = ReportEnumParser.TryParse <FOIReportTextFields>(model.FOIReportColumns.TextFieldType);
            var operatorType  = ReportEnumParser.TryParse <TextFieldOperator>(model.FOIReportColumns.OperatorType);

            return(RedirectToAction("Download", new
            {
                dateType,
                From = model.FOIReportColumns.FromDate,
                To = model.FOIReportColumns.ToDate,
                textFieldType,
                operatorType,
                model.FOIReportColumns.SearchText,
                columnsToHide
            }));
        }