示例#1
0
 private void Insert_Click(object sender, EventArgs e)
 {
     using (EmployeeIEF frm = new EmployeeIEF(null, db))
     {
         if (frm.ShowDialog() == DialogResult.OK)
         {
             employeeBindingSource.DataSource = db.Employee.ToList();
         }
     }
 }
示例#2
0
 private void Edit_Click(object sender, EventArgs e)
 {
     if (employeeBindingSource.Current == null)
     {
         return;
     }
     using (EmployeeIEF frm = new EmployeeIEF(employeeBindingSource.Current as Employee, db))
     {
         if (frm.ShowDialog() == DialogResult.OK)
         {
             employeeBindingSource.DataSource = db.Employee.ToList();
         }
         else
         {
             db = new my_db_for_db_2Entities();
             employeeBindingSource.DataSource = db.Employee.ToList();
         }
     }
 }