-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmDepartment.cs
60 lines (48 loc) · 1.61 KB
/
frmDepartment.cs
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
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;
using CMS_project.CMSdbTableAdapters;
namespace CMS_project
{
public partial class frmDepartment : Form
{
public frmDepartment()
{
InitializeComponent();
}
private void tblDeptBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.tblDeptBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.cMSdb);
}
tblDeptTableAdapter tblDept;
private void frmDepartment_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'cMSdb.tblDept' table. You can move, or remove it, as needed.
this.tblDeptTableAdapter.Fill(this.cMSdb.tblDept);
}
private void btnAdd_Click(object sender, EventArgs e)
{
try
{
tblDept = new tblDeptTableAdapter();
tblDept.spAddNewDept(txtDeptName.Text);
MessageBox.Show("Record Inserted");
txtDeptName.Clear();
txtDeptName.Focus();
this.tblDeptTableAdapter.Fill(this.cMSdb.tblDept);
}
catch (Exception ex)
{
MessageBox.Show("Record Couldn't Insert" + " " + ex.Message);
}
}
}
}