Шаг 4.3 Лабораторная сдана
This commit is contained in:
parent
e05df9849a
commit
a2a8c25236
@ -32,6 +32,10 @@
|
|||||||
this.СправочникиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.СправочникиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.ИзделияToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.ИзделияToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.КомпонентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.КомпонентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.отчетыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.списокДокументовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.компонентыПоДокументамToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.списокЗаказовToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.DataGridView = new System.Windows.Forms.DataGridView();
|
this.DataGridView = new System.Windows.Forms.DataGridView();
|
||||||
this.CreateOrderButton = new System.Windows.Forms.Button();
|
this.CreateOrderButton = new System.Windows.Forms.Button();
|
||||||
this.TakeOrderInWorkButton = new System.Windows.Forms.Button();
|
this.TakeOrderInWorkButton = new System.Windows.Forms.Button();
|
||||||
@ -44,11 +48,14 @@
|
|||||||
//
|
//
|
||||||
// MenuStrip
|
// MenuStrip
|
||||||
//
|
//
|
||||||
|
this.MenuStrip.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||||
this.MenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.MenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.СправочникиToolStripMenuItem});
|
this.СправочникиToolStripMenuItem,
|
||||||
|
this.отчетыToolStripMenuItem});
|
||||||
this.MenuStrip.Location = new System.Drawing.Point(0, 0);
|
this.MenuStrip.Location = new System.Drawing.Point(0, 0);
|
||||||
this.MenuStrip.Name = "MenuStrip";
|
this.MenuStrip.Name = "MenuStrip";
|
||||||
this.MenuStrip.Size = new System.Drawing.Size(1042, 24);
|
this.MenuStrip.Padding = new System.Windows.Forms.Padding(7, 3, 0, 3);
|
||||||
|
this.MenuStrip.Size = new System.Drawing.Size(1191, 30);
|
||||||
this.MenuStrip.TabIndex = 0;
|
this.MenuStrip.TabIndex = 0;
|
||||||
this.MenuStrip.Text = "menuStrip1";
|
this.MenuStrip.Text = "menuStrip1";
|
||||||
//
|
//
|
||||||
@ -58,37 +65,71 @@
|
|||||||
this.ИзделияToolStripMenuItem,
|
this.ИзделияToolStripMenuItem,
|
||||||
this.КомпонентыToolStripMenuItem});
|
this.КомпонентыToolStripMenuItem});
|
||||||
this.СправочникиToolStripMenuItem.Name = "СправочникиToolStripMenuItem";
|
this.СправочникиToolStripMenuItem.Name = "СправочникиToolStripMenuItem";
|
||||||
this.СправочникиToolStripMenuItem.Size = new System.Drawing.Size(94, 20);
|
this.СправочникиToolStripMenuItem.Size = new System.Drawing.Size(117, 24);
|
||||||
this.СправочникиToolStripMenuItem.Text = "Cправочники";
|
this.СправочникиToolStripMenuItem.Text = "Cправочники";
|
||||||
//
|
//
|
||||||
// ИзделияToolStripMenuItem
|
// ИзделияToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.ИзделияToolStripMenuItem.Name = "ИзделияToolStripMenuItem";
|
this.ИзделияToolStripMenuItem.Name = "ИзделияToolStripMenuItem";
|
||||||
this.ИзделияToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
this.ИзделияToolStripMenuItem.Size = new System.Drawing.Size(182, 26);
|
||||||
this.ИзделияToolStripMenuItem.Text = "Изделия";
|
this.ИзделияToolStripMenuItem.Text = "Изделия";
|
||||||
this.ИзделияToolStripMenuItem.Click += new System.EventHandler(this.ИзделияToolStripMenuItem_Click);
|
this.ИзделияToolStripMenuItem.Click += new System.EventHandler(this.ИзделияToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// КомпонентыToolStripMenuItem
|
// КомпонентыToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.КомпонентыToolStripMenuItem.Name = "КомпонентыToolStripMenuItem";
|
this.КомпонентыToolStripMenuItem.Name = "КомпонентыToolStripMenuItem";
|
||||||
this.КомпонентыToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
this.КомпонентыToolStripMenuItem.Size = new System.Drawing.Size(182, 26);
|
||||||
this.КомпонентыToolStripMenuItem.Text = "Компоненты";
|
this.КомпонентыToolStripMenuItem.Text = "Компоненты";
|
||||||
this.КомпонентыToolStripMenuItem.Click += new System.EventHandler(this.КомпонентыToolStripMenuItem_Click);
|
this.КомпонентыToolStripMenuItem.Click += new System.EventHandler(this.КомпонентыToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
|
// отчетыToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.отчетыToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
|
this.списокДокументовToolStripMenuItem,
|
||||||
|
this.компонентыПоДокументамToolStripMenuItem,
|
||||||
|
this.списокЗаказовToolStripMenuItem});
|
||||||
|
this.отчетыToolStripMenuItem.Name = "отчетыToolStripMenuItem";
|
||||||
|
this.отчетыToolStripMenuItem.Size = new System.Drawing.Size(73, 24);
|
||||||
|
this.отчетыToolStripMenuItem.Text = "Отчеты";
|
||||||
|
//
|
||||||
|
// списокДокументовToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.списокДокументовToolStripMenuItem.Name = "списокДокументовToolStripMenuItem";
|
||||||
|
this.списокДокументовToolStripMenuItem.Size = new System.Drawing.Size(292, 26);
|
||||||
|
this.списокДокументовToolStripMenuItem.Text = "Список документов";
|
||||||
|
this.списокДокументовToolStripMenuItem.Click += new System.EventHandler(this.списокДокументовToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// компонентыПоДокументамToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.компонентыПоДокументамToolStripMenuItem.Name = "компонентыПоДокументамToolStripMenuItem";
|
||||||
|
this.компонентыПоДокументамToolStripMenuItem.Size = new System.Drawing.Size(292, 26);
|
||||||
|
this.компонентыПоДокументамToolStripMenuItem.Text = "Компоненты по документам";
|
||||||
|
this.компонентыПоДокументамToolStripMenuItem.Click += new System.EventHandler(this.компонентыПоДокументамToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
|
// списокЗаказовToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem";
|
||||||
|
this.списокЗаказовToolStripMenuItem.Size = new System.Drawing.Size(292, 26);
|
||||||
|
this.списокЗаказовToolStripMenuItem.Text = "Список заказов";
|
||||||
|
this.списокЗаказовToolStripMenuItem.Click += new System.EventHandler(this.списокЗаказовToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
// DataGridView
|
// DataGridView
|
||||||
//
|
//
|
||||||
this.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
this.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
this.DataGridView.Location = new System.Drawing.Point(0, 27);
|
this.DataGridView.Location = new System.Drawing.Point(0, 36);
|
||||||
|
this.DataGridView.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
this.DataGridView.Name = "DataGridView";
|
this.DataGridView.Name = "DataGridView";
|
||||||
|
this.DataGridView.RowHeadersWidth = 51;
|
||||||
this.DataGridView.RowTemplate.Height = 25;
|
this.DataGridView.RowTemplate.Height = 25;
|
||||||
this.DataGridView.Size = new System.Drawing.Size(881, 421);
|
this.DataGridView.Size = new System.Drawing.Size(1007, 561);
|
||||||
this.DataGridView.TabIndex = 1;
|
this.DataGridView.TabIndex = 1;
|
||||||
//
|
//
|
||||||
// CreateOrderButton
|
// CreateOrderButton
|
||||||
//
|
//
|
||||||
this.CreateOrderButton.Location = new System.Drawing.Point(905, 27);
|
this.CreateOrderButton.Location = new System.Drawing.Point(1034, 36);
|
||||||
|
this.CreateOrderButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
this.CreateOrderButton.Name = "CreateOrderButton";
|
this.CreateOrderButton.Name = "CreateOrderButton";
|
||||||
this.CreateOrderButton.Size = new System.Drawing.Size(125, 33);
|
this.CreateOrderButton.Size = new System.Drawing.Size(143, 44);
|
||||||
this.CreateOrderButton.TabIndex = 2;
|
this.CreateOrderButton.TabIndex = 2;
|
||||||
this.CreateOrderButton.Text = "Создать заказ";
|
this.CreateOrderButton.Text = "Создать заказ";
|
||||||
this.CreateOrderButton.UseVisualStyleBackColor = true;
|
this.CreateOrderButton.UseVisualStyleBackColor = true;
|
||||||
@ -96,9 +137,10 @@
|
|||||||
//
|
//
|
||||||
// TakeOrderInWorkButton
|
// TakeOrderInWorkButton
|
||||||
//
|
//
|
||||||
this.TakeOrderInWorkButton.Location = new System.Drawing.Point(905, 66);
|
this.TakeOrderInWorkButton.Location = new System.Drawing.Point(1034, 88);
|
||||||
|
this.TakeOrderInWorkButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
this.TakeOrderInWorkButton.Name = "TakeOrderInWorkButton";
|
this.TakeOrderInWorkButton.Name = "TakeOrderInWorkButton";
|
||||||
this.TakeOrderInWorkButton.Size = new System.Drawing.Size(125, 39);
|
this.TakeOrderInWorkButton.Size = new System.Drawing.Size(143, 52);
|
||||||
this.TakeOrderInWorkButton.TabIndex = 3;
|
this.TakeOrderInWorkButton.TabIndex = 3;
|
||||||
this.TakeOrderInWorkButton.Text = "Отдать на выполнение";
|
this.TakeOrderInWorkButton.Text = "Отдать на выполнение";
|
||||||
this.TakeOrderInWorkButton.UseVisualStyleBackColor = true;
|
this.TakeOrderInWorkButton.UseVisualStyleBackColor = true;
|
||||||
@ -106,9 +148,10 @@
|
|||||||
//
|
//
|
||||||
// OrderReadyButton
|
// OrderReadyButton
|
||||||
//
|
//
|
||||||
this.OrderReadyButton.Location = new System.Drawing.Point(905, 111);
|
this.OrderReadyButton.Location = new System.Drawing.Point(1034, 148);
|
||||||
|
this.OrderReadyButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
this.OrderReadyButton.Name = "OrderReadyButton";
|
this.OrderReadyButton.Name = "OrderReadyButton";
|
||||||
this.OrderReadyButton.Size = new System.Drawing.Size(125, 33);
|
this.OrderReadyButton.Size = new System.Drawing.Size(143, 44);
|
||||||
this.OrderReadyButton.TabIndex = 4;
|
this.OrderReadyButton.TabIndex = 4;
|
||||||
this.OrderReadyButton.Text = "Заказ готов";
|
this.OrderReadyButton.Text = "Заказ готов";
|
||||||
this.OrderReadyButton.UseVisualStyleBackColor = true;
|
this.OrderReadyButton.UseVisualStyleBackColor = true;
|
||||||
@ -116,9 +159,10 @@
|
|||||||
//
|
//
|
||||||
// IssuedOrderButton
|
// IssuedOrderButton
|
||||||
//
|
//
|
||||||
this.IssuedOrderButton.Location = new System.Drawing.Point(905, 150);
|
this.IssuedOrderButton.Location = new System.Drawing.Point(1034, 200);
|
||||||
|
this.IssuedOrderButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
this.IssuedOrderButton.Name = "IssuedOrderButton";
|
this.IssuedOrderButton.Name = "IssuedOrderButton";
|
||||||
this.IssuedOrderButton.Size = new System.Drawing.Size(125, 33);
|
this.IssuedOrderButton.Size = new System.Drawing.Size(143, 44);
|
||||||
this.IssuedOrderButton.TabIndex = 5;
|
this.IssuedOrderButton.TabIndex = 5;
|
||||||
this.IssuedOrderButton.Text = "Заказ выдан";
|
this.IssuedOrderButton.Text = "Заказ выдан";
|
||||||
this.IssuedOrderButton.UseVisualStyleBackColor = true;
|
this.IssuedOrderButton.UseVisualStyleBackColor = true;
|
||||||
@ -126,9 +170,10 @@
|
|||||||
//
|
//
|
||||||
// UpdateListButton
|
// UpdateListButton
|
||||||
//
|
//
|
||||||
this.UpdateListButton.Location = new System.Drawing.Point(905, 189);
|
this.UpdateListButton.Location = new System.Drawing.Point(1034, 252);
|
||||||
|
this.UpdateListButton.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
this.UpdateListButton.Name = "UpdateListButton";
|
this.UpdateListButton.Name = "UpdateListButton";
|
||||||
this.UpdateListButton.Size = new System.Drawing.Size(125, 33);
|
this.UpdateListButton.Size = new System.Drawing.Size(143, 44);
|
||||||
this.UpdateListButton.TabIndex = 6;
|
this.UpdateListButton.TabIndex = 6;
|
||||||
this.UpdateListButton.Text = "Обновить список";
|
this.UpdateListButton.Text = "Обновить список";
|
||||||
this.UpdateListButton.UseVisualStyleBackColor = true;
|
this.UpdateListButton.UseVisualStyleBackColor = true;
|
||||||
@ -136,9 +181,9 @@
|
|||||||
//
|
//
|
||||||
// FormMain
|
// FormMain
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(1042, 450);
|
this.ClientSize = new System.Drawing.Size(1191, 600);
|
||||||
this.Controls.Add(this.UpdateListButton);
|
this.Controls.Add(this.UpdateListButton);
|
||||||
this.Controls.Add(this.IssuedOrderButton);
|
this.Controls.Add(this.IssuedOrderButton);
|
||||||
this.Controls.Add(this.OrderReadyButton);
|
this.Controls.Add(this.OrderReadyButton);
|
||||||
@ -147,8 +192,10 @@
|
|||||||
this.Controls.Add(this.DataGridView);
|
this.Controls.Add(this.DataGridView);
|
||||||
this.Controls.Add(this.MenuStrip);
|
this.Controls.Add(this.MenuStrip);
|
||||||
this.MainMenuStrip = this.MenuStrip;
|
this.MainMenuStrip = this.MenuStrip;
|
||||||
|
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
this.Name = "FormMain";
|
this.Name = "FormMain";
|
||||||
this.Text = "Завод ЖБИ";
|
this.Text = "Завод ЖБИ";
|
||||||
|
this.Load += new System.EventHandler(this.FormMain_Load);
|
||||||
this.MenuStrip.ResumeLayout(false);
|
this.MenuStrip.ResumeLayout(false);
|
||||||
this.MenuStrip.PerformLayout();
|
this.MenuStrip.PerformLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)(this.DataGridView)).EndInit();
|
((System.ComponentModel.ISupportInitialize)(this.DataGridView)).EndInit();
|
||||||
@ -169,5 +216,9 @@
|
|||||||
private Button OrderReadyButton;
|
private Button OrderReadyButton;
|
||||||
private Button IssuedOrderButton;
|
private Button IssuedOrderButton;
|
||||||
private Button UpdateListButton;
|
private Button UpdateListButton;
|
||||||
|
private ToolStripMenuItem отчетыToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem списокДокументовToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem компонентыПоДокументамToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem списокЗаказовToolStripMenuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,5 @@
|
|||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using PrecastConcretePlantBusinessLogic.BusinessLogic;
|
||||||
using PrecastConcretePlantContracts.BindingModels;
|
using PrecastConcretePlantContracts.BindingModels;
|
||||||
using PrecastConcretePlantContracts.BusinessLogicsContracts;
|
using PrecastConcretePlantContracts.BusinessLogicsContracts;
|
||||||
using PrecastConcretePlantDataModels.Enums;
|
using PrecastConcretePlantDataModels.Enums;
|
||||||
@ -19,12 +20,13 @@ namespace PrecastConcretePlantView
|
|||||||
|
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
private readonly IOrderLogic _orderLogic;
|
private readonly IOrderLogic _orderLogic;
|
||||||
|
private readonly IReportLogic _reportLogic;
|
||||||
public FormMain(ILogger<FormMain> logger, IOrderLogic orderLogic)
|
public FormMain(ILogger<FormMain> logger, IOrderLogic orderLogic, IReportLogic reportLogic)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_orderLogic = orderLogic;
|
_orderLogic = orderLogic;
|
||||||
|
_reportLogic = reportLogic;
|
||||||
LoadData();
|
LoadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,5 +199,36 @@ namespace PrecastConcretePlantView
|
|||||||
{
|
{
|
||||||
LoadData();
|
LoadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void списокДокументовToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
|
||||||
|
if (dialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
_reportLogic.SaveReinforcediesToWordFile(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(FormReportReinforcedComponents));
|
||||||
|
if (service is FormReportReinforcedComponents form)
|
||||||
|
{
|
||||||
|
form.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void списокЗаказовToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var service = Program.ServiceProvider?.GetService(typeof(FormReportOrder));
|
||||||
|
if (service is FormReportOrder form)
|
||||||
|
{
|
||||||
|
form.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
131
PrecastConcretePlant/PrecastConcretePlant/FormReportOrder.Designer.cs
generated
Normal file
131
PrecastConcretePlant/PrecastConcretePlant/FormReportOrder.Designer.cs
generated
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
namespace PrecastConcretePlantView
|
||||||
|
{
|
||||||
|
partial class FormReportOrder
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.panel = new System.Windows.Forms.Panel();
|
||||||
|
this.buttonCreateToPdf = new System.Windows.Forms.Button();
|
||||||
|
this.buttonCreateReport = new System.Windows.Forms.Button();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.dateTimePickerEnd = new System.Windows.Forms.DateTimePicker();
|
||||||
|
this.dateTimePickerStart = new System.Windows.Forms.DateTimePicker();
|
||||||
|
this.panel.SuspendLayout();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// panel
|
||||||
|
//
|
||||||
|
this.panel.Controls.Add(this.buttonCreateToPdf);
|
||||||
|
this.panel.Controls.Add(this.buttonCreateReport);
|
||||||
|
this.panel.Controls.Add(this.label2);
|
||||||
|
this.panel.Controls.Add(this.label1);
|
||||||
|
this.panel.Controls.Add(this.dateTimePickerEnd);
|
||||||
|
this.panel.Controls.Add(this.dateTimePickerStart);
|
||||||
|
this.panel.Dock = System.Windows.Forms.DockStyle.Top;
|
||||||
|
this.panel.Location = new System.Drawing.Point(0, 0);
|
||||||
|
this.panel.Name = "panel";
|
||||||
|
this.panel.Size = new System.Drawing.Size(984, 69);
|
||||||
|
this.panel.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// buttonCreateToPdf
|
||||||
|
//
|
||||||
|
this.buttonCreateToPdf.Location = new System.Drawing.Point(782, 39);
|
||||||
|
this.buttonCreateToPdf.Name = "buttonCreateToPdf";
|
||||||
|
this.buttonCreateToPdf.Size = new System.Drawing.Size(190, 27);
|
||||||
|
this.buttonCreateToPdf.TabIndex = 5;
|
||||||
|
this.buttonCreateToPdf.Text = "PDF";
|
||||||
|
this.buttonCreateToPdf.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonCreateToPdf.Click += new System.EventHandler(this.buttonCreateToPdf_Click);
|
||||||
|
//
|
||||||
|
// buttonCreateReport
|
||||||
|
//
|
||||||
|
this.buttonCreateReport.Location = new System.Drawing.Point(554, 39);
|
||||||
|
this.buttonCreateReport.Name = "buttonCreateReport";
|
||||||
|
this.buttonCreateReport.Size = new System.Drawing.Size(190, 27);
|
||||||
|
this.buttonCreateReport.TabIndex = 4;
|
||||||
|
this.buttonCreateReport.Text = "Сформировать";
|
||||||
|
this.buttonCreateReport.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonCreateReport.Click += new System.EventHandler(this.buttonCreateReport_Click);
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(369, 9);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(56, 20);
|
||||||
|
this.label2.TabIndex = 3;
|
||||||
|
this.label2.Text = "Конец:";
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(87, 6);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(64, 20);
|
||||||
|
this.label1.TabIndex = 2;
|
||||||
|
this.label1.Text = "Начало:";
|
||||||
|
//
|
||||||
|
// dateTimePickerEnd
|
||||||
|
//
|
||||||
|
this.dateTimePickerEnd.Location = new System.Drawing.Point(307, 39);
|
||||||
|
this.dateTimePickerEnd.Name = "dateTimePickerEnd";
|
||||||
|
this.dateTimePickerEnd.Size = new System.Drawing.Size(187, 27);
|
||||||
|
this.dateTimePickerEnd.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// dateTimePickerStart
|
||||||
|
//
|
||||||
|
this.dateTimePickerStart.Location = new System.Drawing.Point(35, 39);
|
||||||
|
this.dateTimePickerStart.Name = "dateTimePickerStart";
|
||||||
|
this.dateTimePickerStart.Size = new System.Drawing.Size(187, 27);
|
||||||
|
this.dateTimePickerStart.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// FormReportOrder
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(984, 450);
|
||||||
|
this.Controls.Add(this.panel);
|
||||||
|
this.Name = "FormReportOrder";
|
||||||
|
this.Text = "Заказы";
|
||||||
|
this.panel.ResumeLayout(false);
|
||||||
|
this.panel.PerformLayout();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Panel panel;
|
||||||
|
private DateTimePicker dateTimePickerEnd;
|
||||||
|
private DateTimePicker dateTimePickerStart;
|
||||||
|
private Button buttonCreateToPdf;
|
||||||
|
private Button buttonCreateReport;
|
||||||
|
private Label label2;
|
||||||
|
private Label label1;
|
||||||
|
}
|
||||||
|
}
|
94
PrecastConcretePlant/PrecastConcretePlant/FormReportOrder.cs
Normal file
94
PrecastConcretePlant/PrecastConcretePlant/FormReportOrder.cs
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
using PrecastConcretePlantContracts.BindingModels;
|
||||||
|
using PrecastConcretePlantContracts.BusinessLogicsContracts;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Microsoft.Reporting.WinForms;
|
||||||
|
|
||||||
|
namespace PrecastConcretePlantView
|
||||||
|
{
|
||||||
|
public partial class FormReportOrder : Form
|
||||||
|
{
|
||||||
|
private readonly ReportViewer reportViewer;
|
||||||
|
private readonly ILogger _logger;
|
||||||
|
private readonly IReportLogic _logic;
|
||||||
|
|
||||||
|
public FormReportOrder(ILogger<FormReportOrder> logger, IReportLogic logic)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_logger = logger;
|
||||||
|
_logic = logic;
|
||||||
|
reportViewer = new ReportViewer
|
||||||
|
{
|
||||||
|
Dock = DockStyle.Fill
|
||||||
|
};
|
||||||
|
reportViewer.LocalReport.LoadReportDefinition(new FileStream("ReportOrders.rdlc", FileMode.Open));
|
||||||
|
Controls.Clear();
|
||||||
|
Controls.Add(reportViewer);
|
||||||
|
Controls.Add(panel);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonCreateReport_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (dateTimePickerStart.Value.Date >= dateTimePickerEnd.Value.Date)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Дата начала должна быть меньше даты окончания","Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var dataSource = _logic.GetOrders(new ReportBindingModel
|
||||||
|
{
|
||||||
|
DateFrom = dateTimePickerStart.Value,
|
||||||
|
DateTo = dateTimePickerEnd.Value
|
||||||
|
});
|
||||||
|
var source = new ReportDataSource("DataSetOrders", dataSource);
|
||||||
|
reportViewer.LocalReport.DataSources.Clear();
|
||||||
|
reportViewer.LocalReport.DataSources.Add(source);
|
||||||
|
var parameters = new[] { new ReportParameter("ReportParameterPeriod", $"c{ dateTimePickerStart.Value.ToShortDateString()} по {dateTimePickerEnd.Value.ToShortDateString()}") };
|
||||||
|
reportViewer.LocalReport.SetParameters(parameters);
|
||||||
|
reportViewer.RefreshReport();
|
||||||
|
_logger.LogInformation("Загрузка списка заказов на период {From}-{ To}", dateTimePickerStart.Value.ToShortDateString(), dateTimePickerEnd.Value.ToShortDateString());
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Ошибка загрузки списка заказов на период");
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
|
||||||
|
MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void buttonCreateToPdf_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (dateTimePickerStart.Value.Date >= dateTimePickerEnd.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 = dateTimePickerStart.Value,
|
||||||
|
DateTo = dateTimePickerEnd.Value
|
||||||
|
});
|
||||||
|
_logger.LogInformation("Сохранение списка заказов на период { From} -{ To}", dateTimePickerStart.Value.ToShortDateString(),dateTimePickerEnd.Value.ToShortDateString());
|
||||||
|
MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Ошибка сохранения списка заказов на период");
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,60 @@
|
|||||||
|
<root>
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
@ -30,6 +30,7 @@
|
|||||||
<PackageReference Include="Microsoft.Extensions.Primitives" Version="7.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Primitives" Version="7.0.0" />
|
||||||
<PackageReference Include="NLog" Version="5.1.1" />
|
<PackageReference Include="NLog" Version="5.1.1" />
|
||||||
<PackageReference Include="NLog.Extensions.Logging" Version="5.2.1" />
|
<PackageReference Include="NLog.Extensions.Logging" Version="5.2.1" />
|
||||||
|
<PackageReference Include="ReportViewerCore.WinForms" Version="15.1.17" />
|
||||||
<PackageReference Include="Serilog" Version="2.12.0" />
|
<PackageReference Include="Serilog" Version="2.12.0" />
|
||||||
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
|
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
|
||||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
||||||
|
@ -50,6 +50,8 @@ namespace PrecastConcretePlantView
|
|||||||
services.AddTransient<FormReinforced>();
|
services.AddTransient<FormReinforced>();
|
||||||
services.AddTransient<FormReinforcedComponent>();
|
services.AddTransient<FormReinforcedComponent>();
|
||||||
services.AddTransient<FormReinforceds>();
|
services.AddTransient<FormReinforceds>();
|
||||||
|
services.AddTransient<FormReportReinforcedComponents>();
|
||||||
|
services.AddTransient<FormReportOrder>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
|
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2016/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
|
||||||
<AutoRefresh>0</AutoRefresh>
|
<AutoRefresh>0</AutoRefresh>
|
||||||
<DataSources>
|
<DataSources>
|
||||||
<DataSource Name="LawFirmContractsViewModels">
|
<DataSource Name="PrecastConcretePlantContractsViewModels">
|
||||||
<ConnectionProperties>
|
<ConnectionProperties>
|
||||||
<DataProvider>System.Data.DataSet</DataProvider>
|
<DataProvider>System.Data.DataSet</DataProvider>
|
||||||
<ConnectString>/* Local Connection */</ConnectString>
|
<ConnectString>/* Local Connection */</ConnectString>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<DataSets>
|
<DataSets>
|
||||||
<DataSet Name="DataSetOrders">
|
<DataSet Name="DataSetOrders">
|
||||||
<Query>
|
<Query>
|
||||||
<DataSourceName>LawFirmContractsViewModels</DataSourceName>
|
<DataSourceName>PrecastConcretePlantContractsViewModels</DataSourceName>
|
||||||
<CommandText>/* Local Query */</CommandText>
|
<CommandText>/* Local Query */</CommandText>
|
||||||
</Query>
|
</Query>
|
||||||
<Fields>
|
<Fields>
|
||||||
@ -25,8 +25,8 @@
|
|||||||
<DataField>DateCreate</DataField>
|
<DataField>DateCreate</DataField>
|
||||||
<rd:TypeName>System.DateTime</rd:TypeName>
|
<rd:TypeName>System.DateTime</rd:TypeName>
|
||||||
</Field>
|
</Field>
|
||||||
<Field Name="DocumentName">
|
<Field Name="ReinforcedName">
|
||||||
<DataField>DocumentName</DataField>
|
<DataField>ReinforcedName</DataField>
|
||||||
<rd:TypeName>System.String</rd:TypeName>
|
<rd:TypeName>System.String</rd:TypeName>
|
||||||
</Field>
|
</Field>
|
||||||
<Field Name="Sum">
|
<Field Name="Sum">
|
||||||
@ -39,9 +39,9 @@
|
|||||||
</Field>
|
</Field>
|
||||||
</Fields>
|
</Fields>
|
||||||
<rd:DataSetInfo>
|
<rd:DataSetInfo>
|
||||||
<rd:DataSetName>LawFirmContracts.ViewModels</rd:DataSetName>
|
<rd:DataSetName>PrecastConcretePlantContracts.ViewModels</rd:DataSetName>
|
||||||
<rd:TableName>ReportOrdersViewModel</rd:TableName>
|
<rd:TableName>ReportOrdersViewModel</rd:TableName>
|
||||||
<rd:ObjectDataSourceType>LawFirmContracts.ViewModels.ReportOrdersViewModel, LawFirmContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</rd:ObjectDataSourceType>
|
<rd:ObjectDataSourceType>PrecastConcretePlantContracts.ViewModels.ReportOrdersViewModel, PrecastConcretePlantContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</rd:ObjectDataSourceType>
|
||||||
</rd:DataSetInfo>
|
</rd:DataSetInfo>
|
||||||
</DataSet>
|
</DataSet>
|
||||||
</DataSets>
|
</DataSets>
|
||||||
@ -212,7 +212,7 @@
|
|||||||
<Paragraph>
|
<Paragraph>
|
||||||
<TextRuns>
|
<TextRuns>
|
||||||
<TextRun>
|
<TextRun>
|
||||||
<Value>Документ</Value>
|
<Value>Железобетонные изделия</Value>
|
||||||
<Style>
|
<Style>
|
||||||
<FontWeight>Bold</FontWeight>
|
<FontWeight>Bold</FontWeight>
|
||||||
</Style>
|
</Style>
|
||||||
@ -368,21 +368,21 @@
|
|||||||
</TablixCell>
|
</TablixCell>
|
||||||
<TablixCell>
|
<TablixCell>
|
||||||
<CellContents>
|
<CellContents>
|
||||||
<Textbox Name="DocumentName">
|
<Textbox Name="ReinforcedName">
|
||||||
<CanGrow>true</CanGrow>
|
<CanGrow>true</CanGrow>
|
||||||
<KeepTogether>true</KeepTogether>
|
<KeepTogether>true</KeepTogether>
|
||||||
<Paragraphs>
|
<Paragraphs>
|
||||||
<Paragraph>
|
<Paragraph>
|
||||||
<TextRuns>
|
<TextRuns>
|
||||||
<TextRun>
|
<TextRun>
|
||||||
<Value>=Fields!DocumentName.Value</Value>
|
<Value>=Fields!ReinforcedName.Value</Value>
|
||||||
<Style />
|
<Style />
|
||||||
</TextRun>
|
</TextRun>
|
||||||
</TextRuns>
|
</TextRuns>
|
||||||
<Style />
|
<Style />
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
</Paragraphs>
|
</Paragraphs>
|
||||||
<rd:DefaultName>DocumentName</rd:DefaultName>
|
<rd:DefaultName>ReinforcedName</rd:DefaultName>
|
||||||
<Style>
|
<Style>
|
||||||
<Border>
|
<Border>
|
||||||
<Color>LightGrey</Color>
|
<Color>LightGrey</Color>
|
||||||
|
@ -44,14 +44,14 @@ namespace PrecastConcretePlantDatabaseImplement.Implements
|
|||||||
|
|
||||||
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
||||||
{
|
{
|
||||||
if (!model.Id.HasValue)
|
if (!model.Id.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue)
|
||||||
{
|
{
|
||||||
return new();
|
return new();
|
||||||
}
|
}
|
||||||
|
|
||||||
using var context = new PrecastConcretePlantDataBase();
|
using var context = new PrecastConcretePlantDataBase();
|
||||||
|
|
||||||
return context.Orders.Where(x => x.Id == model.Id).Select(x => x.GetViewModel).ToList();
|
return context.Orders.Where(x => x.Id == model.Id || model.DateFrom <= x.DateCreate && x.DateCreate <= model.DateTo).Select(x => x.GetViewModel).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<OrderViewModel> GetFullList()
|
public List<OrderViewModel> GetFullList()
|
||||||
|
@ -37,7 +37,7 @@ namespace PrecastConcretePlantFileImplement.Implements
|
|||||||
|
|
||||||
public OrderViewModel? GetElement(OrderSearchModel model)
|
public OrderViewModel? GetElement(OrderSearchModel model)
|
||||||
{
|
{
|
||||||
if (!model.Id.HasValue)
|
if (!model.Id.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ namespace PrecastConcretePlantFileImplement.Implements
|
|||||||
return new();
|
return new();
|
||||||
}
|
}
|
||||||
|
|
||||||
return source.Orders.Where(x => x.Id == model.Id).Select(x => x.GetViewModel).ToList();
|
return source.Orders.Where(x => x.Id == model.Id || model.DateFrom <= x.DateCreate && x.DateCreate <= model.DateTo).Select(x => x.GetViewModel).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<OrderViewModel> GetFullList()
|
public List<OrderViewModel> GetFullList()
|
||||||
|
Loading…
Reference in New Issue
Block a user