Ejemplo n.º 1
0
        private void ButtonGuardarPDF_Click(object sender, EventArgs e)
        {
            if (SorteoGenerico != null && SorteoGenerico.Resultado.Any())
            {
                SaveFileDialog dialogoDestino = new SaveFileDialog();
                dialogoDestino.Filter = "Archivo PDF (Portable Document Format)|*.pdf";
                StringBuilder strNombre = new StringBuilder();
                strNombre.Append("Sorteo Picos de Agua")
                .Append(" ")
                .Append(FechaSorteo.ToShortDateString().Replace('/', '.'));
                dialogoDestino.FileName = strNombre.ToString();
                DialogResult resultado = dialogoDestino.ShowDialog();

                if (resultado == DialogResult.OK)
                {
                    this.Cursor = Cursors.WaitCursor;
                    string destino = dialogoDestino.FileName;

                    ControladorPDF pdf = new ControladorPDF();
                    pdf.GuardarSorteoPicos(destino, "Sorteo Picos de Agua", FechaSorteo.ToShortDateString(),
                                           SorteoGenerico.Inicio.ToString(), SorteoGenerico.Tope.ToString(), ExtraerPicosSorteados(SorteoGenerico.Resultado));
                }
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("No se ha realizado ningún sorteo.", "?", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
            }
            this.Cursor = Cursors.Default;
        }
Ejemplo n.º 2
0
        private void btnGuardarPDF_Click(object sender, EventArgs e)
        {
            if (FechasSorteadas != null && FechasSorteadas.Any())
            {
                SaveFileDialog dialogoDestino = new SaveFileDialog();
                dialogoDestino.Filter = "Archivo PDF (Portable Document Format)|*.pdf";
                StringBuilder strNombre = new StringBuilder();
                strNombre.Append(SorteoPredefinido.ToString())
                .Append(" ")
                .Append(FechaSorteo.ToShortDateString().Replace('/', '.'));
                dialogoDestino.FileName = strNombre.ToString();
                DialogResult resultado = dialogoDestino.ShowDialog();

                if (resultado == DialogResult.OK)
                {
                    this.Cursor = Cursors.WaitCursor;
                    string strFechaInicio  = FechaInicio.ToShortDateString();
                    string strFechaTope    = FechaTope.ToShortDateString();
                    string strTituloSorteo = SorteoPredefinido.ToString();
                    // Ajustar titulos segun tipo de sorteo
                    if (SorteoPredefinido == EnumSorteo.DIA_SEMANA || SorteoPredefinido == EnumSorteo.MES_ANIO)
                    {
                        strFechaInicio  = "---";
                        strFechaTope    = "---";
                        strTituloSorteo = SorteoPredefinido != EnumSorteo.MES_ANIO ? "DIA DE LA SEMANA" : "MES DEL AÑO";
                    }
                    else
                    {
                        strTituloSorteo = "DIAS POR SEMANA";
                    }
                    string         destino = dialogoDestino.FileName;
                    ControladorPDF pdf     = new ControladorPDF();
                    pdf.GuardarSorteoFechas(destino, "Sorteo: " + strTituloSorteo, FechaSorteo.ToShortDateString(),
                                            strFechaInicio, strFechaTope, IncluirDomingos, FechasSorteadas);
                }
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("No se ha realizado ningún sorteo.", "?", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
            }
            this.Cursor = Cursors.Default;
        }
Ejemplo n.º 3
0
        private void ButtonGuardarPDF_Click(object sender, EventArgs e)
        {
            if (SorteoGenerico != null && SorteoGenerico.Resultado.Any())
            {
                SaveFileDialog dialogoDestino = new SaveFileDialog();
                dialogoDestino.Filter = "Archivo PDF (Portable Document Format)|*.pdf";
                StringBuilder strNombre = new StringBuilder();
                strNombre.Append(SorteoPredefinido.ToString())
                .Append(" ")
                .Append(FechaSorteo.ToShortDateString().Replace('/', '.'));
                dialogoDestino.FileName = strNombre.ToString();
                DialogResult resultado = dialogoDestino.ShowDialog();

                if (resultado == DialogResult.OK)
                {
                    this.Cursor = Cursors.WaitCursor;
                    string     destino      = dialogoDestino.FileName;
                    List <int> verificacion = new List <int>();
                    if (SorteoGenerico is Personalizado)
                    {
                        verificacion = chkVerificacion.Checked && (radioButtonEportarTodo.Checked || radioButtonExportarVerificacionSeparada.Checked) ? (SorteoGenerico as Personalizado).ResultadoVerificacion : verificacion;
                    }
                    else if (SorteoGenerico is Haccp)
                    {
                        verificacion = !radioButtonExportarSoloSorteo.Checked ? (SorteoGenerico as Haccp).ResultadoVerificacion : verificacion;
                    }
                    ControladorPDF pdf   = new ControladorPDF();
                    string         rango = chkRango.Checked ? rango = Rango.ToString() : rango = "N/A";
                    pdf.GuardarSorteoNumeros(destino, "Sorteo: " + SorteoPredefinido.ToString(), FechaSorteo.ToShortDateString(),
                                             SorteoGenerico.Inicio.ToString(), SorteoGenerico.Tope.ToString(), rango,
                                             SorteoGenerico.Resultado, verificacion, radioButtonExportarVerificacionSeparada.Checked);
                }
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("No se ha realizado ningún sorteo.", "?", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
            }
            this.Cursor = Cursors.Default;
        }