예제 #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();
         }
     }
 }
예제 #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();
         }
     }
 }