Exemplo n.º 1
0
        public async Task <IActionResult> PersonData(RegixPersonDataVM model)
        {
            ValidateReason(model.Report);
            if (!ModelState.IsValid)
            {
                return(View(nameof(PersonData), model));
            }
            var currentId = model.Report.Id;

            if (service.PersonData_SaveData(model))
            {
                await RegixReportSaveFile(NomenclatureConstants.RegixType.PersonData, model.Report.Id);

                this.SaveLogOperation(currentId == 0, model.Report.Id);
                SetSuccessMessage("Четенето премина успешно");
                return(RedirectToAction(nameof(PersonData), new { id = model.Report.Id }));
            }
            else
            {
                SetErrorMessage("Проблем при четене на данните");
            }
            return(View(nameof(PersonData), model));
        }