Esempio n. 1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     using (FormAddEditAdmin form = new FormAddEditAdmin(null)) {
         if (form.ShowDialog() == DialogResult.OK)
         {
             adminBindingSource.DataSource = AdminService.GetAll();
         }
     }
 }
Esempio n. 2
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     if (adminBindingSource.DataSource == null)
     {
         return;
     }
     using (FormAddEditAdmin form = new FormAddEditAdmin(adminBindingSource.Current as Admin))
     {
         if (form.ShowDialog() == DialogResult.OK)
         {
             adminBindingSource.DataSource = AdminService.GetAll();
         }
     }
 }