This commit is contained in:
Zakharov_Rostislav 2024-05-26 18:59:05 +04:00
commit 42c893e105
3 changed files with 8 additions and 4 deletions

View File

@ -521,13 +521,13 @@ namespace BankClientApp.Controllers
switch (format)
{
case "word":
APIClient.PostRequest<ReportBindingModel>($"api/report/savetransferstoword", new ReportBindingModel
APIClient.PostRequest($"api/report/savetransferstoword", new ReportBindingModel
{
SelectedCardIds = cards,
});
break;
case "excel":
APIClient.PostRequest<ReportBindingModel>($"api/report/savetransferstoword", new ReportBindingModel
APIClient.PostRequest($"api/report/savetransferstoword", new ReportBindingModel
{
SelectedCardIds = cards,
});

View File

@ -28,14 +28,16 @@ namespace BankRestApi.Controllers
}
[HttpPost]
public void SaveTransfersToWord(ReportBindingModel? model)
public void SaveTransfersToWord(ReportBindingModel model)
{
try
{
_logic.SaveTransfersToWordFile(model);
}
catch(Exception ex)
{
_logger.LogError(ex, "Ошибка сохранения переводов в ворд");
throw;
}
}
[HttpPost]

View File

@ -37,6 +37,8 @@ builder.Services.AddTransient<IRequestLogic, RequestLogic>();
builder.Services.AddTransient<IWithdrawalStorage, WithdrawalStorage>();
builder.Services.AddTransient<IWithdrawalLogic, WithdrawalLogic>();
builder.Services.AddTransient<IReportLogic, ReportLogic>();
builder.Services.AddTransient<AbstractSaveToPdf, SaveToPdf>();
builder.Services.AddTransient<AbstractSaveToWord, SaveToWord>();
builder.Services.AddTransient<AbstractSaveToExcel, SaveToExcel>();