Сносим ненужное.
This commit is contained in:
parent
b8554342d2
commit
7eca1129b2
@ -95,8 +95,11 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Сохранение заказов в файл-Pdf
|
//Сохранение заказов в файл-Pdf
|
||||||
public void SaveAccountsToPdfFile(ReportBindingModel model)
|
public ReportCashierViewModelForHTML SaveAccountsToPdfFile(ReportBindingModel model)
|
||||||
{
|
{
|
||||||
|
var listMoneyTransfers = GetMoneyTransfers(model);
|
||||||
|
var listCashWithdrawals = GetCashWithrawals(model);
|
||||||
|
|
||||||
_saveToPdf.CreateDoc(new PdfInfo
|
_saveToPdf.CreateDoc(new PdfInfo
|
||||||
{
|
{
|
||||||
ForClient = false,
|
ForClient = false,
|
||||||
@ -105,9 +108,17 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics
|
|||||||
Title = "Отчёт по операциям начислений и переводов между счетами",
|
Title = "Отчёт по операциям начислений и переводов между счетами",
|
||||||
DateFrom = model.DateFrom!.Value,
|
DateFrom = model.DateFrom!.Value,
|
||||||
DateTo = model.DateTo!.Value,
|
DateTo = model.DateTo!.Value,
|
||||||
ReportMoneyTransfer = GetMoneyTransfers(model),
|
ReportMoneyTransfer = listMoneyTransfers,
|
||||||
ReportCashWithdrawal = GetCashWithrawals(model)
|
ReportCashWithdrawal = listCashWithdrawals
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//возврат полученных списков для отображения на вебе
|
||||||
|
return new ReportCashierViewModelForHTML
|
||||||
|
{
|
||||||
|
ReportCashWithdrawal = listCashWithdrawals,
|
||||||
|
|
||||||
|
ReportMoneyTransfer = listMoneyTransfers
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using BankYouBankruptContracts.ViewModels.Client.Reports;
|
using BankYouBankruptContracts.ViewModels.Client.Reports;
|
||||||
|
using BankYouBankruptContracts.ViewModels;
|
||||||
|
|
||||||
namespace BankYouBankruptBusinessLogic.BusinessLogics
|
namespace BankYouBankruptBusinessLogic.BusinessLogics
|
||||||
{
|
{
|
||||||
@ -84,17 +85,28 @@ namespace BankYouBankruptBusinessLogic.BusinessLogics
|
|||||||
}
|
}
|
||||||
|
|
||||||
//отчёт в формате PDF для клиента
|
//отчёт в формате PDF для клиента
|
||||||
public void SaveClientReportToPdfFile(ReportBindingModel model)
|
public ReportClientViewModelForHTML SaveClientReportToPdfFile(ReportBindingModel model)
|
||||||
{
|
{
|
||||||
|
var listCreditings = GetCrediting(model);
|
||||||
|
var listDebitings = GetDebiting(model);
|
||||||
|
|
||||||
_saveToPdf.CreateDoc(new PdfInfo
|
_saveToPdf.CreateDoc(new PdfInfo
|
||||||
{
|
{
|
||||||
FileName = model.FileName,
|
FileName = model.FileName,
|
||||||
Title = "Отчёт по операциям с картами",
|
Title = "Отчёт по операциям с картами",
|
||||||
DateFrom = model.DateFrom!.Value,
|
DateFrom = model.DateFrom!.Value,
|
||||||
DateTo = model.DateTo!.Value,
|
DateTo = model.DateTo!.Value,
|
||||||
ReportCrediting = GetCrediting(model),
|
ReportCrediting = listCreditings,
|
||||||
ReportDebiting = GetDebiting(model)
|
ReportDebiting = listDebitings
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//возврат полученных списков для отображения на вебе
|
||||||
|
return new ReportClientViewModelForHTML
|
||||||
|
{
|
||||||
|
ReportCrediting = listCreditings,
|
||||||
|
|
||||||
|
ReportDebiting = listDebitings
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,191 @@
|
|||||||
|
using BankYouBankruptBusinessLogic.OfficePackage.HelperEnums;
|
||||||
|
using BankYouBankruptBusinessLogic.OfficePackage.HelperModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BankYouBankruptBusinessLogic.OfficePackage
|
||||||
|
{
|
||||||
|
public abstract class AbstractSaveToPdf
|
||||||
|
{
|
||||||
|
//публичный метод создания документа. Описание методов ниже
|
||||||
|
public void CreateDoc(PdfInfo info)
|
||||||
|
{
|
||||||
|
if(info.ForClient)
|
||||||
|
{
|
||||||
|
CreateDocClient(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CreateDocCashier(info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Отчёт для клиента
|
||||||
|
|
||||||
|
public void CreateDocClient(PdfInfo info)
|
||||||
|
{
|
||||||
|
CreatePdf(info);
|
||||||
|
|
||||||
|
CreateParagraph(new PdfParagraph
|
||||||
|
{
|
||||||
|
Text = info.Title + $"\nот {DateTime.Now.ToShortDateString()}",
|
||||||
|
|
||||||
|
Style = "NormalTitle",
|
||||||
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||||
|
});
|
||||||
|
|
||||||
|
CreateParagraph(new PdfParagraph
|
||||||
|
{
|
||||||
|
Text = $"Расчётный период: с {info.DateFrom.ToShortDateString()} по {info.DateTo.ToShortDateString()}",
|
||||||
|
Style = "Normal",
|
||||||
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||||
|
});
|
||||||
|
|
||||||
|
//параграф с отчётом на пополнения
|
||||||
|
CreateParagraph(new PdfParagraph { Text = "Отчёт по пополнениям", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Center });
|
||||||
|
|
||||||
|
CreateTable(new List<string> { "3cm", "3cm", "5cm", "5cm" });
|
||||||
|
|
||||||
|
CreateRow(new PdfRowParameters
|
||||||
|
{
|
||||||
|
Texts = new List<string> { "Номер операции", "Номер карты", "Сумма", "Дата операции" },
|
||||||
|
Style = "NormalTitle",
|
||||||
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach (var report in info.ReportCrediting)
|
||||||
|
{
|
||||||
|
CreateRow(new PdfRowParameters
|
||||||
|
{
|
||||||
|
Texts = new List<string> { report.OperationId.ToString(), report.CardNumber, report.SumOperation.ToString(), report.DateComplite.ToString() },
|
||||||
|
Style = "Normal",
|
||||||
|
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//подсчёт суммы операций на пополнение
|
||||||
|
CreateParagraph(new PdfParagraph { Text = $"Итоговая сумма поступлений за период: {info.ReportCrediting.Sum(x => x.SumOperation)}\t", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Right });
|
||||||
|
|
||||||
|
//отчёт с отчётом на снятие
|
||||||
|
CreateParagraph(new PdfParagraph { Text = "Отчёт по снятиям", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Center });
|
||||||
|
|
||||||
|
CreateTable(new List<string> { "3cm", "3cm", "5cm", "5cm" });
|
||||||
|
|
||||||
|
CreateRow(new PdfRowParameters
|
||||||
|
{
|
||||||
|
Texts = new List<string> { "Номер операции", "Номер карты", "Сумма", "Дата операции" },
|
||||||
|
Style = "NormalTitle",
|
||||||
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach (var report in info.ReportDebiting)
|
||||||
|
{
|
||||||
|
CreateRow(new PdfRowParameters
|
||||||
|
{
|
||||||
|
Texts = new List<string> { report.OperationId.ToString(), report.CardNumber, report.SumOperation.ToString(), report.DateComplite.ToString() },
|
||||||
|
Style = "Normal",
|
||||||
|
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//подсчёт суммы операций на пополнение
|
||||||
|
CreateParagraph(new PdfParagraph { Text = $"Итоговая сумма снятий за период: {info.ReportDebiting.Sum(x => x.SumOperation)}\t", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Right });
|
||||||
|
|
||||||
|
SavePdf(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Отчёт для кассира
|
||||||
|
|
||||||
|
//создание отчёта для кассира
|
||||||
|
public void CreateDocCashier(PdfInfo info)
|
||||||
|
{
|
||||||
|
CreatePdf(info);
|
||||||
|
|
||||||
|
CreateParagraph(new PdfParagraph
|
||||||
|
{
|
||||||
|
Text = info.Title + $"\nот {DateTime.Now.ToShortDateString()}\nФИО клиента: {info.FullClientName}",
|
||||||
|
Style = "NormalTitle",
|
||||||
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||||
|
});
|
||||||
|
|
||||||
|
CreateParagraph(new PdfParagraph
|
||||||
|
{
|
||||||
|
Text = $"Расчётный период: с {info.DateFrom.ToShortDateString()} по {info.DateTo.ToShortDateString()}",
|
||||||
|
Style = "Normal",
|
||||||
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||||
|
});
|
||||||
|
|
||||||
|
//параграф с отчётом по выдаче наличных с карт
|
||||||
|
CreateParagraph(new PdfParagraph { Text = "Отчёт по выдаче наличных со счёта", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Center });
|
||||||
|
|
||||||
|
CreateTable(new List<string> { "3.5cm", "3.5cm", "5cm", "5cm" });
|
||||||
|
|
||||||
|
CreateRow(new PdfRowParameters
|
||||||
|
{
|
||||||
|
Texts = new List<string> { "Номер операции", "Номер счёта", "Сумма операции", "Дата операции" },
|
||||||
|
Style = "NormalTitle",
|
||||||
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach (var report in info.ReportCashWithdrawal)
|
||||||
|
{
|
||||||
|
CreateRow(new PdfRowParameters
|
||||||
|
{
|
||||||
|
Texts = new List<string> { report.OperationId.ToString(), report.AccountPayeeNumber, report.SumOperation.ToString(), report.DateComplite.ToShortDateString(), },
|
||||||
|
Style = "Normal",
|
||||||
|
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
CreateParagraph(new PdfParagraph { Text = $"Итоговая сумма снятий за период: {info.ReportCashWithdrawal.Sum(x => x.SumOperation)}\t", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Right });
|
||||||
|
|
||||||
|
//параграф с отчётом по переводу денег со счёта на счёт
|
||||||
|
CreateParagraph(new PdfParagraph { Text = "Отчёт по денежным переводам между счетами", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Center });
|
||||||
|
|
||||||
|
CreateTable(new List<string> { "3cm", "3cm", "3cm", "4cm", "4cm" });
|
||||||
|
|
||||||
|
CreateRow(new PdfRowParameters
|
||||||
|
{
|
||||||
|
Texts = new List<string> { "Номер операции", "Номер счёта отправителя", "Номер счёта получателя", "Сумма операции", "Дата операции" },
|
||||||
|
Style = "NormalTitle",
|
||||||
|
ParagraphAlignment = PdfParagraphAlignmentType.Center
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach (var report in info.ReportMoneyTransfer)
|
||||||
|
{
|
||||||
|
CreateRow(new PdfRowParameters
|
||||||
|
{
|
||||||
|
Texts = new List<string> { report.OperationId.ToString(), report.AccountSenderNumber, report.AccountPayeeNumber, report.SumOperation.ToString(), report.DateComplite.ToShortDateString(), },
|
||||||
|
Style = "Normal",
|
||||||
|
ParagraphAlignment = PdfParagraphAlignmentType.Left
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
CreateParagraph(new PdfParagraph { Text = $"Итоговая сумма переводов за период: {info.ReportMoneyTransfer.Sum(x => x.SumOperation)}\t", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Right });
|
||||||
|
|
||||||
|
SavePdf(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
/// Создание pdf-файла
|
||||||
|
protected abstract void CreatePdf(PdfInfo info);
|
||||||
|
|
||||||
|
/// Создание параграфа с текстом
|
||||||
|
protected abstract void CreateParagraph(PdfParagraph paragraph);
|
||||||
|
|
||||||
|
/// Создание таблицы
|
||||||
|
protected abstract void CreateTable(List<string> columns);
|
||||||
|
|
||||||
|
/// Создание и заполнение строки
|
||||||
|
protected abstract void CreateRow(PdfRowParameters rowParameters);
|
||||||
|
|
||||||
|
/// Сохранение файла
|
||||||
|
protected abstract void SavePdf(PdfInfo info);
|
||||||
|
}
|
||||||
|
}
|
@ -275,67 +275,9 @@ namespace BankYouBankruptClientApp.Controllers
|
|||||||
DateTo = dateTo
|
DateTo = dateTo
|
||||||
});
|
});
|
||||||
|
|
||||||
PdfLoadViewModel support = APIClient.GetRequest<PdfLoadViewModel>($"api/Report/LoadReport?whoRequested={bool.TrueString}");
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*PdfDocument doc = new PdfDocument();
|
|
||||||
|
|
||||||
doc.LoadFromBytes(support.bytes);
|
|
||||||
|
|
||||||
support.document = doc;*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//return File(support.bytes, "application/pdf", "support.pdf")
|
|
||||||
|
|
||||||
/*/Create PDF Document
|
|
||||||
PdfDocument document = new PdfDocument();
|
|
||||||
|
|
||||||
//You will have to add Page in PDF Document
|
|
||||||
PdfPage page = document.AddPage();
|
|
||||||
|
|
||||||
//For drawing in PDF Page you will nedd XGraphics Object
|
|
||||||
XGraphics gfx = XGraphics.FromPdfPage(page);
|
|
||||||
|
|
||||||
//For Test you will have to define font to be used
|
|
||||||
XFont font = new XFont("Verdana", 20, XFontStyle.Bold);
|
|
||||||
|
|
||||||
//Finally use XGraphics & font object to draw text in PDF Page
|
|
||||||
gfx.DrawString("My First PDF Document", font, XBrushes.Black,
|
|
||||||
|
|
||||||
new XRect(0, 0, page.Width, page.Height), XStringFormats.Center);
|
|
||||||
|
|
||||||
//Specify file name of the PDF file
|
|
||||||
string filename = "FirstPDFDocument.pdf";
|
|
||||||
|
|
||||||
//Save PDF File
|
|
||||||
document.Save(filename);
|
|
||||||
|
|
||||||
//Load PDF File for viewing
|
|
||||||
Process.Start(filename);*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*MemoryStream stream = new MemoryStream(support.bytes);
|
|
||||||
PdfDocument document = PdfReader.Open(stream, PdfDocumentOpenMode.Import);
|
|
||||||
support.document = document.Save(stream, false);*/
|
|
||||||
|
|
||||||
//ViewBag.ReportFile = File(support.bytes, "application/pdf");
|
|
||||||
|
|
||||||
ViewBag.ReportFile = new FileContentResult(support.bytes, "application/pdf");
|
|
||||||
|
|
||||||
//ViewBag.ReportFile = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location).ToString();
|
|
||||||
|
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*[HttpPost]
|
|
||||||
public object LoadReport()
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Получение отчета по картам
|
#region Получение отчета по картам
|
||||||
|
@ -25,25 +25,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<h1>Просмотр отчёта в формате pdf</h1>
|
|
||||||
<object id="forPdf" data={@ViewBag.ReportFile.FileContents} type="application/pdf" width="100%" height="100%">
|
|
||||||
<p>Unable to display PDF file. <a href="/uploads/media/default/0001/01/540cb75550adf33f281f29132dddd14fded85bfc.pdf">Download</a> instead.</p>
|
|
||||||
</object>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<!-- подгрузка отчёта PDF в реальном времени -->
|
|
||||||
<!-- <script>
|
|
||||||
$('#createReport').on('click', function () {
|
|
||||||
load();
|
|
||||||
});
|
|
||||||
|
|
||||||
function load() {
|
|
||||||
byte[] bytes;
|
|
||||||
BinaryFormatter bf = new BinaryFormatter();
|
|
||||||
MemoryStream ms = new MemoryStream();
|
|
||||||
bf.Serialize(ms, fileContent);
|
|
||||||
bytes = ms.ToArray();
|
|
||||||
System.IO.File.WriteAllBytes("hello.pdf", bytes);
|
|
||||||
}
|
|
||||||
</script> -->
|
|
@ -20,7 +20,7 @@ namespace BankYouBankruptContracts.BusinessLogicsContracts
|
|||||||
//Сохранение отчёта по счетам в файл-Excel
|
//Сохранение отчёта по счетам в файл-Excel
|
||||||
void SaveAccountsToExcelFile(ReportBindingModel model);
|
void SaveAccountsToExcelFile(ReportBindingModel model);
|
||||||
|
|
||||||
//Сохранение отчёта по счетам в файл-Pdf
|
//Сохранение отчёта по счетам в файл-Pdf
|
||||||
void SaveAccountsToPdfFile(ReportBindingModel model);
|
ReportCashierViewModelForHTML SaveAccountsToPdfFile(ReportBindingModel model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using BankYouBankruptContracts.BindingModels;
|
using BankYouBankruptContracts.BindingModels;
|
||||||
using BankYouBankruptContracts.SearchModels;
|
using BankYouBankruptContracts.SearchModels;
|
||||||
|
using BankYouBankruptContracts.ViewModels;
|
||||||
using BankYouBankruptContracts.ViewModels.Client.Reports;
|
using BankYouBankruptContracts.ViewModels.Client.Reports;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@ -25,7 +26,7 @@ namespace BankYouBankruptContracts.BusinessLogicsContracts
|
|||||||
|
|
||||||
void SaveDebitingToExcelFile(ReportBindingModel model);
|
void SaveDebitingToExcelFile(ReportBindingModel model);
|
||||||
|
|
||||||
//Сохранение отчёта по картам в файл-Pdf
|
//Сохранение отчёта по картам в файл-Pdf
|
||||||
void SaveClientReportToPdfFile(ReportBindingModel model);
|
ReportClientViewModelForHTML SaveClientReportToPdfFile(ReportBindingModel model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
using PdfSharp.Pdf;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace BankYouBankruptContracts.ViewModels
|
|
||||||
{
|
|
||||||
//для возврата pdf на страницу
|
|
||||||
public class PdfLoadViewModel
|
|
||||||
{
|
|
||||||
public byte[] bytes { get; set; }
|
|
||||||
|
|
||||||
public PdfDocument document { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -8,7 +8,6 @@ namespace BankYouBankruptContracts.ViewModels
|
|||||||
{
|
{
|
||||||
public class ReportCashierViewModel
|
public class ReportCashierViewModel
|
||||||
{
|
{
|
||||||
|
|
||||||
public int OperationId { get; set; }
|
public int OperationId { get; set; }
|
||||||
|
|
||||||
public int DebitingId { get; set; }
|
public int DebitingId { get; set; }
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BankYouBankruptContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class ReportCashierViewModelForHTML
|
||||||
|
{
|
||||||
|
//перечень переводов со счёта на счёт
|
||||||
|
public List<ReportCashierViewModel> ReportMoneyTransfer { get; set; } = new();
|
||||||
|
|
||||||
|
//перечень зачислений денежных средств на карту (т. е. на её счёт)
|
||||||
|
public List<ReportCashierViewModel> ReportCashWithdrawal { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
using BankYouBankruptContracts.ViewModels.Client.Reports;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BankYouBankruptContracts.ViewModels
|
||||||
|
{
|
||||||
|
public class ReportClientViewModelForHTML
|
||||||
|
{
|
||||||
|
//перечень заказов за указанный период для вывода/сохранения
|
||||||
|
public List<ReportClientViewModel> ReportCrediting { get; set; } = new();
|
||||||
|
|
||||||
|
//перечень заказов за указанный период для вывода/сохранения
|
||||||
|
public List<ReportClientViewModel> ReportDebiting { get; set; } = new();
|
||||||
|
}
|
||||||
|
}
|
@ -36,11 +36,11 @@ namespace BankYouBankruptRestAPI.Controllers
|
|||||||
|
|
||||||
//метод генерации отчёта за период по картам клиента
|
//метод генерации отчёта за период по картам клиента
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void CreateClientReport(ReportSupportBindingModel model)
|
public ReportClientViewModelForHTML CreateClientReport(ReportSupportBindingModel model)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_reportClientLogic.SaveClientReportToPdfFile(new ReportBindingModel
|
return _reportClientLogic.SaveClientReportToPdfFile(new ReportBindingModel
|
||||||
{
|
{
|
||||||
FileName = "Отчёт_по_картам.pdf",
|
FileName = "Отчёт_по_картам.pdf",
|
||||||
DateFrom = model.DateFrom,
|
DateFrom = model.DateFrom,
|
||||||
@ -56,11 +56,11 @@ namespace BankYouBankruptRestAPI.Controllers
|
|||||||
|
|
||||||
//метод генерации отчёта по всем счетм клиентов
|
//метод генерации отчёта по всем счетм клиентов
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void CreateCashierReport(ReportSupportBindingModel model)
|
public ReportCashierViewModelForHTML CreateCashierReport(ReportSupportBindingModel model)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_reportCashierLogic.SaveAccountsToPdfFile(new ReportBindingModel
|
return _reportCashierLogic.SaveAccountsToPdfFile(new ReportBindingModel
|
||||||
{
|
{
|
||||||
FileName = "Отчёт_по_счетам.pdf",
|
FileName = "Отчёт_по_счетам.pdf",
|
||||||
ClientId = model.ClientId,
|
ClientId = model.ClientId,
|
||||||
@ -74,23 +74,5 @@ namespace BankYouBankruptRestAPI.Controllers
|
|||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
|
||||||
public PdfLoadViewModel LoadReport(bool whoRequested)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
PdfLoadViewModel model = new PdfLoadViewModel();
|
|
||||||
|
|
||||||
model.bytes = _reportLoad.LoadFile(whoRequested);
|
|
||||||
|
|
||||||
return model;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, "Ошибка входа в систему");
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
BankYouBankrupt/BankYouBankruptRestAPI/Отчёт_по_картам.pdf
Normal file
BIN
BankYouBankrupt/BankYouBankruptRestAPI/Отчёт_по_картам.pdf
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user