-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTeacher.cs
More file actions
71 lines (61 loc) · 2.03 KB
/
Teacher.cs
File metadata and controls
71 lines (61 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using Database.DataSet1TableAdapters;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Database
{
public partial class Teacher : Form
{
public Teacher()
{
InitializeComponent();
}
private void teacherBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.teacherBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.dataSet1);
}
private void Teacher_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'dataSet1.Teacher' table. You can move, or remove it, as needed.
this.teacherTableAdapter.Fill(this.dataSet1.Teacher);
}
private void button1_Click(object sender, EventArgs e)
{
teacherBindingSource.AddNew();
}
private void button2_Click(object sender, EventArgs e)
{
teacherBindingSource.EndEdit();
teacherTableAdapter.Update(dataSet1);
}
private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
for (int i = 0; i < teacherDataGridView.Rows.Count; i++)
{
teacherDataGridView.Rows[i].Selected = false;
for (int j = 0; j < teacherDataGridView.ColumnCount; j++)
{
if (teacherDataGridView.Rows[i].Cells[j].Value != null)
{
if (teacherDataGridView.Rows[i].Cells[j].Value.ToString().Contains(textBox1.Text))
{
teacherDataGridView.Rows[i].Selected = true;
break;
}
}
}
}
}
}
}