コード例 #1
0
 private void btnImpresion_Click(object sender, EventArgs e)
 {
     try
     {
         if (this.dgvReporteVentasXSucursal.SelectedRows.Count == 1)
         {
             ReportesVentaXSucursal       Datos      = this.ObtenerDatosReporte();
             frmVerReporteVentasXSucursal VerReporte = new frmVerReporteVentasXSucursal(Datos.IDReporte);
             VerReporte.ShowDialog();
             VerReporte.Dispose();
         }
         else
         {
             MessageBox.Show("Seleccione una fila.", Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         LogError.AddExcFileTxt(ex, "frmReporteVentasXSucursal ~ btnImpresion_Click");
         MessageBox.Show(Comun.MensajeError, Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #2
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                this.txtMensajeError.Visible = false;
                List <Error> Errores = this.ValidarDatos();

                if (Errores.Count == 0)
                {
                    ReportesVentaXSucursal         Datos = this.ObtenerDatos();
                    ReporteVentasXSucursal_Negocio Neg   = new ReporteVentasXSucursal_Negocio();

                    int IDReporte = Neg.GenerarReporteVentasXSucursal(Comun.Conexion, Datos.FechaInicio, Datos.FechaFin, Comun.IDUsuario, Datos.IDSucursal);
                    //IDReporte = Neg.GenerarReporteVentasXSucursalXFormasPago (Comun.Conexion, Datos.FechaInicio, Datos.FechaFin, IDReporte , Datos.IDSucursal);

                    if (IDReporte > 0)
                    {
                        frmVerReporteVentasXSucursal VerReporte = new frmVerReporteVentasXSucursal(IDReporte);
                        VerReporte.ShowDialog();
                        VerReporte.Dispose();
                        this.DialogResult = DialogResult.OK;
                    }
                    else
                    {
                        MessageBox.Show("Ocurrió un error al generar el reporte.", Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    this.MostrarMensajeError(Errores);
                }
            }
            catch (Exception ex)
            {
                LogError.AddExcFileTxt(ex, "frmNuevoReporteVentasXSucursal ~ btnGuardar_Click");
                MessageBox.Show(Comun.MensajeError, Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }