Component Artyoma dont work

This commit is contained in:
user 2023-11-30 11:20:36 +04:00
parent 3704947e84
commit 280fcbba32
8 changed files with 149 additions and 85 deletions

View File

@ -11,6 +11,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="ComponentsLibraryNet60" Version="1.0.0" /> <PackageReference Include="ComponentsLibraryNet60" Version="1.0.0" />
<PackageReference Include="ControlsLibraryNet60" Version="1.0.0" /> <PackageReference Include="ControlsLibraryNet60" Version="1.0.0" />
<PackageReference Include="ExcelFormsLibrary" Version="1.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.14"> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.14">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@ -20,7 +21,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\DateBaseImplement\DateBaseImplement.csproj" /> <ProjectReference Include="..\DateBaseImplement\DateBaseImplement.csproj" />
<ProjectReference Include="..\WinFormsLibrary\WinFormsLibrary.csproj" /> <ProjectReference Include="..\WinFormsLibrary\WinFormsLibraryAA.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -28,105 +28,98 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container(); components = new System.ComponentModel.Container();
this.dataTable = new ControlsLibraryNet60.Data.ControlDataTableTable(); dataTable = new ControlsLibraryNet60.Data.ControlDataTableTable();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); contextMenuStrip1 = new ContextMenuStrip(components);
this.создатьToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); создатьToolStripMenuItem = new ToolStripMenuItem();
this.изменитьToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); изменитьToolStripMenuItem = new ToolStripMenuItem();
this.удалитьToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); удалитьToolStripMenuItem = new ToolStripMenuItem();
this.справочникToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); справочникToolStripMenuItem = new ToolStripMenuItem();
this.сформирироватьWordToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); сформирироватьWordToolStripMenuItem = new ToolStripMenuItem();
this.сформироватьPdfToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); сформироватьPdfToolStripMenuItem = new ToolStripMenuItem();
this.сформироватьExcelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); сформироватьExcelToolStripMenuItem = new ToolStripMenuItem();
this.documentWithImage1 = new WinFormsLibrary.DocumentWithImage(this.components); documentWithImage1 = new WinFormsLibrary.DocumentWithImage(components);
this.table2column1 = new WinFormsLibrary.Table2column(this.components); table2column1 = new WinFormsLibrary.Table2column(components);
this.componentDocumentWithChartBarExcel1 = new ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartBarExcel(this.components); componentDocumentWithChartBarExcel1 = new ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartBarExcel(components);
this.contextMenuStrip1.SuspendLayout(); gistograma1 = new WinFormsLibrary.not_visual.Gistograma(components);
this.SuspendLayout(); contextMenuStrip1.SuspendLayout();
SuspendLayout();
// //
// dataTable // dataTable
// //
this.dataTable.Location = new System.Drawing.Point(13, 12); dataTable.Location = new Point(13, 12);
this.dataTable.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); dataTable.Margin = new Padding(4, 3, 4, 3);
this.dataTable.Name = "dataTable"; dataTable.Name = "dataTable";
this.dataTable.SelectedRowIndex = -1; dataTable.SelectedRowIndex = -1;
this.dataTable.Size = new System.Drawing.Size(774, 426); dataTable.Size = new Size(774, 426);
this.dataTable.TabIndex = 0; dataTable.TabIndex = 0;
// //
// contextMenuStrip1 // contextMenuStrip1
// //
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { contextMenuStrip1.Items.AddRange(new ToolStripItem[] { создатьToolStripMenuItem, изменитьToolStripMenuItem, удалитьToolStripMenuItem, справочникToolStripMenuItem, сформирироватьWordToolStripMenuItem, сформироватьPdfToolStripMenuItem, сформироватьExcelToolStripMenuItem });
this.создатьToolStripMenuItem, contextMenuStrip1.Name = "contextMenuStrip1";
this.изменитьToolStripMenuItem, contextMenuStrip1.Size = new Size(205, 158);
this.удалитьToolStripMenuItem,
this.справочникToolStripMenuItem,
this.сформирироватьWordToolStripMenuItem,
this.сформироватьPdfToolStripMenuItem,
this.сформироватьExcelToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(205, 158);
// //
// создатьToolStripMenuItem // создатьToolStripMenuItem
// //
this.создатьToolStripMenuItem.Name = "создатьToolStripMenuItem"; создатьToolStripMenuItem.Name = "создатьToolStripMenuItem";
this.создатьToolStripMenuItem.Size = new System.Drawing.Size(204, 22); создатьToolStripMenuItem.Size = new Size(204, 22);
this.создатьToolStripMenuItem.Text = "Создать"; создатьToolStripMenuItem.Text = "Создать";
this.создатьToolStripMenuItem.Click += new System.EventHandler(this.создатьToolStripMenuItem_Click); создатьToolStripMenuItem.Click += создатьToolStripMenuItem_Click;
// //
// изменитьToolStripMenuItem // изменитьToolStripMenuItem
// //
this.изменитьToolStripMenuItem.Name = "изменитьToolStripMenuItem"; изменитьToolStripMenuItem.Name = "изменитьToolStripMenuItem";
this.изменитьToolStripMenuItem.Size = new System.Drawing.Size(204, 22); изменитьToolStripMenuItem.Size = new Size(204, 22);
this.изменитьToolStripMenuItem.Text = "Изменить"; изменитьToolStripMenuItem.Text = "Изменить";
this.изменитьToolStripMenuItem.Click += new System.EventHandler(this.изменитьToolStripMenuItem_Click); изменитьToolStripMenuItem.Click += изменитьToolStripMenuItem_Click;
// //
// удалитьToolStripMenuItem // удалитьToolStripMenuItem
// //
this.удалитьToolStripMenuItem.Name = "удалитьToolStripMenuItem"; удалитьToolStripMenuItem.Name = "удалитьToolStripMenuItem";
this.удалитьToolStripMenuItem.Size = new System.Drawing.Size(204, 22); удалитьToolStripMenuItem.Size = new Size(204, 22);
this.удалитьToolStripMenuItem.Text = "Удалить"; удалитьToolStripMenuItem.Text = "Удалить";
this.удалитьToolStripMenuItem.Click += new System.EventHandler(this.удалитьToolStripMenuItem_Click); удалитьToolStripMenuItem.Click += удалитьToolStripMenuItem_Click;
// //
// справочникToolStripMenuItem // справочникToolStripMenuItem
// //
this.справочникToolStripMenuItem.Name = "справочникToolStripMenuItem"; справочникToolStripMenuItem.Name = "справочникToolStripMenuItem";
this.справочникToolStripMenuItem.Size = new System.Drawing.Size(204, 22); справочникToolStripMenuItem.Size = new Size(204, 22);
this.справочникToolStripMenuItem.Text = "Справочник"; справочникToolStripMenuItem.Text = "Справочник";
this.справочникToolStripMenuItem.Click += new System.EventHandler(this.справочникToolStripMenuItem_Click); справочникToolStripMenuItem.Click += справочникToolStripMenuItem_Click;
// //
// сформирироватьWordToolStripMenuItem // сформирироватьWordToolStripMenuItem
// //
this.сформирироватьWordToolStripMenuItem.Name = "сформирироватьWordToolStripMenuItem"; сформирироватьWordToolStripMenuItem.Name = "сформирироватьWordToolStripMenuItem";
this.сформирироватьWordToolStripMenuItem.Size = new System.Drawing.Size(204, 22); сформирироватьWordToolStripMenuItem.Size = new Size(204, 22);
this.сформирироватьWordToolStripMenuItem.Text = "Сформирировать Word"; сформирироватьWordToolStripMenuItem.Text = "Сформирировать Word";
this.сформирироватьWordToolStripMenuItem.Click += new System.EventHandler(this.сформирироватьWordToolStripMenuItem_Click); сформирироватьWordToolStripMenuItem.Click += сформирироватьWordToolStripMenuItem_Click;
// //
// сформироватьPdfToolStripMenuItem // сформироватьPdfToolStripMenuItem
// //
this.сформироватьPdfToolStripMenuItem.Name = "сформироватьPdfToolStripMenuItem"; сформироватьPdfToolStripMenuItem.Name = "сформироватьPdfToolStripMenuItem";
this.сформироватьPdfToolStripMenuItem.Size = new System.Drawing.Size(204, 22); сформироватьPdfToolStripMenuItem.Size = new Size(204, 22);
this.сформироватьPdfToolStripMenuItem.Text = "Сформировать Pdf"; сформироватьPdfToolStripMenuItem.Text = "Сформировать Pdf";
this.сформироватьPdfToolStripMenuItem.Click += new System.EventHandler(this.сформироватьPdfToolStripMenuItem_Click); сформироватьPdfToolStripMenuItem.Click += сформироватьPdfToolStripMenuItem_Click;
// //
// сформироватьExcelToolStripMenuItem // сформироватьExcelToolStripMenuItem
// //
this.сформироватьExcelToolStripMenuItem.Name = "сформироватьExcelToolStripMenuItem"; сформироватьExcelToolStripMenuItem.Name = "сформироватьExcelToolStripMenuItem";
this.сформироватьExcelToolStripMenuItem.Size = new System.Drawing.Size(204, 22); сформироватьExcelToolStripMenuItem.Size = new Size(204, 22);
this.сформироватьExcelToolStripMenuItem.Text = "Сформировать Excel"; сформироватьExcelToolStripMenuItem.Text = "Сформировать Excel";
this.сформироватьExcelToolStripMenuItem.Click += new System.EventHandler(this.сформироватьExcelToolStripMenuItem_Click); сформироватьExcelToolStripMenuItem.Click += сформироватьExcelToolStripMenuItem_Click;
// //
// FormMain // FormMain
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); AutoScaleDimensions = new SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450); ClientSize = new Size(800, 450);
this.Controls.Add(this.dataTable); Controls.Add(dataTable);
this.Name = "FormMain"; Name = "FormMain";
this.Text = "Главная форма"; Text = "Главная форма";
this.Load += new System.EventHandler(this.FormMain_Load); Load += FormMain_Load;
this.contextMenuStrip1.ResumeLayout(false); contextMenuStrip1.ResumeLayout(false);
this.ResumeLayout(false); ResumeLayout(false);
} }
#endregion #endregion
@ -143,5 +136,6 @@
private WinFormsLibrary.DocumentWithImage documentWithImage1; private WinFormsLibrary.DocumentWithImage documentWithImage1;
private WinFormsLibrary.Table2column table2column1; private WinFormsLibrary.Table2column table2column1;
private ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartBarExcel componentDocumentWithChartBarExcel1; private ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartBarExcel componentDocumentWithChartBarExcel1;
private WinFormsLibrary.not_visual.Gistograma gistograma1;
} }
} }

View File

@ -6,6 +6,7 @@ using ControlsLibraryNet60.Models;
using DocumentFormat.OpenXml.Drawing.Charts; using DocumentFormat.OpenXml.Drawing.Charts;
using System.ComponentModel; using System.ComponentModel;
using WinFormsLibrary; using WinFormsLibrary;
using WinFormsLibrary.not_visual;
using WinFormsLibrary.SupportClasses; using WinFormsLibrary.SupportClasses;
namespace AppView namespace AppView
@ -202,30 +203,35 @@ namespace AppView
var uniqueTypes = providers.Select(p => p.Type).Distinct(); var uniqueTypes = providers.Select(p => p.Type).Distinct();
Dictionary<string, List<(int Date, double Value)>> data = new Dictionary<string, List<(int Date, double Value)>>(); List<ChartData> data = new List<ChartData>();
foreach (var uniqueType in uniqueTypes) foreach (var uniqueType in uniqueTypes)
{ {
var typeProviders = providers.Where(p => p.Type == uniqueType).ToList(); var typeProviders = providers.Where(p => p.Type == uniqueType).ToList();
var dataList = new List<(int Date, double Value)>(); var dataList = new List<double>();
for (int i = 0; i < typeProviders.Count; i++) for (int i = 0; i < typeProviders.Count; i++)
{ {
dataList.Add((i + 1, i + 1)); // Ïðîñòî ïðèìåð äàííûõ (Date, Value), âû ìîæåòå èñïîëüçîâàòü ñâîè äàííûå dataList.Add(i + 1); // Ïðîñòî ïðèìåð äàííûõ (Date, Value), âû ìîæåòå èñïîëüçîâàòü ñâîè äàííûå
} }
ChartData chData = new ChartData();
chData.SeriesName = uniqueType;
chData.Data = dataList.ToArray();
data.Add(uniqueType, dataList); data.Add(chData);
} }
componentDocumentWithChartBarExcel1.CreateDoc(new ComponentDocumentWithChartConfig() gistograma1.GenerateExcelChartDocument(fileName, "Ñâîäêà ïî òèïàì èçäåëèÿ.", "Êîëè÷åñòâî ïîñòàâùèêîâ äëÿ òîâàðîâ êàæäîãî òèïà", WinFormsLibrary.not_visual.LegendPosition.Bottom, data);
/*componentDocumentWithChartBarExcel1.CreateDoc(new ComponentDocumentWithChartConfig()
{ {
FilePath = fileName, FilePath = fileName,
Header = "Ñâîäêà ïî òèïàì èçäåëèÿ.", Header = "Ñâîäêà ïî òèïàì èçäåëèÿ.",
ChartTitle = "Êîëè÷åñòâî ïîñòàâùèêîâ äëÿ òîâàðîâ êàæäîãî òèïà", ChartTitle = "Êîëè÷åñòâî ïîñòàâùèêîâ äëÿ òîâàðîâ êàæäîãî òèïà",
LegendLocation = ComponentsLibraryNet60.Models.Location.Bottom, LegendLocation = ComponentsLibraryNet60.Models.Location.Bottom,
Data = data Data = data
}); });*/
} }
} }
} }

View File

@ -1,4 +1,64 @@
<root> <?xml version="1.0" encoding="utf-8"?>
<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">
@ -69,4 +129,7 @@
<metadata name="componentDocumentWithChartBarExcel1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="componentDocumentWithChartBarExcel1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>478, 17</value> <value>478, 17</value>
</metadata> </metadata>
<metadata name="gistograma1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>754, 17</value>
</metadata>
</root> </root>

View File

@ -5,15 +5,15 @@ VisualStudioVersion = 17.3.32819.101
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinFormsProject", "WinFormsProject\WinFormsProject.csproj", "{1FC6ABE3-DF27-453A-B2EE-FA17C71C9CF0}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinFormsProject", "WinFormsProject\WinFormsProject.csproj", "{1FC6ABE3-DF27-453A-B2EE-FA17C71C9CF0}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinFormsLibrary", "WinFormsLibrary\WinFormsLibrary.csproj", "{CF6B5601-DC60-48A2-8BDC-1CE32E3F6F15}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinFormsLibraryAA", "WinFormsLibrary\WinFormsLibraryAA.csproj", "{CF6B5601-DC60-48A2-8BDC-1CE32E3F6F15}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataModels", "DataModels\DataModels.csproj", "{23F0E442-0283-4192-A17B-D13D0C01C10D}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataModels", "DataModels\DataModels.csproj", "{23F0E442-0283-4192-A17B-D13D0C01C10D}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contracts", "Contracts\Contracts.csproj", "{6A196E6B-91D9-4873-9E5F-0D96D18A74F5}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Contracts", "Contracts\Contracts.csproj", "{6A196E6B-91D9-4873-9E5F-0D96D18A74F5}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DateBaseImplement", "DateBaseImplement\DateBaseImplement.csproj", "{F53D2EB4-F1EB-4C24-987C-CCC6BFC5FAD7}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DateBaseImplement", "DateBaseImplement\DateBaseImplement.csproj", "{F53D2EB4-F1EB-4C24-987C-CCC6BFC5FAD7}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppView", "AppView\AppView.csproj", "{294B81DD-546F-40AD-9BCE-0F51F1D17D1A}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppView", "AppView\AppView.csproj", "{294B81DD-546F-40AD-9BCE-0F51F1D17D1A}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -30,7 +30,7 @@ namespace WinFormsProject
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)
{ {
testArray = new List<string>() { /*testArray = new List<string>() {
"C:\\Users\\user\\Desktop\\images\\car_img1.png", "C:\\Users\\user\\Desktop\\images\\car_img1.png",
"C:\\Users\\user\\Desktop\\images\\car_img2.png", "C:\\Users\\user\\Desktop\\images\\car_img2.png",
}; };
@ -53,7 +53,7 @@ namespace WinFormsProject
{ {
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
} }*/
} }
private void button2_Click(object sender, EventArgs e) private void button2_Click(object sender, EventArgs e)

View File

@ -9,7 +9,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\WinFormsLibrary\WinFormsLibrary.csproj" /> <ProjectReference Include="..\WinFormsLibrary\WinFormsLibraryAA.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>