public IActionResult Edit(string account1CCode, DateTime reportDate) { PDNEditEdit pdnEditIndex = new PDNEditEdit() { Account1CCode = account1CCode, ReportDate = reportDate }; return(View(pdnEditIndex)); }
public async Task <IActionResult> Edit(DateTime reportDate, string account1CCode, PDNCard[] pdnCards, PDNNonCard[] pdnNonCards, int creditHistoryID, bool pdnAccept) { pdnCards.AsParallel().ForAll(i => i.Errors = i.CheckPDNError(reportDate)); pdnNonCards.AsParallel().ForAll(i => i.Errors = i.CheckPDNError(reportDate)); PDNInfoList pdnInfoList = new PDNInfoList { PDNCards = pdnCards, PDNNonCards = pdnNonCards, Manual = true, Account1CID = account1CCode, ReportDate = reportDate, CreditHistoryID = creditHistoryID, PDNAccept = pdnAccept }; try { await _ServiceServicePDN.SavePDNAsync(pdnInfoList, CancellationToken.None); } catch (Exception exception) { _Logger.LogError( exception, "Не удалось сохранить данные ПДН. Пользователь: {login}, данные: {pdnInfoList}, ошибка: {exceptionMessage}", HelperASP.Login(User), pdnInfoList, exception.Message); } PDNEditEdit pdnEditIndex = new PDNEditEdit { Account1CCode = account1CCode, ReportDate = reportDate }; if (pdnAccept) { return(RedirectToAction("Index")); } return(View(pdnEditIndex)); }