private void gridControlMessaggi_DoubleClick(object sender, EventArgs e) { Messaggio msg = this.gridViewMessaggi.GetRow(this.gridViewMessaggi.FocusedRowHandle) as Messaggio; if (msg != null) { using (XtraFormMessaggio fmsg = new XtraFormMessaggio()) { fmsg.Init(msg); if (fmsg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { AggiornaGriglie(); } } } }
private void VisualizzaMessaggi() { using (XPCollection <Messaggio> msgs = new XPCollection <Messaggio>(this.unitOfWork1)) { msgs.Criteria = new GroupOperator(GroupOperatorType.And, new CriteriaOperator[] { new BinaryOperator("Data", DateTime.Now.Date, BinaryOperatorType.LessOrEqual), new BinaryOperator("DataFine", DateTime.Now.Date, BinaryOperatorType.GreaterOrEqual), new BinaryOperator("Tipologia", EnumTipoMessaggio.MessaggioInformativo) }); foreach (Messaggio msg in msgs) { if (!msg.Letto(Program.UtenteCollegato.Oid)) { using (XtraFormMessaggio form = new XtraFormMessaggio()) { form.Init(msg); form.ShowDialog(); } } } } }
private void gridControlMessaggi_EmbeddedNavigator_ButtonClick(object sender, NavigatorButtonClickEventArgs e) { if (e.Button.ButtonType == NavigatorButtonType.Append) { e.Handled = true; if (Program.UtenteCollegato.Autorizzato(Utente.OperazioneRiepiloghi)) { using (XtraFormMessaggio fmsg = new XtraFormMessaggio()) { fmsg.Init(null); if (fmsg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { AggiornaGriglie(); } } } else { XtraMessageBox.Show("Utente non autorizzato a comporre nuovi messaggi.", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }