From 280fcbba32931c4bbfb0adb51fb1f6d7691efd58 Mon Sep 17 00:00:00 2001 From: user Date: Thu, 30 Nov 2023 11:20:36 +0400 Subject: [PATCH] Component Artyoma dont work --- WinFormsProject/AppView/AppView.csproj | 3 +- WinFormsProject/AppView/FormMain.Designer.cs | 132 +++++++++--------- WinFormsProject/AppView/FormMain.cs | 18 ++- WinFormsProject/AppView/FormMain.resx | 65 ++++++++- ...ibrary.csproj => WinFormsLibraryAA.csproj} | 0 WinFormsProject/WinFormsProject.sln | 10 +- WinFormsProject/WinFormsProject/Form2.cs | 4 +- .../WinFormsProject/WinFormsProject.csproj | 2 +- 8 files changed, 149 insertions(+), 85 deletions(-) rename WinFormsProject/WinFormsLibrary/{WinFormsLibrary.csproj => WinFormsLibraryAA.csproj} (100%) diff --git a/WinFormsProject/AppView/AppView.csproj b/WinFormsProject/AppView/AppView.csproj index ec28f5f..db7c8b7 100644 --- a/WinFormsProject/AppView/AppView.csproj +++ b/WinFormsProject/AppView/AppView.csproj @@ -11,6 +11,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -20,7 +21,7 @@ - + \ No newline at end of file diff --git a/WinFormsProject/AppView/FormMain.Designer.cs b/WinFormsProject/AppView/FormMain.Designer.cs index 3b0720f..8063a07 100644 --- a/WinFormsProject/AppView/FormMain.Designer.cs +++ b/WinFormsProject/AppView/FormMain.Designer.cs @@ -28,105 +28,98 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - this.dataTable = new ControlsLibraryNet60.Data.ControlDataTableTable(); - this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); - 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.сформирироватьWordToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.сформироватьPdfToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.сформироватьExcelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.documentWithImage1 = new WinFormsLibrary.DocumentWithImage(this.components); - this.table2column1 = new WinFormsLibrary.Table2column(this.components); - this.componentDocumentWithChartBarExcel1 = new ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartBarExcel(this.components); - this.contextMenuStrip1.SuspendLayout(); - this.SuspendLayout(); + components = new System.ComponentModel.Container(); + dataTable = new ControlsLibraryNet60.Data.ControlDataTableTable(); + contextMenuStrip1 = new ContextMenuStrip(components); + создатьToolStripMenuItem = new ToolStripMenuItem(); + изменитьToolStripMenuItem = new ToolStripMenuItem(); + удалитьToolStripMenuItem = new ToolStripMenuItem(); + справочникToolStripMenuItem = new ToolStripMenuItem(); + сформирироватьWordToolStripMenuItem = new ToolStripMenuItem(); + сформироватьPdfToolStripMenuItem = new ToolStripMenuItem(); + сформироватьExcelToolStripMenuItem = new ToolStripMenuItem(); + documentWithImage1 = new WinFormsLibrary.DocumentWithImage(components); + table2column1 = new WinFormsLibrary.Table2column(components); + componentDocumentWithChartBarExcel1 = new ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartBarExcel(components); + gistograma1 = new WinFormsLibrary.not_visual.Gistograma(components); + contextMenuStrip1.SuspendLayout(); + SuspendLayout(); // // dataTable // - this.dataTable.Location = new System.Drawing.Point(13, 12); - this.dataTable.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.dataTable.Name = "dataTable"; - this.dataTable.SelectedRowIndex = -1; - this.dataTable.Size = new System.Drawing.Size(774, 426); - this.dataTable.TabIndex = 0; + dataTable.Location = new Point(13, 12); + dataTable.Margin = new Padding(4, 3, 4, 3); + dataTable.Name = "dataTable"; + dataTable.SelectedRowIndex = -1; + dataTable.Size = new Size(774, 426); + dataTable.TabIndex = 0; // // contextMenuStrip1 // - this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.создатьToolStripMenuItem, - this.изменитьToolStripMenuItem, - this.удалитьToolStripMenuItem, - this.справочникToolStripMenuItem, - this.сформирироватьWordToolStripMenuItem, - this.сформироватьPdfToolStripMenuItem, - this.сформироватьExcelToolStripMenuItem}); - this.contextMenuStrip1.Name = "contextMenuStrip1"; - this.contextMenuStrip1.Size = new System.Drawing.Size(205, 158); + contextMenuStrip1.Items.AddRange(new ToolStripItem[] { создатьToolStripMenuItem, изменитьToolStripMenuItem, удалитьToolStripMenuItem, справочникToolStripMenuItem, сформирироватьWordToolStripMenuItem, сформироватьPdfToolStripMenuItem, сформироватьExcelToolStripMenuItem }); + contextMenuStrip1.Name = "contextMenuStrip1"; + contextMenuStrip1.Size = new Size(205, 158); // // создатьToolStripMenuItem // - this.создатьToolStripMenuItem.Name = "создатьToolStripMenuItem"; - this.создатьToolStripMenuItem.Size = new System.Drawing.Size(204, 22); - this.создатьToolStripMenuItem.Text = "Создать"; - this.создатьToolStripMenuItem.Click += new System.EventHandler(this.создатьToolStripMenuItem_Click); + создатьToolStripMenuItem.Name = "создатьToolStripMenuItem"; + создатьToolStripMenuItem.Size = new Size(204, 22); + создатьToolStripMenuItem.Text = "Создать"; + создатьToolStripMenuItem.Click += создатьToolStripMenuItem_Click; // // изменитьToolStripMenuItem // - this.изменитьToolStripMenuItem.Name = "изменитьToolStripMenuItem"; - this.изменитьToolStripMenuItem.Size = new System.Drawing.Size(204, 22); - this.изменитьToolStripMenuItem.Text = "Изменить"; - this.изменитьToolStripMenuItem.Click += new System.EventHandler(this.изменитьToolStripMenuItem_Click); + изменитьToolStripMenuItem.Name = "изменитьToolStripMenuItem"; + изменитьToolStripMenuItem.Size = new Size(204, 22); + изменитьToolStripMenuItem.Text = "Изменить"; + изменитьToolStripMenuItem.Click += изменитьToolStripMenuItem_Click; // // удалитьToolStripMenuItem // - this.удалитьToolStripMenuItem.Name = "удалитьToolStripMenuItem"; - this.удалитьToolStripMenuItem.Size = new System.Drawing.Size(204, 22); - this.удалитьToolStripMenuItem.Text = "Удалить"; - this.удалитьToolStripMenuItem.Click += new System.EventHandler(this.удалитьToolStripMenuItem_Click); + удалитьToolStripMenuItem.Name = "удалитьToolStripMenuItem"; + удалитьToolStripMenuItem.Size = new Size(204, 22); + удалитьToolStripMenuItem.Text = "Удалить"; + удалитьToolStripMenuItem.Click += удалитьToolStripMenuItem_Click; // // справочникToolStripMenuItem // - this.справочникToolStripMenuItem.Name = "справочникToolStripMenuItem"; - this.справочникToolStripMenuItem.Size = new System.Drawing.Size(204, 22); - this.справочникToolStripMenuItem.Text = "Справочник"; - this.справочникToolStripMenuItem.Click += new System.EventHandler(this.справочникToolStripMenuItem_Click); + справочникToolStripMenuItem.Name = "справочникToolStripMenuItem"; + справочникToolStripMenuItem.Size = new Size(204, 22); + справочникToolStripMenuItem.Text = "Справочник"; + справочникToolStripMenuItem.Click += справочникToolStripMenuItem_Click; // // сформирироватьWordToolStripMenuItem // - this.сформирироватьWordToolStripMenuItem.Name = "сформирироватьWordToolStripMenuItem"; - this.сформирироватьWordToolStripMenuItem.Size = new System.Drawing.Size(204, 22); - this.сформирироватьWordToolStripMenuItem.Text = "Сформирировать Word"; - this.сформирироватьWordToolStripMenuItem.Click += new System.EventHandler(this.сформирироватьWordToolStripMenuItem_Click); + сформирироватьWordToolStripMenuItem.Name = "сформирироватьWordToolStripMenuItem"; + сформирироватьWordToolStripMenuItem.Size = new Size(204, 22); + сформирироватьWordToolStripMenuItem.Text = "Сформирировать Word"; + сформирироватьWordToolStripMenuItem.Click += сформирироватьWordToolStripMenuItem_Click; // // сформироватьPdfToolStripMenuItem // - this.сформироватьPdfToolStripMenuItem.Name = "сформироватьPdfToolStripMenuItem"; - this.сформироватьPdfToolStripMenuItem.Size = new System.Drawing.Size(204, 22); - this.сформироватьPdfToolStripMenuItem.Text = "Сформировать Pdf"; - this.сформироватьPdfToolStripMenuItem.Click += new System.EventHandler(this.сформироватьPdfToolStripMenuItem_Click); + сформироватьPdfToolStripMenuItem.Name = "сформироватьPdfToolStripMenuItem"; + сформироватьPdfToolStripMenuItem.Size = new Size(204, 22); + сформироватьPdfToolStripMenuItem.Text = "Сформировать Pdf"; + сформироватьPdfToolStripMenuItem.Click += сформироватьPdfToolStripMenuItem_Click; // // сформироватьExcelToolStripMenuItem // - this.сформироватьExcelToolStripMenuItem.Name = "сформироватьExcelToolStripMenuItem"; - this.сформироватьExcelToolStripMenuItem.Size = new System.Drawing.Size(204, 22); - this.сформироватьExcelToolStripMenuItem.Text = "Сформировать Excel"; - this.сформироватьExcelToolStripMenuItem.Click += new System.EventHandler(this.сформироватьExcelToolStripMenuItem_Click); + сформироватьExcelToolStripMenuItem.Name = "сформироватьExcelToolStripMenuItem"; + сформироватьExcelToolStripMenuItem.Size = new Size(204, 22); + сформироватьExcelToolStripMenuItem.Text = "Сформировать Excel"; + сформироватьExcelToolStripMenuItem.Click += сформироватьExcelToolStripMenuItem_Click; // // FormMain // - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); - this.Controls.Add(this.dataTable); - this.Name = "FormMain"; - this.Text = "Главная форма"; - this.Load += new System.EventHandler(this.FormMain_Load); - this.contextMenuStrip1.ResumeLayout(false); - this.ResumeLayout(false); - + AutoScaleDimensions = new SizeF(7F, 15F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(800, 450); + Controls.Add(dataTable); + Name = "FormMain"; + Text = "Главная форма"; + Load += FormMain_Load; + contextMenuStrip1.ResumeLayout(false); + ResumeLayout(false); } #endregion @@ -143,5 +136,6 @@ private WinFormsLibrary.DocumentWithImage documentWithImage1; private WinFormsLibrary.Table2column table2column1; private ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartBarExcel componentDocumentWithChartBarExcel1; + private WinFormsLibrary.not_visual.Gistograma gistograma1; } } \ No newline at end of file diff --git a/WinFormsProject/AppView/FormMain.cs b/WinFormsProject/AppView/FormMain.cs index 57dd75f..4e9f567 100644 --- a/WinFormsProject/AppView/FormMain.cs +++ b/WinFormsProject/AppView/FormMain.cs @@ -6,6 +6,7 @@ using ControlsLibraryNet60.Models; using DocumentFormat.OpenXml.Drawing.Charts; using System.ComponentModel; using WinFormsLibrary; +using WinFormsLibrary.not_visual; using WinFormsLibrary.SupportClasses; namespace AppView @@ -202,30 +203,35 @@ namespace AppView var uniqueTypes = providers.Select(p => p.Type).Distinct(); - Dictionary> data = new Dictionary>(); + List data = new List(); foreach (var uniqueType in uniqueTypes) { var typeProviders = providers.Where(p => p.Type == uniqueType).ToList(); - var dataList = new List<(int Date, double Value)>(); + var dataList = new List(); 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, Header = " .", ChartTitle = " ", LegendLocation = ComponentsLibraryNet60.Models.Location.Bottom, Data = data - }); + });*/ } } } \ No newline at end of file diff --git a/WinFormsProject/AppView/FormMain.resx b/WinFormsProject/AppView/FormMain.resx index 01068d2..afd9012 100644 --- a/WinFormsProject/AppView/FormMain.resx +++ b/WinFormsProject/AppView/FormMain.resx @@ -1,4 +1,64 @@ - + + + @@ -69,4 +129,7 @@ 478, 17 + + 754, 17 + \ No newline at end of file diff --git a/WinFormsProject/WinFormsLibrary/WinFormsLibrary.csproj b/WinFormsProject/WinFormsLibrary/WinFormsLibraryAA.csproj similarity index 100% rename from WinFormsProject/WinFormsLibrary/WinFormsLibrary.csproj rename to WinFormsProject/WinFormsLibrary/WinFormsLibraryAA.csproj diff --git a/WinFormsProject/WinFormsProject.sln b/WinFormsProject/WinFormsProject.sln index ebeb726..f05fbb7 100644 --- a/WinFormsProject/WinFormsProject.sln +++ b/WinFormsProject/WinFormsProject.sln @@ -5,15 +5,15 @@ VisualStudioVersion = 17.3.32819.101 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinFormsProject", "WinFormsProject\WinFormsProject.csproj", "{1FC6ABE3-DF27-453A-B2EE-FA17C71C9CF0}" 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 -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 -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 -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 -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 Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/WinFormsProject/WinFormsProject/Form2.cs b/WinFormsProject/WinFormsProject/Form2.cs index 2c6c06a..015add8 100644 --- a/WinFormsProject/WinFormsProject/Form2.cs +++ b/WinFormsProject/WinFormsProject/Form2.cs @@ -30,7 +30,7 @@ namespace WinFormsProject private void button1_Click(object sender, EventArgs e) { - testArray = new List() { + /*testArray = new List() { "C:\\Users\\user\\Desktop\\images\\car_img1.png", "C:\\Users\\user\\Desktop\\images\\car_img2.png", }; @@ -53,7 +53,7 @@ namespace WinFormsProject { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } - } + }*/ } private void button2_Click(object sender, EventArgs e) diff --git a/WinFormsProject/WinFormsProject/WinFormsProject.csproj b/WinFormsProject/WinFormsProject/WinFormsProject.csproj index 0654708..3f91dba 100644 --- a/WinFormsProject/WinFormsProject/WinFormsProject.csproj +++ b/WinFormsProject/WinFormsProject/WinFormsProject.csproj @@ -9,7 +9,7 @@ - + \ No newline at end of file