protected void editCommand() { DomainObject entity = (DomainObject)getSelectedEntity(); if (entity == null) { return; } EntityDetailForm form; try { form = createEntityDetailForm(entity.Id); } catch (InfrastructureException ex) { MessageDialogs.showError(ex.Message, this.Text); return; } catch (Exception ex) { MessageDialogs.showError(ex.Message, this.Text); return; } if (form.ShowDialog() == DialogResult.OK) { onEntityUpdated(form.Entity); } }
private void mnPrint_Click(object sender, EventArgs e) { VezbaEditorBaseForm childForm = this.ActiveMdiChild as VezbaEditorBaseForm; if (childForm == null) { return; } Cursor.Current = Cursors.WaitCursor; Cursor.Show(); try { PreviewDialog p = new PreviewDialog(); p.setIzvestaj(new VezbaIzvestaj(childForm)); p.ShowDialog(); } catch (InfrastructureException ex) { MessageDialogs.showError(ex.Message, this.Text); } catch (Exception ex) { MessageDialogs.showError(ex.Message, this.Text); } finally { Cursor.Hide(); Cursor.Current = Cursors.Arrow; } }
private void mnPromenaGimnasticara_Click(object sender, EventArgs e) { try { GimnasticariForm f = new GimnasticariForm(); f.ShowDialog(); } catch (BusinessException ex) { MessageDialogs.showMessage(ex.Message, this.Text); } catch (InfrastructureException ex) { MessageDialogs.showError(ex.Message, this.Text); } }
private void mnPregledElemenata_Click(object sender, EventArgs e) { try { PregledElemenataForm f = new PregledElemenataForm(); f.ShowDialog(); } catch (BusinessException ex) { MessageDialogs.showMessage(ex.Message, this.Text); } catch (InfrastructureException ex) { MessageDialogs.showError(ex.Message, this.Text); } }
private void mnNaziviGrupa_Click(object sender, EventArgs e) { try { GrupeForm f = new GrupeForm(); f.ShowDialog(); } catch (BusinessException ex) { MessageDialogs.showMessage(ex.Message, this.Text); } catch (InfrastructureException ex) { MessageDialogs.showError(ex.Message, this.Text); } }
protected void deleteCommand() { DomainObject entity = (DomainObject)getSelectedEntity(); if (entity == null) { return; } if (!MessageDialogs.queryConfirmation(deleteConfirmationMessage(entity), this.Text)) { return; } try { using (ISession session = NHibernateHelper.OpenSession()) using (session.BeginTransaction()) { CurrentSessionContext.Bind(session); if (refIntegrityDeleteDlg(entity)) { delete(entity); session.Transaction.Commit(); onEntityDeleted(entity); } } } catch (InfrastructureException ex) { string errMsg = deleteErrorMessage(entity); MessageDialogs.showError( String.Format("{0} \n\n{1}", errMsg, ex.Message), this.Text); } catch (Exception ex) { string errMsg = deleteErrorMessage(entity); MessageDialogs.showError( String.Format("{0} \n\n{1}", errMsg, ex.Message), this.Text); } finally { CurrentSessionContext.Unbind(NHibernateHelper.SessionFactory); } }
private void mnTabelaElemenata_Click(object sender, EventArgs e) { try { TabelaElemenataForm f = new TabelaElemenataForm( TabelaElemenataForm.TabelaElemenataFormRezimRada.Edit, Sprava.Undefined); f.ShowDialog(); } catch (BusinessException ex) { MessageDialogs.showMessage(ex.Message, this.Text); } catch (InfrastructureException ex) { MessageDialogs.showError(ex.Message, this.Text); } }
private void btnPrint_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; Cursor.Show(); try { PreviewDialog p = new PreviewDialog(); p.setIzvestaj(new TabelaIzvestaj(tabela)); p.ShowDialog(); } catch (InfrastructureException ex) { MessageDialogs.showError(ex.Message, this.Text); } catch (Exception ex) { MessageDialogs.showError(ex.Message, this.Text); } finally { Cursor.Hide(); Cursor.Current = Cursors.Arrow; } }
protected void addCommand() { EntityDetailForm form; try { form = createEntityDetailForm(null); } catch (InfrastructureException ex) { MessageDialogs.showError(ex.Message, this.Text); return; } catch (Exception ex) { MessageDialogs.showError(ex.Message, this.Text); return; } if (form.ShowDialog() == DialogResult.OK) { onEntityAdded(form.Entity); } }