private void LoadData() { try { WIN.GUI.UTILITY.Helper.ShowWaitBox("Elaborazione in corso...", Properties.Resources.Waiting); TesseramentoHandler h = new TesseramentoHandler(); IBindingList res = h.GetAllAsBinbingList(); gridControl1.DataSource = res; if (res.Count == 0) { XtraMessageBox.Show("Nessun risultato è stato trovato. Riprovare per altri periodi!", "Nessun risultato", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } catch (Exception ex) { WIN.SCHEDULING_APP.GUI.Utility.ErrorHandler.Show(ex); } finally { WIN.GUI.UTILITY.Helper.HideWaitBox(); } }
private void TryDelete(Tesseramento movimento, int rowIndex) { if (movimento == null) { return; } if (XtraMessageBox.Show("Rimuovere il tesseramento selezionato?", "Domanda", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { TesseramentoHandler h = new TesseramentoHandler(); h.Delete(movimento); IBindingList h1 = gridView1.DataSource as IBindingList; h1.Remove(movimento); } }
private void cmdOk_Click(object sender, EventArgs e) { try { SetObjectProperties(); TesseramentoHandler h = new TesseramentoHandler(); h.SaveOrUpdate(_current); this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } catch (Exception ex) { ErrorHandler.Show(ex); } }
private void ViewReportTesseramento(int anno) { TesseramentoHandler h = new TesseramentoHandler(); IList l = new ArrayList(); Tesseramento t = h.GetCompleteTesseramentoByAnno(anno); if (t == null) { XtraMessageBox.Show("Nessun riepilogo disponibile per l'anno: " + anno.ToString(), "Informazione", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } l.Add(t); TesseramentoReport r = new TesseramentoReport(); r.DataSource = l; r.Tag = anno; r.ShowPreviewDialog(); }