private void btnGuardar_Click(object sender, EventArgs e) { try { this.txtMensajeError.Visible = false; List <Error> Errores = this.ValidarDatos(); if (Errores.Count == 0) { ReporteMonedero Datos = this.ObtenerDatos(); Reporte_NegocioMonedero Neg = new Reporte_NegocioMonedero(); int IDReporte = Neg.GenerarReporteMonedero(Comun.Conexion, Datos.FechaInicio, Datos.FechaFin, Comun.IDUsuario); if (IDReporte > 0) { frmVerReporteMonedero VerReporte = new frmVerReporteMonedero(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, "frmNuevoReporteMonedero ~ btnGuardar_Click"); MessageBox.Show(Comun.MensajeError, Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnImpresion_Click_1(object sender, EventArgs e) { try { if (this.dgvReportesTrabajosRealizados.SelectedRows.Count == 1) { ReporteMonedero Datos = this.ObtenerDatosReporte(); frmVerReporteMonedero VerReporte = new frmVerReporteMonedero(Datos.IDReporte); VerReporte.ShowDialog(); VerReporte.Dispose(); } else { MessageBox.Show("Seleccione una fila.", Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { LogError.AddExcFileTxt(ex, "frmReporteMonedero ~ btnImpresion_Click"); MessageBox.Show(Comun.MensajeError, Comun.Sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }