Пример #1
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            DialogResult respuesta;
            double       total = 0;
            Button       btn   = null;

            LOK = false;
            try
            {
                if (Calcular())
                {
                    //VALIDAMOS CONDICION A CREDITO
                    if ((montoDeduda > 0) && (!PermiteCredito))
                    {
                        objUtil.MostrarMensajeAdvertencia("El Credito No esta Permitido");
                    }
                    else if ((montoDeduda > 0) && (PermiteCredito))
                    {
                        respuesta = objUtil.MostrarMensajePregunta("SE REGISTRARA UNA CUENTA POR COBRAR DE: " + montoDeduda.ToString("N2") + "\r" +
                                                                   "ESTA SEGURO DE REGISTRAR LOS DATOS?"
                                                                   );
                        if (respuesta == System.Windows.Forms.DialogResult.Yes)
                        {
                            LOK = true;
                        }
                    }
                    else
                    {
                        total = (enEfectivo - aDevolver) + enCheques + enTarjetas;
                        if (total <= 0)
                        {
                            objUtil.MostrarMensajeAdvertencia("El Desglose de Pagoo Debe Ser Mayor a Cero");
                        }
                        else if ((total - monto) > 1)
                        {
                            objUtil.MostrarMensajeAdvertencia("El Desglose de Pagoo No Puede ser Mayor al Monto a Pagar");
                        }
                        else
                        {
                            LOK = true;
                        }
                    }

                    if (LOK)
                    {
                        btn = (Button)sender;
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                objUtil.MostrarMensajeError(ex.Message);
            }
        }
Пример #2
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            DataDB_ELR_NET.DataDB objDB = new DataDB_ELR_NET.DataDB();

            string Clave = "";

            try
            {
                this.Cursor   = Cursors.WaitCursor;
                objDB.timeOut = 90;

                Nombre_Usuario = txtNombreUsuario.Text.Trim().ToUpper();
                Clave          = txtClave.Text.Trim();

                if ((Nombre_Usuario == "") || (Clave == ""))
                {
                    objUtil.MostrarMensajeAdvertencia("Debe especificar Nombre de Usuario y Clave o PassWord");
                }
                else if (objDB.ValidarUsuarioPassword(Nombre_Usuario, Clave, objUtil.nombrePC, objUtil.localIP) < 1)
                {
                    objUtil.MostrarMensajeAdvertencia(objDB.MENSAJE);
                }
                else
                {
                    loginOK = true;
                    Close();
                }
            }
            catch (Exception ex)
            {
                loginOK = false;
                objUtil.MostrarMensajeError(ex.Message, "");
            }
            finally
            {
                this.Cursor = Cursors.Default;

                txtClave.Text = "";
                objDB         = null;

                if (txtNombreUsuario.Text.Trim() != "")
                {
                    txtClave.Focus();
                }
                else
                {
                    txtNombreUsuario.Focus();
                }
            }
        }
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtVariable.Text.Trim() == "")
                {
                    objUtil.MostrarMensajeAdvertencia("DEBE INDICAR EL NOMBRE DE LA VARIABLE");
                }
                else
                {
                    variable   = txtVariable.Text.Trim();
                    valor      = txtValor.Text.Trim();
                    comentario = txtComentario.Text.Trim();

                    lOK = true;
                    Close();
                }
            }
            catch (Exception ex)
            {
                objUtil.MostrarMensajeError(ex.Message);
            }
        }
Пример #4
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            ELRUtils objUtil = new ELRUtils();

            DataDB_ELR_NET.DataDB db = new DataDB_ELR_NET.DataDB();

            string claveActual = "";
            string claveNueva  = "";
            string confirmar   = "";

            bool valido = false;

            try
            {
                claveActual = txtClaveActual.Text.Trim();
                claveNueva  = txtClaveNueva.Text.Trim();
                confirmar   = txtConfirmar.Text.Trim();

                //Validamos Haya Digitado Claves
                if (claveActual == "")
                {
                    objUtil.MostrarMensajeAdvertencia("Debe Digitar la Clave Actual");
                    txtClaveActual.Focus();
                }
                else if (claveNueva == "")
                {
                    objUtil.MostrarMensajeAdvertencia("Debe Digitar la Nueva Clave");
                    txtClaveNueva.Focus();
                }
                else if (confirmar == "")
                {
                    objUtil.MostrarMensajeAdvertencia("Debe Confirmar la Nueva Clave");
                    txtConfirmar.Focus();
                }
                else if (claveActual == claveNueva)
                {
                    objUtil.MostrarMensajeAdvertencia("La Nueva Clave Debe Ser Diferente a la Clave Actual");
                    txtClaveNueva.Focus();
                }
                else
                {
                    if (claveNueva.Length < 6)
                    {
                        throw new Exception("La clave debe tener minimo 6 caracteres");
                    }

                    //Validamos la Calve Nueva Debe ser Diferente a la Actual

                    if (nombreUsuario.ToUpper() == "SYS.ADMIN")
                    {
                        valido = objUtil.ValidarClave(claveNueva);
                    }


                    if (valido)
                    {
                        if (claveNueva == confirmar)
                        {
                            valido = (db.CambiarClaveUsuario(nombreUsuario, claveActual, claveNueva) > 0);
                            if (valido == false)
                            {
                                objUtil.MostrarMensajeAdvertencia(db.MENSAJE);
                            }
                        }
                        else
                        {
                            valido = false;
                            objUtil.MostrarMensajeAdvertencia("Las Claves no Coinciden");
                            txtConfirmar.Focus();
                        }
                    }

                    if (valido)
                    {
                        objUtil.MostrarMensajeInformacion("Clave o Password Cambiado de Forma Satisfactoria...");
                        Close();
                    }
                }
            }
            catch (Exception ex)
            {
                objUtil.MostrarMensajeError(ex.Message);
            }
            finally
            {
                objUtil = null;
                db      = null;
            }
        }
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            DialogResult respuesta;
            double       total = 0;
            Button       btn   = null;

            try
            {
                LOK = true;
                if (Calcular())
                {
                    //VALIDAMOS CONDICION A CREDITO
                    if ((montoDeduda > 0) && (!esCredito) && diasCredito <= 0)
                    {
                        utils.MostrarMensajeAdvertencia("El Credito No esta Permitido");
                        LOK = false;
                    }
                    else if ((montoDeduda > 0) && (esCredito))
                    {
                        LOK       = false;
                        respuesta = utils.MostrarMensajePregunta("SE REGISTRARA UNA CUENTA POR COBRAR DE: " + montoDeduda.ToString("N2") + "\r" +
                                                                 "ESTA SEGURO DE REGISTRAR LOS DATOS?"
                                                                 );
                        if (respuesta == System.Windows.Forms.DialogResult.Yes)
                        {
                            LOK = true;
                        }
                    }

                    if (LOK)
                    {
                        total = (enEfectivo - aDevolver) + enCheques + enTarjetas;
                        if (total <= 0 && !esCredito)
                        {
                            utils.MostrarMensajeAdvertencia("El Desglose de Pago Debe Ser Mayor a Cero");
                        }
                        else if ((total - monto) > 1)
                        {
                            utils.MostrarMensajeAdvertencia("El Desglose de Pago No Puede ser Mayor al Monto a Pagar");
                        }
                        else
                        {
                            Cursor = Cursors.WaitCursor;

                            filaDesglose["Oficina_Id"] = oficinaId;
                            filaDesglose["Entidad_Id"] = entidadId;
                            filaDesglose["CedulaRNC"]  = txtCedulaRNC.Text.Trim();
                            filaDesglose["Nombres"]    = txtNombres.Text.Trim();
                            filaDesglose["Apellidos"]  = txtApellidos.Text.Trim();
                            filaDesglose["Direccion"]  = txtDireccion.Text.Trim();
                            filaDesglose["Telefono1"]  = txtTelefono1.Text.Trim();
                            filaDesglose["Telefono2"]  = txtTelefono2.Text.Trim();

                            filaDesglose["Monto"]           = monto;
                            filaDesglose["EnEfectivo"]      = enEfectivo;
                            filaDesglose["EnCheques"]       = enCheques;
                            filaDesglose["EnTarjetas"]      = enTarjetas;
                            filaDesglose["Monto_AlContado"] = monto - montoDeduda;
                            filaDesglose["Monto_ACredito"]  = montoDeduda;

                            cedulaRNC      = txtCedulaRNC.Text.Trim();
                            nombreCompleto = (txtNombres.Text.Trim() + " " + txtApellidos.Text.Trim()).Trim();
                            telefonos      = (txtTelefono1.Text.Trim() + "  " + txtTelefono2.Text.Trim()).Trim();

                            filaDesglose["Nombre_Completo"] = nombreCompleto;
                            filaDesglose["Telefonos"]       = telefonos;

                            direccion = txtDireccion.Text.Trim();
                            nombres   = txtNombres.Text.Trim();
                            apellidos = txtApellidos.Text.Trim();
                            telefono1 = txtTelefono1.Text.Trim();
                            telefono2 = txtTelefono2.Text.Trim();


                            db.UpdateFromRow(TABLE_NAME, filaDesglose, CAMPO_ID);
                            LOK = true;
                        }
                    }

                    Cursor = Cursors.Default;
                    if (LOK)
                    {
                        btn = (Button)sender;

                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                utils.MostrarMensajeError(ex.Message);
            }
            finally
            {
                Cursor = Cursors.Default;
            }
        }
Пример #6
0
        private void btnRegistrar_Click(object sender, EventArgs e)
        {
            string codigo = "";
            string codigoActivacion = "", tipo = "";
            string temporalId = "";

            string[] miArray;
            DataDB_ELR_NET.DataDB           db            = new DataDB_ELR_NET.DataDB();
            List <DataDB_ELR_NET.Parametro> MyParametros  = new List <DataDB_ELR_NET.Parametro>();
            ELRFormMensajeErrores           objMsgERRORES = new ELRFormMensajeErrores();
            int resultado = -1;

            try
            {
                codigoActivacion = util.desencriptar(txtCodigoActivacion.Text.Trim());
                miArray          = codigoActivacion.Split('|');
                codigoActivacion = miArray[0];
                if (miArray.Length >= 3)
                {
                    tipo = miArray[2].ToUpper();
                }
                tipo             = tipo.Replace("\0", "").Trim();
                codigoActivacion = codigoActivacion.Replace("\0", "").Trim();
                codigoActivacion = codigoActivacion.Replace("-", "");
                cedulaRNC        = cedulaRNC.Replace("-", "");

                lOK = false;

                if (serialNumero.Trim() == "" && cedulaRNC.Trim() == "")
                {
                    util.MostrarMensajeAdvertencia("El Sistema no ha Podido Identificar el Numero de Serial ...");
                }
                else if (codigoActivacion == "")
                {
                    util.MostrarMensajeAdvertencia("Debe Digitar Codigo de Activacion ...");
                    txtCodigoActivacion.Focus();
                }
                else if ((serialNumero != codigoActivacion && cedulaRNC != codigoActivacion) || tipo != "WIN32")
                {
                    util.MostrarMensajeError("Codigo de Activacion Invalido ...");
                    txtCodigoActivacion.Focus();
                }
                else
                {
                    //PROCEDEMOS A REGISTRAR EL CODIGO DE ACTIVACION
                    this.Cursor = Cursors.WaitCursor;
                    if (codigoActivacion == cedulaRNC)
                    {
                        serialNumero = cedulaRNC + "WIN32";
                    }

                    codigoActivacion = txtCodigoActivacion.Text;
                    temporalId       = util.GetTemporalID();
                    MyParametros.Add(new DataDB_ELR_NET.Parametro("IdentificadorTemp", temporalId));
                    MyParametros.Add(new DataDB_ELR_NET.Parametro("SerialNumero", serialNumero));
                    MyParametros.Add(new DataDB_ELR_NET.Parametro("CodigoActivacion", codigoActivacion));
                    MyParametros.Add(new DataDB_ELR_NET.Parametro("Autor", nombreUsuario));

                    db.iniciarTransaccion();
                    resultado = db.EjecutarSP("SP_SISTEMA_REGISTRAR_LICENCIA", MyParametros);
                    if (resultado < 0)
                    {
                        //MOSTRAMOS MENSAJE DE ERRORES
                        objMsgERRORES.TemporalId = temporalId;
                        objMsgERRORES.objDB      = db;

                        objMsgERRORES.ShowDialog();
                    }
                    else
                    {
                        db.confirmarTransaccion();
                        util.MostrarMensajeInformacion("Datos Registrado de Forma Satisfactoria ...");
                        lOK = true;
                        Close();
                    }
                }
            }
            catch (Exception ex)
            {
                util.MostrarMensajeError(ex.Message);
            }
            finally
            {
                db.cancelarTransaccion();
                this.Cursor = Cursors.Default;
            }
        }
Пример #7
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            double       valor = 0;
            DialogResult resp;

            try
            {
                cedulaRNC      = txtCedulaRNC.Text.Trim();
                nombreCompleto = (txtNombres.Text.Trim() + " " + txtApellidos.Text.Trim()).Trim();
                telefonos      = (txtTelefono1.Text.Trim() + "  " + txtTelefono2.Text.Trim()).Trim();

                direccion = txtDireccion.Text.Trim();
                nombres   = txtNombres.Text.Trim();
                apellidos = txtApellidos.Text.Trim();
                telefono1 = txtTelefono1.Text.Trim();
                telefono2 = txtTelefono2.Text.Trim();

                double.TryParse(telefono1.Replace("-", ""), out valor);

                //Validamos se haya indicado los campos necesarios
                if (nombreCompleto.Length < 10)
                {
                    utils.MostrarMensajeAdvertencia("Debe indicar un nombre valido, Minimo 10 Caracteres");
                    txtNombres.Focus();
                    return;
                }
                else if (direccion.Length < 10)
                {
                    utils.MostrarMensajeAdvertencia("Debe indicar una direccion valida, Minimo 10 Caracteres");
                    txtDireccion.Focus();
                    return;
                }
                else if (valor <= 0 || telefono1.Replace("-", "").Length < 10)
                {
                    utils.MostrarMensajeAdvertencia("Debe indicar un numero de telefono valido");
                    txtTelefono1.Focus();
                    return;
                }
                else
                {
                    resp = utils.MostrarMensajePregunta("Esta seguro que los datos suministrado estan corecto?");
                    if (resp == DialogResult.Yes)
                    {
                        filaDesglose["Oficina_Id"] = oficinaId;
                        filaDesglose["Entidad_Id"] = entidadId;
                        filaDesglose["CedulaRNC"]  = txtCedulaRNC.Text.Trim();
                        filaDesglose["Nombres"]    = txtNombres.Text.Trim();
                        filaDesglose["Apellidos"]  = txtApellidos.Text.Trim();
                        filaDesglose["Direccion"]  = txtDireccion.Text.Trim();
                        filaDesglose["Telefono1"]  = txtTelefono1.Text.Trim();
                        filaDesglose["Telefono2"]  = txtTelefono2.Text.Trim();



                        cedulaRNC      = txtCedulaRNC.Text.Trim();
                        nombreCompleto = (txtNombres.Text.Trim() + " " + txtApellidos.Text.Trim()).Trim();
                        telefonos      = (txtTelefono1.Text.Trim() + "  " + txtTelefono2.Text.Trim()).Trim();

                        filaDesglose["Nombre_Completo"] = nombreCompleto;
                        filaDesglose["Telefonos"]       = telefonos;

                        direccion = txtDireccion.Text.Trim();
                        nombres   = txtNombres.Text.Trim();
                        apellidos = txtApellidos.Text.Trim();
                        telefono1 = txtTelefono1.Text.Trim();
                        telefono2 = txtTelefono2.Text.Trim();

                        db.UpdateFromRow(TABLE_NAME, filaDesglose, CAMPO_ID);
                        lOK = true;
                        Close();
                    }
                }
            }
            catch (Exception ex)
            {
                utils.MostrarMensajeError(ex.Message);
            }
        }