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