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