예제 #1
0
        private void simpleButtonOk_Click(object sender, EventArgs e)
        {
            if (Program.Postazione.Tipologia == EnumTipologiaPostazione.NonAttiva)
            {
                XtraMessageBox.Show("Questa postazione non e' abilitata per emettere biglietti.", "Errore", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (this.checkEditContanti.Checked || this.checkEditPos.Checked)
            {
                if (m_Prenotazione.ConPrenotazione())
                {
                    if (this.dxValidationProvider1.Validate())
                    {
                        m_Prenotazione.RiferimentoVendita = this.textEditRiferimento.Text;
                    }
                    else
                    {
                        return;
                    }
                }

                if (CreaVendita())
                {
                    ReportHelper.Print(m_Prenotazione.Vendita);

                    //XtraReportStampa1 stampa = new XtraReportStampa1();
                    //stampa.xpCollection1.Criteria = new BinaryOperator("Vendita.Oid", m_Prenotazione.Vendita.Oid);

                    //stampa.ShowPrintMarginsWarning = false;

                    //if (string.IsNullOrEmpty(Program.Postazione.PrinterName))
                    //    stampa.ShowPreviewDialog();
                    //else
                    //    stampa.Print(Program.Postazione.PrinterName);

                    DialogResult = DialogResult.OK;
                }
                else
                {
                    DialogResult = DialogResult.Cancel;
                }
            }
            else
            {
                XtraMessageBox.Show("Specificare il tipo di incasso (Contanti/POS)", "Avviso", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
예제 #2
0
        public void Init(PrenotazioneComplessiva prenotazione, List <Ingresso> elenco, bool imponiData, DateTime dataImposta, bool prevendita)
        {
            m_Prenotazione = prenotazione;
            m_Elenco       = elenco;
            m_ImponiData   = imponiData;
            m_DataImposta  = dataImposta;
            m_Prevendita   = prevendita;

            m_Prenotazione.StampaSingolaPersona = m_Prenotazione.SoloProfiliSingoli() || m_Prenotazione.CardMusei() || m_Prenotazione.CardMyFE();

            this.labelControlInfo1.Text = String.Format("Totale Biglietti: {0}",
                                                        m_Prenotazione.StampaSingolaPersona ?
                                                        m_Prenotazione.GestoreProfili.TotalePersone() : 1);

            this.labelControlInfo2.Text = String.Format("Totale Persone: {0}", m_Prenotazione.GestoreProfili.TotalePersone());
            if (m_Prenotazione.GestoreProfili.TotalePersoneScuole() > 0)
            {
                this.labelControlInfo2.Text += String.Format(" ({0} scuole)", m_Prenotazione.GestoreProfili.TotalePersoneScuole());
            }

            this.labelControlInfo3.Text = String.Format("Importo Totale: {0:c}", m_Prenotazione.GestoreProfili.TotaleImporto());

            // IMPOSTO CONTANTI
            if (m_Prenotazione.GestoreProfili.TotaleImporto() == 0)
            {
                this.checkEditContanti.Checked = true;
            }
            else if (Program.Postazione.Opzione(Postazione.SoloContanti))
            {
                this.checkEditContanti.Checked = true;
            }

            if (m_Prenotazione.ConPrenotazione())
            {
                this.labelControlRiferimento.Text = "Riferimento:";
                this.textEditRiferimento.Text     = m_Prenotazione.RiferimentoVendita;

                if (m_Prenotazione.PreventObj != null)
                {
                    this.labelControlPrevent.Text = String.Format("Modifica prenotazione: {0}", m_Prenotazione.PreventObj.NumeroPrenotazione);
                }
                //else if (m_Prenotazione.TaskGroup != null)
                //    this.labelControlPrevent.Text = String.Format("Prenotazione: {0}", m_Prenotazione.TaskGroup.Codice);
                else
                {
                    this.labelControlPrevent.Text = "Nuova prenotazione";
                }
            }
            else
            {
                this.labelControlRiferimento.Text = "Senza prenotazione.";
                this.textEditRiferimento.Visible  = false;
                this.labelControlPrevent.Visible  = false;
            }

            // calcola e visualizza data di validità dei biglietti
            if (!m_ImponiData)
            {
                m_DataImposta = DateTime.Now;
            }

            DateTime inizioVal = m_DataImposta.Date;
            DateTime fineVal   = m_DataImposta.Date;

            if (m_Prenotazione.GestoreProfili.Bigliettone() || m_Prenotazione.GestoreProfili.Cumulativo())
            {
                fineVal = inizioVal.AddDays(15);
            }

            if (m_Prenotazione.GestoreProfili.CardMusei())
            {
                fineVal = new DateTime(inizioVal.Year, 12, 31);
            }

            if (m_Prenotazione.ConPrenotazione())
            {
                inizioVal = m_Prenotazione.InizioPrenotazioni(inizioVal);
                fineVal   = m_Prenotazione.FinePrenotazioni(fineVal);
            }

            this.labelControlValidita.Text = string.Format("Validità: dal {0:d} al {1:d}", inizioVal, fineVal);

            //MessageBox.Show(String.Format("{0} / {1}", GestoreCalendario.TipoGS, GestoreCalendario.TipoScuola));
        }