Exemplo n.º 1
0
        public async Task <IActionResult> Create()
        {
            ReportCreateBindingModel reportCreateBindingModel = new ReportCreateBindingModel();
            await Task.Run((() => { }));

            return(View(reportCreateBindingModel));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create(ReportCreateBindingModel reportCreateBindingModel)
        {
            if (!ModelState.IsValid)
            {
                this.ViewData["error"] = ControllerConstants.InputErrorMessage;
                return(View(reportCreateBindingModel));
            }

            var result = await _reportService.CreateCustomReport(reportCreateBindingModel.To <ReportServiceModel>());

            if (!result)
            {
                this.ViewData["error"] = ControllerConstants.ReportCreateErrorMessage;
                return(View(reportCreateBindingModel));
            }
            return(RedirectToAction("All"));
        }