Всё, кроме pdf
This commit is contained in:
parent
d21e7de890
commit
a8cd32adeb
@ -87,14 +87,15 @@
|
|||||||
//
|
//
|
||||||
списокКомпонентовToolStripMenuItem.Name = "списокКомпонентовToolStripMenuItem";
|
списокКомпонентовToolStripMenuItem.Name = "списокКомпонентовToolStripMenuItem";
|
||||||
списокКомпонентовToolStripMenuItem.Size = new Size(242, 22);
|
списокКомпонентовToolStripMenuItem.Size = new Size(242, 22);
|
||||||
списокКомпонентовToolStripMenuItem.Text = "список компонентов";
|
списокКомпонентовToolStripMenuItem.Text = "список компьютеров";
|
||||||
списокКомпонентовToolStripMenuItem.Click += ComputerComponentsToolStripMenuItem_Click;
|
списокКомпонентовToolStripMenuItem.Click += ComponentsDocxToolStripMenuItem_Click;
|
||||||
//
|
//
|
||||||
// компонентыПоКомпьютерамToolStripMenuItem
|
// компонентыПоКомпьютерамToolStripMenuItem
|
||||||
//
|
//
|
||||||
компонентыПоКомпьютерамToolStripMenuItem.Name = "компонентыПоКомпьютерамToolStripMenuItem";
|
компонентыПоКомпьютерамToolStripMenuItem.Name = "компонентыПоКомпьютерамToolStripMenuItem";
|
||||||
компонентыПоКомпьютерамToolStripMenuItem.Size = new Size(242, 22);
|
компонентыПоКомпьютерамToolStripMenuItem.Size = new Size(242, 22);
|
||||||
компонентыПоКомпьютерамToolStripMenuItem.Text = "компоненты по компьютерам";
|
компонентыПоКомпьютерамToolStripMenuItem.Text = "компоненты по компьютерам";
|
||||||
|
компонентыПоКомпьютерамToolStripMenuItem.Click += ComputerComponentsToolStripMenuItem_Click;
|
||||||
//
|
//
|
||||||
// списокЗаказовToolStripMenuItem
|
// списокЗаказовToolStripMenuItem
|
||||||
//
|
//
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using ComputersShopContracts.BindingModels;
|
using ComputersShopBusinessLogic.BusinessLogics;
|
||||||
|
using ComputersShopContracts.BindingModels;
|
||||||
using ComputersShopContracts.BusinessLogicContracts;
|
using ComputersShopContracts.BusinessLogicContracts;
|
||||||
using ComputersShopDataModels.Enums;
|
using ComputersShopDataModels.Enums;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
@ -18,12 +19,14 @@ namespace ComputersShopView
|
|||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FormMain_Load(object sender, EventArgs e)
|
private void FormMain_Load(object sender, EventArgs e)
|
||||||
@ -166,6 +169,16 @@ namespace ComputersShopView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ComponentsDocxToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
using var dialog = new SaveFileDialog { Filter = "docx|*.docx" };
|
||||||
|
if (dialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
_reportLogic.SaveComputersToWordFile(new ReportBindingModel { FileName = dialog.FileName });
|
||||||
|
MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ComputerComponentsToolStripMenuItem_Click(object sender, EventArgs e)
|
private void ComputerComponentsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var service = Program.ServiceProvider?.GetService(typeof(FormReportComputerComponents));
|
var service = Program.ServiceProvider?.GetService(typeof(FormReportComputerComponents));
|
||||||
|
@ -28,94 +28,99 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.panel = new System.Windows.Forms.Panel();
|
panel = new Panel();
|
||||||
this.buttonToPdf = new System.Windows.Forms.Button();
|
buttonToPdf = new Button();
|
||||||
this.buttonMake = new System.Windows.Forms.Button();
|
buttonMake = new Button();
|
||||||
this.dateTimePickerTo = new System.Windows.Forms.DateTimePicker();
|
dateTimePickerTo = new DateTimePicker();
|
||||||
this.labelTo = new System.Windows.Forms.Label();
|
labelTo = new Label();
|
||||||
this.dateTimePickerFrom = new System.Windows.Forms.DateTimePicker();
|
dateTimePickerFrom = new DateTimePicker();
|
||||||
this.labelFrom = new System.Windows.Forms.Label();
|
labelFrom = new Label();
|
||||||
this.panel.SuspendLayout();
|
panel.SuspendLayout();
|
||||||
this.SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// panel
|
// panel
|
||||||
//
|
//
|
||||||
this.panel.Controls.Add(this.buttonToPdf);
|
panel.Controls.Add(buttonToPdf);
|
||||||
this.panel.Controls.Add(this.buttonMake);
|
panel.Controls.Add(buttonMake);
|
||||||
this.panel.Controls.Add(this.dateTimePickerTo);
|
panel.Controls.Add(dateTimePickerTo);
|
||||||
this.panel.Controls.Add(this.labelTo);
|
panel.Controls.Add(labelTo);
|
||||||
this.panel.Controls.Add(this.dateTimePickerFrom);
|
panel.Controls.Add(dateTimePickerFrom);
|
||||||
this.panel.Controls.Add(this.labelFrom);
|
panel.Controls.Add(labelFrom);
|
||||||
this.panel.Dock = System.Windows.Forms.DockStyle.Top;
|
panel.Dock = DockStyle.Top;
|
||||||
this.panel.Location = new System.Drawing.Point(0, 0);
|
panel.Location = new Point(0, 0);
|
||||||
this.panel.Name = "panel";
|
panel.Margin = new Padding(3, 2, 3, 2);
|
||||||
this.panel.Size = new System.Drawing.Size(926, 47);
|
panel.Name = "panel";
|
||||||
this.panel.TabIndex = 0;
|
panel.Size = new Size(810, 35);
|
||||||
|
panel.TabIndex = 0;
|
||||||
//
|
//
|
||||||
// buttonToPdf
|
// buttonToPdf
|
||||||
//
|
//
|
||||||
this.buttonToPdf.Location = new System.Drawing.Point(825, 7);
|
buttonToPdf.Location = new Point(722, 5);
|
||||||
this.buttonToPdf.Name = "buttonToPdf";
|
buttonToPdf.Margin = new Padding(3, 2, 3, 2);
|
||||||
this.buttonToPdf.Size = new System.Drawing.Size(94, 29);
|
buttonToPdf.Name = "buttonToPdf";
|
||||||
this.buttonToPdf.TabIndex = 5;
|
buttonToPdf.Size = new Size(82, 22);
|
||||||
this.buttonToPdf.Text = "в Pdf";
|
buttonToPdf.TabIndex = 5;
|
||||||
this.buttonToPdf.UseVisualStyleBackColor = true;
|
buttonToPdf.Text = "в Pdf";
|
||||||
this.buttonToPdf.Click += new System.EventHandler(this.ButtonToPdf_Click);
|
buttonToPdf.UseVisualStyleBackColor = true;
|
||||||
|
buttonToPdf.Click += ButtonToPdf_Click;
|
||||||
//
|
//
|
||||||
// buttonMake
|
// buttonMake
|
||||||
//
|
//
|
||||||
this.buttonMake.Location = new System.Drawing.Point(643, 7);
|
buttonMake.Location = new Point(563, 5);
|
||||||
this.buttonMake.Name = "buttonMake";
|
buttonMake.Margin = new Padding(3, 2, 3, 2);
|
||||||
this.buttonMake.Size = new System.Drawing.Size(149, 29);
|
buttonMake.Name = "buttonMake";
|
||||||
this.buttonMake.TabIndex = 4;
|
buttonMake.Size = new Size(130, 22);
|
||||||
this.buttonMake.Text = "Сформировать";
|
buttonMake.TabIndex = 4;
|
||||||
this.buttonMake.UseVisualStyleBackColor = true;
|
buttonMake.Text = "Сформировать";
|
||||||
this.buttonMake.Click += new System.EventHandler(this.ButtonMake_Click);
|
buttonMake.UseVisualStyleBackColor = true;
|
||||||
|
buttonMake.Click += ButtonMake_Click;
|
||||||
//
|
//
|
||||||
// dateTimePickerTo
|
// dateTimePickerTo
|
||||||
//
|
//
|
||||||
this.dateTimePickerTo.Location = new System.Drawing.Point(348, 9);
|
dateTimePickerTo.Location = new Point(304, 7);
|
||||||
this.dateTimePickerTo.Name = "dateTimePickerTo";
|
dateTimePickerTo.Margin = new Padding(3, 2, 3, 2);
|
||||||
this.dateTimePickerTo.Size = new System.Drawing.Size(250, 27);
|
dateTimePickerTo.Name = "dateTimePickerTo";
|
||||||
this.dateTimePickerTo.TabIndex = 3;
|
dateTimePickerTo.Size = new Size(219, 23);
|
||||||
|
dateTimePickerTo.TabIndex = 3;
|
||||||
//
|
//
|
||||||
// labelTo
|
// labelTo
|
||||||
//
|
//
|
||||||
this.labelTo.AutoSize = true;
|
labelTo.AutoSize = true;
|
||||||
this.labelTo.Location = new System.Drawing.Point(292, 14);
|
labelTo.Location = new Point(256, 10);
|
||||||
this.labelTo.Name = "labelTo";
|
labelTo.Name = "labelTo";
|
||||||
this.labelTo.Size = new System.Drawing.Size(50, 20);
|
labelTo.Size = new Size(38, 15);
|
||||||
this.labelTo.TabIndex = 2;
|
labelTo.TabIndex = 2;
|
||||||
this.labelTo.Text = "label1";
|
labelTo.Text = "label1";
|
||||||
//
|
//
|
||||||
// dateTimePickerFrom
|
// dateTimePickerFrom
|
||||||
//
|
//
|
||||||
this.dateTimePickerFrom.Location = new System.Drawing.Point(36, 9);
|
dateTimePickerFrom.Location = new Point(32, 7);
|
||||||
this.dateTimePickerFrom.Name = "dateTimePickerFrom";
|
dateTimePickerFrom.Margin = new Padding(3, 2, 3, 2);
|
||||||
this.dateTimePickerFrom.Size = new System.Drawing.Size(250, 27);
|
dateTimePickerFrom.Name = "dateTimePickerFrom";
|
||||||
this.dateTimePickerFrom.TabIndex = 1;
|
dateTimePickerFrom.Size = new Size(219, 23);
|
||||||
|
dateTimePickerFrom.TabIndex = 1;
|
||||||
//
|
//
|
||||||
// labelFrom
|
// labelFrom
|
||||||
//
|
//
|
||||||
this.labelFrom.AutoSize = true;
|
labelFrom.AutoSize = true;
|
||||||
this.labelFrom.Location = new System.Drawing.Point(12, 14);
|
labelFrom.Location = new Point(10, 10);
|
||||||
this.labelFrom.Name = "labelFrom";
|
labelFrom.Name = "labelFrom";
|
||||||
this.labelFrom.Size = new System.Drawing.Size(18, 20);
|
labelFrom.Size = new Size(15, 15);
|
||||||
this.labelFrom.TabIndex = 0;
|
labelFrom.TabIndex = 0;
|
||||||
this.labelFrom.Text = "C";
|
labelFrom.Text = "C";
|
||||||
//
|
//
|
||||||
// FormReportOrders
|
// FormReportOrders
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(926, 450);
|
ClientSize = new Size(810, 582);
|
||||||
this.Controls.Add(this.panel);
|
Controls.Add(panel);
|
||||||
this.Name = "FormReportOrders";
|
Margin = new Padding(3, 2, 3, 2);
|
||||||
this.Text = "Заказы";
|
Name = "FormReportOrders";
|
||||||
this.panel.ResumeLayout(false);
|
Text = "Заказы";
|
||||||
this.panel.PerformLayout();
|
panel.ResumeLayout(false);
|
||||||
this.ResumeLayout(false);
|
panel.PerformLayout();
|
||||||
|
ResumeLayout(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -1,64 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<root>
|
||||||
<root>
|
|
||||||
<!--
|
|
||||||
Microsoft ResX Schema
|
|
||||||
|
|
||||||
Version 2.0
|
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
|
||||||
that is mostly human readable. The generation and parsing of the
|
|
||||||
various data types are done through the TypeConverter classes
|
|
||||||
associated with the data types.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
|
||||||
<resheader name="version">2.0</resheader>
|
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
|
||||||
<comment>This is a comment</comment>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
|
||||||
name/value pairs.
|
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
|
||||||
text/value conversion through the TypeConverter architecture.
|
|
||||||
Classes that don't support this are serialized and stored with the
|
|
||||||
mimetype set.
|
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
|
||||||
read any of the formats listed below.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
|
||||||
value : The object must be serialized into a byte array
|
|
||||||
: using a System.ComponentModel.TypeConverter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
-->
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
Loading…
Reference in New Issue
Block a user