diff --git a/Bank/OperatorApp/Controllers/HomeController.cs b/Bank/OperatorApp/Controllers/HomeController.cs index 38d95c0..62137ba 100644 --- a/Bank/OperatorApp/Controllers/HomeController.cs +++ b/Bank/OperatorApp/Controllers/HomeController.cs @@ -266,7 +266,7 @@ namespace OperatorApp.Controllers } [HttpPost] - public IActionResult PaymentsReport(List payments, bool word, bool excel) + public IActionResult PaymentsReport(List payments, string doctype) { List paymentBindings = new List(); foreach (int paymentId in payments) @@ -281,16 +281,16 @@ namespace OperatorApp.Controllers DealPayments = paymentView.DealPayments }); } - //if (word) - //{ - MemoryStream list = _reportLogic.SavePaymentPurchaseToWord(new ReportBindingModel { FileName = "test" }, paymentBindings); - return File(list, "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "testDoc.docx"); - //} - //else - //{ - // MemoryStream list = _reportLogic.SavePaymentPurchaseToExcel(new ReportBindingModel { FileName = "test" }, paymentBindings); - // return File(list, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "testExcel.xlsx"); - //} + if (doctype.Equals("word")) + { + MemoryStream list = _reportLogic.SavePaymentPurchaseToWord(new ReportBindingModel { FileName = "test" }, paymentBindings); + return File(list, "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "testDoc.docx"); + } + else + { + MemoryStream list = _reportLogic.SavePaymentPurchaseToExcel(new ReportBindingModel { FileName = "test" }, paymentBindings); + return File(list, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "testExcel.xlsx"); + } } [HttpGet] diff --git a/Bank/OperatorApp/Views/Home/PaymentsReport.cshtml b/Bank/OperatorApp/Views/Home/PaymentsReport.cshtml index 27bed14..c4bc90a 100644 --- a/Bank/OperatorApp/Views/Home/PaymentsReport.cshtml +++ b/Bank/OperatorApp/Views/Home/PaymentsReport.cshtml @@ -12,10 +12,13 @@
-
Word
-
-
Excel
-
+
Word
+ @Html.RadioButton("doctype", "word", true) + +
+
+
Excel
+ @Html.RadioButton("doctype", "excel")
diff --git a/Bank/OperatorApp/Views/Home/TransfersReport.cshtml b/Bank/OperatorApp/Views/Home/TransfersReport.cshtml index b91993c..db33f83 100644 --- a/Bank/OperatorApp/Views/Home/TransfersReport.cshtml +++ b/Bank/OperatorApp/Views/Home/TransfersReport.cshtml @@ -5,7 +5,7 @@ ViewData["Title"] = "TransfersReport"; }
-

Создание отчёта

+

Создание списка

@@ -13,11 +13,22 @@
@Html.EditorFor(x => x.DateFrom, new { htmlAttributes = new { @class = "form-control my-3", @type = "date", @name="DateFrom", @required="true", @id="DateFrom" } })
+
+
По:
@Html.EditorFor(x => x.DateTo, new { htmlAttributes = new { @class = "form-control my-3", @type = "date", @name="DateTo", @required="true", @id="DateTo" } })
+

Вывести на:

+
+
На почту (.pdf)
+ @Html.RadioButton("reptype", "pdf", true) +
+
+
На форму
+ @Html.RadioButton("reptype", "onForm") +