private void Btn_Cancelar_Click(object sender, EventArgs e) { iniciazliarTbpConsulta(); Tbc_RptApp.SelectedTab = Tbp_Consulta; this.reporteApp = new ReporteAplicacion(); llenarDgv(); }
public ReporteAplicacion obtenerReporteApp(int app, int modulo) { ReporteAplicacion reporteAppTmp = new ReporteAplicacion(); try { String sComando = String.Format("SELECT PK_id_reporte , PK_id_aplicacion, PK_id_MODULO, ESTADO " + "FROM TBL_RPT_APP " + "WHERE PK_id_aplicacion = {0} " + " AND PK_id_MODULO = {1}" + " AND ESTADO <> 0; ", app.ToString(), modulo.ToString()); OdbcDataReader reader = transaccion.ConsultarDatos(sComando); if (reader.HasRows) { while (reader.Read()) { reporteAppTmp.REPORTE = rep.obtenerReporte(reader.GetInt32(0)); reporteAppTmp.APLICACION = this.app.obtenerAplicacion(reader.GetInt32(1), reader.GetInt32(2)); reporteAppTmp.MODULO = mod.obtenerModulo(reader.GetInt32(2)); reporteAppTmp.ESTADO = reader.GetInt32(3); } } } catch (OdbcException ex) { throw new Exception("No se obtuvieron registros." + ex.ToString()); } return(reporteAppTmp); }
public void imprimirReporteAplicacion(string usuario, int Modulo, int Aplicacion) { PropiedadReporteControl propiedadReporteControl = new PropiedadReporteControl(); PropiedadReporte propiedadReporte = propiedadReporteControl.obtenerPropiedadPorUsuarioAplicacion(usuario, Aplicacion, Modulo); ReporteAplicacionControl datos = new ReporteAplicacionControl(); ReporteAplicacion repApp = datos.obtenerReporteApp(Aplicacion, Modulo); Reporte rpt = repApp.REPORTE; string pathFile = rpt.CONFIGURACION.RUTA + rpt.NOMBRE_ARCHIVO; Frm_VistaReporte frmVistaRpt; switch (propiedadReporte.IMPRIMIR) { case 0: frmVistaRpt = new Frm_VistaReporte(pathFile, 0); frmVistaRpt.Show(); break; case 1: frmVistaRpt = new Frm_VistaReporte(pathFile, 1); frmVistaRpt.Show(); break; default: break; } }
/* * Programacion botones. */ private void Btn_Guardar_Click(object sender, EventArgs e) { deshabilitarBotones(); this.reporteApp = llenarReporteApp(); this.propiedadReporte = llenarPropiedadRpt(); sentencia s = new sentencia(); Dialogo dialogo = new Dialogo(); bool confirmacion = dialogo.dialogoSiNo("Confirmacion", "Desea guardar?"); if (confirmacion) { if (this.accion == "nuevo") { reporteAppControl.insertarReporteApp(this.reporteApp); propiedadReporteControl.insertarPropiedadReporte(this.propiedadReporte); } else if (this.accion == "modificar") { reporteAppControl.actualizarReporteApp(this.reporteApp); } iniciazliarTbpConsulta(); Tbc_RptApp.SelectedTab = Tbp_Consulta; this.reporteApp = new ReporteAplicacion(); llenarDgv(); s.insertarBitacora(usuario, "Guardar reporte aplicacion", "Tbl_Aplicacion"); } }
private void Btn_Nuevo_Click(object sender, EventArgs e) { iniciazliarTbpConsulta(); this.reporteApp = new ReporteAplicacion(); Tbc_RptApp.SelectedTab = Tbp_Datos; this.accion = "nuevo"; }
public List <ReporteAplicacion> obtenerAllReporteAppByMdl(int modulo) { List <ReporteAplicacion> reporteAppList = new List <ReporteAplicacion>(); try { String sComando = String.Format("SELECT PK_id_reporte , PK_id_aplicacion, PK_id_MODULO, ESTADO " + "FROM TBL_RPT_APP" + "WHERE PK_id_MODULO = {0} " + " AND ESTADO <> 0; ", modulo.ToString()); OdbcDataReader reader = transaccion.ConsultarDatos(sComando); if (reader.HasRows) { while (reader.Read()) { ReporteAplicacion reporteAppTmp = new ReporteAplicacion(); reporteAppTmp.REPORTE.REPORTE = reader.GetInt32(0); reporteAppTmp.APLICACION.APLICACION = reader.GetInt32(1); reporteAppTmp.MODULO.MODULO = reader.GetInt32(2); reporteAppTmp.ESTADO = reader.GetInt32(3); reporteAppList.Add(reporteAppTmp); } } } catch (OdbcException ex) { MessageBox.Show(ex.ToString(), "Error al obtener reporte aplicacion."); return(null); } return(reporteAppList); }
public ReporteAplicacion obtenerReporteApp(int app, int modulo) { ReporteAplicacion reporteAppTmp = new ReporteAplicacion(); try { String sComando = String.Format("SELECT ID_REPORTE, ID_APLICACION, ID_MODULO, ESTADO " + "FROM TBL_RPT_APP " + "WHERE ID_APLICACION = {0} " + " AND ID_MODULO = {1}" + " AND ESTADO <> 0; ", app.ToString(), modulo.ToString()); OdbcDataReader reader = transaccion.ConsultarDatos(sComando); if (reader.HasRows) { while (reader.Read()) { reporteAppTmp.REPORTE.REPORTE = int.Parse(reader.GetString(0)); reporteAppTmp.APLICACION.APLICACION = int.Parse(reader.GetString(1)); reporteAppTmp.MODULO.MODULO = int.Parse(reader.GetString(2)); reporteAppTmp.ESTADO = int.Parse(reader.GetString(3)); } } } catch (OdbcException ex) { MessageBox.Show(ex.ToString(), "Error al obtener reporte aplicacion."); return(null); } return(reporteAppTmp); }
private void llenarTbpDato(ReporteAplicacion reporteApp) { deshabilitarCampos(); Cmb_Reporte.SelectedItem = Cmb_Reporte.Items[reporteApp.REPORTE.REPORTE]; Cmb_Modulo.SelectedItem = Cmb_Modulo.Items[reporteApp.MODULO.MODULO]; Cmb_Aplicacion.SelectedItem = Cmb_Aplicacion.Items[reporteApp.APLICACION.APLICACION]; Txt_Estado.Text = reporteApp.ESTADO.ToString(); }
private void Btn_Modificar_Click(object sender, EventArgs e) { habilitarCampos(); this.reporteApp = llenarReporteApp(); this.accion = "modificar"; sentencia s = new sentencia(usuario); s.insertarBitacora(usuario, "Modificar reporte aplicacion", "Tbl_Aplicacion"); }
private void seleccionarRegistro(object sender, DataGridViewCellEventArgs e) { int fila = Dgv_Consulta.CurrentCell.RowIndex; String codigoApp = Dgv_Consulta.Rows[fila].Cells[1].Value.ToString(); String codigoMdl = Dgv_Consulta.Rows[fila].Cells[2].Value.ToString(); this.reporteApp = reporteAppControl.obtenerReporteApp(int.Parse(codigoApp), Int32.Parse(codigoMdl)); llenarTbpDato(this.reporteApp); Tbc_RptApp.SelectedTab = Tbp_Datos; }
private ReporteAplicacion llenarReporteApp() { ReporteAplicacion reporteAppTmp = new ReporteAplicacion(); reporteAppTmp.REPORTE = (Reporte)Cmb_Reporte.SelectedItem; reporteAppTmp.MODULO = (Modulo)Cmb_Modulo.SelectedItem; reporteAppTmp.APLICACION = (Aplicacion)Cmb_Aplicacion.SelectedItem; reporteAppTmp.ESTADO = int.Parse(Txt_Estado.Text); return(reporteAppTmp); }
private void Btn_Nuevo_Click(object sender, EventArgs e) { habilitarBotones(); iniciazliarTbpConsulta(); this.reporteApp = new ReporteAplicacion(); Tbc_RptApp.SelectedTab = Tbp_Datos; this.accion = "nuevo"; sentencia s = new sentencia(usuario); s.insertarBitacora(usuario, "Creacion reporte aplicacion", "Tbl_Aplicacion"); }
public void insertarReporteApp(ReporteAplicacion reporteApp) { try { String sComando = String.Format("INSERT INTO TBL_RPT_APP VALUES ({0}, {1}, {2}, {3}); ", reporteApp.REPORTE.REPORTE.ToString(), reporteApp.APLICACION.APLICACION.ToString(), reporteApp.MODULO.MODULO.ToString(), reporteApp.ESTADO.ToString()); this.transaccion.insertarDatos(sComando); } catch (OdbcException ex) { MessageBox.Show(ex.ToString(), "Error al asociar reporte a aplicacion."); } }
private void Btn_Borrar_Click(object sender, EventArgs e) { this.accion = null; Dialogo dialogo = new Dialogo(); bool confirmacion = dialogo.dialogoSiNo("Confirmacion", "Desea eliminar?"); if (confirmacion) { reporteAppControl.eliminarReporteApp(this.reporteApp.APLICACION.APLICACION, this.reporteApp.MODULO.MODULO); this.reporteApp = new ReporteAplicacion(); iniciazliarTbpConsulta(); Tbc_RptApp.SelectedTab = Tbp_Consulta; llenarDgv(); } }
private void llenarTbpDato(ReporteAplicacion reporteApp) { deshabilitarCampos(); ReporteAplicacionControl reporteAplicacionCont = new ReporteAplicacionControl(); ReporteAplicacion reporteAplicacion = reporteAplicacionCont.obtenerReporteApp(reporteApp.APLICACION.APLICACION, reporteApp.MODULO.MODULO); Cmb_Reporte.Text = reporteAplicacion.REPORTE.NOMBRE; Cmb_Reporte.SelectedText = Cmb_Reporte.Text; Cmb_Modulo.Text = reporteAplicacion.MODULO.NOMBRE; Cmb_Modulo.SelectedText = Cmb_Modulo.Text; Cmb_Aplicacion.SelectedText = reporteAplicacion.APLICACION.NOMBRE; Txt_Estado.Text = reporteApp.ESTADO.ToString(); }
public void actualizarReporteApp(ReporteAplicacion reporteApp) { try { String sComando = String.Format("UPDATE TBL_RPT_APP " + "SET ID_REPORTE = {0}, ESTADO = {3} " + "WHERE ID_APLICACION = {1} " + " AND ID_MODULO = {2}; ", reporteApp.REPORTE.REPORTE.ToString(), reporteApp.APLICACION.APLICACION.ToString(), reporteApp.MODULO.MODULO.ToString(), reporteApp.ESTADO.ToString()); this.transaccion.insertarDatos(sComando); } catch (OdbcException ex) { MessageBox.Show(ex.ToString(), "Error al actualizar reporte aplicacion."); } }
/* * Programacion botones. */ private void Btn_Guardar_Click(object sender, EventArgs e) { this.reporteApp = llenarReporteApp(); Dialogo dialogo = new Dialogo(); bool confirmacion = dialogo.dialogoSiNo("Confirmacion", "Desea guardar?"); if (confirmacion) { if (this.accion == "nuevo") { reporteAppControl.insertarReporteApp(this.reporteApp); } else if (this.accion == "modificar") { reporteAppControl.actualizarReporteApp(this.reporteApp); } } }
private void Btn_Borrar_Click(object sender, EventArgs e) { deshabilitarBotones(); propiedadReporte = llenarPropiedadRpt(); propiedadReporte.ESTADO = 0; this.accion = null; Dialogo dialogo = new Dialogo(); bool confirmacion = dialogo.dialogoSiNo("Confirmacion", "Desea eliminar?"); if (confirmacion) { propiedadReporteControl.modificarPropiedadReporte(propiedadReporte); reporteAppControl.eliminarReporteApp(this.reporteApp.APLICACION.APLICACION, this.reporteApp.MODULO.MODULO); this.reporteApp = new ReporteAplicacion(); iniciazliarTbpConsulta(); Tbc_RptApp.SelectedTab = Tbp_Consulta; llenarDgv(); } }
public List <ReporteAplicacion> obtenerAllReporteApp() { List <ReporteAplicacion> reporteAppList = new List <ReporteAplicacion>(); ReporteControl reporteControl = new ReporteControl(); ModuloControl moduloControl = new ModuloControl(); AplicacionControl aplicacionControl = new AplicacionControl(); try { String sComando = String.Format("SELECT ID_REPORTE, ID_APLICACION, ID_MODULO, ESTADO " + "FROM TBL_RPT_APP " + "WHERE ESTADO <> 0; "); OdbcDataReader reader = transaccion.ConsultarDatos(sComando); if (reader.HasRows) { while (reader.Read()) { ReporteAplicacion reporteAppTmp = new ReporteAplicacion(); reporteAppTmp.REPORTE = reporteControl.obtenerReporte(reader.GetInt32(0)); reporteAppTmp.MODULO = moduloControl.obtenerModulo(reader.GetInt32(2)); reporteAppTmp.APLICACION = aplicacionControl.obtenerAplicacion(reader.GetInt32(1), reporteAppTmp.MODULO.MODULO); reporteAppTmp.ESTADO = int.Parse(reader.GetString(3)); reporteAppList.Add(reporteAppTmp); } } } catch (OdbcException ex) { MessageBox.Show(ex.ToString(), "Error al obtener reporte aplicacion."); return(null); } return(reporteAppList); }
private void Btn_Modificar_Click(object sender, EventArgs e) { habilitarCampos(); this.reporteApp = llenarReporteApp(); this.accion = "modificar"; }