Exemplo n.º 1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     using (frmAddEditPizza frm = new frmAddEditPizza(null))
     {
         if (frm.ShowDialog() == DialogResult.OK)
         {
             pizzeBindingSource.DataSource = db.Pizze.ToList();
         }
     }
 }
Exemplo n.º 2
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (pizzeBindingSource.Current == null)
     {
         return;
     }
     using (frmAddEditPizza frm = new frmAddEditPizza(pizzeBindingSource.Current as Pizze))
     {
         if (frm.ShowDialog() == DialogResult.OK)
         {
             pizzeBindingSource.DataSource = db.Pizze.ToList();
         }
     }
 }