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