75 lines
1.7 KiB
C#
75 lines
1.7 KiB
C#
using KOP_Labs.Classes;
|
|
using KOP_Labs.Exceptions;
|
|
using System.Security.Principal;
|
|
using System.Text;
|
|
|
|
namespace WinForm
|
|
{
|
|
public partial class Form1 : Form
|
|
{
|
|
public Form1()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void booksForm1_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
private void buttonFillValues_Click(object sender, EventArgs e)
|
|
{
|
|
|
|
booksForm1.FillValues("fgdfgfdgd fdgdffdg adsdds");
|
|
|
|
}
|
|
|
|
private void buttonClear_Click(object sender, EventArgs e)
|
|
{
|
|
booksForm1.ClearList();
|
|
}
|
|
|
|
private void buttonTextBox_Click(object sender, EventArgs e)
|
|
|
|
{
|
|
labelCheckComponent.Text = "Ââåäåííûé òåêñò: ";
|
|
|
|
labelCheckComponent.Text += textBoxComponent1.Value;
|
|
if (textBoxComponent1.Error.Length > 0)
|
|
{
|
|
MessageBox.Show(textBoxComponent1.Error);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
private void buttonTable_Click(object sender, EventArgs e)
|
|
{
|
|
tableComponent.AddRow(new Book(1, "book1", "lalala"));
|
|
tableComponent.AddRow(new Book(1, "book2", "lalala2"));
|
|
tableComponent.AddRow(new Book(1, "book3", "lalala"));
|
|
|
|
}
|
|
|
|
|
|
private void buttonConfig_Click(object sender, EventArgs e)
|
|
{
|
|
tableComponent.TableConfiguration(3,
|
|
new List<string>() { "fds", "fds", "fds" },
|
|
new List<int>() { 80, 80, 80 },
|
|
new List<bool> { true, true, true },
|
|
new List<string> { "Id", "Name", "Annotation" });
|
|
}
|
|
|
|
private void buttonCleatTable_Click(object sender, EventArgs e)
|
|
{
|
|
tableComponent.ClearRows();
|
|
}
|
|
|
|
private void buttonGetObj_Click(object sender, EventArgs e)
|
|
{
|
|
string answer = tableComponent.GetSelectedObject<Book>().Name.ToString() + " " + tableComponent.GetSelectedObject<Book>().Annotation.ToString() + " ";
|
|
MessageBox.Show(answer);
|
|
}
|
|
}
|
|
} |