private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (lstLocales.SelectedIndex == -1)
     {
         MessageBox.Show("Debe seleccionar un local.", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     if (string.IsNullOrEmpty(cmbForma.Text))
     {
         MessageBox.Show("Debe seleccionar una forma de pago.", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     try
     {
         if (!BL.UtilDB.ValidarServicioMysql())
         {
             MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                     + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                     MessageBoxIcon.Error);
             return;
         }
         int forma = Convert.ToInt32(cmbForma.SelectedValue.ToString());
         string strDesde = dateTimeDesde.Value.ToString("yyyy-MM-dd 00:00:00");
         DateTime hasta = dateTimeHasta.Value;
         string strHasta = hasta.AddDays(1).ToString("yyyy-MM-dd 00:00:00");
         int idLocal = Convert.ToInt32(lstLocales.SelectedValue.ToString());
         string parametros = txtParametros.Text;
         frmProgress frm = new frmProgress(forma, strDesde, strHasta, idLocal, "frmVentasDetalleInter", "cargar", parametros);
         frm.ShowDialog();
         DataTable tblVentasDetalleCons = frmProgress.tblEstatica;
         string nombreLocal = lstLocales.Text;
         VentasDetalleRpt ventas = new VentasDetalleRpt(tblVentasDetalleCons, nombreLocal);
         ventas.Show();
     }
     catch (NullReferenceException)
     {
         return;
     }
 }
예제 #2
0
 private void btnAceptar_Click(object sender, EventArgs e)
 {
     if (lstLocales.SelectedIndex == -1)
     {
         MessageBox.Show("Debe seleccionar un local.", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     if (string.IsNullOrEmpty(cmbForma.Text))
     {
         MessageBox.Show("Debe seleccionar una forma de pago.", "Trend", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     try
     {
         if (!BL.UtilDB.ValidarServicioMysql())
         {
             MessageBox.Show("No se pudo conectar con el servidor de base de datos."
                             + '\r' + "Consulte al administrador del sistema.", "Trend Sistemas", MessageBoxButtons.OK,
                             MessageBoxIcon.Error);
             return;
         }
         int         forma      = Convert.ToInt32(cmbForma.SelectedValue.ToString());
         string      strDesde   = dateTimeDesde.Value.ToString("yyyy-MM-dd 00:00:00");
         DateTime    hasta      = dateTimeHasta.Value;
         string      strHasta   = hasta.AddDays(1).ToString("yyyy-MM-dd 00:00:00");
         int         idLocal    = Convert.ToInt32(lstLocales.SelectedValue.ToString());
         string      parametros = txtParametros.Text;
         frmProgress frm        = new frmProgress(forma, strDesde, strHasta, idLocal, "frmVentasDetalleInter", "cargar", parametros);
         frm.ShowDialog();
         DataTable        tblVentasDetalleCons = frmProgress.tblEstatica;
         string           nombreLocal          = lstLocales.Text;
         VentasDetalleRpt ventas = new VentasDetalleRpt(tblVentasDetalleCons, nombreLocal);
         ventas.Show();
     }
     catch (NullReferenceException)
     {
         return;
     }
 }