private void gridControlPrenotazioni_DoubleClick(object sender, EventArgs e)
        {
            Prenotazione prenotazione = this.gridViewPrenotazioni.GetRow(this.gridViewPrenotazioni.FocusedRowHandle) as Prenotazione;

            if (prenotazione != null)
            {
                using (XtraFormEditPrenotazione formpre = new XtraFormEditPrenotazione())
                {
                    formpre.Init(prenotazione);
                    if (formpre.ShowDialog(this) == DialogResult.OK)
                    {
                        prenotazione.Save();
                        this.m_CollectionMySet.Add(prenotazione);
                        this.m_CollectionPrenotazioni.Add(prenotazione);
                        VerificaStato();
                    }
                }
            }
        }
示例#2
0
        private void schedulerControlPrenotazioni_EditAppointmentFormShowing(object sender, DevExpress.XtraScheduler.AppointmentFormEventArgs e)
        {
            Prenotazione prenotazione = e.Appointment.GetSourceObject(this.schedulerStoragePrenotazioni) as Prenotazione;

            if (prenotazione != null && prenotazione.Label != Prenotazione.LabelDisabled)
            {
                XtraFormEditPrenotazione formpre = new XtraFormEditPrenotazione();
                formpre.Init(prenotazione);

                if (formpre.ShowDialog(this) == DialogResult.OK)
                {
                    XtraUserControlCalendario2 ucal = this.xtraTabControlIngressi.SelectedTabPage.Controls[0] as XtraUserControlCalendario2;
                    ucal.NotificaAttivazione(this.xtraTabControlIngressi.SelectedTabPage);
                }
            }

            this.schedulerControlPrenotazioni.Refresh();
            e.Handled = true;
        }
        private void gridControlPrenotazioni_EmbeddedNavigator_ButtonClick(object sender, NavigatorButtonClickEventArgs e)
        {
            if (e.Button.ButtonType == NavigatorButtonType.Append)
            {
                e.Handled = true;

                Prenotazione prenotazione = new Prenotazione(m_UnitOfWork);
                prenotazione.Ingresso    = m_Ingresso;
                prenotazione.Description = m_Ingresso.Descrizione;
                prenotazione.Subject     = PrenotazioneComplessiva.RiferimentoGlobale;
                // "nuova squadra";
                //prenotazione.DurataSlot = m_Ingresso.DurataSlot(GestoreCalendario.TipoGS);
                prenotazione.DurataSlot = GestoreCalendario.GetTimeSpan(m_Ingresso.CodicePrevent);
                prenotazione.StartDate  = this.m_Scheduler.SelectedInterval.Start;
                prenotazione.StartDate  = prenotazione.FixStartDate();

                using (XtraFormEditPrenotazione formpre = new XtraFormEditPrenotazione())
                {
                    formpre.Init(prenotazione);
                    if (formpre.ShowDialog(this) == DialogResult.OK)
                    {
                        prenotazione.Save();
                        this.m_CollectionMySet.Add(prenotazione);
                        this.m_CollectionPrenotazioni.Add(prenotazione);
                        VerificaStato();
                    }
                }
            }

            if (e.Button.ButtonType == NavigatorButtonType.Remove)
            {
                e.Handled = true;

                Prenotazione prenotazione = this.gridViewPrenotazioni.GetRow(this.gridViewPrenotazioni.FocusedRowHandle) as Prenotazione;
                if (prenotazione != null)
                {
                    prenotazione.Delete();
                    VerificaStato();
                }
            }
        }