diff --git a/LawFirm/AbstractLawFirmBusinessLogic/AbstractLawFirmBusinessLogic.csproj b/LawFirm/AbstractLawFirmBusinessLogic/AbstractLawFirmBusinessLogic.csproj
index e7fbd8e..e013934 100644
--- a/LawFirm/AbstractLawFirmBusinessLogic/AbstractLawFirmBusinessLogic.csproj
+++ b/LawFirm/AbstractLawFirmBusinessLogic/AbstractLawFirmBusinessLogic.csproj
@@ -7,7 +7,9 @@
+
+
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/BusinessLogic/ReportLogic.cs b/LawFirm/AbstractLawFirmBusinessLogic/BusinessLogic/ReportLogic.cs
new file mode 100644
index 0000000..c89bb3b
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/BusinessLogic/ReportLogic.cs
@@ -0,0 +1,185 @@
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperModels;
+using AbstractLawFirmBusinessLogic.OfficePackage;
+using AbstractLawFirmContracts.BindingModels;
+using AbstractLawFirmContracts.BusinessLogicsContracts;
+using AbstractLawFirmContracts.SearchModels;
+using AbstractLawFirmContracts.StoragesContracts;
+using AbstractLawFirmContracts.ViewModels;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AbstractLawFirmBusinessLogic.BusinessLogic
+{
+ public class ReportLogic : IReportLogic
+ {
+ private readonly IComponentStorage _componentStorage;
+ private readonly IDocumentStorage _documentStorage;
+ private readonly IOrderStorage _orderStorage;
+ private readonly IShopStorage _shopStorage;
+ private readonly AbstractSaveToExcel _saveToExcel;
+ private readonly AbstractSaveToWord _saveToWord;
+ private readonly AbstractSaveToPdf _saveToPdf;
+ public ReportLogic(IDocumentStorage documentStorage, IComponentStorage
+ componentStorage, IOrderStorage orderStorage, IShopStorage shopStorage,
+ AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord,
+ AbstractSaveToPdf saveToPdf)
+ {
+ _documentStorage = documentStorage;
+ _componentStorage = componentStorage;
+ _orderStorage = orderStorage;
+ _shopStorage = shopStorage;
+ _saveToExcel = saveToExcel;
+ _saveToWord = saveToWord;
+ _saveToPdf = saveToPdf;
+ }
+ ///
+ /// Получение списка компонент с указанием, в каких изделиях используются
+ ///
+ ///
+ public List GetDocumentComponent()
+ {
+ var documents = _documentStorage.GetFullList();
+ var list = new List();
+ foreach (var document in documents)
+ {
+ var record = new ReportDocumentComponentViewModel
+ {
+ DocumentName = document.DocumentName,
+ Components = new List<(string Component, int Count)>(),
+ TotalCount = 0
+ };
+ foreach (var component in document.DocumentComponents.Values)
+ {
+ record.Components.Add((component.Item1.ComponentName, component.Item2));
+ record.TotalCount += component.Item2;
+ }
+ list.Add(record);
+ }
+ return list;
+ }
+ ///
+ /// Получение списка заказов за определенный период
+ ///
+ ///
+ ///
+ public List GetOrders(ReportBindingModel model)
+ {
+ return _orderStorage.GetFilteredList(new OrderSearchModel
+ {
+ DateFrom
+ = model.DateFrom,
+ DateTo = model.DateTo
+ })
+ .Select(x => new ReportOrdersViewModel
+ {
+ Id = x.Id,
+ DateCreate = x.DateCreate,
+ DocumentName = x.DocumentName,
+ Sum = x.Sum,
+ Status = x.Status.ToString(),
+ })
+ .ToList();
+ }
+ ///
+ /// Сохранение компонент в файл-Word
+ ///
+ ///
+ public void SaveDocumentsToWordFile(ReportBindingModel model)
+ {
+ _saveToWord.CreateDoc(new WordInfo
+ {
+ FileName = model.FileName,
+ Title = "Список пакетов документов",
+ Documents = _documentStorage.GetFullList()
+ });
+ }
+ ///
+ /// Сохранение компонент с указаеним продуктов в файл-Excel
+ ///
+ ///
+ public void SaveDocumentComponentToExcelFile(ReportBindingModel model)
+ {
+ _saveToExcel.CreateReport(new ExcelInfo
+ {
+ FileName = model.FileName,
+ Title = "Список компонент",
+ DocumentComponents = GetDocumentComponent()
+ });
+ }
+ ///
+ /// Сохранение заказов в файл-Pdf
+ ///
+ ///
+ public void SaveOrdersToPdfFile(ReportBindingModel model)
+ {
+ _saveToPdf.CreateDoc(new PdfInfo
+ {
+ FileName = model.FileName,
+ Title = "Список заказов",
+ DateFrom = model.DateFrom!.Value,
+ DateTo = model.DateTo!.Value,
+ Orders = GetOrders(model)
+ });
+ }
+ public void SaveShopsToWordFile(ReportBindingModel model)
+ {
+ _saveToWord.CreateTableDoc(new WordInfo
+ {
+ FileName = model.FileName,
+ Title = "Список магазинов",
+ Shops = _shopStorage.GetFullList()
+ });
+ }
+ public void SaveShopDocumentsToExcelFile(ReportBindingModel model)
+ {
+ _saveToExcel.CreateShopReport(new ExcelInfo
+ {
+ FileName = model.FileName,
+ Title = "Загруженность магазинов",
+ ShopDocuments = GetShopDocuments()
+ });
+ }
+ public List GetShopDocuments()
+ {
+ var shops = _shopStorage.GetFullList();
+ var list = new List();
+ foreach (var shop in shops)
+ {
+ var record = new ReportShopDocumentsViewModel
+ {
+ ShopName = shop.ShopName,
+ Documents = new List>(),
+ Count = 0
+ };
+ foreach (var docCount in shop.ShopDocuments.Values)
+ {
+ record.Documents.Add(new Tuple(docCount.Item1.DocumentName, docCount.Item2));
+ record.Count += docCount.Item2;
+ }
+ list.Add(record);
+ }
+ return list;
+ }
+ public List GetDateOrders()
+ {
+ return _orderStorage.GetFullList().GroupBy(x => x.DateCreate.Date).Select(x => new ReportDateOrdersViewModel
+ {
+ DateCreate = x.Key,
+ CountOrders = x.Count(),
+ SumOrders = x.Sum(y => y.Sum)
+ }).ToList();
+ }
+ public void SaveDateOrdersToPdfFile(ReportBindingModel model)
+ {
+ _saveToPdf.CreateReportDateDoc(new PdfInfo
+ {
+ FileName = model.FileName,
+ Title = "Заказы по датам",
+ DateOrders = GetDateOrders()
+ });
+ }
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/AbstractSaveToExcel.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/AbstractSaveToExcel.cs
new file mode 100644
index 0000000..8164b9f
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/AbstractSaveToExcel.cs
@@ -0,0 +1,163 @@
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperEnums;
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperModels;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage
+{
+ public abstract class AbstractSaveToExcel
+ {
+ ///
+ /// Создание отчета
+ ///
+ ///
+ public void CreateReport(ExcelInfo info)
+ {
+ CreateExcel(info);
+ InsertCellInWorksheet(new ExcelCellParameters
+ {
+ ColumnName = "A",
+ RowIndex = 1,
+ Text = info.Title,
+ StyleInfo = ExcelStyleInfoType.Title
+ });
+ MergeCells(new ExcelMergeParameters
+ {
+ CellFromName = "A1",
+ CellToName = "C1"
+ });
+ uint rowIndex = 2;
+ foreach (var pc in info.DocumentComponents)
+ {
+ InsertCellInWorksheet(new ExcelCellParameters
+ {
+ ColumnName = "A",
+ RowIndex = rowIndex,
+ Text = pc.DocumentName,
+ StyleInfo = ExcelStyleInfoType.Text
+ });
+ rowIndex++;
+ foreach (var (Component, Count) in pc.Components)
+ {
+ InsertCellInWorksheet(new ExcelCellParameters
+ {
+ ColumnName = "B",
+ RowIndex = rowIndex,
+ Text = Component,
+ StyleInfo = ExcelStyleInfoType.TextWithBorder
+ });
+ InsertCellInWorksheet(new ExcelCellParameters
+ {
+ ColumnName = "C",
+ RowIndex = rowIndex,
+ Text = Count.ToString(),
+ StyleInfo = ExcelStyleInfoType.TextWithBorder
+ });
+ rowIndex++;
+ }
+ InsertCellInWorksheet(new ExcelCellParameters
+ {
+ ColumnName = "A",
+ RowIndex = rowIndex,
+ Text = "Итого",
+ StyleInfo = ExcelStyleInfoType.Text
+ });
+ InsertCellInWorksheet(new ExcelCellParameters
+ {
+ ColumnName = "C",
+ RowIndex = rowIndex,
+ Text = pc.TotalCount.ToString(),
+ StyleInfo = ExcelStyleInfoType.Text
+ });
+ rowIndex++;
+ }
+ SaveExcel(info);
+ }
+ public void CreateShopReport(ExcelInfo info)
+ {
+ CreateExcel(info);
+ InsertCellInWorksheet(new ExcelCellParameters
+ {
+ ColumnName = "A",
+ RowIndex = 1,
+ Text = info.Title,
+ StyleInfo = ExcelStyleInfoType.Title
+ });
+ MergeCells(new ExcelMergeParameters
+ {
+ CellFromName = "A1",
+ CellToName = "C1"
+ });
+ uint rowIndex = 2;
+ foreach (var pc in info.ShopDocuments)
+ {
+ InsertCellInWorksheet(new ExcelCellParameters
+ {
+ ColumnName = "A",
+ RowIndex = rowIndex,
+ Text = pc.ShopName,
+ StyleInfo = ExcelStyleInfoType.Text
+ });
+ rowIndex++;
+ foreach (var (DocumentName, Count) in pc.Documents)
+ {
+ InsertCellInWorksheet(new ExcelCellParameters
+ {
+ ColumnName = "B",
+ RowIndex = rowIndex,
+ Text = DocumentName,
+ StyleInfo = ExcelStyleInfoType.TextWithBorder
+ });
+ InsertCellInWorksheet(new ExcelCellParameters
+ {
+ ColumnName = "C",
+ RowIndex = rowIndex,
+ Text = Count.ToString(),
+ StyleInfo = ExcelStyleInfoType.TextWithBorder
+ });
+ rowIndex++;
+ }
+ InsertCellInWorksheet(new ExcelCellParameters
+ {
+ ColumnName = "A",
+ RowIndex = rowIndex,
+ Text = "Итого",
+ StyleInfo = ExcelStyleInfoType.Text
+ });
+ InsertCellInWorksheet(new ExcelCellParameters
+ {
+ ColumnName = "C",
+ RowIndex = rowIndex,
+ Text = pc.Count.ToString(),
+ StyleInfo = ExcelStyleInfoType.Text
+ });
+ rowIndex++;
+ }
+ SaveExcel(info);
+ }
+ ///
+ /// Создание excel-файла
+ ///
+ ///
+ protected abstract void CreateExcel(ExcelInfo info);
+ ///
+ /// Добавляем новую ячейку в лист
+ ///
+ ///
+ protected abstract void InsertCellInWorksheet(ExcelCellParameters
+ excelParams);
+ ///
+ /// Объединение ячеек
+ ///
+ ///
+ protected abstract void MergeCells(ExcelMergeParameters excelParams);
+ ///
+ /// Сохранение файла
+ ///
+ ///
+ protected abstract void SaveExcel(ExcelInfo info);
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/AbstractSaveToPdf.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/AbstractSaveToPdf.cs
new file mode 100644
index 0000000..da7d3d3
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/AbstractSaveToPdf.cs
@@ -0,0 +1,114 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperEnums;
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperModels;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage
+{
+ public abstract class AbstractSaveToPdf
+ {
+ public void CreateDoc(PdfInfo info)
+ {
+ CreatePdf(info);
+ CreateParagraph(new PdfParagraph
+ {
+ Text = info.Title,
+ Style = "NormalTitle",
+ ParagraphAlignment = PdfParagraphAlignmentType.Center
+ });
+ CreateParagraph(new PdfParagraph
+ {
+ Text = $"с { info.DateFrom.ToShortDateString() } по { info.DateTo.ToShortDateString() }", Style = "Normal",
+ ParagraphAlignment = PdfParagraphAlignmentType.Center
+ });
+ CreateTable(new List { "2cm", "3cm", "6cm", "3cm", "4cm" });
+ CreateRow(new PdfRowParameters
+ {
+ Texts = new List { "Номер", "Дата заказа", "Пакет документов", "Сумма", "Статус" },
+ Style = "NormalTitle",
+ ParagraphAlignment = PdfParagraphAlignmentType.Center
+ });
+ foreach (var order in info.Orders)
+ {
+ CreateRow(new PdfRowParameters
+ {
+ Texts = new List { order.Id.ToString(),
+order.DateCreate.ToShortDateString(), order.DocumentName, order.Sum.ToString(), order.Status },
+ Style = "Normal",
+ ParagraphAlignment = PdfParagraphAlignmentType.Left
+ });
+ }
+ CreateParagraph(new PdfParagraph
+ {
+ Text = $"Итого: {info.Orders.Sum(x => x.Sum)}\t",
+ Style = "Normal",
+ ParagraphAlignment =
+ PdfParagraphAlignmentType.Rigth
+ });
+ SavePdf(info);
+ }
+ public void CreateReportDateDoc(PdfInfo info)
+ {
+ CreatePdf(info);
+ CreateParagraph(new PdfParagraph
+ {
+ Text = info.Title,
+ Style = "NormalTitle",
+ ParagraphAlignment = PdfParagraphAlignmentType.Center
+ });
+ CreateTable(new List { "3cm", "3cm", "7cm" });
+ CreateRow(new PdfRowParameters
+ {
+ Texts = new List { "Дата", "Количество", "Сумма" },
+ Style = "NormalTitle",
+ ParagraphAlignment = PdfParagraphAlignmentType.Center
+ });
+ foreach (var order in info.DateOrders)
+ {
+ CreateRow(new PdfRowParameters
+ {
+ Texts = new List { order.DateCreate.ToShortDateString(), order.CountOrders.ToString(), order.SumOrders.ToString() },
+ Style = "Normal",
+ ParagraphAlignment = PdfParagraphAlignmentType.Left
+ });
+ }
+ CreateParagraph(new PdfParagraph
+ {
+ Text = $"Итого: {info.DateOrders.Sum(x => x.SumOrders)}\t",
+ Style = "Normal",
+ ParagraphAlignment = PdfParagraphAlignmentType.Center
+ });
+ SavePdf(info);
+ }
+ ///
+ /// Создание doc-файла
+ ///
+ ///
+ protected abstract void CreatePdf(PdfInfo info);
+ ///
+ /// Создание параграфа с текстом
+ ///
+ ///
+ ///
+ protected abstract void CreateParagraph(PdfParagraph paragraph);
+ ///
+ /// Создание таблицы
+ ///
+ ///
+ ///
+ protected abstract void CreateTable(List columns);
+ ///
+ /// Создание и заполнение строки
+ ///
+ ///
+ protected abstract void CreateRow(PdfRowParameters rowParameters);
+ ///
+ /// Сохранение файла
+ ///
+ ///
+ protected abstract void SavePdf(PdfInfo info);
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/AbstractSaveToWord.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/AbstractSaveToWord.cs
new file mode 100644
index 0000000..455456f
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/AbstractSaveToWord.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperModels;
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperEnums;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage
+{
+ public abstract class AbstractSaveToWord
+ {
+ public void CreateDoc(WordInfo info)
+ {
+ CreateWord(info);
+ CreateParagraph(new WordParagraph
+ {
+ Texts = new List<(string, WordTextProperties)> { (info.Title, new WordTextProperties { Bold = true, Size = "24", }) },
+ TextProperties = new WordTextProperties
+ {
+ Size = "24",
+ JustificationType = WordJustificationType.Center
+ }
+ });
+ foreach (var document in info.Documents)
+ {
+ CreateParagraph(new WordParagraph
+ {
+ Texts = new List<(string, WordTextProperties)> {
+ (document.DocumentName + " - ", new WordTextProperties { Size = "24", Bold = true}),
+ (document.Price.ToString(), new WordTextProperties { Size = "24", })
+ },
+ TextProperties = new WordTextProperties
+ {
+ Size = "24",
+ JustificationType = WordJustificationType.Both
+ }
+ });
+ }
+ SaveWord(info);
+ }
+ public void CreateTableDoc(WordInfo wordInfo)
+ {
+ CreateWord(wordInfo);
+ var list = new List();
+ foreach (var shop in wordInfo.Shops)
+ {
+ list.Add(shop.ShopName);
+ list.Add(shop.Address);
+ list.Add(shop.OpeningDate.ToString());
+ }
+ var wordTable = new WordTable
+ {
+ Headers = new List {
+ "Название",
+ "Адрес",
+ "Дата открытия"},
+ Texts = list
+ };
+ CreateTable(wordTable);
+ SaveWord(wordInfo);
+ }
+ ///
+ /// Создание doc-файла
+ ///
+ ///
+ protected abstract void CreateWord(WordInfo info);
+ ///
+ /// Создание абзаца с текстом
+ ///
+ ///
+ ///
+ protected abstract void CreateParagraph(WordParagraph paragraph);
+ ///
+ /// Сохранение файла
+ ///
+ ///
+ protected abstract void SaveWord(WordInfo info);
+ protected abstract void CreateTable(WordTable info);
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperEnums/ExcelStyleInfoType.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperEnums/ExcelStyleInfoType.cs
new file mode 100644
index 0000000..16049e3
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperEnums/ExcelStyleInfoType.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage.HelperEnums
+{
+ public enum ExcelStyleInfoType
+ {
+ Title,
+ Text,
+ TextWithBorder
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperEnums/PdfParagraphAlignmentType.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperEnums/PdfParagraphAlignmentType.cs
new file mode 100644
index 0000000..ad992b9
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperEnums/PdfParagraphAlignmentType.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage.HelperEnums
+{
+ public enum PdfParagraphAlignmentType
+ {
+ Center,
+ Left,
+ Rigth
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperEnums/WordJustificationType.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperEnums/WordJustificationType.cs
new file mode 100644
index 0000000..8320c56
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperEnums/WordJustificationType.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage.HelperEnums
+{
+ public enum WordJustificationType
+ {
+ Center,
+ Both
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/ExcelCellParameters.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/ExcelCellParameters.cs
new file mode 100644
index 0000000..2b1e36b
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/ExcelCellParameters.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperEnums;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage.HelperModels
+{
+ public class ExcelCellParameters
+ {
+ public string ColumnName { get; set; } = string.Empty;
+ public uint RowIndex { get; set; }
+ public string Text { get; set; } = string.Empty;
+ public string CellReference => $"{ColumnName}{RowIndex}";
+ public ExcelStyleInfoType StyleInfo { get; set; }
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs
new file mode 100644
index 0000000..87f9440
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using AbstractLawFirmContracts.ViewModels;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage.HelperModels
+{
+ public class ExcelInfo
+ {
+ public string FileName { get; set; } = string.Empty;
+ public string Title { get; set; } = string.Empty;
+ public List DocumentComponents
+ {
+ get;
+ set;
+ } = new();
+ public List ShopDocuments
+ {
+ get;
+ set;
+ } = new();
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/ExcelMergeParameters.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/ExcelMergeParameters.cs
new file mode 100644
index 0000000..7a5d2cc
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/ExcelMergeParameters.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage.HelperModels
+{
+ public class ExcelMergeParameters
+ {
+ public string CellFromName { get; set; } = string.Empty;
+ public string CellToName { get; set; } = string.Empty;
+ public string Merge => $"{CellFromName}:{CellToName}";
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs
new file mode 100644
index 0000000..5434a16
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs
@@ -0,0 +1,19 @@
+using AbstractLawFirmContracts.ViewModels;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage.HelperModels
+{
+ public class PdfInfo
+ {
+ public string FileName { get; set; } = string.Empty;
+ public string Title { get; set; } = string.Empty;
+ public DateTime DateFrom { get; set; }
+ public DateTime DateTo { get; set; }
+ public List Orders { get; set; } = new();
+ public List DateOrders { get; set; } = new();
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/PdfParagraph.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/PdfParagraph.cs
new file mode 100644
index 0000000..da0bc46
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/PdfParagraph.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperEnums;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage.HelperModels
+{
+ public class PdfParagraph
+ {
+ public string Text { get; set; } = string.Empty;
+ public string Style { get; set; } = string.Empty;
+ public PdfParagraphAlignmentType ParagraphAlignment { get; set; }
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/PdfRowParameters.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/PdfRowParameters.cs
new file mode 100644
index 0000000..7d2d925
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/PdfRowParameters.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperEnums;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage.HelperModels
+{
+ public class PdfRowParameters
+ {
+ public List Texts { get; set; } = new();
+ public string Style { get; set; } = string.Empty;
+ public PdfParagraphAlignmentType ParagraphAlignment { get; set; }
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/WordInfo.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/WordInfo.cs
new file mode 100644
index 0000000..23de53d
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/WordInfo.cs
@@ -0,0 +1,17 @@
+using AbstractLawFirmContracts.ViewModels;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage.HelperModels
+{
+ public class WordInfo
+ {
+ public string FileName { get; set; } = string.Empty;
+ public string Title { get; set; } = string.Empty;
+ public List Documents { get; set; } = new();
+ public List Shops { get; set; } = new();
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/WordParagraph.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/WordParagraph.cs
new file mode 100644
index 0000000..2c13a95
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/WordParagraph.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage.HelperModels
+{
+ public class WordParagraph
+ {
+ public List<(string, WordTextProperties)> Texts { get; set; } = new();
+ public WordTextProperties? TextProperties { get; set; }
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/WordTable.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/WordTable.cs
new file mode 100644
index 0000000..ab44f51
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/WordTable.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage.HelperModels
+{
+ public class WordTable
+ {
+ public List Headers { get; set; } = new();
+ public List Texts { get; set; } = new();
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/WordTextProperties.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/WordTextProperties.cs
new file mode 100644
index 0000000..08c3674
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/HelperModels/WordTextProperties.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperEnums;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage.HelperModels
+{
+ public class WordTextProperties
+ {
+ public string Size { get; set; } = string.Empty;
+ public bool Bold { get; set; }
+ public WordJustificationType JustificationType { get; set; }
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/Implements/SaveToExcel.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/Implements/SaveToExcel.cs
new file mode 100644
index 0000000..947a3ba
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/Implements/SaveToExcel.cs
@@ -0,0 +1,356 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using DocumentFormat.OpenXml.Office2010.Excel;
+using DocumentFormat.OpenXml.Office2013.Excel;
+using DocumentFormat.OpenXml;
+using DocumentFormat.OpenXml.Packaging;
+using DocumentFormat.OpenXml.Spreadsheet;
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperModels;
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperEnums;
+
+
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage.Implements
+{
+ public class SaveToExcel : AbstractSaveToExcel
+ {
+ private SpreadsheetDocument? _spreadsheetDocument;
+ private SharedStringTablePart? _shareStringPart;
+ private Worksheet? _worksheet;
+ ///
+ /// Настройка стилей для файла
+ ///
+ ///
+ private static void CreateStyles(WorkbookPart workbookpart)
+ {
+ var sp = workbookpart.AddNewPart();
+ sp.Stylesheet = new Stylesheet();
+ var fonts = new Fonts() { Count = 2U, KnownFonts = true };
+ var fontUsual = new Font();
+ fontUsual.Append(new FontSize() { Val = 12D });
+ fontUsual.Append(new DocumentFormat.OpenXml.Office2010.Excel.Color()
+ { Theme = 1U });
+ fontUsual.Append(new FontName() { Val = "Times New Roman" });
+ fontUsual.Append(new FontFamilyNumbering() { Val = 2 });
+ fontUsual.Append(new FontScheme() { Val = FontSchemeValues.Minor });
+ var fontTitle = new Font();
+ fontTitle.Append(new Bold());
+ fontTitle.Append(new FontSize() { Val = 14D });
+ fontTitle.Append(new DocumentFormat.OpenXml.Office2010.Excel.Color()
+ { Theme = 1U });
+ fontTitle.Append(new FontName() { Val = "Times New Roman" });
+ fontTitle.Append(new FontFamilyNumbering() { Val = 2 });
+ fontTitle.Append(new FontScheme() { Val = FontSchemeValues.Minor });
+ fonts.Append(fontUsual);
+ fonts.Append(fontTitle);
+ var fills = new Fills() { Count = 2U };
+ var fill1 = new Fill();
+ fill1.Append(new PatternFill() { PatternType = PatternValues.None });
+ var fill2 = new Fill();
+ fill2.Append(new PatternFill()
+ {
+ PatternType = PatternValues.Gray125
+ });
+ fills.Append(fill1);
+ fills.Append(fill2);
+ var borders = new Borders() { Count = 2U };
+ var borderNoBorder = new Border();
+ borderNoBorder.Append(new LeftBorder());
+ borderNoBorder.Append(new RightBorder());
+ borderNoBorder.Append(new TopBorder());
+ borderNoBorder.Append(new BottomBorder());
+ borderNoBorder.Append(new DiagonalBorder());
+ var borderThin = new Border();
+ var leftBorder = new LeftBorder() { Style = BorderStyleValues.Thin };
+ leftBorder.Append(new DocumentFormat.OpenXml.Office2010.Excel.Color()
+ { Indexed = 64U });
+ var rightBorder = new RightBorder()
+ {
+ Style = BorderStyleValues.Thin
+ };
+ rightBorder.Append(new
+ DocumentFormat.OpenXml.Office2010.Excel.Color()
+ { Indexed = 64U });
+ var topBorder = new TopBorder() { Style = BorderStyleValues.Thin };
+ topBorder.Append(new DocumentFormat.OpenXml.Office2010.Excel.Color()
+ { Indexed = 64U });
+ var bottomBorder = new BottomBorder()
+ {
+ Style =
+ BorderStyleValues.Thin
+ };
+ bottomBorder.Append(new
+ DocumentFormat.OpenXml.Office2010.Excel.Color()
+ { Indexed = 64U });
+ borderThin.Append(leftBorder);
+ borderThin.Append(rightBorder);
+ borderThin.Append(topBorder);
+ borderThin.Append(bottomBorder);
+ borderThin.Append(new DiagonalBorder());
+ borders.Append(borderNoBorder);
+ borders.Append(borderThin);
+ var cellStyleFormats = new CellStyleFormats() { Count = 1U };
+ var cellFormatStyle = new CellFormat()
+ {
+ NumberFormatId = 0U,
+ FontId
+ = 0U,
+ FillId = 0U,
+ BorderId = 0U
+ };
+ cellStyleFormats.Append(cellFormatStyle);
+ var cellFormats = new CellFormats() { Count = 3U };
+ var cellFormatFont = new CellFormat()
+ {
+ NumberFormatId = 0U,
+ FontId = 0U,
+ FillId = 0U,
+ BorderId = 0U,
+ FormatId = 0U,
+ ApplyFont = true
+ };
+ var cellFormatFontAndBorder = new CellFormat()
+ {
+ NumberFormatId = 0U,
+ FontId = 0U,
+ FillId = 0U,
+ BorderId = 1U,
+ FormatId = 0U,
+ ApplyFont = true,
+ ApplyBorder = true
+ };
+ var cellFormatTitle = new CellFormat()
+ {
+ NumberFormatId = 0U,
+ FontId
+ = 1U,
+ FillId = 0U,
+ BorderId = 0U,
+ FormatId = 0U,
+ Alignment = new Alignment()
+ {
+ Vertical = VerticalAlignmentValues.Center,
+ WrapText = true,
+ Horizontal =
+ HorizontalAlignmentValues.Center
+ },
+ ApplyFont = true
+ };
+ cellFormats.Append(cellFormatFont);
+ cellFormats.Append(cellFormatFontAndBorder);
+ cellFormats.Append(cellFormatTitle);
+ var cellStyles = new CellStyles() { Count = 1U };
+ cellStyles.Append(new CellStyle()
+ {
+ Name = "Normal",
+ FormatId = 0U,
+ BuiltinId = 0U
+ });
+ var differentialFormats = new
+ DocumentFormat.OpenXml.Office2013.Excel.DifferentialFormats()
+ { Count = 0U };
+
+ var tableStyles = new TableStyles()
+ {
+ Count = 0U,
+ DefaultTableStyle =
+ "TableStyleMedium2",
+ DefaultPivotStyle = "PivotStyleLight16"
+ };
+ var stylesheetExtensionList = new StylesheetExtensionList();
+ var stylesheetExtension1 = new StylesheetExtension()
+ {
+ Uri =
+ "{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}"
+ };
+ stylesheetExtension1.AddNamespaceDeclaration("x14",
+ "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
+ stylesheetExtension1.Append(new SlicerStyles()
+ {
+ DefaultSlicerStyle =
+ "SlicerStyleLight1"
+ });
+ var stylesheetExtension2 = new StylesheetExtension()
+ {
+ Uri =
+ "{9260A510-F301-46a8-8635-F512D64BE5F5}"
+ };
+ stylesheetExtension2.AddNamespaceDeclaration("x15",
+ "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main");
+ stylesheetExtension2.Append(new TimelineStyles()
+ {
+ DefaultTimelineStyle = "TimeSlicerStyleLight1"
+ });
+ stylesheetExtensionList.Append(stylesheetExtension1);
+ stylesheetExtensionList.Append(stylesheetExtension2);
+ sp.Stylesheet.Append(fonts);
+ sp.Stylesheet.Append(fills);
+ sp.Stylesheet.Append(borders);
+ sp.Stylesheet.Append(cellStyleFormats);
+ sp.Stylesheet.Append(cellFormats);
+ sp.Stylesheet.Append(cellStyles);
+ sp.Stylesheet.Append(differentialFormats);
+ sp.Stylesheet.Append(tableStyles);
+ sp.Stylesheet.Append(stylesheetExtensionList);
+ }
+ ///
+ /// Получение номера стиля из типа
+ ///
+ ///
+ ///
+ private static uint GetStyleValue(ExcelStyleInfoType styleInfo)
+ {
+ return styleInfo switch
+ {
+ ExcelStyleInfoType.Title => 2U,
+ ExcelStyleInfoType.TextWithBorder => 1U,
+ ExcelStyleInfoType.Text => 0U,
+ _ => 0U,
+ };
+ }
+ protected override void CreateExcel(ExcelInfo info)
+ {
+ _spreadsheetDocument = SpreadsheetDocument.Create(info.FileName,
+ SpreadsheetDocumentType.Workbook);
+ // Создаем книгу (в ней хранятся листы)
+ var workbookpart = _spreadsheetDocument.AddWorkbookPart();
+ workbookpart.Workbook = new Workbook();
+ CreateStyles(workbookpart);
+ // Получаем/создаем хранилище текстов для книги
+ _shareStringPart =
+ _spreadsheetDocument.WorkbookPart!.GetPartsOfType().Any()
+ ?
+ _spreadsheetDocument.WorkbookPart.GetPartsOfType().First()
+ :
+ _spreadsheetDocument.WorkbookPart.AddNewPart();
+ // Создаем SharedStringTable, если его нет
+ if (_shareStringPart.SharedStringTable == null)
+ {
+ _shareStringPart.SharedStringTable = new SharedStringTable();
+ }
+ // Создаем лист в книгу
+ var worksheetPart = workbookpart.AddNewPart();
+ worksheetPart.Worksheet = new Worksheet(new SheetData());
+ // Добавляем лист в книгу
+ var sheets =
+ _spreadsheetDocument.WorkbookPart.Workbook.AppendChild(new Sheets());
+ var sheet = new Sheet()
+ {
+ Id =
+ _spreadsheetDocument.WorkbookPart.GetIdOfPart(worksheetPart),
+ SheetId = 1,
+ Name = "Лист"
+ };
+ sheets.Append(sheet);
+ _worksheet = worksheetPart.Worksheet;
+ }
+ protected override void InsertCellInWorksheet(ExcelCellParameters
+ excelParams)
+ {
+ if (_worksheet == null || _shareStringPart == null)
+ {
+ return;
+ }
+ var sheetData = _worksheet.GetFirstChild();
+ if (sheetData == null)
+ {
+ return;
+ }
+ // Ищем строку, либо добавляем ее
+ Row row;
+ if (sheetData.Elements().Where(r => r.RowIndex! ==
+ excelParams.RowIndex).Any())
+ {
+ row = sheetData.Elements().Where(r => r.RowIndex! ==
+ excelParams.RowIndex).First();
+ }
+ else
+ {
+ row = new Row() { RowIndex = excelParams.RowIndex };
+ sheetData.Append(row);
+ }
+ // Ищем нужную ячейку
+ Cell cell;
+ if (row.Elements().Where(c => c.CellReference!.Value ==
+ excelParams.CellReference).Any())
+ {
+ cell = row.Elements().Where(c => c.CellReference!.Value ==
+ excelParams.CellReference).First();
+ }
+ else
+ {
+ // Все ячейки должны быть последовательно друг за другом расположены
+ // нужно определить, после какой вставлять
+ Cell? refCell = null;
+ foreach (Cell rowCell in row.Elements())
+ {
+ if (string.Compare(rowCell.CellReference!.Value,
+ excelParams.CellReference, true) > 0)
+ {
+ refCell = rowCell;
+ break;
+ }
+ }
+ var newCell = new Cell()
+ {
+ CellReference =
+ excelParams.CellReference
+ };
+ row.InsertBefore(newCell, refCell);
+ cell = newCell;
+ }
+ // вставляем новый текст
+ _shareStringPart.SharedStringTable.AppendChild(new
+ SharedStringItem(new Text(excelParams.Text)));
+ _shareStringPart.SharedStringTable.Save();
+ cell.CellValue = new
+ CellValue((_shareStringPart.SharedStringTable.Elements().Count(
+ ) - 1).ToString());
+ cell.DataType = new EnumValue(CellValues.SharedString);
+ cell.StyleIndex = GetStyleValue(excelParams.StyleInfo);
+ }
+ protected override void MergeCells(ExcelMergeParameters excelParams)
+ {
+ if (_worksheet == null)
+ {
+ return;
+ }
+ MergeCells mergeCells;
+ if (_worksheet.Elements().Any())
+ {
+ mergeCells = _worksheet.Elements().First();
+ }
+ else
+ {
+ mergeCells = new MergeCells();
+ if (_worksheet.Elements().Any())
+ {
+ _worksheet.InsertAfter(mergeCells,
+ _worksheet.Elements().First());
+ }
+ else
+ {
+ _worksheet.InsertAfter(mergeCells,
+ _worksheet.Elements().First());
+ }
+ }
+ var mergeCell = new MergeCell()
+ {
+ Reference = new StringValue(excelParams.Merge)
+ };
+ mergeCells.Append(mergeCell);
+ }
+ protected override void SaveExcel(ExcelInfo info)
+ {
+ if (_spreadsheetDocument == null)
+ {
+ return;
+ }
+ _spreadsheetDocument.WorkbookPart!.Workbook.Save();
+ _spreadsheetDocument.Dispose();
+ }
+
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/Implements/SaveToPdf.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/Implements/SaveToPdf.cs
new file mode 100644
index 0000000..3f2f752
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/Implements/SaveToPdf.cs
@@ -0,0 +1,107 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MigraDoc.DocumentObjectModel;
+using MigraDoc.Rendering;
+using MigraDoc.DocumentObjectModel.Tables;
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperModels;
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperEnums;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage.Implements
+{
+ public class SaveToPdf : AbstractSaveToPdf
+ {
+ private Document? _document;
+ private Section? _section;
+ private Table? _table;
+ private static ParagraphAlignment
+ GetParagraphAlignment(PdfParagraphAlignmentType type)
+ {
+ return type switch
+ {
+ PdfParagraphAlignmentType.Center => ParagraphAlignment.Center,
+ PdfParagraphAlignmentType.Left => ParagraphAlignment.Left,
+ PdfParagraphAlignmentType.Rigth => ParagraphAlignment.Right,
+ _ => ParagraphAlignment.Justify,
+ };
+ }
+ ///
+ /// Создание стилей для документа
+ ///
+ ///
+ private static void DefineStyles(Document document)
+ {
+ var style = document.Styles["Normal"];
+ style.Font.Name = "Times New Roman";
+ style.Font.Size = 14;
+ style = document.Styles.AddStyle("NormalTitle", "Normal");
+ style.Font.Bold = true;
+ }
+ protected override void CreatePdf(PdfInfo info)
+ {
+ _document = new Document();
+ DefineStyles(_document);
+ _section = _document.AddSection();
+ }
+ protected override void CreateParagraph(PdfParagraph pdfParagraph)
+ {
+ if (_section == null)
+ {
+ return;
+ }
+ var paragraph = _section.AddParagraph(pdfParagraph.Text);
+ paragraph.Format.SpaceAfter = "1cm";
+ paragraph.Format.Alignment =
+ GetParagraphAlignment(pdfParagraph.ParagraphAlignment);
+ paragraph.Style = pdfParagraph.Style;
+ }
+ protected override void CreateTable(List columns)
+ {
+ if (_document == null)
+ {
+ return;
+ }
+ _table = _document.LastSection.AddTable();
+ foreach (var elem in columns)
+ {
+ _table.AddColumn(elem);
+ }
+ }
+ protected override void CreateRow(PdfRowParameters rowParameters)
+ {
+ if (_table == null)
+ {
+ return;
+ }
+ var row = _table.AddRow();
+ for (int i = 0; i < rowParameters.Texts.Count; ++i)
+ {
+ row.Cells[i].AddParagraph(rowParameters.Texts[i]);
+ if (!string.IsNullOrEmpty(rowParameters.Style))
+ {
+ row.Cells[i].Style = rowParameters.Style;
+ }
+ Unit borderWidth = 0.5;
+ row.Cells[i].Borders.Left.Width = borderWidth;
+ row.Cells[i].Borders.Right.Width = borderWidth;
+ row.Cells[i].Borders.Top.Width = borderWidth;
+ row.Cells[i].Borders.Bottom.Width = borderWidth;
+ row.Cells[i].Format.Alignment =
+ GetParagraphAlignment(rowParameters.ParagraphAlignment);
+ row.Cells[i].VerticalAlignment = VerticalAlignment.Center;
+ }
+ }
+ protected override void SavePdf(PdfInfo info)
+ {
+ var renderer = new PdfDocumentRenderer(true)
+ {
+ Document = _document
+ };
+ renderer.RenderDocument();
+ renderer.PdfDocument.Save(info.FileName);
+ }
+
+ }
+}
diff --git a/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/Implements/SaveToWord.cs b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/Implements/SaveToWord.cs
new file mode 100644
index 0000000..1e39ada
--- /dev/null
+++ b/LawFirm/AbstractLawFirmBusinessLogic/OfficePackage/Implements/SaveToWord.cs
@@ -0,0 +1,210 @@
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperEnums;
+using AbstractLawFirmBusinessLogic.OfficePackage.HelperModels;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using DocumentFormat.OpenXml;
+using DocumentFormat.OpenXml.Packaging;
+using DocumentFormat.OpenXml.Wordprocessing;
+
+namespace AbstractLawFirmBusinessLogic.OfficePackage.Implements
+{
+ public class SaveToWord : AbstractSaveToWord
+ {
+ private WordprocessingDocument? _wordDocument;
+ private Body? _docBody;
+ ///
+ /// Получение типа выравнивания
+ ///
+ ///
+ ///
+ private static JustificationValues
+ GetJustificationValues(WordJustificationType type)
+ {
+ return type switch
+ {
+ WordJustificationType.Both => JustificationValues.Both,
+ WordJustificationType.Center => JustificationValues.Center,
+ _ => JustificationValues.Left,
+ };
+ }
+ ///
+ /// Настройки страницы
+ ///
+ ///
+ private static SectionProperties CreateSectionProperties()
+ {
+ var properties = new SectionProperties();
+ var pageSize = new PageSize
+ {
+ Orient = PageOrientationValues.Portrait
+ };
+ properties.AppendChild(pageSize);
+ return properties;
+ }
+ ///
+ /// Задание форматирования для абзаца
+ ///
+ ///
+ ///
+ private static ParagraphProperties?
+ CreateParagraphProperties(WordTextProperties? paragraphProperties)
+ {
+ if (paragraphProperties == null)
+ {
+ return null;
+ }
+ var properties = new ParagraphProperties();
+ properties.AppendChild(new Justification()
+ {
+ Val =
+ GetJustificationValues(paragraphProperties.JustificationType)
+ });
+ properties.AppendChild(new SpacingBetweenLines
+ {
+ LineRule = LineSpacingRuleValues.Auto
+ });
+ properties.AppendChild(new Indentation());
+ var paragraphMarkRunProperties = new ParagraphMarkRunProperties();
+ if (!string.IsNullOrEmpty(paragraphProperties.Size))
+ {
+ paragraphMarkRunProperties.AppendChild(new FontSize
+ {
+ Val =
+ paragraphProperties.Size
+ });
+ }
+ properties.AppendChild(paragraphMarkRunProperties);
+ return properties;
+ }
+ protected override void CreateWord(WordInfo info)
+ {
+ _wordDocument = WordprocessingDocument.Create(info.FileName,
+ WordprocessingDocumentType.Document);
+ MainDocumentPart mainPart = _wordDocument.AddMainDocumentPart();
+ mainPart.Document = new Document();
+ _docBody = mainPart.Document.AppendChild(new Body());
+ }
+ protected override void CreateParagraph(WordParagraph paragraph)
+ {
+ if (_docBody == null || paragraph == null)
+ {
+ return;
+ }
+ var docParagraph = new Paragraph();
+
+ docParagraph.AppendChild(CreateParagraphProperties(paragraph.TextProperties));
+ foreach (var run in paragraph.Texts)
+ {
+ var docRun = new Run();
+ var properties = new RunProperties();
+ properties.AppendChild(new FontSize { Val = run.Item2.Size });
+ if (run.Item2.Bold)
+ {
+ properties.AppendChild(new Bold());
+ }
+ docRun.AppendChild(properties);
+ docRun.AppendChild(new Text
+ {
+ Text = run.Item1,
+ Space =
+ SpaceProcessingModeValues.Preserve
+ });
+ docParagraph.AppendChild(docRun);
+ }
+ _docBody.AppendChild(docParagraph);
+ }
+ protected override void SaveWord(WordInfo info)
+ {
+ if (_docBody == null || _wordDocument == null)
+ {
+ return;
+ }
+ _docBody.AppendChild(CreateSectionProperties());
+ _wordDocument.MainDocumentPart!.Document.Save();
+ _wordDocument.Dispose();
+ }
+ protected override void CreateTable(WordTable table)
+ {
+ if (_docBody == null || table == null)
+ {
+ return;
+ }
+ Table tab = new Table();
+ TableProperties props = new TableProperties(
+ new TableBorders(
+ new TopBorder
+ {
+ Val = new EnumValue(BorderValues.Single),
+ Size = 12
+ },
+ new BottomBorder
+ {
+ Val = new EnumValue(BorderValues.Single),
+ Size = 12
+ },
+ new LeftBorder
+ {
+ Val = new EnumValue(BorderValues.Single),
+ Size = 12
+ },
+ new RightBorder
+ {
+ Val = new EnumValue(BorderValues.Single),
+ Size = 12
+ },
+ new InsideHorizontalBorder
+ {
+ Val = new EnumValue(BorderValues.Single),
+ Size = 12
+ },
+ new InsideVerticalBorder
+ {
+ Val = new EnumValue(BorderValues.Single),
+ Size = 12
+ }
+ )
+ );
+ tab.AppendChild(props);
+ TableGrid tableGrid = new TableGrid();
+ for (int i = 0; i < table.Headers.Count; i++)
+ {
+ tableGrid.AppendChild(new GridColumn());
+ }
+ tab.AppendChild(tableGrid);
+ TableRow tableRow = new TableRow();
+ foreach (var text in table.Headers)
+ {
+ tableRow.AppendChild(CreateTableCell(text));
+ }
+ tab.AppendChild(tableRow);
+ int height = table.Texts.Count / table.Headers.Count;
+ int width = table.Headers.Count;
+ for (int i = 0; i < height; i++)
+ {
+ tableRow = new TableRow();
+ for (int j = 0; j < width; j++)
+ {
+ var element = table.Texts[i * table.Headers.Count + j];
+ tableRow.AppendChild(CreateTableCell(element));
+ }
+ tab.AppendChild(tableRow);
+ }
+
+ _docBody.AppendChild(tab);
+
+ }
+ private TableCell CreateTableCell(string element)
+ {
+ var tableParagraph = new Paragraph();
+ var run = new Run();
+ run.AppendChild(new Text { Text = element });
+ tableParagraph.AppendChild(run);
+ var tableCell = new TableCell();
+ tableCell.AppendChild(tableParagraph);
+ return tableCell;
+ }
+ }
+}
diff --git a/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/BindingModels/ReportBindingModel.cs b/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/BindingModels/ReportBindingModel.cs
new file mode 100644
index 0000000..ab0ab39
--- /dev/null
+++ b/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/BindingModels/ReportBindingModel.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AbstractLawFirmContracts.BindingModels
+{
+ public class ReportBindingModel
+ {
+ public string FileName { get; set; } = string.Empty;
+ public DateTime? DateFrom { get; set; }
+ public DateTime? DateTo { get; set; }
+ }
+}
diff --git a/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/BusinessLogicsContracts/IReportLogic.cs b/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/BusinessLogicsContracts/IReportLogic.cs
new file mode 100644
index 0000000..18188f2
--- /dev/null
+++ b/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/BusinessLogicsContracts/IReportLogic.cs
@@ -0,0 +1,45 @@
+using AbstractLawFirmContracts.BindingModels;
+using AbstractLawFirmContracts.ViewModels;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AbstractLawFirmContracts.BusinessLogicsContracts
+{
+ public interface IReportLogic
+ {
+ ///
+ /// Получение списка компонент с указанием, в каких изделиях используются
+ ///
+ ///
+ List GetDocumentComponent();
+ ///
+ /// Получение списка заказов за определенный период
+ ///
+ ///
+ ///
+ List GetOrders(ReportBindingModel model);
+ ///
+ /// Сохранение компонент в файл-Word
+ ///
+ ///
+ void SaveDocumentsToWordFile(ReportBindingModel model);
+ ///
+ /// Сохранение компонент с указаеним продуктов в файл-Excel
+ ///
+ ///
+ void SaveDocumentComponentToExcelFile(ReportBindingModel model);
+ ///
+ /// Сохранение заказов в файл-Pdf
+ ///
+ ///
+ void SaveOrdersToPdfFile(ReportBindingModel model);
+ List GetShopDocuments();
+ List GetDateOrders();
+ void SaveShopsToWordFile(ReportBindingModel model);
+ void SaveShopDocumentsToExcelFile(ReportBindingModel model);
+ void SaveDateOrdersToPdfFile(ReportBindingModel model);
+ }
+}
diff --git a/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/SearchModels/OrderSearchModel.cs b/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/SearchModels/OrderSearchModel.cs
index d568495..02604d4 100644
--- a/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/SearchModels/OrderSearchModel.cs
+++ b/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/SearchModels/OrderSearchModel.cs
@@ -9,5 +9,7 @@ namespace AbstractLawFirmContracts.SearchModels
public class OrderSearchModel
{
public int? Id { get; set; }
+ public DateTime? DateFrom { get; set; }
+ public DateTime? DateTo { get; set; }
}
}
diff --git a/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/ViewModels/ReportDateOrdersViewModel.cs b/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/ViewModels/ReportDateOrdersViewModel.cs
new file mode 100644
index 0000000..5a8c16d
--- /dev/null
+++ b/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/ViewModels/ReportDateOrdersViewModel.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AbstractLawFirmContracts.ViewModels
+{
+ public class ReportDateOrdersViewModel
+ {
+ public DateTime DateCreate { get; set; }
+ public int CountOrders { get; set; }
+ public double SumOrders { get; set; }
+ }
+}
diff --git a/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/ViewModels/ReportDocumentComponentViewModel.cs b/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/ViewModels/ReportDocumentComponentViewModel.cs
new file mode 100644
index 0000000..4835f9f
--- /dev/null
+++ b/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/ViewModels/ReportDocumentComponentViewModel.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AbstractLawFirmContracts.ViewModels
+{
+ public class ReportDocumentComponentViewModel
+ {
+ public string DocumentName { get; set; } = string.Empty;
+ public int TotalCount { get; set; }
+ public List<(string Component, int Count)> Components { get; set; } = new();
+ }
+}
diff --git a/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/ViewModels/ReportOrdersViewModel.cs b/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/ViewModels/ReportOrdersViewModel.cs
new file mode 100644
index 0000000..c5f86cb
--- /dev/null
+++ b/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/ViewModels/ReportOrdersViewModel.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AbstractLawFirmContracts.ViewModels
+{
+ public class ReportOrdersViewModel
+ {
+ public int Id { get; set; }
+ public DateTime DateCreate { get; set; }
+ public string DocumentName { get; set; } = string.Empty;
+ public double Sum { get; set; }
+ public String Status { get; set; } = string.Empty;
+ }
+}
diff --git a/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/ViewModels/ReportShopDocumentsViewModel.cs b/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/ViewModels/ReportShopDocumentsViewModel.cs
new file mode 100644
index 0000000..380a709
--- /dev/null
+++ b/LawFirm/AbstractLawFirmContracts/AbstractLawFirmContracts/ViewModels/ReportShopDocumentsViewModel.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace AbstractLawFirmContracts.ViewModels
+{
+ public class ReportShopDocumentsViewModel
+ {
+ public string ShopName { get; set; } = string.Empty;
+ public int Count { get; set; }
+ public List> Documents { get; set; } = new();
+ }
+}
diff --git a/LawFirm/AbstractLawFirmDatabaseImplement/Implements/OrderStorage.cs b/LawFirm/AbstractLawFirmDatabaseImplement/Implements/OrderStorage.cs
index 29e72b2..34fdd40 100644
--- a/LawFirm/AbstractLawFirmDatabaseImplement/Implements/OrderStorage.cs
+++ b/LawFirm/AbstractLawFirmDatabaseImplement/Implements/OrderStorage.cs
@@ -26,13 +26,13 @@ namespace AbstractLawFirmDatabaseImplement.Implements
public List GetFilteredList(OrderSearchModel model)
{
- if (!model.Id.HasValue)
+ if (!model.Id.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue)
{
return new();
}
using var context = new AbstractLawFirmDatabase();
return context.Orders
- .Where(x => x.Id == model.Id)
+ .Where(x => x.Id == model.Id || model.DateFrom <= x.DateCreate && x.DateCreate <= model.DateTo)
.Include(x => x.Document)
.Select(x => x.GetViewModel)
.ToList();
diff --git a/LawFirm/AbstractLawFirmFileImplement/Implements/OrderStorage.cs b/LawFirm/AbstractLawFirmFileImplement/Implements/OrderStorage.cs
index 5dc4b6c..ace8d47 100644
--- a/LawFirm/AbstractLawFirmFileImplement/Implements/OrderStorage.cs
+++ b/LawFirm/AbstractLawFirmFileImplement/Implements/OrderStorage.cs
@@ -31,11 +31,11 @@ namespace AbstractLawFirmFileImplement.Implements
public List GetFilteredList(OrderSearchModel model)
{
- if (!model.Id.HasValue)
+ if (!model.Id.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue)
{
return new();
}
- return source.Orders.Where(x => x.Id == model.Id).Select(x => GetViewModel(x)).ToList();
+ return source.Orders.Where(x => x.Id == model.Id || model.DateFrom <= x.DateCreate && x.DateCreate <= model.DateTo).Select(x => x.GetViewModel).ToList();
}
public List GetFullList()
diff --git a/LawFirm/AbstractLawFirmListImplement/Implements/OrderStorage.cs b/LawFirm/AbstractLawFirmListImplement/Implements/OrderStorage.cs
index 82a0ece..6d5d65c 100644
--- a/LawFirm/AbstractLawFirmListImplement/Implements/OrderStorage.cs
+++ b/LawFirm/AbstractLawFirmListImplement/Implements/OrderStorage.cs
@@ -37,7 +37,7 @@ namespace AbstractLawFirmListImplement.Implements
}
foreach (var order in _source.Orders)
{
- if (order.Id == model.Id)
+ if (order.Id == model.Id || model.DateFrom <= order.DateCreate && order.DateCreate <= model.DateTo)
{
result.Add(AccessDocumentStorage(order.GetViewModel));
}
diff --git a/LawFirm/LawFirmView/FormMain.Designer.cs b/LawFirm/LawFirmView/FormMain.Designer.cs
index 7af45c1..9ea8da7 100644
--- a/LawFirm/LawFirmView/FormMain.Designer.cs
+++ b/LawFirm/LawFirmView/FormMain.Designer.cs
@@ -33,6 +33,10 @@
this.компонентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.пакетыДокументовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.магазиныToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.отчётыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.списокПакетовДокументовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.компонентыПоПакетамДокументовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.списокЗаказовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.dataGridView = new System.Windows.Forms.DataGridView();
this.buttonCreateOrder = new System.Windows.Forms.Button();
this.buttonTakeOrderInWork = new System.Windows.Forms.Button();
@@ -41,6 +45,9 @@
this.buttonRef = new System.Windows.Forms.Button();
this.buttonSupplyShop = new System.Windows.Forms.Button();
this.buttonSellDocs = new System.Windows.Forms.Button();
+ this.списокМагазиновToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.загруженностьМагазиновToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.списокЗаказовПоДатамToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
this.SuspendLayout();
@@ -48,7 +55,8 @@
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.toolStripMenuItemCatalogs});
+ this.toolStripMenuItemCatalogs,
+ this.отчётыToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(910, 24);
@@ -86,6 +94,40 @@
this.магазиныToolStripMenuItem.Text = "Магазины";
this.магазиныToolStripMenuItem.Click += new System.EventHandler(this.магазиныToolStripMenuItem_Click);
//
+ // отчётыToolStripMenuItem
+ //
+ this.отчётыToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.списокПакетовДокументовToolStripMenuItem,
+ this.компонентыПоПакетамДокументовToolStripMenuItem,
+ this.списокЗаказовToolStripMenuItem,
+ this.списокМагазиновToolStripMenuItem,
+ this.загруженностьМагазиновToolStripMenuItem,
+ this.списокЗаказовПоДатамToolStripMenuItem});
+ this.отчётыToolStripMenuItem.Name = "отчётыToolStripMenuItem";
+ this.отчётыToolStripMenuItem.Size = new System.Drawing.Size(60, 20);
+ this.отчётыToolStripMenuItem.Text = "Отчёты";
+ //
+ // списокПакетовДокументовToolStripMenuItem
+ //
+ this.списокПакетовДокументовToolStripMenuItem.Name = "списокПакетовДокументовToolStripMenuItem";
+ this.списокПакетовДокументовToolStripMenuItem.Size = new System.Drawing.Size(278, 22);
+ this.списокПакетовДокументовToolStripMenuItem.Text = "Список пакетов документов";
+ this.списокПакетовДокументовToolStripMenuItem.Click += new System.EventHandler(this.списокПакетовДокументовToolStripMenuItem_Click);
+ //
+ // компонентыПоПакетамДокументовToolStripMenuItem
+ //
+ this.компонентыПоПакетамДокументовToolStripMenuItem.Name = "компонентыПоПакетамДокументовToolStripMenuItem";
+ this.компонентыПоПакетамДокументовToolStripMenuItem.Size = new System.Drawing.Size(278, 22);
+ this.компонентыПоПакетамДокументовToolStripMenuItem.Text = "Компоненты по пакетам документов";
+ this.компонентыПоПакетамДокументовToolStripMenuItem.Click += new System.EventHandler(this.компонентыПоПакетамДокументовToolStripMenuItem_Click);
+ //
+ // списокЗаказовToolStripMenuItem
+ //
+ this.списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem";
+ this.списокЗаказовToolStripMenuItem.Size = new System.Drawing.Size(278, 22);
+ this.списокЗаказовToolStripMenuItem.Text = "Список заказов";
+ this.списокЗаказовToolStripMenuItem.Click += new System.EventHandler(this.списокЗаказовToolStripMenuItem_Click);
+ //
// dataGridView
//
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
@@ -165,6 +207,27 @@
this.buttonSellDocs.UseVisualStyleBackColor = true;
this.buttonSellDocs.Click += new System.EventHandler(this.buttonSellDocs_Click);
//
+ // списокМагазиновToolStripMenuItem
+ //
+ this.списокМагазиновToolStripMenuItem.Name = "списокМагазиновToolStripMenuItem";
+ this.списокМагазиновToolStripMenuItem.Size = new System.Drawing.Size(278, 22);
+ this.списокМагазиновToolStripMenuItem.Text = "Список магазинов";
+ this.списокМагазиновToolStripMenuItem.Click += new System.EventHandler(this.списокМагазиновToolStripMenuItem_Click);
+ //
+ // загруженностьМагазиновToolStripMenuItem
+ //
+ this.загруженностьМагазиновToolStripMenuItem.Name = "загруженностьМагазиновToolStripMenuItem";
+ this.загруженностьМагазиновToolStripMenuItem.Size = new System.Drawing.Size(278, 22);
+ this.загруженностьМагазиновToolStripMenuItem.Text = "Загруженность магазинов";
+ this.загруженностьМагазиновToolStripMenuItem.Click += new System.EventHandler(this.загруженностьМагазиновToolStripMenuItem_Click);
+ //
+ // списокЗаказовПоДатамToolStripMenuItem
+ //
+ this.списокЗаказовПоДатамToolStripMenuItem.Name = "списокЗаказовПоДатамToolStripMenuItem";
+ this.списокЗаказовПоДатамToolStripMenuItem.Size = new System.Drawing.Size(278, 22);
+ this.списокЗаказовПоДатамToolStripMenuItem.Text = "Список заказов по датам";
+ this.списокЗаказовПоДатамToolStripMenuItem.Click += new System.EventHandler(this.списокЗаказовПоДатамToolStripMenuItem_Click);
+ //
// FormMain
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
@@ -203,8 +266,15 @@
private Button buttonOrderReady;
private Button buttonIssuedOrder;
private Button buttonRef;
+ private ToolStripMenuItem отчётыToolStripMenuItem;
+ private ToolStripMenuItem списокПакетовДокументовToolStripMenuItem;
+ private ToolStripMenuItem компонентыПоПакетамДокументовToolStripMenuItem;
+ private ToolStripMenuItem списокЗаказовToolStripMenuItem;
private ToolStripMenuItem магазиныToolStripMenuItem;
private Button buttonSupplyShop;
private Button buttonSellDocs;
+ private ToolStripMenuItem списокМагазиновToolStripMenuItem;
+ private ToolStripMenuItem загруженностьМагазиновToolStripMenuItem;
+ private ToolStripMenuItem списокЗаказовПоДатамToolStripMenuItem;
}
}
\ No newline at end of file
diff --git a/LawFirm/LawFirmView/FormMain.cs b/LawFirm/LawFirmView/FormMain.cs
index 753cbf7..1a0587d 100644
--- a/LawFirm/LawFirmView/FormMain.cs
+++ b/LawFirm/LawFirmView/FormMain.cs
@@ -1,4 +1,5 @@
-using AbstractLawFirmContracts.BindingModels;
+using AbstractLawFirmBusinessLogic.BusinessLogic;
+using AbstractLawFirmContracts.BindingModels;
using AbstractLawFirmContracts.BusinessLogicsContracts;
using AbstractLawFirmDataModels.Enums;
using Microsoft.Extensions.Logging;
@@ -18,11 +19,13 @@ namespace LawFirmView
{
private readonly ILogger _logger;
private readonly IOrderLogic _orderLogic;
- public FormMain(ILogger logger, IOrderLogic orderLogic)
+ private readonly IReportLogic _reportLogic;
+ public FormMain(ILogger logger, IOrderLogic orderLogic, IReportLogic reportLogic)
{
InitializeComponent();
_logger = logger;
_orderLogic = orderLogic;
+ _reportLogic = reportLogic;
}
private void FormMain_Load(object sender, EventArgs e)
@@ -203,5 +206,69 @@ namespace LawFirmView
form.ShowDialog();
}
}
+
+ private void списокПакетовДокументовToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
+ if (dialog.ShowDialog() == DialogResult.OK)
+ {
+ _reportLogic.SaveDocumentsToWordFile(new ReportBindingModel
+ {
+ FileName = dialog.FileName
+ });
+ MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK,
+ MessageBoxIcon.Information);
+ }
+ }
+
+ private void компонентыПоПакетамДокументовToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormReportDocumentComponents));
+ if (service is FormReportDocumentComponents form)
+ {
+ form.ShowDialog();
+ }
+
+ }
+
+ private void списокЗаказовToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormReportOrders));
+ if (service is FormReportOrders form)
+ {
+ form.ShowDialog();
+ }
+ }
+
+ private void списокМагазиновToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
+ if (dialog.ShowDialog() == DialogResult.OK)
+ {
+ _reportLogic.SaveShopsToWordFile(new ReportBindingModel
+ {
+ FileName = dialog.FileName
+ });
+ MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+ }
+
+ private void загруженностьМагазиновToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormReportShopDocuments));
+ if (service is FormReportShopDocuments form)
+ {
+ form.ShowDialog();
+ }
+ }
+
+ private void списокЗаказовПоДатамToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ var service = Program.ServiceProvider?.GetService(typeof(FormReportDateOrders));
+ if (service is FormReportDateOrders form)
+ {
+ form.ShowDialog();
+ }
+ }
}
}
diff --git a/LawFirm/LawFirmView/FormReportDateOrders.Designer.cs b/LawFirm/LawFirmView/FormReportDateOrders.Designer.cs
new file mode 100644
index 0000000..3d765c1
--- /dev/null
+++ b/LawFirm/LawFirmView/FormReportDateOrders.Designer.cs
@@ -0,0 +1,87 @@
+namespace LawFirmView
+{
+ partial class FormReportDateOrders
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.panel = new System.Windows.Forms.Panel();
+ this.buttonSaveToPdf = new System.Windows.Forms.Button();
+ this.buttonMake = new System.Windows.Forms.Button();
+ this.panel.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // panel
+ //
+ this.panel.Controls.Add(this.buttonSaveToPdf);
+ this.panel.Controls.Add(this.buttonMake);
+ this.panel.Dock = System.Windows.Forms.DockStyle.Top;
+ this.panel.Location = new System.Drawing.Point(0, 0);
+ this.panel.Name = "panel";
+ this.panel.Size = new System.Drawing.Size(800, 51);
+ this.panel.TabIndex = 0;
+ //
+ // buttonSaveToPdf
+ //
+ this.buttonSaveToPdf.Location = new System.Drawing.Point(135, 12);
+ this.buttonSaveToPdf.Name = "buttonSaveToPdf";
+ this.buttonSaveToPdf.Size = new System.Drawing.Size(75, 23);
+ this.buttonSaveToPdf.TabIndex = 1;
+ this.buttonSaveToPdf.Text = "В Pdf";
+ this.buttonSaveToPdf.UseVisualStyleBackColor = true;
+ this.buttonSaveToPdf.Click += new System.EventHandler(this.buttonSaveToPdf_Click);
+ //
+ // buttonMake
+ //
+ this.buttonMake.Location = new System.Drawing.Point(12, 12);
+ this.buttonMake.Name = "buttonMake";
+ this.buttonMake.Size = new System.Drawing.Size(104, 23);
+ this.buttonMake.TabIndex = 0;
+ this.buttonMake.Text = "Сформировать";
+ this.buttonMake.UseVisualStyleBackColor = true;
+ this.buttonMake.Click += new System.EventHandler(this.buttonMake_Click);
+ //
+ // FormReportDateOrders
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 422);
+ this.Controls.Add(this.panel);
+ this.Name = "FormReportDateOrders";
+ this.Text = "FormReportDateOrders";
+ this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormReportDateOrders_FormClosed);
+ this.panel.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private Panel panel;
+ private Button buttonSaveToPdf;
+ private Button buttonMake;
+ }
+}
\ No newline at end of file
diff --git a/LawFirm/LawFirmView/FormReportDateOrders.cs b/LawFirm/LawFirmView/FormReportDateOrders.cs
new file mode 100644
index 0000000..658b59d
--- /dev/null
+++ b/LawFirm/LawFirmView/FormReportDateOrders.cs
@@ -0,0 +1,84 @@
+using AbstractLawFirmContracts.BindingModels;
+using AbstractLawFirmContracts.BusinessLogicsContracts;
+using Microsoft.Extensions.Logging;
+using Microsoft.Reporting.WinForms;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace LawFirmView
+{
+ public partial class FormReportDateOrders : Form
+ {
+ private readonly ReportViewer reportViewer;
+ private readonly ILogger _logger;
+ private readonly IReportLogic _logic;
+ private readonly FileStream _fileStream;
+ public FormReportDateOrders(ILogger logger, IReportLogic reportLogic)
+ {
+ InitializeComponent();
+ _logger = logger;
+ _logic = reportLogic;
+ reportViewer = new ReportViewer
+ {
+ Dock = DockStyle.Fill
+ };
+ _fileStream = new FileStream("ReportOrdersByDate.rdlc", FileMode.Open);
+ reportViewer.LocalReport.LoadReportDefinition(_fileStream);
+ Controls.Clear();
+ Controls.Add(reportViewer);
+ Controls.Add(panel);
+ }
+
+ private void buttonMake_Click(object sender, EventArgs e)
+ {
+ try
+ {
+ var dataSource = _logic.GetDateOrders();
+ var source = new ReportDataSource("DataSetOrders", dataSource);
+ reportViewer.LocalReport.DataSources.Clear();
+ reportViewer.LocalReport.DataSources.Add(source);
+ reportViewer.RefreshReport();
+ _logger.LogInformation("Загрузка списка заказов на весь период по датам");
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Ошибка загрузки списка заказов на период");
+ MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+
+ private void buttonSaveToPdf_Click(object sender, EventArgs e)
+ {
+ using var dialog = new SaveFileDialog { Filter = "pdf|*.pdf" };
+ if (dialog.ShowDialog() == DialogResult.OK)
+ {
+ try
+ {
+ _logic.SaveDateOrdersToPdfFile(new ReportBindingModel
+ {
+ FileName = dialog.FileName
+ });
+ _logger.LogInformation("Сохранение списка заказов на весь период по датам");
+ MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Ошибка сохранения списка заказов на период");
+ MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ }
+
+ private void FormReportDateOrders_FormClosed(object sender, FormClosedEventArgs e)
+ {
+ _fileStream.Close();
+ }
+ }
+}
diff --git a/LawFirm/LawFirmView/FormReportDateOrders.resx b/LawFirm/LawFirmView/FormReportDateOrders.resx
new file mode 100644
index 0000000..f298a7b
--- /dev/null
+++ b/LawFirm/LawFirmView/FormReportDateOrders.resx
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/LawFirm/LawFirmView/FormReportDocumentComponents.Designer.cs b/LawFirm/LawFirmView/FormReportDocumentComponents.Designer.cs
new file mode 100644
index 0000000..a411e08
--- /dev/null
+++ b/LawFirm/LawFirmView/FormReportDocumentComponents.Designer.cs
@@ -0,0 +1,101 @@
+namespace LawFirmView
+{
+ partial class FormReportDocumentComponents
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.buttonSaveToExcel = new System.Windows.Forms.Button();
+ this.dataGridView = new System.Windows.Forms.DataGridView();
+ this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
+ this.SuspendLayout();
+ //
+ // buttonSaveToExcel
+ //
+ this.buttonSaveToExcel.Location = new System.Drawing.Point(22, 12);
+ this.buttonSaveToExcel.Name = "buttonSaveToExcel";
+ this.buttonSaveToExcel.Size = new System.Drawing.Size(160, 23);
+ this.buttonSaveToExcel.TabIndex = 0;
+ this.buttonSaveToExcel.Text = "Сохранить в Excel";
+ this.buttonSaveToExcel.UseVisualStyleBackColor = true;
+ this.buttonSaveToExcel.Click += new System.EventHandler(this.buttonSaveToExcel_Click);
+ //
+ // dataGridView
+ //
+ this.dataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
+ this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+ this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+ this.Column1,
+ this.Column2,
+ this.Column3});
+ this.dataGridView.Location = new System.Drawing.Point(22, 41);
+ this.dataGridView.Name = "dataGridView";
+ this.dataGridView.RowTemplate.Height = 25;
+ this.dataGridView.Size = new System.Drawing.Size(546, 305);
+ this.dataGridView.TabIndex = 1;
+ //
+ // Column1
+ //
+ this.Column1.HeaderText = "Пакет документов";
+ this.Column1.Name = "Column1";
+ //
+ // Column2
+ //
+ this.Column2.HeaderText = "Компонент";
+ this.Column2.Name = "Column2";
+ //
+ // Column3
+ //
+ this.Column3.HeaderText = "Количество";
+ this.Column3.Name = "Column3";
+ //
+ // FormReportDocumentComponents
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(601, 391);
+ this.Controls.Add(this.dataGridView);
+ this.Controls.Add(this.buttonSaveToExcel);
+ this.Name = "FormReportDocumentComponents";
+ this.Text = "FormReportDocumentComponents";
+ this.Load += new System.EventHandler(this.FormReportDocumentComponents_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private Button buttonSaveToExcel;
+ private DataGridView dataGridView;
+ private DataGridViewTextBoxColumn Column1;
+ private DataGridViewTextBoxColumn Column2;
+ private DataGridViewTextBoxColumn Column3;
+ }
+}
\ No newline at end of file
diff --git a/LawFirm/LawFirmView/FormReportDocumentComponents.cs b/LawFirm/LawFirmView/FormReportDocumentComponents.cs
new file mode 100644
index 0000000..c7fa6da
--- /dev/null
+++ b/LawFirm/LawFirmView/FormReportDocumentComponents.cs
@@ -0,0 +1,88 @@
+using AbstractLawFirmContracts.BindingModels;
+using AbstractLawFirmContracts.BusinessLogicsContracts;
+using Microsoft.Extensions.Logging;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace LawFirmView
+{
+ public partial class FormReportDocumentComponents : Form
+ {
+ private readonly ILogger _logger;
+ private readonly IReportLogic _logic;
+ public FormReportDocumentComponents(ILogger logger, IReportLogic logic)
+ {
+ InitializeComponent();
+ _logger = logger;
+ _logic = logic;
+ }
+
+ private void FormReportDocumentComponents_Load(object sender, EventArgs e)
+ {
+ try
+ {
+ var dict = _logic.GetDocumentComponent();
+ if (dict != null)
+ {
+ dataGridView.Rows.Clear();
+ foreach (var elem in dict)
+ {
+ dataGridView.Rows.Add(new object[] { elem.DocumentName, "", "" });
+ foreach (var listElem in elem.Components)
+ {
+ dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 });
+ }
+ dataGridView.Rows.Add(new object[] { "Итого", "", elem.TotalCount });
+ dataGridView.Rows.Add(Array.Empty | | |
@@ -24,4 +25,13 @@
+
+
+ Always
+
+
+ Always
+
+
+
\ No newline at end of file
diff --git a/LawFirm/LawFirmView/Program.cs b/LawFirm/LawFirmView/Program.cs
index 34f007a..790f036 100644
--- a/LawFirm/LawFirmView/Program.cs
+++ b/LawFirm/LawFirmView/Program.cs
@@ -1,4 +1,6 @@
using AbstractLawFirmBusinessLogic.BusinessLogic;
+using AbstractLawFirmBusinessLogic.OfficePackage.Implements;
+using AbstractLawFirmBusinessLogic.OfficePackage;
using AbstractLawFirmContracts.BusinessLogicsContracts;
using AbstractLawFirmContracts.StoragesContracts;
using AbstractLawFirmDatabaseImplement.Implements;
@@ -42,6 +44,10 @@ namespace LawFirmView
services.AddTransient();
services.AddTransient();
services.AddTransient();
+ services.AddTransient();
+ services.AddTransient();
+ services.AddTransient();
+ services.AddTransient();
services.AddTransient();
services.AddTransient();
services.AddTransient();
@@ -53,6 +59,10 @@ namespace LawFirmView
services.AddTransient();
services.AddTransient();
services.AddTransient();
+ services.AddTransient();
+ services.AddTransient();
+ services.AddTransient();
+ services.AddTransient();
}
}
diff --git a/LawFirm/LawFirmView/ReportOrders.rdlc b/LawFirm/LawFirmView/ReportOrders.rdlc
new file mode 100644
index 0000000..ccadb1e
--- /dev/null
+++ b/LawFirm/LawFirmView/ReportOrders.rdlc
@@ -0,0 +1,599 @@
+
+
+ 0
+
+
+
+ System.Data.DataSet
+ /* Local Connection */
+
+ 10791c83-cee8-4a38-bbd0-245fc17cefb3
+
+
+
+
+
+ AbstractLawFirmContractsViewModels
+ /* Local Query */
+
+
+
+ Id
+ System.Int32
+
+
+ DateCreate
+ System.DateTime
+
+
+ DocumentName
+ System.String
+
+
+ Sum
+ System.Decimal
+
+
+ Status
+ System.String
+
+
+
+ AbstractLawFirmContracts.ViewModels
+ ReportOrdersViewModel
+ AbstractLawFirmContracts.ViewModels.ReportOrdersViewModel, AbstractLawFirmContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!ReportParameterPeriod.Value
+
+
+
+
+
+
+ ReportParameterPeriod
+ 1cm
+ 1cm
+ 21cm
+
+
+ Middle
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ Заказы
+
+
+
+
+
+
+ 1cm
+ 21cm
+ 1
+
+
+ Middle
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+ 2.5cm
+
+
+ 3.21438cm
+
+
+ 8.23317cm
+
+
+ 2.5cm
+
+
+ 2.5cm
+
+
+
+
+ 0.6cm
+
+
+
+
+ true
+ true
+
+
+
+
+ Номер
+
+
+
+
+
+
+ Textbox5
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Дата создания
+
+
+
+
+
+
+ Textbox1
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Пакет документов
+
+
+
+
+
+
+ Textbox3
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Сумма
+
+
+
+
+
+
+ Textbox7
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Статус
+
+
+
+
+
+
+ Textbox2
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.6cm
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Id.Value
+
+
+
+
+
+
+ Id
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!DateCreate.Value
+
+
+
+
+
+
+ DateCreate
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!DocumentName.Value
+
+
+
+
+
+
+ DocumentName
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Sum.Value
+
+
+
+
+
+
+ Sum
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Status.Value
+
+
+
+
+
+
+ Status
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ After
+
+
+
+
+
+
+ DataSetOrders
+ 2.48391cm
+ 0.55245cm
+ 1.2cm
+ 18.94755cm
+ 2
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Итого:
+
+
+
+
+
+
+ 4cm
+ 12cm
+ 0.6cm
+ 2.5cm
+ 3
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ =Sum(Fields!Sum.Value, "DataSetOrders")
+
+
+
+
+
+
+ 4cm
+ 14.5cm
+ 0.6cm
+ 2.5cm
+ 4
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ 5.72875cm
+
+
+ 21cm
+
+ 29.7cm
+ 21cm
+ 2cm
+ 2cm
+ 2cm
+ 2cm
+ 0.13cm
+
+
+
+
+
+
+ String
+ true
+ ReportParameter1
+
+
+
+
+ 4
+ 2
+
+
+ 0
+ 0
+ ReportParameterPeriod
+
+
+
+
+ Cm
+ 2de0031a-4d17-449d-922d-d9fc54572312
+
diff --git a/LawFirm/LawFirmView/ReportOrdersByDate.rdlc b/LawFirm/LawFirmView/ReportOrdersByDate.rdlc
new file mode 100644
index 0000000..35fb6a2
--- /dev/null
+++ b/LawFirm/LawFirmView/ReportOrdersByDate.rdlc
@@ -0,0 +1,424 @@
+
+
+ 0
+
+
+
+ System.Data.DataSet
+ /* Local Connection */
+
+ 10791c83-cee8-4a38-bbd0-245fc17cefb3
+
+
+
+
+
+ AbstractLawFirmContractsViewModels
+ /* Local Query */
+
+
+
+ DateCreate
+ System.DateTime
+
+
+ CountOrders
+ System.Decimal
+
+
+ SumOrders
+ System.Double
+
+
+
+ AbstractLawFirmContracts.ViewModels
+ ReportDateOrdersViewModel
+ AbstractLawFirmContracts.ViewModels.ReportDateOrdersViewModel, LawFirmContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Заказы
+
+
+
+
+
+
+ 1cm
+ 21cm
+
+
+ Middle
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+ 3cm
+
+
+ 3cm
+
+
+ 7cm
+
+
+
+
+ 0.6cm
+
+
+
+
+ true
+ true
+
+
+
+
+ Дата
+
+
+
+
+
+
+ Textbox1
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Количество
+
+
+
+
+
+
+ Textbox3
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Сумма
+
+
+
+
+
+
+ Textbox2
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.6cm
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!DateCreate.Value
+
+
+
+
+
+
+ DateCreate
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!CountOrders.Value
+
+
+
+
+
+
+ CountOrders
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!SumOrders.Value
+
+
+
+
+
+
+ SumOrders
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ After
+
+
+
+
+
+
+ DataSetOrders
+ 2.48391cm
+ 0.55245cm
+ 1.2cm
+ 13cm
+ 1
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Всего:
+
+
+
+
+
+
+ 4cm
+ 8.55245cm
+ 0.6cm
+ 2.5cm
+ 2
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ =Sum(Fields!SumOrders.Value, "DataSetOrders")
+
+
+
+
+
+
+ 4cm
+ 11.05245cm
+ 0.6cm
+ 2.5cm
+ 3
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ 5.72875cm
+
+
+ 21cm
+
+ 29.7cm
+ 21cm
+ 2cm
+ 2cm
+ 2cm
+ 2cm
+ 0.13cm
+
+
+
+
+
+
+ String
+ true
+ ReportParameter1
+
+
+
+
+ 4
+ 2
+
+
+ 0
+ 0
+ ReportParameterPeriod
+
+
+
+
+ Cm
+ 2de0031a-4d17-449d-922d-d9fc54572312
+