public ClientFormController(ClientForm form, Operation operation) { this.form = form; form.SetController(this); this.operation = operation; SetFormTitle(); SetTextBoxesState(); }
public void ShowClientEditForm() { try { Klient client = clients.GetActiveElement(); ClientForm form = new ClientForm(client); ClientFormController formController = new ClientFormController(form, Operation.Edit); formController.Queries = queriesClient; dr = form.ShowDialog(); // odswiezenie danych ReloadIfFormReturnedOK(); } catch (NullReferenceException ex) { // pusta tabela/? } }
// --- FORMULARZE public void ShowClientAddForm() { ClientForm form = new ClientForm(); ClientFormController formController = new ClientFormController(form, Operation.Add); formController.Queries = queriesClient; dr = form.ShowDialog(); // odswiezenie danych ReloadIfFormReturnedOK(); }
public ClientFormController(ClientForm form) { this.form = form; form.SetController(this); }