From 69b21488e65e3f2f4deb2f92c699006097e7df9c Mon Sep 17 00:00:00 2001
From: abazov73 <92822431+abazov73@users.noreply.github.com>
Date: Thu, 30 Nov 2023 01:45:08 +0400
Subject: [PATCH] Add word table documemt creation
---
AbazovApp/AccountsApp/AccountsApp.csproj | 2 +-
AbazovApp/AccountsApp/FormMain.Designer.cs | 3 +++
AbazovApp/AccountsApp/FormMain.cs | 16 ++++++++++++++++
AbazovApp/AccountsApp/FormMain.resx | 9 ++++++---
4 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/AbazovApp/AccountsApp/AccountsApp.csproj b/AbazovApp/AccountsApp/AccountsApp.csproj
index 48b9f15..ff7b89f 100644
--- a/AbazovApp/AccountsApp/AccountsApp.csproj
+++ b/AbazovApp/AccountsApp/AccountsApp.csproj
@@ -15,7 +15,7 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
diff --git a/AbazovApp/AccountsApp/FormMain.Designer.cs b/AbazovApp/AccountsApp/FormMain.Designer.cs
index ba49e36..f3752c2 100644
--- a/AbazovApp/AccountsApp/FormMain.Designer.cs
+++ b/AbazovApp/AccountsApp/FormMain.Designer.cs
@@ -41,6 +41,7 @@
this.интересыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.controlDataTable = new ControlsLibraryNet60.Data.ControlDataTableTable();
this.excelImagesComponent = new AbazovViewComponents.LogicalComponents.ExcelImagesComponent(this.components);
+ this.wordTableComponentAccount = new NevaevaLibrary.LogicalComponents.WordTableComponent(this.components);
this.componentDocumentWithChartBarPdf = new ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartBarPdf(this.components);
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
@@ -116,6 +117,7 @@
this.документСТаблицейToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T)));
this.документСТаблицейToolStripMenuItem.Size = new System.Drawing.Size(313, 26);
this.документСТаблицейToolStripMenuItem.Text = "Документ с таблицей";
+ this.документСТаблицейToolStripMenuItem.Click += new System.EventHandler(this.документСТаблицейToolStripMenuItem_Click);
//
// документСДиаграммойToolStripMenuItem
//
@@ -173,6 +175,7 @@
private ToolStripMenuItem интересыToolStripMenuItem;
private ControlsLibraryNet60.Data.ControlDataTableTable controlDataTable;
private AbazovViewComponents.LogicalComponents.ExcelImagesComponent excelImagesComponent;
+ private NevaevaLibrary.LogicalComponents.WordTableComponent wordTableComponentAccount;
private ComponentsLibraryNet60.DocumentWithChart.ComponentDocumentWithChartBarPdf componentDocumentWithChartBarPdf;
}
}
\ No newline at end of file
diff --git a/AbazovApp/AccountsApp/FormMain.cs b/AbazovApp/AccountsApp/FormMain.cs
index 123055c..19cbb4e 100644
--- a/AbazovApp/AccountsApp/FormMain.cs
+++ b/AbazovApp/AccountsApp/FormMain.cs
@@ -126,5 +126,21 @@ namespace AccountsApp
MessageBox.Show("Успех");
}
+
+ private void документСТаблицейToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ string path = AppDomain.CurrentDomain.BaseDirectory + "Аккаунты.docx";
+ List<(int, int)> merges = new List<(int, int)> { (1, 2) };
+ List widths = new List { 100, 100, 100, 100 };
+ List<(string, string)> headers = new List<(string, string)> {
+ ("Id", "Идентификатор"),
+ ("", "Личные данные"),
+ ("Login", "Логин"),
+ ("Email", "Эл. почта"),
+ ("InterestName", "Выбранный интерес")
+ };
+
+ wordTableComponentAccount.createWithTable(path, "Список аккаунтов", merges, widths, headers, _logic.ReadList(null));
+ }
}
}
diff --git a/AbazovApp/AccountsApp/FormMain.resx b/AbazovApp/AccountsApp/FormMain.resx
index f963f1f..3206035 100644
--- a/AbazovApp/AccountsApp/FormMain.resx
+++ b/AbazovApp/AccountsApp/FormMain.resx
@@ -61,12 +61,15 @@
17, 17
- 152, 0
+ 162, 27
+
+
+ 378, 27
- 152, 17
+ 639, 27
- 54
+ 90
\ No newline at end of file