Ejemplo n.º 1
0
        private void btnRegistrar_Click(object sender, EventArgs e)
        {
            if (txtMail.Text.Trim() == "")
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Favor ingrese el correo electrónico.";
                ok.ShowDialog();
                txtMail.ReadOnly = false;
                txtMail.Focus();
                return;
            }

            if (sCodigoOrigenOrden == "04")
            {
                if (txtMotivo.Text.Trim() == "")
                {
                    ok = new VentanasMensajes.frmMensajeOK();
                    ok.LblMensaje.Text = "Debe ingresar un motivo por la Cortesía.";
                    ok.ShowDialog();
                    txtMotivo.Focus();
                    return;
                }
            }

            if (obtenerDatosFormaPagoRealizada(iIdTipoFormaCobro) == false)
            {
                return;
            }

            cobrarComanda_V2();
        }
Ejemplo n.º 2
0
        private void frmComandasCombinar_Load(object sender, EventArgs e)
        {
            int iCuenta = consultarPedidosVigentes();

            crearDataTable();

            if (iCuenta == -1)
            {
                this.Close();
                return;
            }

            if (iCuenta == 0)
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "No existen comandas de mesa activas.";
                ok.ShowDialog();
                this.Close();
                return;
            }

            iCuentaComandas = 0;
            crearControles();

            this.ActiveControl = label2;
        }
Ejemplo n.º 3
0
        private void btnConsumirTarjetaAlmuerzo_Click(object sender, EventArgs e)
        {
            ingresaBoton(btnConsumirTarjetaAlmuerzo);
            llenarArregloMaximo();

            if (Program.iPuedeCobrar == 1)
            {
                Claves_Administrar.frmClaveAccesoFormas clave = new Claves_Administrar.frmClaveAccesoFormas("01");
                clave.ShowDialog();

                if (clave.DialogResult == DialogResult.OK)
                {
                    clave.Close();

                    consultarDatos("13", "");
                    Tarjeta_Almuerzo.frmComandaTarjetaAlmuerzo comanda = new Tarjeta_Almuerzo.frmComandaTarjetaAlmuerzo(Program.iIdOrigenOrden);
                    comanda.ShowDialog();
                }
            }

            else
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "No tiene permisos para ingresar en esta opción.";
                ok.ShowDialog();
            }
        }
Ejemplo n.º 4
0
        private void txtMesa_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (Char.IsDigit(e.KeyChar))
            {
                e.Handled = false;
            }
            else if (Char.IsControl(e.KeyChar))
            {
                e.Handled = false;
            }
            else if (Char.IsSeparator(e.KeyChar))
            {
                e.Handled = false;
            }
            else
            {
                e.Handled = true;
            }

            if (e.KeyChar == (char)Keys.Enter)
            {
                if (txtMesa.Text.Trim() == "")
                {
                    ok = new VentanasMensajes.frmMensajeOK();
                    ok.LblMensaje.Text = "Favor ingrese el número de mesa.";
                    ok.ShowDialog();
                    txtMesa.Focus();
                }

                else
                {
                    //verMesaTextBox();
                }
            }
        }
Ejemplo n.º 5
0
        //Función para ver si la mesa está usada
        private void comprobarMesa(Button botonSeleccionado)
        {
            if (botonSeleccionado.BackColor == Color.Red || botonSeleccionado.BackColor == Color.Cyan)
            {
                usada = true;
            }

            else
            {
                usada = false;
            }


            if (usada == true)
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "La mesa se encuentra ocupada";
                ok.ShowDialog();
            }

            else
            {
                this.DialogResult = DialogResult.OK;
            }
        }
Ejemplo n.º 6
0
        private void btnCombinar_Click(object sender, EventArgs e)
        {
            Areas.frmMensajeCombinar mensaje = new frmMensajeCombinar(dtComandasSeleccionadas);
            mensaje.ShowDialog();

            if (mensaje.DialogResult == DialogResult.OK)
            {
                this.Cursor = Cursors.WaitCursor;

                string sNumeroPedido_Combinar = mensaje.sNumeroPedido;
                int    iIdPedido_Combinar     = mensaje.iIdPedido;
                mensaje.Close();

                Areas.ClaseCombinarComandas_V2 combinar = new ClaseCombinarComandas_V2();

                if (combinar.recibirInformacion(dtComandasSeleccionadas, iIdPedido_Combinar, sNumeroPedido_Combinar) == false)
                {
                    ok = new VentanasMensajes.frmMensajeOK();
                    ok.LblMensaje.Text           = combinar.sRespuesta;
                    ok.ShowDialog(); this.Cursor = Cursors.Default;
                    return;
                }

                else
                {
                    ok = new VentanasMensajes.frmMensajeOK();
                    ok.LblMensaje.Text = "Combinación de comandas se realizó éxitosamente.";
                    ok.ShowDialog();
                    this.Cursor       = Cursors.Default;
                    this.DialogResult = DialogResult.OK;
                }
            }
        }
Ejemplo n.º 7
0
        private void txtFiltrarEmpleados_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)Keys.Enter)
            {
                if (iIdEmpresa == 0)
                {
                    ok = new VentanasMensajes.frmMensajeOK();
                    ok.LblMensaje.Text = "No ha seleccionado ninguna empresa.";
                    ok.ShowDialog();
                }

                else
                {
                    //pnlEmpleados.Controls.Clear();

                    if (txtFiltrarEmpleados.Text.Trim() == "")
                    {
                        cargarEmpleados(iIdClienteEmpresarial, 0);
                    }

                    else
                    {
                        cargarEmpleados(iIdClienteEmpresarial, 1);
                    }
                }
            }
        }
Ejemplo n.º 8
0
        //CREAR RIDE
        private void crearRide(long iIdFactura_P, string sNumeroDocumento)
        {
            try
            {
                dtConsulta = new DataTable();
                dtConsulta.Clear();

                bRespuesta = conexion.GFun_Lo_Genera_Ride(dtConsulta, iIdFactura_P);

                if (bRespuesta == true)
                {
                    //AQUI INSTRUCCION DE SINCRONIZACION CON LOGO
                    //----------------------------------------------------------------------------------------------------


                    //----------------------------------------------------------------------------------------------------

                    bRespuesta = ride_2.generarRide(dtConsulta, filenameRide, iIdFactura_P, Logo_Factura);

                    if (bRespuesta == false)
                    {
                        ok = new VentanasMensajes.frmMensajeOK();
                        ok.LblMensaje.Text = "Error al crear el reporte RIDE de la factura " + sNumeroDocumento;
                        ok.ShowDialog();
                    }
                }
            }

            catch (Exception ex)
            {
                catchMensaje = new VentanasMensajes.frmMensajeCatch();
                catchMensaje.LblMensaje.Text = ex.Message;
                catchMensaje.ShowDialog();
            }
        }
Ejemplo n.º 9
0
        //FUNCION PARA CARGAR LOS PARAMETROS PARA EL FIRMADO DE LOS XML
        private int datosCertificado()
        {
            try
            {
                firmar.Gsub_trae_parametros_certificado(sCertificado_digital);
                sCertificado     = sCertificado_digital[0];
                sPassCertificado = sCertificado_digital[1];

                if (!File.Exists(sCertificado))
                {
                    iBanderPermitirFirmaElectronica = 0;
                    ok = new VentanasMensajes.frmMensajeOK();
                    ok.LblMensaje.Text = "No se encuentra el archivo de la firma electrónica." + Environment.NewLine + "RUTA: " + sCertificado;
                    ok.ShowDialog();
                    return(0);
                }

                iBanderPermitirFirmaElectronica = 1;
                return(1);
            }

            catch (Exception ex)
            {
                //catchMensaje = new VentanasMensajes.frmMensajeCatch();
                //catchMensaje.LblMensaje.Text = ex.Message;
                //catchMensaje.ShowDialog();
                iBanderPermitirFirmaElectronica = 0;
                return(-1);
            }
        }
Ejemplo n.º 10
0
        ///FUNCION PARA LIMPIAR
        private void limpiar()
        {
            LLenarComboEmpresa();
            LLenarComboLocalidad();

            btnReenviar.Visible = false;
            int iVer = datosCertificado();

            if ((iVer == -1) && (iBanderPermitirFirmaElectronica == 0))
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Error al consultar los parámetros de la firma electrónica.";
                ok.ShowDialog();
            }

            else if (iVer == 1)
            {
                btnReenviar.Visible = true;
            }

            chkSeleccionar.Checked = false;
            chkSeleccionar.Text    = "Seleccionar todos los registros";

            txtFechaInicial.Text = DateTime.Now.ToString("dd/MM/yyyy");
            txtFechaFinal.Text   = DateTime.Now.ToString("dd/MM/yyyy");
        }
Ejemplo n.º 11
0
        private void botonEditar_Click(object sender, EventArgs e)
        {
            //PARA ABRIR EL FORMULARIO ORIGINAL
            Button btnEditarComanda = sender as Button;

            if (Convert.ToInt32(btnEditarComanda.Tag) == 1)
            {
                if (Program.iPuedeCobrar == 1)
                {
                    reabrirComanda(Convert.ToInt32(btnEditarComanda.Name));
                }

                else
                {
                    ok = new VentanasMensajes.frmMensajeOK();
                    ok.LblMensaje.Text = "Su usuario no le permite reabrir la cuenta.";
                    ok.ShowDialog();
                }
            }

            else if (Convert.ToInt32(btnEditarComanda.Tag) == 3)
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "No se puede reabrir una comanda que ha sido cancelada o eliminada.";
                ok.ShowDialog();
            }

            else if (Convert.ToInt32(btnEditarComanda.Tag) == 2)
            {
                recuperarComanda(Convert.ToInt32(btnEditarComanda.Name));
            }
        }
Ejemplo n.º 12
0
        private void btnListarVentas_Click(object sender, EventArgs e)
        {
            ingresaBoton(btnListarVentas);
            llenarArregloMaximo();

            if (Program.iPuedeCobrar == 1)
            {
                Claves_Administrar.frmClaveAccesoFormas clave = new Claves_Administrar.frmClaveAccesoFormas("01");
                clave.ShowDialog();

                if (clave.DialogResult == DialogResult.OK)
                {
                    clave.Close();

                    Utilitarios.frmListarCajasVentas listar = new Utilitarios.frmListarCajasVentas();
                    listar.ShowDialog();
                }
            }

            else
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "No tiene permisos para ingresar en esta opción.";
                ok.ShowDialog();
            }
        }
Ejemplo n.º 13
0
        private void botonImprimir_clic(object sender, EventArgs e)
        {
            //PARA ABRIR EL FORMULARIO ORIGINAL
            Button botonsel = sender as Button;

            sSql  = "";
            sSql += "select estado_orden" + Environment.NewLine;
            sSql += "from cv403_cab_pedidos" + Environment.NewLine;
            sSql += "where id_pedido = " + Convert.ToInt32(botonsel.Name);

            dtConsulta = new DataTable();
            dtConsulta.Clear();

            bRespuesta = conexion.GFun_Lo_Busca_Registro(dtConsulta, sSql);

            if (bRespuesta == true)
            {
                if (dtConsulta.Rows.Count > 0)
                {
                    Pedidos.frmVerPrecuentaTextBox precuenta = new Pedidos.frmVerPrecuentaTextBox(botonsel.Name, 1, dtConsulta.Rows[0][0].ToString());
                    precuenta.ShowDialog();
                }
            }

            else
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Ocurrió un problema al imprimir la precuenta.";
                ok.ShowDialog();
            }
        }
Ejemplo n.º 14
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if ((txtValor.Text == "") || (Convert.ToDouble(txtValor.Text) == 0))
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Favor ingrese el monto a retirar o ingresar.";
                ok.ShowDialog();
            }

            else if (txtConcepto.Text == "")
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Favor ingrese el concepto del retiro o ingreso.";
                ok.ShowDialog();
            }

            else if (cmbEmpleados.SelectedValue.ToString() == "0")
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Favor seleccione el empleado que hace uso del ingreso o egreso.";
                ok.ShowDialog();
            }

            else if (cmbCaja.SelectedValue.ToString() == "0")
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Favor seleccione el tipo de caja a descontar.";
                ok.ShowDialog();
            }

            else if (cmbCargo.SelectedValue.ToString() == "0")
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Favor seleccione el tipo de cargo.";
                ok.ShowDialog();
            }

            else
            {
                if (rdbIngresos.Checked == true)
                {
                    iTipoMovimiento = 1;
                }

                else if (rdbEgresos.Checked == true)
                {
                    iTipoMovimiento = 0;
                }

                if (iIdPosMovimientoCaja == 0)
                {
                    insertarRegistro();
                }

                else
                {
                    actualizarRegistro();
                }
            }
        }
Ejemplo n.º 15
0
        private void btnCambioCajero_Click(object sender, EventArgs e)
        {
            llenarArregloMaximo();
            ingresaBoton(btnCambioCajero);

            if (Program.iPuedeCobrar == 1)
            {
                Cajero.frmCambiarCajero cambiar = new Cajero.frmCambiarCajero();
                cambiar.ShowDialog();

                if (cambiar.DialogResult == DialogResult.OK)
                {
                    //etiqueta.crearEtiquetaUsuario();
                    frmVerMenu principal = (frmVerMenu)this.MdiParent;
                    principal.Text = Program.sEtiqueta;

                    cambiar.Close();
                }
            }

            else
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "No tiene permisos para ingresar en esta opción.";
                ok.ShowDialog();
            }
        }
Ejemplo n.º 16
0
        private void btnValorSugerido_Click(object sender, EventArgs e)
        {
            txt_valor.Text = string.Format("{0:0.00}", btnValorSugerido.Text);

            iCgBanco = Convert.ToInt32(cmbBanco.SelectedValue);

            if (iCgBanco == 0)
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Favor seleccione el banco perteneciente al cheque.";
                ok.ShowDialog();
                cmbBanco.Focus();
                return;
            }

            if (txtNumeroCheque.Text.Trim() == "")
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Favor ingrese el número del cheque.";
                ok.ShowDialog();
                txtNumeroCheque.Focus();
                return;
            }

            if (txtNumeroCuenta.Text.Trim() == "")
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Favor ingrese el número de cuenta del cheque.";
                ok.ShowDialog();
                txtNumeroCuenta.Focus();
                return;
            }

            if (txtTitular.Text.Trim() == "")
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Favor ingrese el nombre del titular del cheque.";
                ok.ShowDialog();
                txtTitular.Focus();
                return;
            }

            if (Convert.ToDouble(txt_valor.Text) <= Convert.ToDouble(btnValorSugerido.Text))
            {
                dbValorGrid = Convert.ToDecimal(txt_valor.Text);
            }
            else
            {
                dbValorGrid = Convert.ToDecimal(btnValorSugerido.Text);
            }

            dbValorIngresado = Convert.ToDecimal(txt_valor.Text);

            sNumeroCheque = txtNumeroCheque.Text.Trim();
            sNumeroCuenta = txtNumeroCuenta.Text.Trim();
            sFechaVcto    = Convert.ToDateTime(dtFecha.Text).ToString("yyyy/MM/dd");
            sTitular      = txtTitular.Text.Trim();

            this.DialogResult = DialogResult.OK;
        }
Ejemplo n.º 17
0
        //Función para dar clic en alguna mesa
        private void boton_clic_Mesa(Object sender, EventArgs e)
        {
            try
            {
                botonSeleccionado = sender as Button;

                if ((botonSeleccionado.BackColor == Color.Red) || (botonSeleccionado.BackColor == Color.Cyan))
                {
                    ok = new VentanasMensajes.frmMensajeOK();
                    ok.LblMensaje.Text = "La mesa se encuentra ocupada";
                    ok.ShowDialog();
                    return;
                }

                Program.iIDMESA = Convert.ToInt32(botonSeleccionado.Name);
                sNombreMesa     = botonSeleccionado.Text;

                iIdMesa          = Convert.ToInt32(botonSeleccionado.Name);
                sDescripcionMesa = botonSeleccionado.AccessibleName;

                this.DialogResult = DialogResult.OK;
            }

            catch (Exception ex)
            {
                catchMensaje = new VentanasMensajes.frmMensajeCatch();
                catchMensaje.LblMensaje.Text = ex.Message;
                catchMensaje.ShowDialog();
            }
        }
Ejemplo n.º 18
0
        //FUNCION PARA CARGAR LAS SECCIONES
        private void cargarAreas()
        {
            try
            {
                sSql  = "";
                sSql += "select id_pos_seccion_mesa, codigo, descripcion, color, fondo_pantalla" + Environment.NewLine;
                sSql += "from pos_seccion_mesa" + Environment.NewLine;
                sSql += "where estado = 'A'" + Environment.NewLine;
                sSql += "order by id_pos_seccion_mesa asc";

                dtSecciones = new DataTable();
                dtSecciones.Clear();

                bRespuesta = conexion.GFun_Lo_Busca_Registro(dtSecciones, sSql);

                if (bRespuesta == false)
                {
                    catchMensaje = new VentanasMensajes.frmMensajeCatch();
                    catchMensaje.LblMensaje.Text = "ERROR EN LA INSTRUCCIÓN SQL:" + Environment.NewLine + sSql;
                    catchMensaje.ShowDialog();
                    return;
                }

                iCuentaSecciones = 0;

                if (dtSecciones.Rows.Count > 0)
                {
                    if (dtSecciones.Rows.Count > 8)
                    {
                        btnSiguiente.Enabled = true;
                    }

                    else
                    {
                        btnSiguiente.Enabled = false;
                    }

                    if (mostrarBotonesSecciones() == false)
                    {
                    }
                }

                else
                {
                    ok = new VentanasMensajes.frmMensajeOK();
                    ok.LblMensaje.Text = "No se encuentras secciones configuradas en el sistema.";
                    ok.ShowDialog();
                    return;
                }
            }

            catch (Exception ex)
            {
                catchMensaje = new VentanasMensajes.frmMensajeCatch();
                catchMensaje.LblMensaje.Text = ex.Message;
                catchMensaje.ShowDialog();
            }
        }
Ejemplo n.º 19
0
        //FUNCION PARA OBTENER LOS VALORES PARA INSERTAR EN LA SECCION DE PAGOS
        private bool obtenerDatosFormaPagoRealizada(string sCodigoFormaPago_P)
        {
            try
            {
                sSql  = "";
                sSql += "select * from pos_vw_obtener_datos_formas_pagos" + Environment.NewLine;
                sSql += "where id_localidad = @id_localidad" + Environment.NewLine;
                sSql += "and codigo = @codigo";

                parametro    = new SqlParameter[2];
                parametro[0] = new SqlParameter();
                parametro[0].ParameterName = "@id_localidad";
                parametro[0].SqlDbType     = SqlDbType.Int;
                parametro[0].Value         = Program.iIdLocalidad;

                parametro[1] = new SqlParameter();
                parametro[1].ParameterName = "@codigo";
                parametro[1].SqlDbType     = SqlDbType.VarChar;
                parametro[1].Value         = sCodigoFormaPago_P;

                dtConsulta = new DataTable();
                dtConsulta.Clear();

                bRespuesta = conexion.GFun_Lo_Busca_Registro_Parametros(dtConsulta, sSql, parametro);

                if (bRespuesta == false)
                {
                    catchMensaje = new VentanasMensajes.frmMensajeCatch();
                    catchMensaje.LblMensaje.Text = conexion.sMensajeError;
                    catchMensaje.ShowDialog();
                    return(false);
                }

                if (dtConsulta.Rows.Count == 0)
                {
                    ok = new VentanasMensajes.frmMensajeOK();
                    ok.LblMensaje.Text = "No se encuentran configurados los registros de cobros. Favor comuníquese con el administrador.";
                    ok.ShowDialog();
                    return(false);
                }

                iIdTipoFormaCobro     = Convert.ToInt32(dtConsulta.Rows[0]["id_pos_tipo_forma_cobro"].ToString());
                sDescripcionFormaPago = dtConsulta.Rows[0]["descripcion"].ToString().Trim().ToUpper();
                iIdSriFormaPago_P     = Convert.ToInt32(dtConsulta.Rows[0]["id_sri_forma_pago"].ToString());
                sCodigoMetodoPago     = dtConsulta.Rows[0]["codigo"].ToString().Trim().ToUpper();

                return(true);
            }

            catch (Exception ex)
            {
                catchMensaje = new VentanasMensajes.frmMensajeCatch();
                catchMensaje.LblMensaje.Text = ex.Message;
                catchMensaje.ShowDialog();
                return(false);
            }
        }
Ejemplo n.º 20
0
        //FUNCION PARA CARGAR LA PRECUENTA EN UN TEXTBOX
        private void verPrecuentaTextBox()
        {
            try
            {
                if (consultarDatosEmpresa() == true)
                {
                    if (llenarDataTable() == true)
                    {
                        if (Program.iFormatoPrecuenta == 1)
                        {
                            sRetorno = precuenta.llenarPrecuenta(dtConsulta, sIdOrden, sEstado, dtPago);
                        }

                        else if (Program.iFormatoPrecuenta == 2)
                        {
                            sRetorno = precuenta2.llenarPrecuenta(dtConsulta, sIdOrden, sEstado, dtPago);
                        }

                        if (sRetorno == "")
                        {
                            goto reversa;
                        }
                        else
                        {
                            sTexto = sTexto + sRetorno;
                        }

                        txtReporte.Text = sTexto;
                        sTexto          = "";
                        return;
                    }

                    else
                    {
                        goto reversa;
                    }
                }

                else
                {
                    goto reversa;
                }
            }

            catch (Exception)
            {
                goto reversa;
            }

reversa:
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Ocurrió un problema al realizar la consulta.";
                ok.ShowDialog();
            }
        }
Ejemplo n.º 21
0
        //FUNCION PARA ELIMINAR EN LA BASE DE DATOS
        private void eliminarRegistro()
        {
            try
            {
                //SE INICIA UNA TRANSACCION
                if (!conexion.GFun_Lo_Maneja_Transaccion(Program.G_INICIA_TRANSACCION))
                {
                    ok = new VentanasMensajes.frmMensajeOK();
                    ok.LblMensaje.Text = "Error al abrir transacción.";
                    ok.ShowDialog();
                    limpiar();
                    return;
                }

                sSql = "";
                sSql = sSql + "update pos_porcentaje_propina set" + Environment.NewLine;
                sSql = sSql + "estado = 'E'," + Environment.NewLine;
                sSql = sSql + "fecha_anula = GETDATE()," + Environment.NewLine;
                sSql = sSql + "usuario_anula = '" + Program.sDatosMaximo[0] + "'," + Environment.NewLine;
                sSql = sSql + "terminal_anula = '" + Program.sDatosMaximo[1] + "'" + Environment.NewLine;
                sSql = sSql + "where id_pos_porcentaje_propina = " + iIdRegistro;


                //EJECUTAR LA INSTRUCCIÓN SQL
                if (!conexion.GFun_Lo_Ejecuta_SQL(sSql))
                {
                    catchMensaje = new VentanasMensajes.frmMensajeCatch();
                    catchMensaje.LblMensaje.Text = "ERROR EN LA SIGUIENTE INSTRUCCIÓN:" + Environment.NewLine + sSql;
                    catchMensaje.ShowDialog();
                    goto reversa;
                }

                //SI SE EJECUTA TODO REALIZA EL COMMIT
                conexion.GFun_Lo_Maneja_Transaccion(Program.G_TERMINA_TRANSACCION);
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Registro eliminado éxitosamente.";
                ok.ShowDialog();
                limpiar();
                return;
            }

            catch (Exception ex)
            {
                catchMensaje = new VentanasMensajes.frmMensajeCatch();
                catchMensaje.LblMensaje.Text = ex.Message;
                catchMensaje.ShowDialog();
                goto reversa;
            }

reversa:
            {
                conexion.GFun_Lo_Maneja_Transaccion(Program.G_REVERSA_TRANSACCION);
            }
        }
Ejemplo n.º 22
0
        //FUNCION PARA INSERTAR EN LA BASE DE DATOS
        private void insertarRegistro()
        {
            try
            {
                //SE INICIA UNA TRANSACCION
                if (!conexion.GFun_Lo_Maneja_Transaccion(Program.G_INICIA_TRANSACCION))
                {
                    ok = new VentanasMensajes.frmMensajeOK();
                    ok.LblMensaje.Text = "Error al abrir transacción.";
                    ok.ShowDialog();
                    limpiar();
                    return;
                }

                sSql = "";
                sSql = sSql + "insert into pos_porcentaje_propina (" + Environment.NewLine;
                sSql = sSql + "codigo, valor, estado, fecha_ingreso," + Environment.NewLine;
                sSql = sSql + "usuario_ingreso, terminal_ingreso)" + Environment.NewLine;
                sSql = sSql + "values(" + Environment.NewLine;
                sSql = sSql + "'" + txtCodigo.Text.Trim() + "', " + txtDescripcion.Text.Trim() + "," + Environment.NewLine;
                sSql = sSql + "'A', GETDATE(), '" + Program.sDatosMaximo[0] + "'," + Environment.NewLine;
                sSql = sSql + "'" + Program.sDatosMaximo[1] + "')";

                //EJECUTAR LA INSTRUCCIÓN SQL
                if (!conexion.GFun_Lo_Ejecuta_SQL(sSql))
                {
                    catchMensaje = new VentanasMensajes.frmMensajeCatch();
                    catchMensaje.LblMensaje.Text = "ERROR EN LA SIGUIENTE INSTRUCCIÓN:" + Environment.NewLine + sSql;
                    catchMensaje.ShowDialog();
                    goto reversa;
                }

                //SI SE EJECUTA TODO REALIZA EL COMMIT
                conexion.GFun_Lo_Maneja_Transaccion(Program.G_TERMINA_TRANSACCION);
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Registro ingresado éxitosamente.";
                ok.ShowDialog();
                limpiar();
                return;
            }

            catch (Exception ex)
            {
                catchMensaje = new VentanasMensajes.frmMensajeCatch();
                catchMensaje.LblMensaje.Text = ex.Message;
                catchMensaje.ShowDialog();
                goto reversa;
            }

reversa:
            {
                conexion.GFun_Lo_Maneja_Transaccion(Program.G_REVERSA_TRANSACCION);
            }
        }
Ejemplo n.º 23
0
        //FUNCION PARA CONSULTAR LAS IMPRESORAS
        private void consultarImpresora()
        {
            try
            {
                sSql = "";
                sSql = sSql + "select I.path_url, I.numero_impresion, I.puerto_impresora," + Environment.NewLine;
                sSql = sSql + "I.ip_impresora, I.descripcion, I.cortar_papel, I.abrir_cajon" + Environment.NewLine;
                sSql = sSql + "from pos_impresora I, pos_formato_precuenta FP" + Environment.NewLine;
                sSql = sSql + "where FP.id_pos_impresora = I.id_pos_impresora" + Environment.NewLine;
                sSql = sSql + "and FP.estado = 'A'" + Environment.NewLine;
                sSql = sSql + "and I.estado = 'A'" + Environment.NewLine;
                sSql = sSql + "and FP.id_pos_formato_precuenta = " + Program.iFormatoPrecuenta;

                dtImprimir = new DataTable();
                dtImprimir.Clear();

                bRespuesta = conexion.GFun_Lo_Busca_Registro(dtImprimir, sSql);

                if (bRespuesta == true)
                {
                    if (dtImprimir.Rows.Count > 0)
                    {
                        sNombreImpresora      = dtImprimir.Rows[0][0].ToString();
                        iCantidadImpresiones  = Convert.ToInt16(dtImprimir.Rows[0][1].ToString());
                        sPuertoImpresora      = dtImprimir.Rows[0][2].ToString();
                        sIpImpresora          = dtImprimir.Rows[0][3].ToString();
                        sDescripcionImpresora = dtImprimir.Rows[0][4].ToString();
                        iCortarPapel          = Convert.ToInt16(dtImprimir.Rows[0][5].ToString());
                        iAbrirCajon           = Convert.ToInt16(dtImprimir.Rows[0][6].ToString());
                    }

                    else
                    {
                        ok = new VentanasMensajes.frmMensajeOK();
                        ok.LblMensaje.Text = "No existe el registro de configuración de impresora. Comuníquese con el administrador.";
                        ok.ShowDialog();
                    }
                }

                else
                {
                    ok = new VentanasMensajes.frmMensajeOK();
                    ok.LblMensaje.Text = "Ocurrió un problema al realizar la consulta.";
                    ok.ShowDialog();
                }
            }

            catch (Exception ex)
            {
                catchMensaje = new VentanasMensajes.frmMensajeCatch();
                catchMensaje.LblMensaje.Text = ex.Message;
                catchMensaje.ShowDialog();
            }
        }
Ejemplo n.º 24
0
 //FUNCION MENSAJE DE VALIDACION DE CEDULA
 private void mensajeValidarCedula()
 {
     ok = new VentanasMensajes.frmMensajeOK();
     ok.LblMensaje.Text = "El número de identificación ingresado es incorrecto.";
     ok.ShowDialog();
     txtIdentificacion.Clear();
     txtApellidos.Clear();
     txtDireccion.Clear();
     txtTelefono.Clear();
     txtMail.Clear();
     txtIdentificacion.Focus();
 }
Ejemplo n.º 25
0
        //FUNCION PARA ACTUALIZAR EL REGISTRO
        private void actualizarRegistro()
        {
            try
            {
                //AQUI INICIA PROCESO DE ACTUALIZACION
                if (!conexion.GFun_Lo_Maneja_Transaccion(Program.G_INICIA_TRANSACCION))
                {
                    ok = new VentanasMensajes.frmMensajeOK();
                    ok.LblMensaje.Text = "Error al abrir transacción.";
                    ok.ShowDialog();
                    limpiar();
                    return;
                }

                sSql  = "";
                sSql += "update pos_movimiento_caja set " + Environment.NewLine;
                sSql += "tipo_movimiento = " + iTipoMovimiento + "," + Environment.NewLine;
                sSql += "id_persona = " + Convert.ToInt32(cmbEmpleados.SelectedValue) + "," + Environment.NewLine;
                sSql += "id_caja = " + Convert.ToInt32(cmbCaja.SelectedValue) + "," + Environment.NewLine;
                sSql += "id_pos_cargo = " + Convert.ToInt32(cmbCargo.SelectedValue) + "," + Environment.NewLine;
                sSql += "valor = " + Convert.ToDouble(txtValor.Text) + "," + Environment.NewLine;
                sSql += "concepto = '" + txtConcepto.Text + "'" + Environment.NewLine;
                sSql += "where id_pos_movimiento_caja = " + iIdPosMovimientoCaja + Environment.NewLine;
                sSql += "and estado = 'A'";

                if (!conexion.GFun_Lo_Ejecuta_SQL(sSql))
                {
                    catchMensaje = new VentanasMensajes.frmMensajeCatch();
                    catchMensaje.LblMensaje.Text = "ERROR EN LA SIGUIENTE INSTRUCCIÓN:" + Environment.NewLine + sSql;
                    catchMensaje.ShowDialog();
                    goto reversa;
                }

                conexion.GFun_Lo_Maneja_Transaccion(Program.G_TERMINA_TRANSACCION);
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Movimiento actualizado éxitosamente.";
                ok.ShowDialog();
                llenarGrid(1);
                limpiar();
                return;
            }

            catch (Exception ex)
            {
                catchMensaje = new VentanasMensajes.frmMensajeCatch();
                catchMensaje.LblMensaje.Text = ex.Message;
                catchMensaje.ShowDialog();
                goto reversa;
            }

            reversa : { conexion.GFun_Lo_Maneja_Transaccion(Program.G_REVERSA_TRANSACCION); }
        }
Ejemplo n.º 26
0
        private void btnIngresar_Click(object sender, EventArgs e)
        {
            if (txt_valor.Text == "")
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Ingrese valor.";
                ok.ShowDialog();
            }

            else if (Convert.ToDouble(txt_valor.Text.Trim()) < dbTotal)
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "El pago ingresado es inferior al valor a pagar. Favor corregir.";
                ok.ShowDialog();
            }

            else
            {
                dbRecibido = Convert.ToDouble(txt_valor.Text.Trim());
                dbCambio   = dbRecibido - dbTotal;

                if (pagoCompleto.insertarPagoCompleto(iIdOrden, dbTotal, dbRecibido, dbCambio, iBanderaComandaPendiente, iIdPersona, iNumeroPedidoOrden) == true)
                {
                    if (Program.iEjecutarImpresion == 1)
                    {
                        iIdFacturaGenerada_P = pagoCompleto.iIdFactura;
                        ReportesTextBox.frmVerNotaVenta notaVenta = new ReportesTextBox.frmVerNotaVenta(iIdFacturaGenerada_P, 1);
                        notaVenta.ShowDialog();

                        if (notaVenta.DialogResult == DialogResult.OK)
                        {
                            Cambiocs ok = new Cambiocs("$ " + dbCambio.ToString("N2"));
                            ok.lblVerMensaje.Text = "NOTA DE ENTREGA GENERADA";
                            ok.ShowDialog();
                            Program.dbValorPorcentaje = 0;
                            Program.dbDescuento       = 0;
                            this.DialogResult         = DialogResult.OK;
                        }
                    }

                    else
                    {
                        Cambiocs ok = new Cambiocs("$ " + dbCambio.ToString("N2"));
                        ok.lblVerMensaje.Text = "NOTA DE ENTREGA GENERADA";
                        ok.ShowDialog();
                        Program.dbValorPorcentaje = 0;
                        Program.dbDescuento       = 0;
                        this.DialogResult         = DialogResult.OK;
                    }
                }
            }
        }
Ejemplo n.º 27
0
        //FUNCION PARA ACTUALIZAR EN LA BASE DE DATOS
        private void actualizarRegistro()
        {
            try
            {
                //SE INICIA UNA TRANSACCION
                if (!conexion.GFun_Lo_Maneja_Transaccion(Program.G_INICIA_TRANSACCION))
                {
                    ok = new VentanasMensajes.frmMensajeOK();
                    ok.LblMensaje.Text = "Error al abrir transacción.";
                    ok.ShowDialog();
                    limpiar();
                    return;
                }

                sSql = "";
                sSql = sSql + "update pos_porcentaje_propina set" + Environment.NewLine;
                sSql = sSql + "valor = " + txtDescripcion.Text.Trim() + Environment.NewLine;
                sSql = sSql + "where id_pos_porcentaje_propina = " + iIdRegistro + Environment.NewLine;
                sSql = sSql + "and estado = 'A'";


                //EJECUTAR LA INSTRUCCIÓN SQL
                if (!conexion.GFun_Lo_Ejecuta_SQL(sSql))
                {
                    catchMensaje = new VentanasMensajes.frmMensajeCatch();
                    catchMensaje.LblMensaje.Text = "ERROR EN LA SIGUIENTE INSTRUCCIÓN:" + Environment.NewLine + sSql;
                    catchMensaje.ShowDialog();
                    goto reversa;
                }

                //SI SE EJECUTA TODO REALIZA EL COMMIT
                conexion.GFun_Lo_Maneja_Transaccion(Program.G_TERMINA_TRANSACCION);
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Registro actualizado éxitosamente.";
                ok.ShowDialog();
                limpiar();
                return;
            }

            catch (Exception ex)
            {
                catchMensaje = new VentanasMensajes.frmMensajeCatch();
                catchMensaje.LblMensaje.Text = ex.Message;
                catchMensaje.ShowDialog();
                goto reversa;
            }

reversa:
            {
                conexion.GFun_Lo_Maneja_Transaccion(Program.G_REVERSA_TRANSACCION);
            }
        }
Ejemplo n.º 28
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (txtIdentificacion.Text.Trim() == "")
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "Favor ingrese el número identificación.";
                ok.ShowDialog();
                txtIdentificacion.Focus();
                return;
            }

            consultarEmpleadoIdentificacion();
        }
Ejemplo n.º 29
0
        private void btnRemoverPago_Click(object sender, EventArgs e)
        {
            if (dgvPagos.Rows.Count == 0)
            {
                ok = new VentanasMensajes.frmMensajeOK();
                ok.LblMensaje.Text = "No hay formas de pago ingresados para remover del registro";
                ok.ShowDialog();
            }

            else
            {
                dgvPagos.Rows.Clear();
            }
        }
Ejemplo n.º 30
0
 private void btnIngresar_Click(object sender, EventArgs e)
 {
     if (txtValor.Text == "")
     {
         ok = new VentanasMensajes.frmMensajeOK();
         ok.LblMensaje.Text = "Ingrese un valor.";
         ok.ShowDialog();
     }
     else
     {
         dbPropina         = Convert.ToDecimal(txtValor.Text.Trim());
         this.DialogResult = DialogResult.OK;
     }
 }