[HttpPost] public void RequestsListReport(string format, List<int> accounts)

This commit is contained in:
Zakharov_Rostislav 2024-05-26 17:51:03 +04:00
parent 6a2ff9b373
commit c77ed0a6e5
2 changed files with 33 additions and 6 deletions

View File

@ -464,7 +464,6 @@ namespace BankManagersClientApp.Controllers
#region//Reports
[HttpGet]
public IActionResult RequestsListReport()
{
if (APIClient.Client == null)
@ -473,7 +472,31 @@ namespace BankManagersClientApp.Controllers
}
ViewBag.Accounts = APIClient.GetRequest<List<AccountViewModel>>($"api/account/getaccountlist?managerid={APIClient.Client.Id}");
return View();
}
}
[HttpPost]
public void RequestsListReport(string format, List<int> accounts)
{
if (APIClient.Client == null)
throw new Exception("Вы как суда попали? Суда вход только авторизованным");
switch (format)
{
case "word":
APIClient.PostRequest("/api/report/saverequeststoword", new ReportBindingModel
{
SelectedAccountIds = accounts
});
break;
case "excel":
APIClient.PostRequest("/api/report/saverequeststoexcel", new ReportBindingModel
{
SelectedAccountIds = accounts
});
break;
default:
break;
}
}
[HttpGet]
public IActionResult TransfersWithdrawalsListReport()

View File

@ -18,10 +18,14 @@
}
</select>
</div>
<asp:RadioButtonList ID="buttons" runat="server">
<asp:ListItem id="Word" name="Word" Text="Получить в формате Word" />
<asp:ListItem id="Excel" name="Excel" Text="Получить в формате Excel" />
</asp:RadioButtonList>
</div>
<div>
<input id="word" type="radio" name="format" value="word" />
<label for="word">Получать в формате Word</label>
</div>
<div>
<input id="excel" type="radio" name="format" value="word" />
<label for="excel">Получать в формате Excel</label>
</div>
<div class="row">
<div class="col-9" />