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