76 lines
1.8 KiB
C#
76 lines
1.8 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("gfgdf",1, "book1", "lalala"));
|
|
tableComponent.AddRow(new Book("Pushkin", 1, "book2", "lalala2"));
|
|
tableComponent.AddRow(new Book("Pushkin", 1, "book3", "lalala"));
|
|
|
|
}
|
|
|
|
|
|
private void buttonConfig_Click(object sender, EventArgs e)
|
|
{
|
|
List<TableParameters> tableParameters = new List<TableParameters>();
|
|
tableParameters.Add(new TableParameters("fds", 80, true, "Id"));
|
|
tableParameters.Add(new TableParameters("fds", 80, true, "Name"));
|
|
tableParameters.Add(new TableParameters("fds", 80, true, "Annotation"));
|
|
|
|
tableComponent.TableConfiguration(3, tableParameters);
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
} |