Exemplo n.º 1
0
        public static RespuestaAfilpedsjv ibsAfiliarNatural(long SUserId, string SCedRif, string cta, string SNroTjtaDbto)
        {
            AfilpedsjvIn afilpedsjvIn = new AfilpedsjvIn()
            {
                SUserId      = SUserId.ToString(),
                SCedRif      = SCedRif,
                SCodCtaUlt   = cta,
                SNroTjtaDbto = SNroTjtaDbto,
                SPrefijo     = string.Empty,
                SFiller      = string.Empty
            };
            RespuestaAfilpedsjv respuestaAfilpedsjv = null;

            using (IbsServiceService ibsServiceService = new IbsServiceService())
            {
                ibsServiceService.Timeout = 10000;
                try
                {
                    respuestaAfilpedsjv = ibsServiceService.ibaAfiliarNatural(afilpedsjvIn);
                    if (respuestaAfilpedsjv == null)
                    {
                        throw new IBException(9998, "SQLIB");
                    }
                    if (!string.IsNullOrEmpty(respuestaAfilpedsjv.SError))
                    {
                        throw new IBException(respuestaAfilpedsjv.SError, "SQLIB");
                    }
                    if (respuestaAfilpedsjv.afilpedsjv == null)
                    {
                        throw new IBException(9998, "SQLIB");
                    }
                    if ((respuestaAfilpedsjv.afilpedsjv.EErrores == null ? false : !string.IsNullOrEmpty(respuestaAfilpedsjv.afilpedsjv.EErrores.SVectorCod)))
                    {
                        throw new IBException(respuestaAfilpedsjv.afilpedsjv.EErrores.SVectorCod, "IBS");
                    }
                }
                catch (WebException webException)
                {
                    throw new IBException(9997, "SQLIB");
                }
                catch (SoapException soapException)
                {
                    throw new IBException(9997, "SQLIB");
                }
            }
            return(respuestaAfilpedsjv);
        }
Exemplo n.º 2
0
        protected void btnAceptar_Click(object sender, EventArgs e)
        {
            bool flag = false;

            this.afi = new Afiliado();
            try
            {
                this.ValidarCampos();
                List <Afiliado> afiliados = HelperAfiliado.AfiliadosGet(string.Concat(this.ddlTipoCedula.SelectedValue, this.txtCedula.Text), EnumTipoValor.CedulaAfiliado);
                if (afiliados.Count <= 0)
                {
                    throw new Exception("Usuario o tarjeta no válida");
                }
                this.afi = afiliados[0];
                if (this.afi != null)
                {
                    HelperLogons.ValidarIntentoRecuparecionCLV(this.afi.nAF_Id, this.tddnumtxt.Text, Tools.GetClientIP());
                    flag = true;
                    string text = this.txtCta.Text;
                    RespuestaAfilpedsjv respuestaAfilpedsjv = HelperIbs.ibsAfiliarNatural(this.afi.AF_CodCliente, this.afi.sAF_Rif, text, this.tddnumtxt.Text);
                    this.afi.AF_CodCliente = long.Parse(respuestaAfilpedsjv.afilpedsjv.SUserId);
                }
            }
            catch (IBException bException2)
            {
                IBException bException = bException2;
                string      empty      = string.Empty;
                bool        flag1      = false;
                try
                {
                    if ((bException.IsErrorIB || this.afi == null ? false : this.afi.nAF_Id > (long)0))
                    {
                        HelperLogons.ValidarIntentoRecuparecionCLVFALLIDO(this.afi.nAF_Id, this.tddnumtxt.Text, Tools.GetClientIP());
                    }
                }
                catch (IBException bException1)
                {
                    empty = bException1.IBMessage;
                    flag1 = true;
                }
                if (flag1)
                {
                    WebUtils.MessageBox2005(this, empty);
                }
                else
                {
                    WebUtils.MessageBox2005(this, bException.IBMessage);
                }
                return;
            }
            catch (Exception exception)
            {
                WebUtils.MessageBox2005(this, exception.Message);
                return;
            }
            if ((!flag ? false : this.afi != null))
            {
                this.PreguntasDesafio.llenarPreguntasAfiliado(this.afi.nAF_Id);
                this.panelDatos.Visible      = false;
                this.panelValidacion.Visible = true;
            }
        }
Exemplo n.º 3
0
        protected void btnAceptar_Click(object sender, EventArgs e)
        {
            bool   flag  = false;
            string empty = string.Empty;

            //Daba Error Objeto no instanciado ***** this.afi = new Afiliado(null); ****
            //Modificado 07/08/2016 por Liliana Guerra
            this.afi = new Afiliado();
            try
            {
                this.ValidarCampos();
                List <Afiliado> afiliados = HelperAfiliado.AfiliadosGet(string.Concat(this.ddlTipoCedula.SelectedValue, this.txtCedula.Text.Trim()), EnumTipoValor.CedulaAfiliado);

                if (afiliados.Count > 0)
                {
                    this.afi = afiliados[0];
                    throw new Exception("Usted ya se encuentra afiliado al servicio de Internet Banking");
                }

                this.afi = new Afiliado()
                {
                    cedRIF   = string.Concat(this.ddlTipoCedula.SelectedValue, this.txtCedula.Text.Trim()),
                    sCedula  = this.txtCedula.Text.Trim(),
                    sAF_Rif  = string.Concat(this.ddlTipoCedula.SelectedValue, this.txtCedula.Text.Trim()),
                    sTarjeta = this.tddnumtxt.Text.Trim()
                };

                string str = this.txtCta.Text.Trim();
                RespuestaAfilpedsjv respuestaAfilpedsjv = HelperIbs.ibsAfiliarNatural((long)0, this.afi.cedRIF, str, this.tddnumtxt.Text);
                this.afi.AF_CodCliente = long.Parse(respuestaAfilpedsjv.afilpedsjv.SUserId);
                this.afi.AF_CodOficina = int.Parse(respuestaAfilpedsjv.afilpedsjv.SOfcCte);
                this.afi.sCO_Nombres   = respuestaAfilpedsjv.afilpedsjv.SNomCte.ToUpper();
                this.afi.CO_Celular    = respuestaAfilpedsjv.afilpedsjv.SCelCte;
                bool flag1 = (this.afi.CO_Celular.StartsWith("0412") || this.afi.CO_Celular.StartsWith("0414") || this.afi.CO_Celular.StartsWith("0424") || this.afi.CO_Celular.StartsWith("0416") ? true : this.afi.CO_Celular.StartsWith("0426"));

                if ((this.afi.CO_Celular.Trim().Equals(string.Empty) ? true : !flag1))
                {
                    throw new Exception("Número de celular no válido, por favor dirigirse a una agencia o llamar al número 0500-228.0001");
                }
                flag = true;
            }
            catch (IBException bException)
            {
                empty = bException.IBMessage;
                WebUtils.MessageBox(this, empty);
                return;
            }
            catch (Exception exception)
            {
                empty = exception.Message;
            }
            if ((!flag ? false : this.afi != null))
            {
                Random random = new Random(DateTime.Now.Millisecond);
                int    num    = random.Next(1000000, 2147483647);
                this.clvTemporal = num.ToString();
                HelperTedexis.sendSMS(this.afi.CO_Celular, string.Concat("BAV informa que su Clave de Afiliacion Temporal es: ", this.clvTemporal, ". Si usted no esta realizando esta operacion llame al 0500-288.00.01"));
                HelperLogons.ValidarAfiliacionIntentos(this.afi.sTarjeta, this.clvTemporal, "1");
                this.panelDatos.Visible = false;
                this.panelMSG.Visible   = true;
            }
            else
            {
                try
                {
                    HelperLogons.FallidoIntentoAfiliacion(this.tddnumtxt.Text, Tools.GetClientIP());
                }
                catch (IBException bException1)
                {
                    empty = bException1.IBMessage;
                }
            }
            if (!empty.Equals(string.Empty))
            {
                WebUtils.MessageBox(this, empty);
            }
        }