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