From a2bf2257db57eed156d52ef77539a763c575a95d Mon Sep 17 00:00:00 2001 From: "leonteva.v" Date: Wed, 24 Apr 2024 09:55:55 +0400 Subject: [PATCH] =?UTF-8?q?4=20=D0=BB=D0=B0=D0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Typography/Typography/FormMain.Designer.cs | 38 +- Typography/Typography/FormMain.cs | 31 +- .../Typography/FormReportOrders.Designer.cs | 131 ++++ Typography/Typography/FormReportOrders.cs | 86 +++ Typography/Typography/FormReportOrders.resx | 60 ++ .../Typography/FormReportPrintedComponents.cs | 66 ++ .../FormReportPrintedComponents.designer.cs | 119 ++++ .../FormReportPrintedComponents.resx | 60 ++ Typography/Typography/Program.cs | 9 + Typography/Typography/ReportOrder.rdlc | 599 ++++++++++++++++++ Typography/Typography/TypographyView.csproj | 7 + .../BusinessLogics/ReportLogic.cs | 83 +++ .../OfficePackage/AbstractSaveToExcel.cs | 75 +++ .../OfficePackage/AbstractSaveToPdf.cs | 38 ++ .../OfficePackage/AbstractSaveToWord.cs | 42 ++ .../HelperEnums/ExcelStyleInfoType.cs | 9 + .../HelperEnums/PdfParagraphAlignmentType.cs | 9 + .../HelperEnums/WordJustificationType.cs | 8 + .../HelperModels/ExcelCellParameters.cs | 17 + .../OfficePackage/HelperModels/ExcelInfo.cs | 13 + .../HelperModels/ExcelMergeParameters.cs | 11 + .../OfficePackage/HelperModels/PdfInfo.cs | 17 + .../HelperModels/PdfParagraph.cs | 13 + .../HelperModels/PdfRowParameters.cs | 13 + .../OfficePackage/HelperModels/WordInfo.cs | 13 + .../HelperModels/WordParagraph.cs | 9 + .../HelperModels/WordTextProperties.cs | 13 + .../OfficePackage/Implements/SaveToExcel.cs | 222 +++++++ .../OfficePackage/Implements/SaveToPdf.cs | 94 +++ .../OfficePackage/Implements/SaveToWord.cs | 98 +++ .../TypographyBusinessLogic.csproj | 2 + .../BindingModels/ReportBindingModel.cs | 11 + .../BusinessLogicsContracts/IReportLogic.cs | 18 + .../SearchModels/OrderSearchModel.cs | 4 + .../ViewModels/ReportOrdersViewModel.cs | 15 + .../ReportPrintedComponentViewModel.cs | 11 + .../Implements/OrderStorage.cs | 4 +- .../Implements/OrderStorage.cs | 4 +- .../Implements/OrderStorage.cs | 4 +- 39 files changed, 2068 insertions(+), 8 deletions(-) create mode 100644 Typography/Typography/FormReportOrders.Designer.cs create mode 100644 Typography/Typography/FormReportOrders.cs create mode 100644 Typography/Typography/FormReportOrders.resx create mode 100644 Typography/Typography/FormReportPrintedComponents.cs create mode 100644 Typography/Typography/FormReportPrintedComponents.designer.cs create mode 100644 Typography/Typography/FormReportPrintedComponents.resx create mode 100644 Typography/Typography/ReportOrder.rdlc create mode 100644 Typography/TypographyBusinessLogic/BusinessLogics/ReportLogic.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/AbstractSaveToExcel.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/AbstractSaveToPdf.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/AbstractSaveToWord.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/HelperEnums/ExcelStyleInfoType.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/HelperEnums/PdfParagraphAlignmentType.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/HelperEnums/WordJustificationType.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/HelperModels/ExcelCellParameters.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/HelperModels/ExcelInfo.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/HelperModels/ExcelMergeParameters.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/HelperModels/PdfInfo.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/HelperModels/PdfParagraph.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/HelperModels/PdfRowParameters.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/HelperModels/WordInfo.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/HelperModels/WordParagraph.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/HelperModels/WordTextProperties.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/Implements/SaveToExcel.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/Implements/SaveToPdf.cs create mode 100644 Typography/TypographyBusinessLogic/OfficePackage/Implements/SaveToWord.cs create mode 100644 Typography/TypographyContracts/BindingModels/ReportBindingModel.cs create mode 100644 Typography/TypographyContracts/BusinessLogicsContracts/IReportLogic.cs create mode 100644 Typography/TypographyContracts/ViewModels/ReportOrdersViewModel.cs create mode 100644 Typography/TypographyContracts/ViewModels/ReportPrintedComponentViewModel.cs diff --git a/Typography/Typography/FormMain.Designer.cs b/Typography/Typography/FormMain.Designer.cs index 12610c3..380edea 100644 --- a/Typography/Typography/FormMain.Designer.cs +++ b/Typography/Typography/FormMain.Designer.cs @@ -33,6 +33,10 @@ directoriesToolStripMenuItem = new ToolStripMenuItem(); componentsToolStripMenuItem = new ToolStripMenuItem(); printedsToolStripMenuItem = new ToolStripMenuItem(); + ReportsToolStripMenuItem = new ToolStripMenuItem(); + PrintedListToolStripMenuItem = new ToolStripMenuItem(); + PrintedComponentsToolStripMenuItem = new ToolStripMenuItem(); + ListOfOrdersToolStripMenuItem = new ToolStripMenuItem(); buttonCreateOrder = new Button(); buttonTakeOrderInWork = new Button(); buttonOrderReady = new Button(); @@ -58,7 +62,7 @@ // menuStrip // menuStrip.ImageScalingSize = new Size(20, 20); - menuStrip.Items.AddRange(new ToolStripItem[] { directoriesToolStripMenuItem }); + menuStrip.Items.AddRange(new ToolStripItem[] { directoriesToolStripMenuItem, ReportsToolStripMenuItem }); menuStrip.Location = new Point(0, 0); menuStrip.Name = "menuStrip"; menuStrip.Size = new Size(1331, 28); @@ -86,6 +90,34 @@ printedsToolStripMenuItem.Text = "Печатная продукция"; printedsToolStripMenuItem.Click += printedsToolStripMenuItem_Click; // + // ReportsToolStripMenuItem + // + ReportsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { PrintedListToolStripMenuItem, PrintedComponentsToolStripMenuItem, ListOfOrdersToolStripMenuItem }); + ReportsToolStripMenuItem.Name = "ReportsToolStripMenuItem"; + ReportsToolStripMenuItem.Size = new Size(73, 24); + ReportsToolStripMenuItem.Text = "Отчеты"; + // + // PrintedListToolStripMenuItem + // + PrintedListToolStripMenuItem.Name = "PrintedListToolStripMenuItem"; + PrintedListToolStripMenuItem.Size = new Size(332, 26); + PrintedListToolStripMenuItem.Text = "Список печатной продукции"; + PrintedListToolStripMenuItem.Click += PrintedListToolStripMenuItem_Click; + // + // PrintedComponentsToolStripMenuItem + // + PrintedComponentsToolStripMenuItem.Name = "PrintedComponentsToolStripMenuItem"; + PrintedComponentsToolStripMenuItem.Size = new Size(332, 26); + PrintedComponentsToolStripMenuItem.Text = "Компоненты печатной продукции"; + PrintedComponentsToolStripMenuItem.Click += PrintedComponentsToolStripMenuItem_Click; + // + // ListOfOrdersToolStripMenuItem + // + ListOfOrdersToolStripMenuItem.Name = "ListOfOrdersToolStripMenuItem"; + ListOfOrdersToolStripMenuItem.Size = new Size(332, 26); + ListOfOrdersToolStripMenuItem.Text = "Список заказов"; + ListOfOrdersToolStripMenuItem.Click += ListOfOrdersToolStripMenuItem_Click; + // // buttonCreateOrder // buttonCreateOrder.Location = new Point(1109, 42); @@ -171,5 +203,9 @@ private Button buttonOrderReady; private Button buttonIssuedOrder; private Button buttonRef; + private ToolStripMenuItem ReportsToolStripMenuItem; + private ToolStripMenuItem PrintedListToolStripMenuItem; + private ToolStripMenuItem PrintedComponentsToolStripMenuItem; + private ToolStripMenuItem ListOfOrdersToolStripMenuItem; } } \ No newline at end of file diff --git a/Typography/Typography/FormMain.cs b/Typography/Typography/FormMain.cs index 69420b4..57c6ffb 100644 --- a/Typography/Typography/FormMain.cs +++ b/Typography/Typography/FormMain.cs @@ -2,6 +2,8 @@ using TypographyContracts.BindingModels; using TypographyContracts.BusinessLogicsContracts; using Microsoft.Extensions.Logging; +using Typography; +using TypographyBusinessLogic.BusinessLogics; namespace TypographyView { @@ -9,11 +11,13 @@ namespace TypographyView { 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 LoadData() { @@ -134,5 +138,30 @@ namespace TypographyView { LoadData(); } + private void PrintedListToolStripMenuItem_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "docx|*.docx" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + _reportLogic.SavePrintedsToWordFile(new ReportBindingModel { FileName = dialog.FileName }); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } + private void PrintedComponentsToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormReportPrintedComponents)); + if (service is FormReportPrintedComponents form) + { + form.ShowDialog(); + } + } + private void ListOfOrdersToolStripMenuItem_Click(object sender, EventArgs e) + { + var service = Program.ServiceProvider?.GetService(typeof(FormReportOrders)); + if (service is FormReportOrders form) + { + form.ShowDialog(); + } + } } } diff --git a/Typography/Typography/FormReportOrders.Designer.cs b/Typography/Typography/FormReportOrders.Designer.cs new file mode 100644 index 0000000..4eb7c87 --- /dev/null +++ b/Typography/Typography/FormReportOrders.Designer.cs @@ -0,0 +1,131 @@ +namespace Typography +{ + partial class FormReportOrders + { + /// + /// 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() + { + panelControl = new Panel(); + buttonToPdf = new Button(); + dateTimePickerTo = new DateTimePicker(); + buttonMake = new Button(); + labelFrom = new Label(); + dateTimePickerFrom = new DateTimePicker(); + labelTo = new Label(); + panelControl.SuspendLayout(); + SuspendLayout(); + // + // panelControl + // + panelControl.Controls.Add(buttonToPdf); + panelControl.Controls.Add(dateTimePickerTo); + panelControl.Controls.Add(buttonMake); + panelControl.Controls.Add(labelFrom); + panelControl.Controls.Add(dateTimePickerFrom); + panelControl.Controls.Add(labelTo); + panelControl.Dock = DockStyle.Top; + panelControl.Location = new Point(0, 0); + panelControl.Name = "panelControl"; + panelControl.Size = new Size(982, 49); + panelControl.TabIndex = 0; + // + // buttonToPdf + // + buttonToPdf.Location = new Point(817, 10); + buttonToPdf.Name = "buttonToPdf"; + buttonToPdf.Size = new Size(153, 29); + buttonToPdf.TabIndex = 4; + buttonToPdf.Text = "В Pdf"; + buttonToPdf.UseVisualStyleBackColor = true; + buttonToPdf.Click += ButtonToPdf_Click; + // + // dateTimePickerTo + // + dateTimePickerTo.Location = new Point(254, 10); + dateTimePickerTo.Name = "dateTimePickerTo"; + dateTimePickerTo.Size = new Size(179, 27); + dateTimePickerTo.TabIndex = 6; + // + // buttonMake + // + buttonMake.Location = new Point(439, 10); + buttonMake.Name = "buttonMake"; + buttonMake.Size = new Size(153, 29); + buttonMake.TabIndex = 3; + buttonMake.Text = "Сформировать"; + buttonMake.UseVisualStyleBackColor = true; + buttonMake.Click += ButtonMake_Click; + // + // labelFrom + // + labelFrom.AutoSize = true; + labelFrom.Location = new Point(12, 15); + labelFrom.Name = "labelFrom"; + labelFrom.Size = new Size(18, 20); + labelFrom.TabIndex = 1; + labelFrom.Text = "С"; + // + // dateTimePickerFrom + // + dateTimePickerFrom.Location = new Point(36, 10); + dateTimePickerFrom.Name = "dateTimePickerFrom"; + dateTimePickerFrom.Size = new Size(179, 27); + dateTimePickerFrom.TabIndex = 5; + // + // labelTo + // + labelTo.AutoSize = true; + labelTo.Location = new Point(221, 15); + labelTo.Name = "labelTo"; + labelTo.Size = new Size(27, 20); + labelTo.TabIndex = 2; + labelTo.Text = "по"; + // + // FormReportOrders + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(982, 753); + Controls.Add(panelControl); + Name = "FormReportOrders"; + StartPosition = FormStartPosition.CenterParent; + Text = "Заказы"; + panelControl.ResumeLayout(false); + panelControl.PerformLayout(); + ResumeLayout(false); + } + + #endregion + + private Panel panelControl; + private Label labelFrom; + private Label labelTo; + private Button buttonMake; + private Button buttonToPdf; + private DateTimePicker dateTimePickerFrom; + private DateTimePicker dateTimePickerTo; + } +} \ No newline at end of file diff --git a/Typography/Typography/FormReportOrders.cs b/Typography/Typography/FormReportOrders.cs new file mode 100644 index 0000000..5e294f3 --- /dev/null +++ b/Typography/Typography/FormReportOrders.cs @@ -0,0 +1,86 @@ +using TypographyContracts.BindingModels; +using TypographyContracts.BusinessLogicsContracts; +using Microsoft.Extensions.Logging; +using Microsoft.Reporting.WinForms; + +namespace Typography +{ + public partial class FormReportOrders : Form + { + private readonly ReportViewer reportViewer; + private readonly ILogger _logger; + private readonly IReportLogic _logic; + public FormReportOrders(ILogger logger, IReportLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + reportViewer = new ReportViewer + { + Dock = DockStyle.Fill + }; + reportViewer.LocalReport.LoadReportDefinition(new FileStream("ReportOrder.rdlc", FileMode.Open)); + Controls.Clear(); + Controls.Add(reportViewer); + Controls.Add(panelControl); + } + private void ButtonMake_Click(object sender, EventArgs e) + { + if (dateTimePickerFrom.Value.Date >= dateTimePickerTo.Value.Date) + { + MessageBox.Show("Дата начала должна быть меньше даты окончания", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + try + { + var dataSource = _logic.GetOrders(new ReportBindingModel + { + DateFrom = dateTimePickerFrom.Value, + DateTo = dateTimePickerTo.Value + }); + var source = new ReportDataSource("DataSetOrders", dataSource); + reportViewer.LocalReport.DataSources.Clear(); + reportViewer.LocalReport.DataSources.Add(source); + var parameters = new[] { new ReportParameter("ReportParameterPeriod", + $"c {dateTimePickerFrom.Value.ToShortDateString()} по {dateTimePickerTo.Value.ToShortDateString()}") }; + reportViewer.LocalReport.SetParameters(parameters); + + reportViewer.RefreshReport(); + _logger.LogInformation("Загрузка списка заказов за период {From}-{To}", dateTimePickerFrom.Value.ToShortDateString(), dateTimePickerTo.Value.ToShortDateString()); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки списка заказов за период"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + private void ButtonToPdf_Click(object sender, EventArgs e) + { + if (dateTimePickerFrom.Value.Date >= dateTimePickerTo.Value.Date) + { + MessageBox.Show("Дата начала должна быть меньше даты окончания", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + using var dialog = new SaveFileDialog { Filter = "pdf|*.pdf" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + try + { + _logic.SaveOrdersToPdfFile(new ReportBindingModel + { + FileName = dialog.FileName, + DateFrom = dateTimePickerFrom.Value, + DateTo = dateTimePickerTo.Value + }); + _logger.LogInformation("Сохранение списка заказов за период {From}-{To}", dateTimePickerFrom.Value.ToShortDateString(), dateTimePickerTo.Value.ToShortDateString()); + MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка сохранения списка заказов за период"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } + } +} \ No newline at end of file diff --git a/Typography/Typography/FormReportOrders.resx b/Typography/Typography/FormReportOrders.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/Typography/Typography/FormReportOrders.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/Typography/Typography/FormReportPrintedComponents.cs b/Typography/Typography/FormReportPrintedComponents.cs new file mode 100644 index 0000000..dc15630 --- /dev/null +++ b/Typography/Typography/FormReportPrintedComponents.cs @@ -0,0 +1,66 @@ +using TypographyContracts.BindingModels; +using TypographyContracts.BusinessLogicsContracts; +using Microsoft.Extensions.Logging; + +namespace Typography +{ + public partial class FormReportPrintedComponents : Form + { + private readonly ILogger _logger; + private readonly IReportLogic _logic; + public FormReportPrintedComponents(ILogger logger, IReportLogic logic) + { + InitializeComponent(); + _logger = logger; + _logic = logic; + } + private void FormReportPrintedComponents_Load(object sender, EventArgs e) + { + try + { + var dict = _logic.GetPrintedComponent(); + if (dict != null) + { + dataGridView.Rows.Clear(); + foreach (var elem in dict) + { + dataGridView.Rows.Add(new object[] { elem.PrintedName, "", "" }); + 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); + } + } + private void ButtonSaveToExcel_Click(object sender, EventArgs e) + { + using var dialog = new SaveFileDialog { Filter = "xlsx|*.xlsx" }; + if (dialog.ShowDialog() == DialogResult.OK) + { + try + { + _logic.SavePrintedComponentToExcelFile(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); + } + } + } + } +} \ No newline at end of file diff --git a/Typography/Typography/FormReportPrintedComponents.designer.cs b/Typography/Typography/FormReportPrintedComponents.designer.cs new file mode 100644 index 0000000..f8546cc --- /dev/null +++ b/Typography/Typography/FormReportPrintedComponents.designer.cs @@ -0,0 +1,119 @@ +namespace Typography +{ + partial class FormReportPrintedComponents + { + /// + /// 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(); + ColumnPrinted = new DataGridViewTextBoxColumn(); + ColumnComponent = 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[] { ColumnPrinted, ColumnComponent, ColumnCount }); + dataGridView.Dock = DockStyle.Bottom; + dataGridView.Location = new Point(0, 53); + dataGridView.Margin = new Padding(4, 5, 4, 5); + dataGridView.MultiSelect = false; + dataGridView.Name = "dataGridView"; + dataGridView.ReadOnly = true; + dataGridView.RowHeadersVisible = false; + dataGridView.RowHeadersWidth = 51; + dataGridView.Size = new Size(782, 350); + dataGridView.TabIndex = 0; + // + // buttonSaveToExcel + // + buttonSaveToExcel.Location = new Point(13, 14); + buttonSaveToExcel.Margin = new Padding(4, 5, 4, 5); + buttonSaveToExcel.Name = "buttonSaveToExcel"; + buttonSaveToExcel.Size = new Size(203, 29); + buttonSaveToExcel.TabIndex = 1; + buttonSaveToExcel.Text = "Сохранить в Excel"; + buttonSaveToExcel.UseVisualStyleBackColor = true; + buttonSaveToExcel.Click += ButtonSaveToExcel_Click; + // + // ColumnPrinted + // + ColumnPrinted.HeaderText = "Печатная продукция"; + ColumnPrinted.MinimumWidth = 6; + ColumnPrinted.Name = "ColumnPrinted"; + ColumnPrinted.ReadOnly = true; + ColumnPrinted.Width = 200; + // + // ColumnComponent + // + ColumnComponent.HeaderText = "Компонент"; + ColumnComponent.MinimumWidth = 6; + ColumnComponent.Name = "ColumnComponent"; + ColumnComponent.ReadOnly = true; + ColumnComponent.Width = 200; + // + // ColumnCount + // + ColumnCount.HeaderText = "Количество"; + ColumnCount.MinimumWidth = 6; + ColumnCount.Name = "ColumnCount"; + ColumnCount.ReadOnly = true; + ColumnCount.Width = 125; + // + // FormReportPrintedComponents + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(782, 403); + Controls.Add(buttonSaveToExcel); + Controls.Add(dataGridView); + Margin = new Padding(4, 5, 4, 5); + Name = "FormReportPrintedComponents"; + StartPosition = FormStartPosition.CenterParent; + Text = "Компоненты по печатной продукции"; + Load += FormReportPrintedComponents_Load; + ((System.ComponentModel.ISupportInitialize)dataGridView).EndInit(); + ResumeLayout(false); + } + + #endregion + + private System.Windows.Forms.DataGridView dataGridView; + private System.Windows.Forms.Button buttonSaveToExcel; + private DataGridViewTextBoxColumn ColumnPrinted; + private DataGridViewTextBoxColumn ColumnComponent; + private DataGridViewTextBoxColumn ColumnCount; + } +} \ No newline at end of file diff --git a/Typography/Typography/FormReportPrintedComponents.resx b/Typography/Typography/FormReportPrintedComponents.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/Typography/Typography/FormReportPrintedComponents.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/Typography/Typography/Program.cs b/Typography/Typography/Program.cs index 8416c5a..2e65526 100644 --- a/Typography/Typography/Program.cs +++ b/Typography/Typography/Program.cs @@ -5,7 +5,10 @@ using TypographyDatabaseImplement.Implements; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using NLog.Extensions.Logging; +using TypographyBusinessLogic.OfficePackage.Implements; +using TypographyBusinessLogic.OfficePackage; using System; +using Typography; namespace TypographyView { @@ -41,6 +44,10 @@ namespace TypographyView services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -48,6 +55,8 @@ namespace TypographyView services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); } } } \ No newline at end of file diff --git a/Typography/Typography/ReportOrder.rdlc b/Typography/Typography/ReportOrder.rdlc new file mode 100644 index 0000000..baccfb9 --- /dev/null +++ b/Typography/Typography/ReportOrder.rdlc @@ -0,0 +1,599 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + 10791c83-cee8-4a38-bbd0-245fc17cefb3 + + + + + + TypographyContractsViewModels + /* Local Query */ + + + + Id + System.Int32 + + + DateCreate + System.DateTime + + + PrintedName + System.String + + + Sum + System.Decimal + + + Status + System.String + + + + TypographyContracts.ViewModels + ReportOrdersViewModel + TypographyContracts.ViewModels.ReportOrdersViewModel, TypographyContracts, 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 + + + + + Номер + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Дата создания + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Изделие + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Сумма + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Статус + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + =Fields!Id.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!DateCreate.Value + + + + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!PrintedName.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Sum.Value + + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Status.Value + + + 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 +