Ejemplo n.º 1
0
 private void Insert_Click(object sender, EventArgs e)
 {
     using (GoodsShopsIEF frm = new GoodsShopsIEF(null, db))
     {
         if (frm.ShowDialog() == DialogResult.OK)
         {
             goodsShopsBindingSource.DataSource = db.GoodsShops.ToList();
         }
     }
 }
Ejemplo n.º 2
0
 private void Edit_Click(object sender, EventArgs e)
 {
     if (goodsShopsBindingSource.Current == null)
     {
         return;
     }
     using (GoodsShopsIEF frm = new GoodsShopsIEF(goodsShopsBindingSource.Current as GoodsShops, db))
     {
         if (frm.ShowDialog() == DialogResult.OK)
         {
             goodsShopsBindingSource.DataSource = db.GoodsShops.ToList();
         }
         else
         {
             db = new my_db_for_db_2Entities();
             goodsShopsBindingSource.DataSource = db.GoodsShops.ToList();
         }
     }
 }