Adding method & smth else
This commit is contained in:
parent
110ec41560
commit
0fba596770
@ -94,5 +94,10 @@ namespace CustomComponents
|
|||||||
|
|
||||||
listBox.Items.Add(str);
|
listBox.Items.Add(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deleteAll()
|
||||||
|
{
|
||||||
|
listBox.Items.Clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CustomComponents.ZhelovanovNonVisualComponents
|
||||||
|
{
|
||||||
|
public class ColumnParameters
|
||||||
|
{
|
||||||
|
public string _nameColumn { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public string _nameField { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public ColumnParameters(string nameColumn, string nameField)
|
||||||
|
{
|
||||||
|
_nameColumn = nameColumn;
|
||||||
|
_nameField = nameField;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CustomComponents.ZhelovanovNonVisualComponents
|
||||||
|
{
|
||||||
|
public class DataHistogramm
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public string _nameData { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public double _data { get; set; }
|
||||||
|
|
||||||
|
public DataHistogramm(string nameData, int data)
|
||||||
|
{
|
||||||
|
|
||||||
|
_nameData = nameData;
|
||||||
|
_data = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CustomComponents.ZhelovanovNonVisualComponents
|
||||||
|
{
|
||||||
|
public enum EnumLegends
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
Left = 1,
|
||||||
|
Right = 2,
|
||||||
|
Top = 3,
|
||||||
|
Bottom = 4
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
using DocumentFormat.OpenXml.Drawing;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CustomComponents.ZhelovanovNonVisualComponents
|
||||||
|
{
|
||||||
|
public class MyHistogramm
|
||||||
|
{
|
||||||
|
public string _filePath = string.Empty;
|
||||||
|
|
||||||
|
public string _fileHeader = string.Empty;
|
||||||
|
|
||||||
|
public string _histogramName = string.Empty;
|
||||||
|
|
||||||
|
public EnumLegends _legends;
|
||||||
|
|
||||||
|
public List<DataHistogramm> _dataList = new();
|
||||||
|
public MyHistogramm(string filePath, string fileHeader, string histogramName, EnumLegends legends, List<DataHistogramm> dataList) {
|
||||||
|
_filePath = filePath;
|
||||||
|
_fileHeader = fileHeader;
|
||||||
|
_histogramName = histogramName;
|
||||||
|
_legends = legends;
|
||||||
|
_dataList = dataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CustomComponents.ZhelovanovNonVisualComponents
|
||||||
|
{
|
||||||
|
public class MyTable
|
||||||
|
{
|
||||||
|
public string _filePath = string.Empty;
|
||||||
|
|
||||||
|
public string _fileHeader = string.Empty;
|
||||||
|
public List<string[,]> _dataList = new();
|
||||||
|
public MyTable(string filePath, string fileHeader, List<string[,]> dataList) {
|
||||||
|
_filePath = filePath;
|
||||||
|
_fileHeader = fileHeader;
|
||||||
|
_dataList = dataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CustomComponents.ZhelovanovNonVisualComponents
|
||||||
|
{
|
||||||
|
public class MyTableWithHead<T>
|
||||||
|
{
|
||||||
|
public string _filePath = string.Empty;
|
||||||
|
|
||||||
|
public string _fileHeader = string.Empty;
|
||||||
|
|
||||||
|
public List<double> _heightRow = new();
|
||||||
|
|
||||||
|
public List<double> _widthCol = new();
|
||||||
|
|
||||||
|
public List<T> _dataList;
|
||||||
|
|
||||||
|
|
||||||
|
public Dictionary<int, ColumnParameters> _columnsSettings;
|
||||||
|
|
||||||
|
public MyTableWithHead(string filePath, string fileHeader, List<double> heightRow,
|
||||||
|
List<double> widthCol, List<T> dataList, Dictionary<int, ColumnParameters> columnsSettings)
|
||||||
|
{
|
||||||
|
_filePath = filePath;
|
||||||
|
_fileHeader = fileHeader;
|
||||||
|
_heightRow = heightRow;
|
||||||
|
_widthCol = widthCol;
|
||||||
|
_dataList = dataList;
|
||||||
|
_columnsSettings = columnsSettings;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
namespace KOP_Labs.NonVisualComponents
|
namespace CustomComponents.ZhelovanovNonVisualComponents
|
||||||
{
|
{
|
||||||
partial class WordHistogramm
|
partial class WordHistogramm
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace KOP_Labs.NonVisualComponents
|
namespace CustomComponents.ZhelovanovNonVisualComponents
|
||||||
{
|
{
|
||||||
public partial class WordHistogramm : Component
|
public partial class WordHistogramm : Component
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
namespace KOP_Labs
|
namespace CustomComponents.ZhelovanovVisualComponents
|
||||||
{
|
{
|
||||||
partial class TextBoxComponent
|
partial class TextBoxComponent
|
||||||
{
|
{
|
||||||
|
@ -11,7 +11,7 @@ using System.Threading.Tasks;
|
|||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button;
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Button;
|
||||||
|
|
||||||
namespace KOP_Labs
|
namespace CustomComponents.ZhelovanovVisualComponents
|
||||||
{
|
{
|
||||||
public partial class TextBoxComponent : UserControl
|
public partial class TextBoxComponent : UserControl
|
||||||
{
|
{
|
||||||
|
22
Library/LibraryView/FormBook.Designer.cs
generated
22
Library/LibraryView/FormBook.Designer.cs
generated
@ -1,4 +1,6 @@
|
|||||||
namespace LibraryView
|
using KOP_Labs;
|
||||||
|
|
||||||
|
namespace LibraryView
|
||||||
{
|
{
|
||||||
partial class FormBook
|
partial class FormBook
|
||||||
{
|
{
|
||||||
@ -29,13 +31,13 @@
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
this.label1 = new System.Windows.Forms.Label();
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
this.romanovaComboBoxGenre = new ComponentsLibrary.MyVisualComponents.RomanovaComboBox();
|
this.MeComboBoxGenre = new CustomComponents.DropDownList();
|
||||||
this.textBoxTitle = new System.Windows.Forms.TextBox();
|
this.textBoxTitle = new System.Windows.Forms.TextBox();
|
||||||
this.label2 = new System.Windows.Forms.Label();
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
this.textBoxDescription = new System.Windows.Forms.TextBox();
|
this.textBoxDescription = new System.Windows.Forms.TextBox();
|
||||||
this.label3 = new System.Windows.Forms.Label();
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
this.label4 = new System.Windows.Forms.Label();
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
this.textBoxCost = new ComponentsLibrary.IstyukovVisualComponents.TextBoxModified();
|
this.textBoxCost = new CustomComponents.ZhelovanovVisualComponents.TextBoxComponent();
|
||||||
this.buttonSave = new System.Windows.Forms.Button();
|
this.buttonSave = new System.Windows.Forms.Button();
|
||||||
this.buttonClose = new System.Windows.Forms.Button();
|
this.buttonClose = new System.Windows.Forms.Button();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
@ -51,11 +53,11 @@
|
|||||||
//
|
//
|
||||||
// romanovaComboBoxGenre
|
// romanovaComboBoxGenre
|
||||||
//
|
//
|
||||||
this.romanovaComboBoxGenre.Location = new System.Drawing.Point(-3, 240);
|
this.MeComboBoxGenre.Location = new System.Drawing.Point(-3, 240);
|
||||||
this.romanovaComboBoxGenre.Name = "romanovaComboBoxGenre";
|
this.MeComboBoxGenre.Name = "romanovaComboBoxGenre";
|
||||||
this.romanovaComboBoxGenre.SelectElement = "";
|
this.MeComboBoxGenre.Selected = "";
|
||||||
this.romanovaComboBoxGenre.Size = new System.Drawing.Size(259, 116);
|
this.MeComboBoxGenre.Size = new System.Drawing.Size(259, 116);
|
||||||
this.romanovaComboBoxGenre.TabIndex = 1;
|
this.MeComboBoxGenre.TabIndex = 1;
|
||||||
//
|
//
|
||||||
// textBoxTitle
|
// textBoxTitle
|
||||||
//
|
//
|
||||||
@ -141,7 +143,7 @@
|
|||||||
this.Controls.Add(this.textBoxDescription);
|
this.Controls.Add(this.textBoxDescription);
|
||||||
this.Controls.Add(this.label2);
|
this.Controls.Add(this.label2);
|
||||||
this.Controls.Add(this.textBoxTitle);
|
this.Controls.Add(this.textBoxTitle);
|
||||||
this.Controls.Add(this.romanovaComboBoxGenre);
|
this.Controls.Add(this.MeComboBoxGenre);
|
||||||
this.Controls.Add(this.label1);
|
this.Controls.Add(this.label1);
|
||||||
this.Name = "FormBook";
|
this.Name = "FormBook";
|
||||||
this.Text = "Книги";
|
this.Text = "Книги";
|
||||||
@ -160,7 +162,7 @@
|
|||||||
private TextBox textBoxDescription;
|
private TextBox textBoxDescription;
|
||||||
private Label label3;
|
private Label label3;
|
||||||
private Label label4;
|
private Label label4;
|
||||||
private CustomComponents.
|
private CustomComponents.ZhelovanovVisualComponents.TextBoxComponent textBoxCost;
|
||||||
private Button buttonSave;
|
private Button buttonSave;
|
||||||
private Button buttonClose;
|
private Button buttonClose;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ namespace LibraryView
|
|||||||
var genries = _genreLogic.Read(null);
|
var genries = _genreLogic.Read(null);
|
||||||
foreach (var genre in genries)
|
foreach (var genre in genries)
|
||||||
{
|
{
|
||||||
romanovaComboBoxGenre.FillList(genre.Name);
|
MeComboBoxGenre.AddingToList(genre.Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,14 +48,14 @@ namespace LibraryView
|
|||||||
{
|
{
|
||||||
textBoxTitle.Text = view.Title;
|
textBoxTitle.Text = view.Title;
|
||||||
textBoxDescription.Text = view.Description;
|
textBoxDescription.Text = view.Description;
|
||||||
romanovaComboBoxGenre.SelectElement = view.Genre;
|
MeComboBoxGenre.Selected = view.Genre;
|
||||||
textBoxCost.Value = null;
|
textBoxCost.Value = null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
textBoxTitle.Text = view.Title;
|
textBoxTitle.Text = view.Title;
|
||||||
textBoxDescription.Text = view.Description;
|
textBoxDescription.Text = view.Description;
|
||||||
romanovaComboBoxGenre.SelectElement = view.Genre;
|
MeComboBoxGenre.Selected = view.Genre;
|
||||||
textBoxCost.Value = view.Cost;
|
textBoxCost.Value = view.Cost;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -81,7 +81,7 @@ namespace LibraryView
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(romanovaComboBoxGenre.SelectElement.ToString()))
|
if (string.IsNullOrEmpty(MeComboBoxGenre.Selected.ToString()))
|
||||||
{
|
{
|
||||||
MessageBox.Show("Выберите жанр книги", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
MessageBox.Show("Выберите жанр книги", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
return;
|
return;
|
||||||
@ -106,7 +106,7 @@ namespace LibraryView
|
|||||||
Id = id,
|
Id = id,
|
||||||
Title = textBoxTitle.Text,
|
Title = textBoxTitle.Text,
|
||||||
Description = textBoxDescription.Text,
|
Description = textBoxDescription.Text,
|
||||||
Genre = romanovaComboBoxGenre.SelectElement.ToString(),
|
Genre = MeComboBoxGenre.Selected.ToString(),
|
||||||
Cost = cost
|
Cost = cost
|
||||||
});
|
});
|
||||||
MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
2
Library/LibraryView/FormMain.Designer.cs
generated
2
Library/LibraryView/FormMain.Designer.cs
generated
@ -87,7 +87,7 @@
|
|||||||
|
|
||||||
private MenuStrip menuStrip;
|
private MenuStrip menuStrip;
|
||||||
private ToolStripMenuItem справочникиToolStripMenuItem;
|
private ToolStripMenuItem справочникиToolStripMenuItem;
|
||||||
private ComponentsLibrary.BasharinVisualComponents.SevaTreeView sevaTreeView;
|
private CustomComponents.BasharinVisualComponents.SevaTreeView sevaTreeView;
|
||||||
private ComponentsLibrary.MyNotVisualComponents.RomanovaExcelDocument romanovaExcelDocument;
|
private ComponentsLibrary.MyNotVisualComponents.RomanovaExcelDocument romanovaExcelDocument;
|
||||||
private ComponentsLibrary.BasharinNotVisualComponents.DiagramToPDF diagramTopdf1;
|
private ComponentsLibrary.BasharinNotVisualComponents.DiagramToPDF diagramTopdf1;
|
||||||
private ComponentsLibraryNet60.DocumentWithTable.ComponentDocumentWithTableMultiHeaderWord componentDocumentWithTableMultiHeaderWord;
|
private ComponentsLibraryNet60.DocumentWithTable.ComponentDocumentWithTableMultiHeaderWord componentDocumentWithTableMultiHeaderWord;
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
using ComponentsLibrary.IstyukovNotVisualComponents;
|
//using KOP_Labs.Classes;
|
||||||
using ComponentsLibrary.MyUnvisualComponents;
|
using KOP_Labs.NonVisualComponents;
|
||||||
using ComponentsLibrary.MyUnvisualComponents.HelperModels;
|
|
||||||
using ComponentsLibraryNet60.DocumentWithTable;
|
|
||||||
using ComponentsLibraryNet60.Models;
|
|
||||||
using LibraryContracts.BindingModels;
|
using LibraryContracts.BindingModels;
|
||||||
using LibraryContracts.BusinessLogicsContracts;
|
using LibraryContracts.BusinessLogicsContracts;
|
||||||
using LibraryDatabaseImplement.Models;
|
using LibraryDatabaseImplement.Models;
|
||||||
using Microsoft.Office.Interop.Excel;
|
using Microsoft.Office.Interop.Excel;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics.Metrics;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Unity;
|
using Unity;
|
||||||
|
using CustomComponents.ZhelovanovNonVisualComponents;
|
||||||
|
using CustomComponents;
|
||||||
|
|
||||||
namespace LibraryView
|
namespace LibraryView
|
||||||
{
|
{
|
||||||
@ -138,7 +138,7 @@ namespace LibraryView
|
|||||||
|
|
||||||
private void diagramDocMenuItem_Click(object sender, EventArgs e)
|
private void diagramDocMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
CreatePdfDiagram();
|
CreateWordDiagram();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
|
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
|
||||||
@ -175,7 +175,7 @@ namespace LibraryView
|
|||||||
|
|
||||||
if (keyData == (Keys.Control | Keys.C))
|
if (keyData == (Keys.Control | Keys.C))
|
||||||
{
|
{
|
||||||
CreatePdfDiagram();
|
CreateWordDiagram();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,13 +204,13 @@ namespace LibraryView
|
|||||||
|
|
||||||
string[] data = dataSet.Split(';');
|
string[] data = dataSet.Split(';');
|
||||||
var sfd = new SaveFileDialog();
|
var sfd = new SaveFileDialog();
|
||||||
sfd.FileName = "D:\\Study\\3 course\\KOP\\file\\simpleDocProducts.xls";
|
sfd.FileName = "D:\\Papka\\KOP\\simpleDocProducts.xls";
|
||||||
sfd.Filter = "Excel files (*.xlsx)|*.xlsx";
|
sfd.Filter = "Excel files (*.xlsx)|*.xlsx";
|
||||||
if (sfd.ShowDialog() == DialogResult.OK)
|
if (sfd.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
if (data != null)
|
if (data != null)
|
||||||
{
|
{
|
||||||
romanovaExcelDocument.CreateExcel(sfd.FileName, "Книги", data);
|
bigTextComponent.CreateExcel(sfd.FileName, "Книги", data);
|
||||||
MessageBox.Show("Файл был создан успешно", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show("Файл был создан успешно", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -221,9 +221,11 @@ namespace LibraryView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CreatePdfDiagram()
|
private void CreateWordDiagram()
|
||||||
{
|
{
|
||||||
Dictionary<string, double> data = new Dictionary<string, double>();
|
|
||||||
|
MyHistogramm histogram;
|
||||||
|
List<DataHistogramm> data = new List<DataHistogramm>();
|
||||||
var books = _bookLogic.Read(null);
|
var books = _bookLogic.Read(null);
|
||||||
var genries = _genreLogic.Read(null);
|
var genries = _genreLogic.Read(null);
|
||||||
if (books != null && genries != null)
|
if (books != null && genries != null)
|
||||||
@ -238,15 +240,17 @@ namespace LibraryView
|
|||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data.Add(genre.Name, count);
|
new DataHistogramm(genre.Name, count);
|
||||||
}
|
}
|
||||||
var sfd = new SaveFileDialog();
|
var sfd = new SaveFileDialog();
|
||||||
sfd.FileName = "DiagramBook.pdf";
|
sfd.FileName = "DiagramBook.pdf";
|
||||||
sfd.Filter = "Pdf files (*.pdf)|*.pdf";
|
sfd.Filter = "Pdf files (*.pdf)|*.pdf";
|
||||||
if (sfd.ShowDialog() == DialogResult.OK)
|
if (sfd.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
diagramTopdf1.CreateDocument(sfd.FileName, "Бесплатные книги",
|
|
||||||
"Сколько бесплатных книг какого жанра", ComponentsLibrary.BasharinNotVisualComponents.Area.TOP, data);
|
histogram = new(sfd.FileName, "Бесплатные книги", "Сколько бесплатных книг какого жанра", EnumLegends.Right, data);
|
||||||
|
|
||||||
|
wordHistogramm1.CreateHistogramm(histogram);
|
||||||
MessageBox.Show("Файл был создан успешно", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show("Файл был создан успешно", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -271,7 +275,7 @@ namespace LibraryView
|
|||||||
};
|
};
|
||||||
books.Add(prod);
|
books.Add(prod);
|
||||||
}
|
}
|
||||||
if (sfd.ShowDialog() == DialogResult.OK)
|
/*if (sfd.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
componentDocumentWithTableMultiHeaderWord.CreateDoc(new ComponentDocumentWithTableHeaderDataConfig<Book>
|
componentDocumentWithTableMultiHeaderWord.CreateDoc(new ComponentDocumentWithTableHeaderDataConfig<Book>
|
||||||
{
|
{
|
||||||
@ -289,6 +293,39 @@ namespace LibraryView
|
|||||||
Data = books
|
Data = books
|
||||||
});
|
});
|
||||||
MessageBox.Show("Файл был создан успешно", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show("Файл был создан успешно", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
if (sfd.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string title = "Информация по всем книгам";
|
||||||
|
string[,] row1 = {
|
||||||
|
{ "Id", "Id" }
|
||||||
|
};
|
||||||
|
|
||||||
|
string[,] row2 = {
|
||||||
|
{ "Название", "Title" }
|
||||||
|
};
|
||||||
|
|
||||||
|
string[,] row3 = {
|
||||||
|
{ "Описание", "Description" }
|
||||||
|
};
|
||||||
|
string[,] row4 = {
|
||||||
|
{ "Категория", "Genre" }
|
||||||
|
};
|
||||||
|
string[,] row5 = {
|
||||||
|
{ "Стоимость книг", "CostStr" }
|
||||||
|
};
|
||||||
|
MyTable table = new MyTable(sfd.FileName, title, new List<string[,]> { row1, row2, row3, row4, row5 });
|
||||||
|
wordTableComponent1.CreateDoc(table);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,10 +10,12 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Aspose.Cells" Version="23.9.0" />
|
<PackageReference Include="Aspose.Cells" Version="23.9.0" />
|
||||||
|
<PackageReference Include="KOP_Labs" Version="1.0.0" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.0">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.0">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
<PackageReference Include="Unity" Version="5.11.10" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -1,7 +1,26 @@
|
|||||||
|
using LibraryBusinessLogic.BusinessLogics;
|
||||||
|
using LibraryContracts.BusinessLogicsContracts;
|
||||||
|
using LibraryContracts.StorageContracts;
|
||||||
|
using LibraryDatabaseImplement.Implements;
|
||||||
|
using Unity;
|
||||||
|
using Unity.Lifetime;
|
||||||
|
|
||||||
namespace LibraryView
|
namespace LibraryView
|
||||||
{
|
{
|
||||||
internal static class Program
|
public static class Program
|
||||||
{
|
{
|
||||||
|
private static IUnityContainer container = null;
|
||||||
|
public static IUnityContainer Container
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (container == null)
|
||||||
|
{
|
||||||
|
container = BuildUnityContainer();
|
||||||
|
}
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The main entry point for the application.
|
/// The main entry point for the application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -10,8 +29,19 @@ namespace LibraryView
|
|||||||
{
|
{
|
||||||
// To customize application configuration such as set high DPI settings or default font,
|
// To customize application configuration such as set high DPI settings or default font,
|
||||||
// see https://aka.ms/applicationconfiguration.
|
// see https://aka.ms/applicationconfiguration.
|
||||||
ApplicationConfiguration.Initialize();
|
Application.EnableVisualStyles();
|
||||||
Application.Run(new FormSecond());
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
Application.Run(Container.Resolve<FormMain>());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static IUnityContainer BuildUnityContainer()
|
||||||
|
{
|
||||||
|
var currentContainer = new UnityContainer();
|
||||||
|
currentContainer.RegisterType<IBookStorage, BookStorage>(new HierarchicalLifetimeManager());
|
||||||
|
currentContainer.RegisterType<IBookLogic, BookLogic>(new HierarchicalLifetimeManager());
|
||||||
|
currentContainer.RegisterType<IGenreStorage, GenreStorage>(new HierarchicalLifetimeManager());
|
||||||
|
currentContainer.RegisterType<IGenreLogic, GenreLogic>(new HierarchicalLifetimeManager());
|
||||||
|
return currentContainer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user