Exemplo n.º 1
0
 private void NewConsumerBtn_Click(object sender, EventArgs e)
 {
     using (CustomersIEF frm = new CustomersIEF(null, db))
     {
         if (frm.ShowDialog() == DialogResult.OK)
         {
             customersBindingSource.DataSource = db.Customers.ToList();
         }
     }
 }
Exemplo n.º 2
0
 private void Edit_Click(object sender, EventArgs e)
 {
     if (customersBindingSource.Current == null)
     {
         return;
     }
     using (CustomersIEF frm = new CustomersIEF(customersBindingSource.Current as Customers, db))
     {
         if (frm.ShowDialog() == DialogResult.OK)
         {
             customersBindingSource.DataSource = db.Customers.ToList();
         }
         else
         {
             db = new my_db_for_db_2Entities();
             customersBindingSource.DataSource = db.Customers.ToList();
         }
     }
 }