tch (textBox7. Text, «^ d + $»))
{(filter!="") +=«AND»; +=«Будинок =« »+ textBox7. Text + «» »;
}
}
(textBox4. Text!="")
{(Regex. IsMatch (textBox4. Text, «^ d + $»))
{(filter!="") +=«AND»; +=«Квартира =« »+ textBox4. Text + «» »;
}
}
(Pass. Text!="")
{(Regex. IsMatch (Pass. Text, «^ d + $»))
{(filter!="") +=«AND»; +=«Паспорт =« »+ Pass. Text + «» »;
}
}
абонентиBindingSource. Filter=filter;
} void button3_Click (object sender, EventArgs e)
{filter=«»; (Pass. Text!=«» && Regex. IsMatch (Pass. Text, «^ d + $»)) +=«Паспорт =« » + Pass. Text + «» »;
абонентиBindingSource. Filter=filter;
}
}
}
.4 Form 4 - Додавання або видалення книги
using System; System. Collections. Generic; System. ComponentModel; System. Data; System. Drawing; System. Text; System. Windows. Forms; WindowsApplication1
{partial class Form2: Form
{Form2 ()
{();
} void textBox1_TextChanged (object sender, EventArgs e)
{
} void Form2_Load (object sender, EventArgs e)
{
/ / TODO: This line of code loads data into the «libDataSet1. Книги » table. You can move, or remove it, as needed .. кнігіTableAdapter. Fill (this.libDataSet1. Книги);. Tables [«Книги»]. PrimaryKey=new DataColumn [] {libDataSet1. Tables [«Книги»]. Columns [0]};
} void label6_Click (object sender, EventArgs e)
{
} void button1_Click (object sender, EventArgs e)
{
кнігіTableAdapter. Update (libDataSet1); (); a=new Form1 ();. ShowDialog ();. Close ();
} void button2_Click (object sender, EventArgs e)
{(textBox1. Text!=«» && textBox2. Text!=«» && textBox3. Text!=«» && libDataSet1. Tables [«Книги» ]. Rows. Find (textBox1. Text) == null). Tables [«Книги»]. Rows. Add (textBox1. Text, textBox2. Text, textBox3. Text, Year. Value, 0, BooksCountAll. Value);
} void button3_Click (object sender, EventArgs e)
{(dataGridView1. CurrentRow!=null)
{((int) dataGridView1. CurrentRow. Cells [4]. Value == 0). Rows. RemoveAt (dataGridView1. CurrentRow. Index);. Show («Ви не можете видалити книгу, поки хоча б один екземпляр знаходиться на руках у абонентів.»);
}
} void dataGridView1_CellContentClick (object sender, DataGridViewCellEventArgs e)
{
} void textBox4_TextChanged (object sender, EventArgs e)
{
} void dataSet1BindingSource_CurrentChanged (object sender, EventArgs e)
{