From c6f09e166caf71321ba64680f54bb451de47c404 Mon Sep 17 00:00:00 2001 From: georgiy semikolenov Date: Thu, 18 May 2023 12:07:56 +0400 Subject: [PATCH] =?UTF-8?q?=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ComponentLogic.cs | 2 +- .../OfficePackage/AbstractSaveToExcel.cs | 6 +- .../OfficePackage/AbstractSaveToPdf.cs | 6 +- .../OfficePackage/AbstractSaveToWord.cs | 6 +- .../HelperEnums/ExcelStyleInfo.cs | 2 +- .../HelperEnums/PdfParagraphAlignmentType.cs | 2 +- .../HelperEnums/WordJustificationType.cs | 2 +- .../OfficePackage/HelperModels/ExceInfo.cs | 2 +- .../HelperModels/ExcelCellParameters.cs | 4 +- .../HelperModels/ExcelMergeParameters.cs | 2 +- .../OfficePackage/HelperModels/PdfInfo.cs | 2 +- .../HelperModels/PdfParagraph.cs | 4 +- .../HelperModels/PdfRowParameters.cs | 4 +- .../OfficePackage/HelperModels/WordInfo.cs | 2 +- .../HelperModels/WordParagraph.cs | 2 +- .../HelperModels/WordTextProperties.cs | 4 +- .../OfficePackage/Implements/SaveToExcel.cs | 6 +- .../OfficePackage/Implements/SaveToPdf.cs | 6 +- .../OfficePackage/Implements/SaveToWord.cs | 6 +- .../PlumbingRepairBusinesLogic/OrderLogic.cs | 2 +- .../PlumbingRepairBusinesLogic/ReportLogic.cs | 8 +- .../PlumbingRepairBusinesLogic/WorkLogic.cs | 2 +- .../BusinesLogicsContracts/IReportLogic.cs | 2 +- .../PlumbingRepairView/FormMain.Designer.cs | 5 +- PlumbingRepair/PlumbingRepairView/FormMain.cs | 37 ++++++++- .../FormReportOrders.Designer.cs | 2 +- .../PlumbingRepairView/FormReportOrders.resx | 62 ++++++++++++++- .../FormReportWorkComponents.Designer.cs | 43 ++++++----- .../FormReportWorkComponents.cs | 77 ++++++++++++++++--- .../PlumbingRepairView.csproj | 1 + PlumbingRepair/PlumbingRepairView/Program.cs | 2 +- .../PlumbingRepairView/ReportOrders.rdlc | 10 +++ 32 files changed, 245 insertions(+), 78 deletions(-) create mode 100644 PlumbingRepair/PlumbingRepairView/ReportOrders.rdlc diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/ComponentLogic.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/ComponentLogic.cs index f08bce1..ecd7605 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/ComponentLogic.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/ComponentLogic.cs @@ -5,7 +5,7 @@ using PlumbingRepairContracts.StoragesContracts; using PlumbingRepairContracts.ViewModels; using Microsoft.Extensions.Logging; -namespace PlumbingRepairBusinessLogic.BusinesLogics +namespace PlumbingRepairBusinesLogic.BusinesLogics { public class ComponentLogic : IComponentLogic { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/AbstractSaveToExcel.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/AbstractSaveToExcel.cs index 7ce2329..c9ed0f3 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/AbstractSaveToExcel.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/AbstractSaveToExcel.cs @@ -1,7 +1,7 @@ -using PlumbingRepairBusinessLogic.OfficePackage.HelperEnums; -using PlumbingRepairBusinessLogic.OfficePackage.HelperModels; +using PlumbingRepairBusinesLogic.OfficePackage.HelperEnums; +using PlumbingRepairBusinesLogic.OfficePackage.HelperModels; -namespace PlumbingRepairBusinessLogic.OfficePackage +namespace PlumbingRepairBusinesLogic.OfficePackage { public abstract class AbstractSaveToExcel { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/AbstractSaveToPdf.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/AbstractSaveToPdf.cs index a4be4e3..cd4814a 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/AbstractSaveToPdf.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/AbstractSaveToPdf.cs @@ -1,7 +1,7 @@ -using PlumbingRepairBusinessLogic.OfficePackage.HelperEnums; -using PlumbingRepairBusinessLogic.OfficePackage.HelperModels; +using PlumbingRepairBusinesLogic.OfficePackage.HelperEnums; +using PlumbingRepairBusinesLogic.OfficePackage.HelperModels; -namespace PlumbingRepairBusinessLogic.OfficePackage +namespace PlumbingRepairBusinesLogic.OfficePackage { public abstract class AbstractSaveToPdf { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/AbstractSaveToWord.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/AbstractSaveToWord.cs index fab740c..12fd181 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/AbstractSaveToWord.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/AbstractSaveToWord.cs @@ -1,7 +1,7 @@ -using PlumbingRepairBusinessLogic.OfficePackage.HelperEnums; -using PlumbingRepairBusinessLogic.OfficePackage.HelperModels; +using PlumbingRepairBusinesLogic.OfficePackage.HelperEnums; +using PlumbingRepairBusinesLogic.OfficePackage.HelperModels; -namespace PlumbingRepairBusinessLogic.OfficePackage +namespace PlumbingRepairBusinesLogic.OfficePackage { public abstract class AbstractSaveToWord { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperEnums/ExcelStyleInfo.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperEnums/ExcelStyleInfo.cs index 5e7b35e..03ab77a 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperEnums/ExcelStyleInfo.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperEnums/ExcelStyleInfo.cs @@ -1,4 +1,4 @@ -namespace PlumbingRepairBusinessLogic.OfficePackage.HelperEnums +namespace PlumbingRepairBusinesLogic.OfficePackage.HelperEnums { public enum ExcelStyleInfoType { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperEnums/PdfParagraphAlignmentType.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperEnums/PdfParagraphAlignmentType.cs index 6ff75bf..8240e76 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperEnums/PdfParagraphAlignmentType.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperEnums/PdfParagraphAlignmentType.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace PlumbingRepairBusinessLogic.OfficePackage.HelperEnums +namespace PlumbingRepairBusinesLogic.OfficePackage.HelperEnums { public enum PdfParagraphAlignmentType { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperEnums/WordJustificationType.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperEnums/WordJustificationType.cs index ace781d..25f7f38 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperEnums/WordJustificationType.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperEnums/WordJustificationType.cs @@ -1,4 +1,4 @@ -namespace PlumbingRepairBusinessLogic.OfficePackage.HelperEnums +namespace PlumbingRepairBusinesLogic.OfficePackage.HelperEnums { public enum WordJustificationType { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/ExceInfo.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/ExceInfo.cs index cd66e2b..c671fa6 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/ExceInfo.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/ExceInfo.cs @@ -1,6 +1,6 @@ using PlumbingRepairContracts.ViewModels; -namespace PlumbingRepairBusinessLogic.OfficePackage.HelperModels +namespace PlumbingRepairBusinesLogic.OfficePackage.HelperModels { public class ExcelInfo { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/ExcelCellParameters.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/ExcelCellParameters.cs index 7f2896c..6ef25bb 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/ExcelCellParameters.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/ExcelCellParameters.cs @@ -1,6 +1,6 @@ -using PlumbingRepairBusinessLogic.OfficePackage.HelperEnums; +using PlumbingRepairBusinesLogic.OfficePackage.HelperEnums; -namespace PlumbingRepairBusinessLogic.OfficePackage.HelperModels +namespace PlumbingRepairBusinesLogic.OfficePackage.HelperModels { public class ExcelCellParameters { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/ExcelMergeParameters.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/ExcelMergeParameters.cs index 278d42b..144081d 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/ExcelMergeParameters.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/ExcelMergeParameters.cs @@ -1,4 +1,4 @@ -namespace PlumbingRepairBusinessLogic.OfficePackage.HelperModels +namespace PlumbingRepairBusinesLogic.OfficePackage.HelperModels { public class ExcelMergeParameters { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/PdfInfo.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/PdfInfo.cs index 6dcbc42..6c97c39 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/PdfInfo.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/PdfInfo.cs @@ -1,6 +1,6 @@ using PlumbingRepairContracts.ViewModels; -namespace PlumbingRepairBusinessLogic.OfficePackage.HelperModels +namespace PlumbingRepairBusinesLogic.OfficePackage.HelperModels { public class PdfInfo { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/PdfParagraph.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/PdfParagraph.cs index 2ea9502..889be4a 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/PdfParagraph.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/PdfParagraph.cs @@ -1,6 +1,6 @@ -using PlumbingRepairBusinessLogic.OfficePackage.HelperEnums; +using PlumbingRepairBusinesLogic.OfficePackage.HelperEnums; -namespace PlumbingRepairBusinessLogic.OfficePackage.HelperModels +namespace PlumbingRepairBusinesLogic.OfficePackage.HelperModels { public class PdfParagraph { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/PdfRowParameters.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/PdfRowParameters.cs index 54346ce..96fdfb0 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/PdfRowParameters.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/PdfRowParameters.cs @@ -1,6 +1,6 @@ -using PlumbingRepairBusinessLogic.OfficePackage.HelperEnums; +using PlumbingRepairBusinesLogic.OfficePackage.HelperEnums; -namespace PlumbingRepairBusinessLogic.OfficePackage.HelperModels +namespace PlumbingRepairBusinesLogic.OfficePackage.HelperModels { public class PdfRowParameters { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/WordInfo.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/WordInfo.cs index 36b262e..77774f5 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/WordInfo.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/WordInfo.cs @@ -1,6 +1,6 @@ using PlumbingRepairContracts.ViewModels; -namespace PlumbingRepairBusinessLogic.OfficePackage.HelperModels +namespace PlumbingRepairBusinesLogic.OfficePackage.HelperModels { public class WordInfo { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/WordParagraph.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/WordParagraph.cs index b8e3233..4bcda8c 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/WordParagraph.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/WordParagraph.cs @@ -1,4 +1,4 @@ -namespace PlumbingRepairBusinessLogic.OfficePackage.HelperModels +namespace PlumbingRepairBusinesLogic.OfficePackage.HelperModels { public class WordParagraph { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/WordTextProperties.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/WordTextProperties.cs index d2c8efb..3121f8a 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/WordTextProperties.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/HelperModels/WordTextProperties.cs @@ -1,6 +1,6 @@ -using PlumbingRepairBusinessLogic.OfficePackage.HelperEnums; +using PlumbingRepairBusinesLogic.OfficePackage.HelperEnums; -namespace PlumbingRepairBusinessLogic.OfficePackage.HelperModels +namespace PlumbingRepairBusinesLogic.OfficePackage.HelperModels { public class WordTextProperties { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/Implements/SaveToExcel.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/Implements/SaveToExcel.cs index 74b674e..364b2f0 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/Implements/SaveToExcel.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/Implements/SaveToExcel.cs @@ -3,10 +3,10 @@ using DocumentFormat.OpenXml.Office2013.Excel; using DocumentFormat.OpenXml.Packaging; using DocumentFormat.OpenXml.Spreadsheet; using DocumentFormat.OpenXml; -using PlumbingRepairBusinessLogic.OfficePackage.HelperEnums; -using PlumbingRepairBusinessLogic.OfficePackage.HelperModels; +using PlumbingRepairBusinesLogic.OfficePackage.HelperEnums; +using PlumbingRepairBusinesLogic.OfficePackage.HelperModels; -namespace PlumbingRepairBusinessLogic.OfficePackage.Implements +namespace PlumbingRepairBusinesLogic.OfficePackage.Implements { public class SaveToExcel : AbstractSaveToExcel { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/Implements/SaveToPdf.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/Implements/SaveToPdf.cs index 5b5ea61..625c914 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/Implements/SaveToPdf.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/Implements/SaveToPdf.cs @@ -1,10 +1,10 @@ -using PlumbingRepairBusinessLogic.OfficePackage.HelperEnums; -using PlumbingRepairBusinessLogic.OfficePackage.HelperModels; +using PlumbingRepairBusinesLogic.OfficePackage.HelperEnums; +using PlumbingRepairBusinesLogic.OfficePackage.HelperModels; using MigraDoc.DocumentObjectModel; using MigraDoc.DocumentObjectModel.Tables; using MigraDoc.Rendering; -namespace PlumbingRepairBusinessLogic.OfficePackage.Implements +namespace PlumbingRepairBusinesLogic.OfficePackage.Implements { public class SaveToPdf : AbstractSaveToPdf { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/Implements/SaveToWord.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/Implements/SaveToWord.cs index 94eda29..487dd3f 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/Implements/SaveToWord.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OfficePackage/Implements/SaveToWord.cs @@ -1,11 +1,11 @@ -using PlumbingRepairBusinessLogic.OfficePackage.HelperEnums; -using PlumbingRepairBusinessLogic.OfficePackage.HelperModels; +using PlumbingRepairBusinesLogic.OfficePackage.HelperEnums; +using PlumbingRepairBusinesLogic.OfficePackage.HelperModels; using DocumentFormat.OpenXml; using DocumentFormat.OpenXml.Packaging; using DocumentFormat.OpenXml.Wordprocessing; -namespace PlumbingRepairBusinessLogic.OfficePackage.Implements +namespace PlumbingRepairBusinesLogic.OfficePackage.Implements { public class SaveToWord : AbstractSaveToWord { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/OrderLogic.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/OrderLogic.cs index ad67007..1d116c0 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/OrderLogic.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/OrderLogic.cs @@ -6,7 +6,7 @@ using PlumbingRepairContracts.ViewModels; using PlumbingRepairDataModels.Enums; using Microsoft.Extensions.Logging; -namespace PlumbingRepairBusinessLogic.BusinesLogics +namespace PlumbingRepairBusinesLogic.BusinesLogics { public class OrderLogic: IOrderLogic { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/ReportLogic.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/ReportLogic.cs index 6396c45..1cbdcba 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/ReportLogic.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/ReportLogic.cs @@ -1,12 +1,12 @@ -using PlumbingRepairBusinessLogic.OfficePackage.HelperModels; -using PlumbingRepairBusinessLogic.OfficePackage; +using PlumbingRepairBusinesLogic.OfficePackage.HelperModels; +using PlumbingRepairBusinesLogic.OfficePackage; using PlumbingRepairContracts.BindingModels; -using PlumbingRepairContracts.BusinessLogicsContracts; +using PlumbingRepairContracts.BusinesLogicsContracts; using PlumbingRepairContracts.SearchModels; using PlumbingRepairContracts.StoragesContracts; using PlumbingRepairContracts.ViewModels; -namespace PlumbingRepairBusinessLogic.BusinessLogic +namespace PlumbingRepairBusinesLogic.BusinessLogic { public class ReportLogic : IReportLogic { diff --git a/PlumbingRepair/PlumbingRepairBusinesLogic/WorkLogic.cs b/PlumbingRepair/PlumbingRepairBusinesLogic/WorkLogic.cs index 2c08e4e..b1f3533 100644 --- a/PlumbingRepair/PlumbingRepairBusinesLogic/WorkLogic.cs +++ b/PlumbingRepair/PlumbingRepairBusinesLogic/WorkLogic.cs @@ -5,7 +5,7 @@ using PlumbingRepairContracts.StoragesContracts; using PlumbingRepairContracts.ViewModels; using Microsoft.Extensions.Logging; -namespace PlumbingRepairBusinessLogic.BusinesLogics +namespace PlumbingRepairBusinesLogic.BusinesLogics { public class WorkLogic: IWorkLogic { diff --git a/PlumbingRepair/PlumbingRepairContracts/BusinesLogicsContracts/IReportLogic.cs b/PlumbingRepair/PlumbingRepairContracts/BusinesLogicsContracts/IReportLogic.cs index e1202b2..74a7360 100644 --- a/PlumbingRepair/PlumbingRepairContracts/BusinesLogicsContracts/IReportLogic.cs +++ b/PlumbingRepair/PlumbingRepairContracts/BusinesLogicsContracts/IReportLogic.cs @@ -1,7 +1,7 @@ using PlumbingRepairContracts.BindingModels; using PlumbingRepairContracts.ViewModels; -namespace PlumbingRepairContracts.BusinessLogicsContracts +namespace PlumbingRepairContracts.BusinesLogicsContracts { public interface IReportLogic { diff --git a/PlumbingRepair/PlumbingRepairView/FormMain.Designer.cs b/PlumbingRepair/PlumbingRepairView/FormMain.Designer.cs index 0da09e9..f047a3f 100644 --- a/PlumbingRepair/PlumbingRepairView/FormMain.Designer.cs +++ b/PlumbingRepair/PlumbingRepairView/FormMain.Designer.cs @@ -143,19 +143,22 @@ // this.списокКомпонентовToolStripMenuItem.Name = "списокКомпонентовToolStripMenuItem"; this.списокКомпонентовToolStripMenuItem.Size = new System.Drawing.Size(268, 26); - this.списокКомпонентовToolStripMenuItem.Text = "Список компонентов"; + this.списокКомпонентовToolStripMenuItem.Text = "Список работ"; + this.списокКомпонентовToolStripMenuItem.Click += new System.EventHandler(this.WorksToolStripMenuItem_Click); // // компонентыПоРаботамToolStripMenuItem // this.компонентыПоРаботамToolStripMenuItem.Name = "компонентыПоРаботамToolStripMenuItem"; this.компонентыПоРаботамToolStripMenuItem.Size = new System.Drawing.Size(268, 26); this.компонентыПоРаботамToolStripMenuItem.Text = "Компоненты по работам"; + this.компонентыПоРаботамToolStripMenuItem.Click += new System.EventHandler(this.WorkComponentToolStripMenuItem_Click); // // списокЗаказовToolStripMenuItem // this.списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem"; this.списокЗаказовToolStripMenuItem.Size = new System.Drawing.Size(268, 26); this.списокЗаказовToolStripMenuItem.Text = "Список заказов"; + this.списокЗаказовToolStripMenuItem.Click += new System.EventHandler(this.OrdersToolStripMenuItem_Click); // // menuStrip1 // diff --git a/PlumbingRepair/PlumbingRepairView/FormMain.cs b/PlumbingRepair/PlumbingRepairView/FormMain.cs index cdb5c27..77e3507 100644 --- a/PlumbingRepair/PlumbingRepairView/FormMain.cs +++ b/PlumbingRepair/PlumbingRepairView/FormMain.cs @@ -1,5 +1,6 @@ using Microsoft.Extensions.Logging; using PlumbingRepairContracts.BindingModels; +using PlumbingRepairBusinesLogic.BusinessLogic; using PlumbingRepairContracts.BusinesLogicsContracts; using PlumbingRepairDataModels.Enums; @@ -9,12 +10,13 @@ namespace PlumbingRepairView { 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) @@ -186,5 +188,36 @@ namespace PlumbingRepairView { LoadData(); } + + private void WorksToolStripMenuItem_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + _reportLogic.SaveWorksToWordFile(new ReportBindingModel + { + FileName = dialog.FileName + }); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + + private void WorkComponentToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormReportWorkComponents)); + if (service is FormReportWorkComponents form) + { + form.ShowDialog(); + } + } + + private void OrdersToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormReportOrders)); + if (service is FormReportOrders form) + { + form.ShowDialog(); + } + } } } diff --git a/PlumbingRepair/PlumbingRepairView/FormReportOrders.Designer.cs b/PlumbingRepair/PlumbingRepairView/FormReportOrders.Designer.cs index 09b95ac..2368120 100644 --- a/PlumbingRepair/PlumbingRepairView/FormReportOrders.Designer.cs +++ b/PlumbingRepair/PlumbingRepairView/FormReportOrders.Designer.cs @@ -31,7 +31,7 @@ this.components = new System.ComponentModel.Container(); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "FormReportWorkComponents"; + this.Text = "FormReportOrders"; } #endregion diff --git a/PlumbingRepair/PlumbingRepairView/FormReportOrders.resx b/PlumbingRepair/PlumbingRepairView/FormReportOrders.resx index f298a7b..1af7de1 100644 --- a/PlumbingRepair/PlumbingRepairView/FormReportOrders.resx +++ b/PlumbingRepair/PlumbingRepairView/FormReportOrders.resx @@ -1,4 +1,64 @@ - + + + diff --git a/PlumbingRepair/PlumbingRepairView/FormReportWorkComponents.Designer.cs b/PlumbingRepair/PlumbingRepairView/FormReportWorkComponents.Designer.cs index 1ee78a0..9a4c7ed 100644 --- a/PlumbingRepair/PlumbingRepairView/FormReportWorkComponents.Designer.cs +++ b/PlumbingRepair/PlumbingRepairView/FormReportWorkComponents.Designer.cs @@ -1,4 +1,4 @@ -namespace PlumbingRepair +namespace PlumbingRepairView { partial class FormReportWorkComponents { @@ -28,7 +28,7 @@ /// private void InitializeComponent() { - this.button1 = new System.Windows.Forms.Button(); + this.SaveButton = new System.Windows.Forms.Button(); this.dataGridView = new System.Windows.Forms.DataGridView(); this.Component = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Work = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -36,14 +36,15 @@ ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); this.SuspendLayout(); // - // button1 + // SaveButton // - this.button1.Location = new System.Drawing.Point(12, 12); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(94, 29); - this.button1.TabIndex = 0; - this.button1.Text = "button1"; - this.button1.UseVisualStyleBackColor = true; + this.SaveButton.Location = new System.Drawing.Point(16, 17); + this.SaveButton.Name = "SaveButton"; + this.SaveButton.Size = new System.Drawing.Size(189, 29); + this.SaveButton.TabIndex = 0; + this.SaveButton.Text = "Сохранить в Excel"; + this.SaveButton.UseVisualStyleBackColor = true; + this.SaveButton.Click += new System.EventHandler(this.ButtonSave_Click); // // dataGridView // @@ -52,43 +53,47 @@ this.Component, this.Work, this.Count}); - this.dataGridView.Location = new System.Drawing.Point(-3, 58); + this.dataGridView.Location = new System.Drawing.Point(1, 61); this.dataGridView.Name = "dataGridView"; this.dataGridView.RowHeadersWidth = 51; this.dataGridView.RowTemplate.Height = 29; - this.dataGridView.Size = new System.Drawing.Size(644, 378); + this.dataGridView.Size = new System.Drawing.Size(654, 489); this.dataGridView.TabIndex = 1; // // Component // + this.Component.FillWeight = 200F; this.Component.HeaderText = "Компонент"; this.Component.MinimumWidth = 6; this.Component.Name = "Component"; - this.Component.Width = 195; + this.Component.Width = 200; // // Work // - this.Work.HeaderText = "Изделие"; + this.Work.FillWeight = 200F; + this.Work.HeaderText = "Работа"; this.Work.MinimumWidth = 6; this.Work.Name = "Work"; - this.Work.Width = 195; + this.Work.Width = 200; // // Count // + this.Count.FillWeight = 200F; this.Count.HeaderText = "Количество"; this.Count.MinimumWidth = 6; this.Count.Name = "Count"; - this.Count.Width = 195; + this.Count.Width = 200; // // FormReportWorkComponents // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(639, 538); + this.ClientSize = new System.Drawing.Size(656, 551); this.Controls.Add(this.dataGridView); - this.Controls.Add(this.button1); + this.Controls.Add(this.SaveButton); this.Name = "FormReportWorkComponents"; - this.Text = "FormReportOrders"; + this.Text = "Компоненты по работам"; + this.Load += new System.EventHandler(this.FormReportWorkComponents_Load); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); this.ResumeLayout(false); @@ -96,7 +101,7 @@ #endregion - private Button button1; + private Button SaveButton; private DataGridView dataGridView; private DataGridViewTextBoxColumn Component; private DataGridViewTextBoxColumn Work; diff --git a/PlumbingRepair/PlumbingRepairView/FormReportWorkComponents.cs b/PlumbingRepair/PlumbingRepairView/FormReportWorkComponents.cs index 951d894..337553c 100644 --- a/PlumbingRepair/PlumbingRepairView/FormReportWorkComponents.cs +++ b/PlumbingRepair/PlumbingRepairView/FormReportWorkComponents.cs @@ -1,20 +1,75 @@ -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; +using Microsoft.Extensions.Logging; +using PlumbingRepairContracts.BindingModels; +using PlumbingRepairContracts.BusinesLogicsContracts; namespace PlumbingRepairView { - public partial class FormReportOrders : Form + public partial class FormReportWorkComponents : Form { - public FormReportOrders() + private readonly ILogger _logger; + private readonly IReportLogic _logic; + public FormReportWorkComponents(ILogger logger, IReportLogic logic) { InitializeComponent(); + _logger = logger; + _logic = logic; + } + private void ButtonSave_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog + { + Filter = "xlsx|*.xlsx" + }; + if (dialog.ShowDialog() == DialogResult.OK) + { + try + { + _logic.SaveWorkComponentToExcelFile(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 FormReportWorkComponents_Load(object sender, EventArgs e) + { + try + { + var dict = _logic.GetWork(); + if (dict != null) + { + dataGridView.Rows.Clear(); + foreach (var elem in dict) + { + dataGridView.Rows.Add(new object[] { elem.WorkName, "", "" }); + 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()); + } + } + _logger.LogInformation("Загрузки списка изделий по компонентам"); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки списка изделий по компонентам"); + + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } } } } diff --git a/PlumbingRepair/PlumbingRepairView/PlumbingRepairView.csproj b/PlumbingRepair/PlumbingRepairView/PlumbingRepairView.csproj index 482614a..f59190c 100644 --- a/PlumbingRepair/PlumbingRepairView/PlumbingRepairView.csproj +++ b/PlumbingRepair/PlumbingRepairView/PlumbingRepairView.csproj @@ -14,6 +14,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/PlumbingRepair/PlumbingRepairView/Program.cs b/PlumbingRepair/PlumbingRepairView/Program.cs index f72f77d..1de54e9 100644 --- a/PlumbingRepair/PlumbingRepairView/Program.cs +++ b/PlumbingRepair/PlumbingRepairView/Program.cs @@ -4,7 +4,7 @@ using PlumbingRepairDatabaseImplements.Implements; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using NLog.Extensions.Logging; -using PlumbingRepairBusinessLogic.BusinesLogics; +using PlumbingRepairBusinesLogic.BusinesLogics; namespace PlumbingRepairView diff --git a/PlumbingRepair/PlumbingRepairView/ReportOrders.rdlc b/PlumbingRepair/PlumbingRepairView/ReportOrders.rdlc new file mode 100644 index 0000000..7c2476d --- /dev/null +++ b/PlumbingRepair/PlumbingRepairView/ReportOrders.rdlc @@ -0,0 +1,10 @@ + + + 6.5in + + 2in + + true + + +