예제 #1
0
        public async Task <IActionResult> PersonAddress(RegixPersonAddressVM model)
        {
            SetViewBagPersonAddress(model.AddressTypeId);
            ValidateReason(model.Report);
            if (!ModelState.IsValid)
            {
                return(View(nameof(PersonAddress), model));
            }
            var currentId = model.Report.Id;

            if (service.PersonAddress_SaveData(model))
            {
                await RegixReportSaveFile(model.AddressTypeId, model.Report.Id);

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