예제 #1
0
 private void MenuNovo_Click(object sender, System.EventArgs e)
 {
     using (var forms = new frmUsuariosAdd(null,
                                           new UserRepository(new BiblioteContext()),
                                           new GruposRepository(new BiblioteContext())))
     {
         var usercontrol = OpenFormsDialog.ShowForm(null, forms);
         if (usercontrol == DialogResult.OK)
         {
             Loader();
         }
     }
 }
예제 #2
0
 private void MenuEditar_Click(object sender, System.EventArgs e)
 {
     if (gridView1.FocusedRowHandle >= 0 || gridView1.SelectedRowsCount > 0)
     {
         using (var forms = new frmUsuariosAdd(
                    userModelsBindingSource.Current as UserModels,
                    new UserRepository(new BiblioteContext()),
                    new GruposRepository(new BiblioteContext())))
         {
             var usercontrol = OpenFormsDialog.ShowForm(null, forms);
             if (usercontrol == DialogResult.OK)
             {
                 Loader();
             }
         }
     }
 }