private void BtnAddForenty_Click(object sender, EventArgs e) { using (var forms = new frmGruposAdd(null, new GruposRepository(new BiblioteContext()), new PermissoesRepository(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 frmGruposAdd( gruposModelsBindingSource.Current as GruposModels, new GruposRepository(new BiblioteContext()), new PermissoesRepository(new BiblioteContext()))) { var usercontrol = OpenFormsDialog.ShowForm(null, forms); if (usercontrol == DialogResult.OK) { Loader(); } } } }