private void _Btn_Generar_Click(object sender, EventArgs e) { // comprueba que existan ejecuciones programadas if (_Cb_Ejecucion.Items.Count > 0) { try { _Sfd_Generar.FileName = CLASES._Cls_Varios_Metodos._Mtd_NombreReportesExportacion("INC_VISIBILIDAD") + ".xls";; if (_Sfd_Generar.ShowDialog() == DialogResult.OK) { Thread _Thr_Thread = new Thread(new ThreadStart(_Mtd_GenerarListado)); _Thr_Thread.Start(); while (!_Thr_Thread.IsAlive) { ; } Frm_WaitForm _Frm_Form = new Frm_WaitForm(1000, _Thr_Thread, "Espere por favor..."); _Frm_Form.ShowDialog(this); _Frm_Form.Dispose(); } } catch { Cursor = Cursors.Default; MessageBox.Show("Lo sentimos, ha ocurrido un error generando el listado.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Lo sentimos, no existen incentivos programados para esta compañia.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void _Bt_Conectar_Click(object sender, EventArgs e) { _Cls_VariosMetodos._Mtd_Cerrar_T3_Popup("openvpn"); _Cls_VariosMetodos._Mtd_Cerrar_T3_Popup("openvpn-gui-1.0.3"); object _Ob_Estoy = _Cmb_Estoy.SelectedValue; object _Ob_Conectarme = _Cmb_Conectarme.SelectedValue; Thread _Thr_Thread = new Thread(new System.Threading.ThreadStart(delegate { _Mtd_Conectar(_Ob_Estoy, _Ob_Conectarme); })); _Thr_Thread.Start(); while (!_Thr_Thread.IsAlive) { ; } Frm_WaitForm _Frm_Form = new Frm_WaitForm(1000, _Thr_Thread, "Estableciendo conexión..."); _Frm_Form.ShowDialog(this); _Frm_Form.Dispose(); if (_Bol_Contectado) { _Mtd_ComprobarConexion(); } if (_Bol_Contectado) { this.Close(); } else if (!_Bol_LlaveVpnExiste) { MessageBox.Show("No se encontraron los certificados correspondientes a la sucursal seleccionada.", "Información", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { MessageBox.Show("Problemas con la conexion de internet. Intente mas tarde.", "Información", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } }
private void _Tb_Tab_Selected(object sender, TabControlEventArgs e) { if (e.TabPageIndex == 1) { Cursor = Cursors.WaitCursor; Thread _Thr_Thread = new Thread(new ThreadStart(_Mtd_CargarGridMovimientos)); _Thr_Thread.Start(); while (!_Thr_Thread.IsAlive) { ; } Frm_WaitForm _Frm_Form = new Frm_WaitForm(1000, _Thr_Thread, "Espere por favor..."); _Frm_Form.ShowDialog(this); _Frm_Form.Dispose(); for (int _Int_I = 6; _Int_I <= 18; _Int_I++) { if (_Int_I <= 9) { _Dg_Grid2.Columns[_Int_I].DefaultCellStyle.BackColor = Color.FromArgb(192, 192, 255); } else if (_Int_I <= 13) { _Dg_Grid2.Columns[_Int_I].DefaultCellStyle.BackColor = Color.FromArgb(255, 192, 128); } else if (_Int_I <= 17) { _Dg_Grid2.Columns[_Int_I].DefaultCellStyle.BackColor = Color.FromArgb(255, 255, 192); } } _Dg_Grid2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; Cursor = Cursors.Default; } }
private void _Mtd_ExportarReporte() { //this.Cursor = Cursors.WaitCursor; string _Str_Cadena = "EXEC PA_INF_COBRAN_DETALLADA_CAJA_EXPORTAR '" + Frm_Padre._Str_Comp + "','" + Frm_Padre._Str_GroupComp + "','" + _Txt_Caja.Text + "','" + _Txt_Caja.Text + "'"; if (_Txt_Caja_2.Text.Trim().Length > 0) { _Str_Cadena = "EXEC PA_INF_COBRAN_DETALLADA_CAJA_EXPORTAR '" + Frm_Padre._Str_Comp + "','" + Frm_Padre._Str_GroupComp + "','" + _Txt_Caja.Text + "','" + _Txt_Caja_2.Text + "'"; } try { _Ds_ExportarReporte = Program._MyClsCnn._mtd_conexion._Mtd_RetornarDataset(_Str_Cadena); if (_Sfd_1.ShowDialog() == DialogResult.OK) { Thread _Thr_Thread = new Thread(new ThreadStart(_Mtd_ExportarReporteProcesoExcel)); _Thr_Thread.Start(); while (!_Thr_Thread.IsAlive) { ; } Frm_WaitForm _Frm_Form = new Frm_WaitForm(1000, _Thr_Thread, "Espere por favor..."); _Frm_Form.ShowDialog(this); _Frm_Form.Dispose(); } } catch { //Cursor = Cursors.Default; MessageBox.Show("Error al intentar exportar", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void _Bt_Historial_Click(object sender, EventArgs e) { System.Threading.Thread _Thr_Thread = new System.Threading.Thread(new System.Threading.ThreadStart(_Mtd_Cobranza)); _Thr_Thread.Start(); while (!_Thr_Thread.IsAlive) { ; } Frm_WaitForm _Frm_Form = new Frm_WaitForm(1000, _Thr_Thread, "Espere por favor..!!"); _Frm_Form.ShowDialog(this); _Frm_Form.Dispose(); }
private void _Mtd_ISLR(DateTime _P_Dtm_Desde, DateTime _P_Dtm_Hasta, string _P_Str_ID_Archivo) { Thread _Thr_Thread = new Thread(new ThreadStart(delegate { _Mtd_GuardarISLR(_P_Dtm_Desde, _P_Dtm_Hasta, _P_Str_ID_Archivo); })); _Thr_Thread.Start(); while (!_Thr_Thread.IsAlive) { ; } Frm_WaitForm _Frm_Form = new Frm_WaitForm(1000, _Thr_Thread, "Por favor espere..."); _Frm_Form.ShowDialog(this); _Frm_Form.Dispose(); }
private void _Tool_Crear_ISLR_Click(object sender, EventArgs e) { Thread _Thr_Thread = new Thread(new ThreadStart(delegate { _Mtd_CrearArchivoISLR(Convert.ToString(_Dg_Grid_ISLR.Rows[_Dg_Grid_ISLR.CurrentCell.RowIndex].Cells["Archivo"].Value).Trim()); })); _Thr_Thread.Start(); while (!_Thr_Thread.IsAlive) { ; } Frm_WaitForm _Frm_Form = new Frm_WaitForm(1000, _Thr_Thread, "Por favor espere..."); _Frm_Form.ShowDialog(this); _Frm_Form.Dispose(); MessageBox.Show("El archivo se ha creado correctamente.\n Se encuentra en C:\\seniat\\XML_relacionRetencionesISLR_.xml", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); }
public Frm_RelaFacturaCobro() { InitializeComponent(); Thread _Thr_Thread = new Thread(new ThreadStart(_Mtd_InicioRela)); _Thr_Thread.Start(); // Ejecutamos el subproceso while (!_Thr_Thread.IsAlive) { ; } Frm_WaitForm _Frm_Form = new Frm_WaitForm(1000, _Thr_Thread); _Frm_Form.MdiParent = this.MdiParent; _Frm_Form.ShowDialog(this); // Mostramos el formulario de forma modal. _Frm_Form.Dispose(); }
private void _Bt_Consulta_Click(object sender, EventArgs e) { if (_Rbt_Filtro.Checked) { _Str_Consulta = _Mtd_Buscar(); } else { _Str_Consulta = ""; } if (!_Rbt_Filtro.Checked | (_Rbt_Filtro.Checked & _Str_Consulta.Trim().Length > 0)) { Thread _Thr_Thread = new Thread(new ThreadStart(_Mtd_Cosultar)); _Thr_Thread.Start(); while (!_Thr_Thread.IsAlive) { ; } Frm_WaitForm _Frm_Form = new Frm_WaitForm(1000, _Thr_Thread, "Espere por favor..."); _Frm_Form.ShowDialog(this); _Frm_Form.Dispose(); } }
private void _Mtd_Actualizar(bool _Bol_Null) { string _Str_Cadena = ""; if (_Bol_Null) { _Str_Cadena = "SELECT cticket,companydescrip,casunto,csolicitantename,CASE WHEN ctipofalla='1' THEN 'Arquitectura (Sistema T3)' ELSE 'Tecnología (Soporte Técnico)' END AS ctipofalla,carquitecto,cprioridad,cfechahorareporte,cdiastrans,cfinaprox,cfechahorpausa,cfechahoracerrado,cestadoname,cuser,cestatusconssa FROM VST_T3_REPORTFALLASv1 WHERE 0>1"; } else { _Str_Cadena = "SELECT cticket,companydescrip,casunto,csolicitantename,CASE WHEN ctipofalla='1' THEN 'Arquitectura (Sistema T3)' ELSE 'Tecnología (Soporte Técnico)' END AS ctipofalla,carquitecto,cprioridad,cfechahorareporte,cdiastrans,cfinaprox,cfechahorpausa,cfechahoracerrado,cestadoname,cuser,cestatusconssa FROM VST_T3_REPORTFALLASv1 WHERE 0=0"; //-------------------------------------- if (_Cmb_Solicitante.SelectedIndex > 0) { _Str_Cadena += " AND cuser='******'"; } //-------------------------------------- if (_Cmb_TipoFalla.SelectedIndex > 0) { _Str_Cadena += " AND ctipofalla='" + Convert.ToString(_Cmb_TipoFalla.SelectedValue).Trim() + "'"; } //-------------------------------------- switch (Convert.ToString(_Cmb_Filtrar.SelectedValue).Trim()) { case "1": //Solicitudes pendientes _Str_Cadena += " AND (cfechahoracerrado IS NULL OR cestatusconssa='M' OR cestatusconssa='B')"; break; case "2": //Solicitudes sin asignar _Str_Cadena += " AND cusuarioconssa IS NULL"; break; case "3": //Solicitudes en pausa _Str_Cadena += " AND cestatusconssa='P'"; break; case "4": //Solicitudes en RMA _Str_Cadena += " AND crma='1'"; break; default: break; } //-------------------------------------- if (_Cmb_Arquitecto.SelectedIndex > 0) { _Str_Cadena += " AND carquitecto='" + Convert.ToString(_Cmb_Arquitecto.SelectedValue) + "'"; } //-------------------------------------- if (_Cmb_Estado.SelectedIndex > 0) { _Str_Cadena += " AND cestatusconssa='" + Convert.ToString(_Cmb_Estado.SelectedValue) + "'"; } //-------------------------------------- if (_Cmb_Prioridad.SelectedIndex > 0) { _Str_Cadena += " AND cprioridad='" + Convert.ToString(_Cmb_Prioridad.SelectedValue) + "'"; } //-------------------------------------- if (!_Chk_MostrarF.Checked) { _Str_Cadena += " AND CONVERT(DATETIME,CONVERT(VARCHAR,cfechahorareporte,103)) BETWEEN '" + _Cls_Formato._Mtd_fecha(_Dtp_Desde.Value) + "' AND '" + _Cls_Formato._Mtd_fecha(_Dtp_Hasta.Value) + "'"; } //-------------------------------------- if (_Txt_Ticket.Text.Trim().Length > 0) { _Str_Cadena += " AND cticket='" + _Txt_Ticket.Text.Trim() + "'"; } //-------------------------------------- _Str_Cadena += " ORDER BY cfechahorareporte DESC"; } Thread _Thr_Thread = new Thread(new ThreadStart(delegate { _Mtd_CargarGrid(_Str_Cadena, _Dg_Grid); })); _Thr_Thread.Start(); while (!_Thr_Thread.IsAlive) { ; } Frm_WaitForm _Frm_Form = new Frm_WaitForm(1000, _Thr_Thread, "Por favor espere..."); _Frm_Form.ShowDialog(this); _Frm_Form.Dispose(); }
private void _Bt_Exportar_Click(object sender, EventArgs e) { bool _Bol_ReporteCierreVal = false; if (_Rbt_ReporteCierre.Checked) { if (_Cb_MesAnoCierre.SelectedIndex > 0) { _Bol_ReporteCierreVal = true; } else { MessageBox.Show("Seleccione el mes y año contable para la consulta.", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { _Bol_ReporteCierreVal = true; } if (_Bol_ReporteCierreVal) { string _Str_Sql = ""; string _Str_Mes = ""; string _Str_Ano = ""; if (_Rb_Detalle.Checked) // detallado { if (_Rbt_ReporteActual.Checked) { if (!_Chk_Imp.Checked) // sin impuesto { _Str_Sql += "SELECT cproveedor as Proveedor, cproducto as Codigo, ccodcorrugado as Corrugado,cidproductod as [N° Lote],cprecioventamax as PMV, produc_descrip as Descripcion, produc_descrip_2 as Presentacion, TUNIMEDI.cname as 'Unidad de medida', cexisrealu1 as 'Caja Exist.', cexisrealu2 as 'Unid. exist', CONVERT(NUMERIC(18,2),ccostoneto_u1) as 'Costo neto Caj.', CONVERT(NUMERIC(18,2),ccostoneto_u2) as 'Costo Neto Uni.', CONVERT(NUMERIC(18,2),(ccostoneto_u1*cexisrealu1) + (costoneto_uni_new * cexisrealu2)) as Total "; _Str_Sql += "FROM VST_VALORIZADOINVENTARIO LEFT JOIN TUNIMEDI ON VST_VALORIZADOINVENTARIO.cunidadme = TUNIMEDI.cunidadmed WHERE VST_VALORIZADOINVENTARIO.CCOMPANYPROV='" + Frm_Padre._Str_Comp + "' "; } else // con impuesto { _Str_Sql += "SELECT cproveedor as Proveedor, cproducto as Codigo, ccodcorrugado as Corrugado,cidproductod as [N° Lote],cprecioventamax as PMV, produc_descrip as Descripcion, produc_descrip_2 as Presentacion, TUNIMEDI.cname as 'Unidad de medida', cexisrealu1 as 'Caja Exist.', cexisrealu2 as 'Unid. exist', CONVERT(NUMERIC(18,2),ccostoneto_u1) as 'Costo neto Caj.', CONVERT(NUMERIC(18,2),ccostoneto_u2) as 'Costo Neto Uni.', CONVERT(NUMERIC(18,2),((ccostoneto_u1+(ccostoneto_u1*cpercent/100))*cexisrealu1) + ((costoneto_uni_new+(costoneto_uni_new*cpercent/100))*cexisrealu2)) as Total "; _Str_Sql += "FROM VST_VALORIZADOINVENTARIO LEFT JOIN TUNIMEDI ON VST_VALORIZADOINVENTARIO.cunidadme = TUNIMEDI.cunidadmed WHERE VST_VALORIZADOINVENTARIO.CCOMPANYPROV='" + Frm_Padre._Str_Comp + "' "; } } else { string[] _Str_MesAno = _Cb_MesAnoCierre.SelectedValue.ToString().Split('-'); _Str_Mes = _Str_MesAno[1]; _Str_Ano = _Str_MesAno[0]; if (!_Chk_Imp.Checked) // sin impuesto { _Str_Sql += "SELECT cproveedor as Proveedor, cproducto as Codigo, ccodcorrugado as Corrugado,cidproductod as [N° Lote],cprecioventamax as PMV, produc_descrip as Descripcion, produc_descrip_2 as Presentacion,CNAMEMED as 'Unidad de medida', cexisrealu1 as 'Caja Exist.', cexisrealu2 as 'Unid. exist', CONVERT(NUMERIC(18,2),ccostoneto_u1) as 'Costo neto Caj.', CONVERT(NUMERIC(18,2),ccostoneto_u2) as 'Costo Neto Uni.', CONVERT(NUMERIC(18,2),(ccostoneto_u1*cexisrealu1) + (costoneto_uni_new * cexisrealu2)) as Total "; _Str_Sql += "FROM VST_PRODUCTOS_HIST_INVENT WHERE VST_PRODUCTOS_HIST_INVENT.CCOMPANYPROV='" + Frm_Padre._Str_Comp + "' "; } else // con impuesto { _Str_Sql += "SELECT cproveedor as Proveedor, cproducto as Codigo, ccodcorrugado as Corrugado,cidproductod as [N° Lote],cprecioventamax as PMV, produc_descrip as Descripcion, produc_descrip_2 as Presentacion,CNAMEMED as 'Unidad de medida', cexisrealu1 as 'Caja Exist.', cexisrealu2 as 'Unid. exist', CONVERT(NUMERIC(18,2),ccostoneto_u1) as 'Costo neto Caj.', CONVERT(NUMERIC(18,2),ccostoneto_u2) as 'Costo Neto Uni.', CONVERT(NUMERIC(18,2),((ccostoneto_u1+(ccostoneto_u1*cpercent/100))*cexisrealu1) + ((costoneto_uni_new+(costoneto_uni_new*cpercent/100))*cexisrealu2)) as Total "; _Str_Sql += "FROM VST_PRODUCTOS_HIST_INVENT WHERE VST_PRODUCTOS_HIST_INVENT.CCOMPANYPROV='" + Frm_Padre._Str_Comp + "' "; } } } _Str_Sql += "AND "; if (_Rbt_ReporteCierre.Checked) { _Str_Sql += " VST_PRODUCTOS_HIST_INVENT.CMESCONT='" + _Str_Mes + "' AND VST_PRODUCTOS_HIST_INVENT.CANOCONT='" + _Str_Ano + "' AND "; } if (_Chk_AllProductos.Checked) { _Str_Sql = _Str_Sql + " (cexisrealu1>-1 OR cexisrealu2>-1)"; } else { _Str_Sql = _Str_Sql + " (cexisrealu1>0 OR cexisrealu2>0)"; } if (_Cb_ProveedorFind.SelectedIndex > 0) { _Str_Sql = _Str_Sql + " AND cproveedor='" + _Cb_ProveedorFind.SelectedValue.ToString() + "'"; } if (_Cb_GrupoFind.SelectedIndex > 0) { _Str_Sql = _Str_Sql + " AND cgrupo='" + _Cb_GrupoFind.SelectedValue.ToString() + "'"; } if (_Cb_SubGrupoFind.SelectedIndex > 0) { _Str_Sql = _Str_Sql + " AND csubgrupo='" + _Cb_SubGrupoFind.SelectedValue.ToString() + "'"; } //if (_Cb_MarcaFind.SelectedIndex > 0) _Str_Sql = _Str_Sql + " AND cmarca='" + _Cb_MarcaFind.SelectedValue.ToString() + "'"; _Str_Sql += " ORDER BY cproveedor, cproducto "; Cursor = Cursors.WaitCursor; _Ds_Temp = Program._MyClsCnn._mtd_conexion._Mtd_RetornarDataset(_Str_Sql); Cursor = Cursors.Default; if (_Ds_Temp.Tables[0].Rows.Count > 0) { try { if (_Sfd_1.ShowDialog() == DialogResult.OK) { Thread _Thr_Thread = new Thread(new ThreadStart(_Mtd_Consultar)); _Thr_Thread.Start(); while (!_Thr_Thread.IsAlive) { ; } Frm_WaitForm _Frm_Form = new Frm_WaitForm(1000, _Thr_Thread, "Espere por favor..."); _Frm_Form.ShowDialog(this); _Frm_Form.Dispose(); } } catch { Cursor = Cursors.Default; MessageBox.Show("Error al intentar exportar", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } }