public async Task <IActionResult> CompensationByPaymentPeriod(RegixCompensationByPaymentPeriodVM model) { SetViewBagCompensationByPaymentPeriod(); ValidateReason(model.Report); if (!ModelState.IsValid) { return(View(nameof(CompensationByPaymentPeriod), model)); } var currentId = model.Report.Id; if (service.CompensationByPaymentPeriod_SaveData(model)) { await RegixReportSaveFile(model.CompensationTypeId, model.Report.Id); this.SaveLogOperation(currentId == 0, model.Report.Id); SetSuccessMessage("Четенето премина успешно"); return(RedirectToAction(nameof(CompensationByPaymentPeriod), new { compensationTypeId = model.CompensationTypeId, id = model.Report.Id })); } else { SetErrorMessage("Проблем при четене на данните"); } return(View(nameof(CompensationByPaymentPeriod), model)); }