diff --git a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/BusinessLogics/ReportLogic.cs b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/BusinessLogics/ReportLogic.cs index 3754a51..92dfe1d 100644 --- a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/BusinessLogics/ReportLogic.cs +++ b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/BusinessLogics/ReportLogic.cs @@ -19,17 +19,20 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogics private readonly IOrderStorage _orderStorage; + private readonly IShopStorage _shopStorage; + private readonly AbstractSaveToExcel _saveToExcel; private readonly AbstractSaveToWord _saveToWord; private readonly AbstractSaveToPdf _saveToPdf; - public ReportLogic(IReinforcedStorage reinforcedStorage, IComponentStorage componentStorage, IOrderStorage orderStorage, + public ReportLogic(IReinforcedStorage reinforcedStorage, IComponentStorage componentStorage, IShopStorage shopStorage, IOrderStorage orderStorage, AbstractSaveToExcel saveToExcel, AbstractSaveToWord saveToWord, AbstractSaveToPdf saveToPdf) { _reinforcedStorage = reinforcedStorage; _orderStorage = orderStorage; + _shopStorage = shopStorage; _saveToExcel = saveToExcel; _saveToWord = saveToWord; @@ -63,6 +66,32 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogics return list; } + public List GetShopReinforceds() + { + var shops = _shopStorage.GetFullList(); + + var list = new List(); + + foreach (var shop in shops) + { + var record = new ReportShopReinforcedViewModel + { + ShopName = shop.ShopName, + Reinforceds = new List<(string Reinforced, int Count)>(), + TotalCount = 0, + }; + foreach (var reinforced in shop.ShopReinforceds) + { + record.Reinforceds.Add(new(reinforced.Value.Item1.ReinforcedName, reinforced.Value.Item2)); + record.TotalCount += reinforced.Value.Item2; + } + + list.Add(record); + } + + return list; + } + public List GetOrders(ReportBindingModel model) { return _orderStorage.GetFilteredList(new OrderSearchModel { DateFrom = model.DateFrom, DateTo = model.DateTo }) @@ -77,6 +106,18 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogics .ToList(); } + public List GetGroupedByDateOrders() + { + return _orderStorage.GetFullList().GroupBy(x => x.DateCreate.Date) + .Select(x => new ReportOrdersByDateViewModel + { + Date = x.Key, + Count = x.Count(), + Sum = x.Sum(y => y.Sum) + }) + .ToList(); + + } public void SaveReinforcedsToWordFile(ReportBindingModel model) { _saveToWord.CreateDoc(new WordInfo @@ -87,6 +128,16 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogics }); } + public void SaveShopsToWordFile(ReportBindingModel model) + { + _saveToWord.CreateShopsTable(new WordInfo + { + FileName = model.FileName, + Title = "Список магазинов", + Shops = _shopStorage.GetFullList() + }); + } + public void SaveReinforcedComponentToExcelFile(ReportBindingModel model) { _saveToExcel.CreateReport(new ExcelInfo @@ -97,6 +148,16 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogics }); } + public void SaveShopReinforcedToExcelFile(ReportBindingModel model) + { + _saveToExcel.CreateShopReport(new ExcelInfo + { + FileName = model.FileName, + Title = "Загруженность магазинов", + ShopReinforceds = GetShopReinforceds() + }); + } + public void SaveOrdersToPdfFile(ReportBindingModel model) { _saveToPdf.CreateDoc(new PdfInfo @@ -108,5 +169,15 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogics Orders = GetOrders(model) }); } + + public void SaveGroupedOrdersToPdfFile(ReportBindingModel model) + { + _saveToPdf.CreateDocWithGroupedOrders(new PdfInfo + { + FileName = model.FileName, + Title = "Заказы по датам", + GroupedOrders = GetGroupedByDateOrders() + }); + } } } diff --git a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/AbstractSaveToExcel.cs b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/AbstractSaveToExcel.cs index 37a57f5..5455ffc 100644 --- a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/AbstractSaveToExcel.cs +++ b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/AbstractSaveToExcel.cs @@ -81,6 +81,76 @@ namespace PrecastConcretePlantBusinessLogic.OfficePackage 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 si in info.ShopReinforceds) + { + InsertCellInWorksheet(new ExcelCellParameters + { + ColumnName = "A", + RowIndex = rowIndex, + Text = si.ShopName, + StyleInfo = ExcelStyleInfoType.Text + }); + rowIndex++; + + foreach (var (Reinforced, Count) in si.Reinforceds) + { + InsertCellInWorksheet(new ExcelCellParameters + { + ColumnName = "B", + RowIndex = rowIndex, + Text = Reinforced, + 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 = si.TotalCount.ToString(), + StyleInfo = ExcelStyleInfoType.Text + }); + rowIndex++; + } + + SaveExcel(info); + } // Создание excel-файла protected abstract void CreateExcel(ExcelInfo info); diff --git a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/AbstractSaveToPdf.cs b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/AbstractSaveToPdf.cs index e1f5831..be3cc4d 100644 --- a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/AbstractSaveToPdf.cs +++ b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/AbstractSaveToPdf.cs @@ -36,8 +36,36 @@ namespace PrecastConcretePlantBusinessLogic.OfficePackage SavePdf(info); } + public void CreateDocWithGroupedOrders(PdfInfo info) + { + CreatePdf(info); + CreateParagraph(new PdfParagraph { Text = info.Title, Style = "NormalTitle", ParagraphAlignment = PdfParagraphAlignmentType.Center }); - // Создание pdf-файла + CreateTable(new List { "5cm", "6cm", "5cm" }); + + CreateRow(new PdfRowParameters + { + Texts = new List { "Дата", "Количество заказов", "Сумма" }, + Style = "NormalTitle", + ParagraphAlignment = PdfParagraphAlignmentType.Center + }); + + foreach (var order in info.GroupedOrders) + { + CreateRow(new PdfRowParameters + { + Texts = new List { order.Date.ToShortDateString(), order.Count.ToString(), order.Sum.ToString() }, + Style = "Normal", + ParagraphAlignment = PdfParagraphAlignmentType.Left + }); + } + CreateParagraph(new PdfParagraph { Text = $"Итого: {info.GroupedOrders.Sum(x => x.Sum)}\t", Style = "Normal", ParagraphAlignment = PdfParagraphAlignmentType.Right }); + + SavePdf(info); + } + + + // Создание pdf-файла protected abstract void CreatePdf(PdfInfo info); diff --git a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/AbstractSaveToWord.cs b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/AbstractSaveToWord.cs index b803877..3ccb4a2 100644 --- a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/AbstractSaveToWord.cs +++ b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/AbstractSaveToWord.cs @@ -41,15 +41,67 @@ namespace PrecastConcretePlantBusinessLogic.OfficePackage SaveWord(info); } + public void CreateShopsTable(WordInfo info) + { + CreateWord(info); - // Создание doc-файла + CreateParagraph(new WordParagraph + { + Texts = new List<(string, WordTextProperties)> { (info.Title, new WordTextProperties { Bold = true, Size = "24", }) }, + TextProperties = new WordTextProperties + { + Size = "24", + JustificationType = WordJustificationType.Center + } + }); + + CreateTable(new List { "3000", "3000", "3000" }); + + CreateRow(new WordParagraph + { + Texts = new List<(string, WordTextProperties)> { ("Название магазина", new WordTextProperties { Size = "24" }), + ("Адрес", new WordTextProperties { Size = "24" }), ("Дата открытия", new WordTextProperties { Size = "24" }) }, + TextProperties = new WordTextProperties + { + Size = "24", + Bold = true, + JustificationType = WordJustificationType.Center + } + }); + + foreach (var shop in info.Shops) + { + CreateRow(new WordParagraph + { + Texts = new List<(string, WordTextProperties)> { (shop.ShopName, new WordTextProperties { Size = "22" }), + (shop.Address, new WordTextProperties { Size = "22" }), (shop.DateOpening.ToString(), new WordTextProperties { Size = "22" })}, + TextProperties = new WordTextProperties + { + Size = "22", + JustificationType = WordJustificationType.Center + } + }); + } + + SaveWord(info); + } + + + // Создание doc-файла protected abstract void CreateWord(WordInfo info); // Создание абзаца с текстом protected abstract void CreateParagraph(WordParagraph paragraph); - //Сохранение файла + // Создание таблицы + protected abstract void CreateTable(List columns); + + // Создание строки таблицы + protected abstract void CreateRow(WordParagraph paragraph); + + //Сохранение файла protected abstract void SaveWord(WordInfo info); + } } diff --git a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs index e8f1a9b..629bb0f 100644 --- a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs +++ b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs @@ -14,5 +14,7 @@ namespace PrecastConcretePlantBusinessLogic.OfficePackage.HelperModels public string Title { get; set; } = string.Empty; public List ReinforcedComponents { get; set; } = new(); + + public List ShopReinforceds { get; set; } = new(); } } \ No newline at end of file diff --git a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs index dfb6176..6d5f4c5 100644 --- a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs +++ b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs @@ -18,5 +18,7 @@ namespace PrecastConcretePlantBusinessLogic.OfficePackage.HelperModels public DateTime DateTo { get; set; } public List Orders { get; set; } = new(); + + public List GroupedOrders { get; set; } = new(); } } \ No newline at end of file diff --git a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/HelperModels/WordInfo.cs b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/HelperModels/WordInfo.cs index df43f81..169d79c 100644 --- a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/HelperModels/WordInfo.cs +++ b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/HelperModels/WordInfo.cs @@ -14,5 +14,7 @@ namespace PrecastConcretePlantBusinessLogic.OfficePackage.HelperModels public string Title { get; set; } = string.Empty; public List Reinforceds { get; set; } = new(); + + public List Shops { get; set; } = new(); } } \ No newline at end of file diff --git a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/Implements/SaveToWord.cs b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/Implements/SaveToWord.cs index c4e6c3a..259ecdd 100644 --- a/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/Implements/SaveToWord.cs +++ b/PrecastConcretePlant/PrecastConcretePlantBusinessLogic/OfficePackage/Implements/SaveToWord.cs @@ -18,7 +18,9 @@ namespace PrecastConcretePlantBusinessLogic.OfficePackage.Implements private Body? _docBody; - + private Table? table; + + // Получение типа выравнивания private static JustificationValues GetJustificationValues(WordJustificationType type) { @@ -117,6 +119,67 @@ namespace PrecastConcretePlantBusinessLogic.OfficePackage.Implements _docBody.AppendChild(docParagraph); } + protected override void CreateTable(List columns) + { + if (_docBody == null || columns == null) + { + return; + } + + table = new(); + TableProperties properties = new(); + properties.AppendChild(new TableLayout { Type = TableLayoutValues.Fixed }); + properties.AppendChild(new TableBorders( + new TopBorder() { Val = new EnumValue(BorderValues.Single), Size = 4 }, + new LeftBorder() { Val = new EnumValue(BorderValues.Single), Size = 4 }, + new RightBorder() { Val = new EnumValue(BorderValues.Single), Size = 4 }, + new BottomBorder() { Val = new EnumValue(BorderValues.Single), Size = 4 }, + new InsideHorizontalBorder() { Val = new EnumValue(BorderValues.Single), Size = 4 }, + new InsideVerticalBorder() { Val = new EnumValue(BorderValues.Single), Size = 4 } + )); + properties.AppendChild(new TableWidth { Type = TableWidthUnitValues.Auto }); + table.AppendChild(properties); + + TableGrid tableGrid = new(); + foreach (var column in columns) + { + tableGrid.AppendChild(new GridColumn() { Width = column }); + } + table.AppendChild(tableGrid); + + _docBody.AppendChild(table); + } + + protected override void CreateRow(WordParagraph paragraph) + { + if (_docBody == null || table == null || paragraph == null) + { + return; + } + TableRow tableRow = new(); + foreach (var column in paragraph.Texts) + { + var tableParagraph = new Paragraph(); + tableParagraph.AppendChild(CreateParagraphProperties(paragraph.TextProperties)); + + var tableRun = new Run(); + var runProperties = new RunProperties(); + runProperties.AppendChild(new FontSize { Val = column.Item2.Size }); + if (column.Item2.Bold) + { + runProperties.AppendChild(new Bold()); + } + tableRun.AppendChild(runProperties); + tableRun.AppendChild(new Text { Text = column.Item1, Space = SpaceProcessingModeValues.Preserve }); + tableParagraph.AppendChild(tableRun); + + TableCell cell = new(); + cell.AppendChild(tableParagraph); + tableRow.AppendChild(cell); + } + table.AppendChild(tableRow); + } + protected override void SaveWord(WordInfo info) { if (_docBody == null || _wordDocument == null) diff --git a/PrecastConcretePlant/PrecastConcretePlantContracts/BusinessLogicsContracts/IReportLogic.cs b/PrecastConcretePlant/PrecastConcretePlantContracts/BusinessLogicsContracts/IReportLogic.cs index fdfdae9..dbe0fd5 100644 --- a/PrecastConcretePlant/PrecastConcretePlantContracts/BusinessLogicsContracts/IReportLogic.cs +++ b/PrecastConcretePlant/PrecastConcretePlantContracts/BusinessLogicsContracts/IReportLogic.cs @@ -12,12 +12,22 @@ namespace PrecastConcretePlantContracts.BusinessLogicsContracts { List GetReinforcedComponents(); + List GetShopReinforceds(); + List GetOrders(ReportBindingModel model); + List GetGroupedByDateOrders(); + void SaveReinforcedsToWordFile(ReportBindingModel model); + void SaveShopsToWordFile(ReportBindingModel model); + void SaveReinforcedComponentToExcelFile(ReportBindingModel model); + void SaveShopReinforcedToExcelFile(ReportBindingModel model); + void SaveOrdersToPdfFile(ReportBindingModel model); + + void SaveGroupedOrdersToPdfFile(ReportBindingModel model); } } diff --git a/PrecastConcretePlant/PrecastConcretePlantContracts/ViewModels/ReportOrdersByDateViewModel.cs b/PrecastConcretePlant/PrecastConcretePlantContracts/ViewModels/ReportOrdersByDateViewModel.cs new file mode 100644 index 0000000..923795e --- /dev/null +++ b/PrecastConcretePlant/PrecastConcretePlantContracts/ViewModels/ReportOrdersByDateViewModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PrecastConcretePlantContracts.ViewModels +{ + public class ReportOrdersByDateViewModel + { + public DateTime Date { get; set; } + + public int Count { get; set; } + + public double Sum { get; set; } + } +} diff --git a/PrecastConcretePlant/PrecastConcretePlantContracts/ViewModels/ReportShopReinforcedViewModel.cs b/PrecastConcretePlant/PrecastConcretePlantContracts/ViewModels/ReportShopReinforcedViewModel.cs new file mode 100644 index 0000000..7e7b7cb --- /dev/null +++ b/PrecastConcretePlant/PrecastConcretePlantContracts/ViewModels/ReportShopReinforcedViewModel.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace PrecastConcretePlantContracts.ViewModels +{ + public class ReportShopReinforcedViewModel + { + public string ShopName { get; set; } = string.Empty; + + public int TotalCount { get; set; } + + public List<(string Reinforced, int Count)> Reinforceds { get; set; } = new(); + } +} diff --git a/PrecastConcretePlant/PrecastConcretePlantView/FormMain.Designer.cs b/PrecastConcretePlant/PrecastConcretePlantView/FormMain.Designer.cs index e5c670d..079dade 100644 --- a/PrecastConcretePlant/PrecastConcretePlantView/FormMain.Designer.cs +++ b/PrecastConcretePlant/PrecastConcretePlantView/FormMain.Designer.cs @@ -38,8 +38,8 @@ компонентыПоИзделиямToolStripMenuItem = new ToolStripMenuItem(); списокЗаказовToolStripMenuItem = new ToolStripMenuItem(); списокМагазиновToolStripMenuItem = new ToolStripMenuItem(); - загруженностьМагазиновToolStripMenuItem = new ToolStripMenuItem(); заказыПоДатамToolStripMenuItem = new ToolStripMenuItem(); + загруженностьПоМагазинамToolStripMenuItem = new ToolStripMenuItem(); пополнениеМагазинаToolStripMenuItem = new ToolStripMenuItem(); продажаИзделийToolStripMenuItem = new ToolStripMenuItem(); buttonIssuedOrder = new Button(); @@ -54,11 +54,12 @@ // // menuStrip // + menuStrip.ImageScalingSize = new Size(20, 20); menuStrip.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, отчетыToolStripMenuItem, пополнениеМагазинаToolStripMenuItem, продажаИзделийToolStripMenuItem }); menuStrip.Location = new Point(0, 0); menuStrip.Name = "menuStrip"; - menuStrip.Padding = new Padding(7, 2, 0, 2); - menuStrip.Size = new Size(1031, 24); + menuStrip.Padding = new Padding(8, 3, 0, 3); + menuStrip.Size = new Size(1178, 30); menuStrip.TabIndex = 0; menuStrip.Text = "menuStrip1"; // @@ -66,13 +67,13 @@ // справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { компонентыToolStripMenuItem, изделияToolStripMenuItem, магазиныToolStripMenuItem }); справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem"; - справочникиToolStripMenuItem.Size = new Size(94, 20); + справочникиToolStripMenuItem.Size = new Size(117, 24); справочникиToolStripMenuItem.Text = "Справочники"; // // компонентыToolStripMenuItem // компонентыToolStripMenuItem.Name = "компонентыToolStripMenuItem"; - компонентыToolStripMenuItem.Size = new Size(145, 22); + компонентыToolStripMenuItem.Size = new Size(182, 26); компонентыToolStripMenuItem.Text = "Компоненты"; компонентыToolStripMenuItem.Click += КомпонентыToolStripMenuItem_Click; // @@ -86,15 +87,15 @@ // магазиныToolStripMenuItem // магазиныToolStripMenuItem.Name = "магазиныToolStripMenuItem"; - магазиныToolStripMenuItem.Size = new Size(145, 22); + магазиныToolStripMenuItem.Size = new Size(182, 26); магазиныToolStripMenuItem.Text = "Магазины"; магазиныToolStripMenuItem.Click += МагазиныToolStripMenuItem_Click; // // отчетыToolStripMenuItem // - отчетыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { списокИзделийToolStripMenuItem, компонентыПоИзделиямToolStripMenuItem, списокЗаказовToolStripMenuItem, списокМагазиновToolStripMenuItem, загруженностьМагазиновToolStripMenuItem, заказыПоДатамToolStripMenuItem }); + отчетыToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { списокИзделийToolStripMenuItem, компонентыПоИзделиямToolStripMenuItem, списокЗаказовToolStripMenuItem, списокМагазиновToolStripMenuItem, загруженностьПоМагазинамToolStripMenuItem, заказыПоДатамToolStripMenuItem }); отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem"; - отчетыToolStripMenuItem.Size = new Size(60, 20); + отчетыToolStripMenuItem.Size = new Size(73, 24); отчетыToolStripMenuItem.Text = "Отчеты"; // // списокИзделийToolStripMenuItem @@ -114,52 +115,52 @@ // списокЗаказовToolStripMenuItem // списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem"; - списокЗаказовToolStripMenuItem.Size = new Size(235, 22); + списокЗаказовToolStripMenuItem.Size = new Size(276, 26); списокЗаказовToolStripMenuItem.Text = "Список заказов"; списокЗаказовToolStripMenuItem.Click += СписокЗаказовToolStripMenuItem_Click; // // списокМагазиновToolStripMenuItem // списокМагазиновToolStripMenuItem.Name = "списокМагазиновToolStripMenuItem"; - списокМагазиновToolStripMenuItem.Size = new Size(235, 22); + списокМагазиновToolStripMenuItem.Size = new Size(276, 26); списокМагазиновToolStripMenuItem.Text = "Список магазинов"; списокМагазиновToolStripMenuItem.Click += СписокМагазиновToolStripMenuItem_Click; // - // загруженностьМагазиновToolStripMenuItem - // - загруженностьМагазиновToolStripMenuItem.Name = "загруженностьМагазиновToolStripMenuItem"; - загруженностьМагазиновToolStripMenuItem.Size = new Size(235, 22); - загруженностьМагазиновToolStripMenuItem.Text = "Загруженность магазинов"; - загруженностьМагазиновToolStripMenuItem.Click += ЗагруженностьМагазиновToolStripMenuItem_Click; - // // заказыПоДатамToolStripMenuItem // заказыПоДатамToolStripMenuItem.Name = "заказыПоДатамToolStripMenuItem"; - заказыПоДатамToolStripMenuItem.Size = new Size(235, 22); + заказыПоДатамToolStripMenuItem.Size = new Size(276, 26); заказыПоДатамToolStripMenuItem.Text = "Заказы по датам"; заказыПоДатамToolStripMenuItem.Click += ЗаказыПоДатамToolStripMenuItem_Click; // + // загруженностьПоМагазинамToolStripMenuItem + // + загруженностьПоМагазинамToolStripMenuItem.Name = "загруженностьПоМагазинамToolStripMenuItem"; + загруженностьПоМагазинамToolStripMenuItem.Size = new Size(276, 26); + загруженностьПоМагазинамToolStripMenuItem.Text = "Загруженность магазинов"; + загруженностьПоМагазинамToolStripMenuItem.Click += ЗагруженностьМагазиновToolStripMenuItem_Click; + // // пополнениеМагазинаToolStripMenuItem // пополнениеМагазинаToolStripMenuItem.Name = "пополнениеМагазинаToolStripMenuItem"; - пополнениеМагазинаToolStripMenuItem.Size = new Size(143, 20); + пополнениеМагазинаToolStripMenuItem.Size = new Size(182, 24); пополнениеМагазинаToolStripMenuItem.Text = "Пополнение магазина"; пополнениеМагазинаToolStripMenuItem.Click += ПополнениеМагазинаToolStripMenuItem_Click; // // продажаИзделийToolStripMenuItem // продажаИзделийToolStripMenuItem.Name = "продажаИзделийToolStripMenuItem"; - продажаИзделийToolStripMenuItem.Size = new Size(149, 24); + продажаИзделийToolStripMenuItem.Size = new Size(147, 24); продажаИзделийToolStripMenuItem.Text = "продажа изделий"; продажаИзделийToolStripMenuItem.Click += ПродажаИзделийToolStripMenuItem_Click; // // buttonIssuedOrder // buttonIssuedOrder.Anchor = AnchorStyles.Top | AnchorStyles.Right; - buttonIssuedOrder.Location = new Point(844, 231); - buttonIssuedOrder.Margin = new Padding(4, 3, 4, 3); + buttonIssuedOrder.Location = new Point(965, 308); + buttonIssuedOrder.Margin = new Padding(5, 4, 5, 4); buttonIssuedOrder.Name = "buttonIssuedOrder"; - buttonIssuedOrder.Size = new Size(174, 27); + buttonIssuedOrder.Size = new Size(199, 36); buttonIssuedOrder.TabIndex = 4; buttonIssuedOrder.Text = "Заказ выдан"; buttonIssuedOrder.UseVisualStyleBackColor = true; @@ -168,10 +169,10 @@ // buttonOrderReady // buttonOrderReady.Anchor = AnchorStyles.Top | AnchorStyles.Right; - buttonOrderReady.Location = new Point(844, 171); - buttonOrderReady.Margin = new Padding(4, 3, 4, 3); + buttonOrderReady.Location = new Point(965, 228); + buttonOrderReady.Margin = new Padding(5, 4, 5, 4); buttonOrderReady.Name = "buttonOrderReady"; - buttonOrderReady.Size = new Size(174, 27); + buttonOrderReady.Size = new Size(199, 36); buttonOrderReady.TabIndex = 3; buttonOrderReady.Text = "Заказ готов"; buttonOrderReady.UseVisualStyleBackColor = true; @@ -180,10 +181,10 @@ // buttonTakeOrderInWork // buttonTakeOrderInWork.Anchor = AnchorStyles.Top | AnchorStyles.Right; - buttonTakeOrderInWork.Location = new Point(844, 117); - buttonTakeOrderInWork.Margin = new Padding(4, 3, 4, 3); + buttonTakeOrderInWork.Location = new Point(965, 156); + buttonTakeOrderInWork.Margin = new Padding(5, 4, 5, 4); buttonTakeOrderInWork.Name = "buttonTakeOrderInWork"; - buttonTakeOrderInWork.Size = new Size(174, 27); + buttonTakeOrderInWork.Size = new Size(199, 36); buttonTakeOrderInWork.TabIndex = 2; buttonTakeOrderInWork.Text = "Отдать на выполнение"; buttonTakeOrderInWork.UseVisualStyleBackColor = true; @@ -192,10 +193,10 @@ // buttonCreateOrder // buttonCreateOrder.Anchor = AnchorStyles.Top | AnchorStyles.Right; - buttonCreateOrder.Location = new Point(844, 58); - buttonCreateOrder.Margin = new Padding(4, 3, 4, 3); + buttonCreateOrder.Location = new Point(965, 77); + buttonCreateOrder.Margin = new Padding(5, 4, 5, 4); buttonCreateOrder.Name = "buttonCreateOrder"; - buttonCreateOrder.Size = new Size(174, 27); + buttonCreateOrder.Size = new Size(199, 36); buttonCreateOrder.TabIndex = 1; buttonCreateOrder.Text = "Создать заказ"; buttonCreateOrder.UseVisualStyleBackColor = true; @@ -208,23 +209,24 @@ dataGridView.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; dataGridView.BackgroundColor = SystemColors.ControlLightLight; dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; - dataGridView.Location = new Point(0, 28); - dataGridView.Margin = new Padding(4, 3, 4, 3); + dataGridView.Location = new Point(0, 37); + dataGridView.Margin = new Padding(5, 4, 5, 4); dataGridView.MultiSelect = false; dataGridView.Name = "dataGridView"; dataGridView.ReadOnly = true; dataGridView.RowHeadersVisible = false; + dataGridView.RowHeadersWidth = 51; dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; - dataGridView.Size = new Size(826, 320); + dataGridView.Size = new Size(944, 427); dataGridView.TabIndex = 0; // // buttonUpd // buttonUpd.Anchor = AnchorStyles.Top | AnchorStyles.Right; - buttonUpd.Location = new Point(844, 290); - buttonUpd.Margin = new Padding(4, 3, 4, 3); + buttonUpd.Location = new Point(965, 387); + buttonUpd.Margin = new Padding(5, 4, 5, 4); buttonUpd.Name = "buttonUpd"; - buttonUpd.Size = new Size(174, 27); + buttonUpd.Size = new Size(199, 36); buttonUpd.TabIndex = 5; buttonUpd.Text = "Обновить список"; buttonUpd.UseVisualStyleBackColor = true; @@ -232,9 +234,9 @@ // // FormMain // - AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(1031, 347); + ClientSize = new Size(1178, 463); Controls.Add(buttonUpd); Controls.Add(buttonIssuedOrder); Controls.Add(buttonOrderReady); @@ -243,7 +245,7 @@ Controls.Add(dataGridView); Controls.Add(menuStrip); MainMenuStrip = menuStrip; - Margin = new Padding(4, 3, 4, 3); + Margin = new Padding(5, 4, 5, 4); Name = "FormMain"; StartPosition = FormStartPosition.CenterScreen; Text = "Завод"; @@ -275,7 +277,7 @@ private ToolStripMenuItem компонентыПоИзделиямToolStripMenuItem; private ToolStripMenuItem списокЗаказовToolStripMenuItem; private ToolStripMenuItem списокМагазиновToolStripMenuItem; - private ToolStripMenuItem загруженностьМагазиновToolStripMenuItem; private ToolStripMenuItem заказыПоДатамToolStripMenuItem; + private ToolStripMenuItem загруженностьПоМагазинамToolStripMenuItem; } } \ No newline at end of file diff --git a/PrecastConcretePlant/PrecastConcretePlantView/FormMain.cs b/PrecastConcretePlant/PrecastConcretePlantView/FormMain.cs index ccaa536..a1b67ba 100644 --- a/PrecastConcretePlant/PrecastConcretePlantView/FormMain.cs +++ b/PrecastConcretePlant/PrecastConcretePlantView/FormMain.cs @@ -131,30 +131,30 @@ namespace PrecastConcretePlantView private void СписокМагазиновToolStripMenuItem_Click(object sender, EventArgs e) { - /*using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; + 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(FormReportShopIceCreams)); - if (service is FormReportShopIceCreams form) + var service = Program.ServiceProvider?.GetService(typeof(FormReportShopReinforceds)); + if (service is FormReportShopReinforceds form) { form.ShowDialog(); - }*/ + } } private void ЗаказыПоДатамToolStripMenuItem_Click(object sender, EventArgs e) { - /*var service = Program.ServiceProvider?.GetService(typeof(FormReportGroupedOrders)); + var service = Program.ServiceProvider?.GetService(typeof(FormReportGroupedOrders)); if (service is FormReportGroupedOrders form) { form.ShowDialog(); - }*/ + } } private void ButtonCreateOrder_Click(object sender, EventArgs e) @@ -241,5 +241,6 @@ namespace PrecastConcretePlantView { LoadData(); } + } } \ No newline at end of file diff --git a/PrecastConcretePlant/PrecastConcretePlantView/FormReportGroupedOrders.cs b/PrecastConcretePlant/PrecastConcretePlantView/FormReportGroupedOrders.cs new file mode 100644 index 0000000..4a1d86c --- /dev/null +++ b/PrecastConcretePlant/PrecastConcretePlantView/FormReportGroupedOrders.cs @@ -0,0 +1,72 @@ +using PrecastConcretePlantContracts.BindingModels; +using PrecastConcretePlantContracts.BusinessLogicsContracts; +using Microsoft.Extensions.Logging; +using Microsoft.Reporting.WinForms; + +namespace PrecastConcretePlantView +{ + public partial class FormReportGroupedOrders : Form + { + private readonly ReportViewer reportViewer; + + private readonly ILogger _logger; + + private readonly IReportLogic _logic; + + public FormReportGroupedOrders(ILogger logger, IReportLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + reportViewer = new ReportViewer + { + Dock = DockStyle.Fill + }; + reportViewer.LocalReport.LoadReportDefinition(new FileStream("ReportGroupedOrders.rdlc", FileMode.Open)); + Controls.Clear(); + Controls.Add(reportViewer); + Controls.Add(panel); + } + + private void ButtonCreateReport_Click(object sender, EventArgs e) + { + try + { + var dataSource = _logic.GetGroupedByDateOrders(); + var source = new ReportDataSource("DataSetOrders", dataSource); + reportViewer.LocalReport.DataSources.Clear(); + reportViewer.LocalReport.DataSources.Add(source); + + reportViewer.RefreshReport(); + _logger.LogInformation("Loading list of grouped orders"); + } + catch (Exception ex) + { + _logger.LogError(ex, "Loading list of grouped orders error"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonToPdf_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "pdf|*.pdf" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + try + { + _logic.SaveGroupedOrdersToPdfFile(new ReportBindingModel + { + FileName = dialog.FileName, + }); + _logger.LogInformation("Saving list of grouped orders"); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception ex) + { + _logger.LogError(ex, "Saving list of grouped orders error"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + } +} \ No newline at end of file diff --git a/PrecastConcretePlant/PrecastConcretePlantView/FormReportGroupedOrders.designer.cs b/PrecastConcretePlant/PrecastConcretePlantView/FormReportGroupedOrders.designer.cs new file mode 100644 index 0000000..4c4abd0 --- /dev/null +++ b/PrecastConcretePlant/PrecastConcretePlantView/FormReportGroupedOrders.designer.cs @@ -0,0 +1,91 @@ +namespace PrecastConcretePlantView +{ + partial class FormReportGroupedOrders + { + /// + /// 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() + { + panel = new Panel(); + buttonToPdf = new Button(); + buttonCreateReport = new Button(); + panel.SuspendLayout(); + SuspendLayout(); + // + // panel + // + panel.Controls.Add(buttonToPdf); + panel.Controls.Add(buttonCreateReport); + panel.Dock = DockStyle.Top; + panel.Location = new Point(0, 0); + panel.Margin = new Padding(4, 3, 4, 3); + panel.Name = "panel"; + panel.Size = new Size(1031, 40); + panel.TabIndex = 0; + // + // buttonToPdf + // + buttonToPdf.Anchor = AnchorStyles.Top | AnchorStyles.Right; + buttonToPdf.Location = new Point(188, 8); + buttonToPdf.Margin = new Padding(4, 3, 4, 3); + buttonToPdf.Name = "buttonToPdf"; + buttonToPdf.Size = new Size(139, 27); + buttonToPdf.TabIndex = 5; + buttonToPdf.Text = "В Pdf"; + buttonToPdf.UseVisualStyleBackColor = true; + buttonToPdf.Click += ButtonToPdf_Click; + // + // buttonCreateReport + // + buttonCreateReport.Location = new Point(11, 8); + buttonCreateReport.Margin = new Padding(4, 3, 4, 3); + buttonCreateReport.Name = "buttonCreateReport"; + buttonCreateReport.Size = new Size(139, 27); + buttonCreateReport.TabIndex = 4; + buttonCreateReport.Text = "Сформировать"; + buttonCreateReport.UseVisualStyleBackColor = true; + buttonCreateReport.Click += ButtonCreateReport_Click; + // + // FormReportGroupedOrders + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(1031, 647); + Controls.Add(panel); + Margin = new Padding(4, 3, 4, 3); + Name = "FormReportGroupedOrders"; + StartPosition = FormStartPosition.CenterScreen; + Text = "Заказы по датам"; + panel.ResumeLayout(false); + ResumeLayout(false); + } + + #endregion + + private System.Windows.Forms.Panel panel; + private System.Windows.Forms.Button buttonToPdf; + private System.Windows.Forms.Button buttonCreateReport; + } +} \ No newline at end of file diff --git a/PrecastConcretePlant/PrecastConcretePlantView/FormReportGroupedOrders.resx b/PrecastConcretePlant/PrecastConcretePlantView/FormReportGroupedOrders.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/PrecastConcretePlant/PrecastConcretePlantView/FormReportGroupedOrders.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/PrecastConcretePlant/PrecastConcretePlantView/FormReportShopReinforceds.cs b/PrecastConcretePlant/PrecastConcretePlantView/FormReportShopReinforceds.cs new file mode 100644 index 0000000..5d86ada --- /dev/null +++ b/PrecastConcretePlant/PrecastConcretePlantView/FormReportShopReinforceds.cs @@ -0,0 +1,70 @@ +using PrecastConcretePlantContracts.BindingModels; +using PrecastConcretePlantContracts.BusinessLogicsContracts; +using Microsoft.Extensions.Logging; + +namespace PrecastConcretePlantView +{ + public partial class FormReportShopReinforceds : Form + { + private readonly ILogger _logger; + + private readonly IReportLogic _logic; + + public FormReportShopReinforceds(ILogger logger, IReportLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + } + + private void FormReportShopReinforceds_Load(object sender, EventArgs e) + { + try + { + var dict = _logic.GetShopReinforceds(); + if (dict != null) + { + dataGridView.Rows.Clear(); + foreach (var elem in dict) + { + dataGridView.Rows.Add(new object[] { elem.ShopName, "", "" }); + foreach (var listElem in elem.Reinforceds) + { + dataGridView.Rows.Add(new object[] { "", listElem.Item1, listElem.Item2 }); + } + dataGridView.Rows.Add(new object[] { "Итого", "", elem.TotalCount }); + dataGridView.Rows.Add(Array.Empty()); + } + } + _logger.LogInformation("Loading information on store workload"); + } + catch (Exception ex) + { + _logger.LogError(ex, "Loading information on store workload error"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ButtonSaveToExcel_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "xlsx|*.xlsx" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + try + { + _logic.SaveShopReinforcedToExcelFile(new ReportBindingModel + { + FileName = dialog.FileName + }); + _logger.LogInformation("Saving information on store workload"); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception ex) + { + _logger.LogError(ex, "Saving information on store workload error"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + } +} \ No newline at end of file diff --git a/PrecastConcretePlant/PrecastConcretePlantView/FormReportShopReinforceds.designer.cs b/PrecastConcretePlant/PrecastConcretePlantView/FormReportShopReinforceds.designer.cs new file mode 100644 index 0000000..550580d --- /dev/null +++ b/PrecastConcretePlant/PrecastConcretePlantView/FormReportShopReinforceds.designer.cs @@ -0,0 +1,114 @@ +namespace PrecastConcretePlantView +{ + partial class FormReportShopReinforceds + { + /// + /// 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() + { + dataGridView = new DataGridView(); + buttonSaveToExcel = new Button(); + ColumnShop = new DataGridViewTextBoxColumn(); + ColumnReinforced = new DataGridViewTextBoxColumn(); + ColumnCount = new DataGridViewTextBoxColumn(); + ((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit(); + SuspendLayout(); + // + // dataGridView + // + dataGridView.AllowUserToAddRows = false; + dataGridView.AllowUserToDeleteRows = false; + dataGridView.AllowUserToOrderColumns = true; + dataGridView.AllowUserToResizeColumns = false; + dataGridView.AllowUserToResizeRows = false; + dataGridView.BackgroundColor = SystemColors.ControlLightLight; + dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize; + dataGridView.Columns.AddRange(new DataGridViewColumn[] { ColumnShop, ColumnReinforced, ColumnCount }); + dataGridView.Dock = DockStyle.Bottom; + dataGridView.Location = new Point(0, 47); + dataGridView.Margin = new Padding(4, 3, 4, 3); + dataGridView.MultiSelect = false; + dataGridView.Name = "dataGridView"; + dataGridView.ReadOnly = true; + dataGridView.RowHeadersVisible = false; + dataGridView.Size = new Size(616, 510); + dataGridView.TabIndex = 0; + // + // buttonSaveToExcel + // + buttonSaveToExcel.Location = new Point(13, 10); + buttonSaveToExcel.Margin = new Padding(4, 3, 4, 3); + buttonSaveToExcel.Name = "buttonSaveToExcel"; + buttonSaveToExcel.Size = new Size(186, 27); + buttonSaveToExcel.TabIndex = 1; + buttonSaveToExcel.Text = "Сохранить в Excel"; + buttonSaveToExcel.UseVisualStyleBackColor = true; + buttonSaveToExcel.Click += ButtonSaveToExcel_Click; + // + // ColumnShop + // + ColumnShop.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + ColumnShop.HeaderText = "Магазин"; + ColumnShop.Name = "ColumnShop"; + ColumnShop.ReadOnly = true; + // + // ColumnIceCream + // + ColumnReinforced.HeaderText = "Изделия"; + ColumnReinforced.Name = "ColumnReinforced"; + ColumnReinforced.ReadOnly = true; + ColumnReinforced.Width = 200; + // + // ColumnCount + // + ColumnCount.HeaderText = "Количество"; + ColumnCount.Name = "ColumnCount"; + ColumnCount.ReadOnly = true; + // + // FormReportShopReinforceds + // + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(616, 557); + Controls.Add(buttonSaveToExcel); + Controls.Add(dataGridView); + Margin = new Padding(4, 3, 4, 3); + Name = "FormReportShopReinforceds"; + StartPosition = FormStartPosition.CenterScreen; + Text = "Загруженность магазинов"; + Load += FormReportShopReinforceds_Load; + ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); + ResumeLayout(false); + } + + #endregion + + private System.Windows.Forms.DataGridView dataGridView; + private System.Windows.Forms.Button buttonSaveToExcel; + private DataGridViewTextBoxColumn ColumnShop; + private DataGridViewTextBoxColumn ColumnReinforced; + private DataGridViewTextBoxColumn ColumnCount; + } +} \ No newline at end of file diff --git a/PrecastConcretePlant/PrecastConcretePlantView/FormReportShopReinforceds.resx b/PrecastConcretePlant/PrecastConcretePlantView/FormReportShopReinforceds.resx new file mode 100644 index 0000000..af32865 --- /dev/null +++ b/PrecastConcretePlant/PrecastConcretePlantView/FormReportShopReinforceds.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/PrecastConcretePlant/PrecastConcretePlantView/PrecastConcretePlantView.csproj b/PrecastConcretePlant/PrecastConcretePlantView/PrecastConcretePlantView.csproj index 5c0bd5c..248f247 100644 --- a/PrecastConcretePlant/PrecastConcretePlantView/PrecastConcretePlantView.csproj +++ b/PrecastConcretePlant/PrecastConcretePlantView/PrecastConcretePlantView.csproj @@ -28,6 +28,9 @@ + + Always + Always diff --git a/PrecastConcretePlant/PrecastConcretePlantView/Program.cs b/PrecastConcretePlant/PrecastConcretePlantView/Program.cs index 7647cf0..ebcf959 100644 --- a/PrecastConcretePlant/PrecastConcretePlantView/Program.cs +++ b/PrecastConcretePlant/PrecastConcretePlantView/Program.cs @@ -67,6 +67,9 @@ namespace PrecastConcretePlantView services.AddTransient(); services.AddTransient(); + + services.AddTransient(); + services.AddTransient(); } } } \ No newline at end of file diff --git a/PrecastConcretePlant/PrecastConcretePlantView/ReportGroupedOrders.rdlc b/PrecastConcretePlant/PrecastConcretePlantView/ReportGroupedOrders.rdlc new file mode 100644 index 0000000..9f5344e --- /dev/null +++ b/PrecastConcretePlant/PrecastConcretePlantView/ReportGroupedOrders.rdlc @@ -0,0 +1,424 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + 10791c83-cee8-4a38-bbd0-245fc17cefb3 + + + + + + PrecastConcretePlantContractsViewModels + /* Local Query */ + + + + Date + System.DateTime + + + Count + System.Int32 + + + Sum + System.Decimal + + + + PrecastConcretePlantContracts.ViewModels + ReportOrdersByDateViewModel + PrecastConcretePlantContracts.ViewModels.ReportOrdersByDateViewModel, PrecastConcretePlantContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + + + + + + + + + true + true + + + + + Заказы по датам + + + + + + + 1cm + 21cm + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + 6.01401cm + + + 6.56042cm + + + 6.12687cm + + + + + 0.6cm + + + + + true + true + + + + + Дата + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Количество заказов + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Сумма + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Fields!Date.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Count.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Sum.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + After + + + + + + + DataSetOrders + 1.95474cm + 1.16099cm + 1.2cm + 18.7013cm + 1 + + + + + + true + true + + + + + Всего: + + + + + + + 4cm + 11.23542cm + 0.6cm + 2.5cm + 2 + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + + + + + =Sum(Fields!Sum.Value, "DataSetOrders") + + + + + + + 4cm + 13.73542cm + 0.6cm + 6.12687cm + 3 + + + 2pt + 2pt + 2pt + 2pt + + + + 5.72875cm +