Exemplo n.º 1
0
        private void ValidarClaves()
        {
            List <Afiliado> afiliados = HelperAfiliado.AfiliadosGet(afi.AF_CodCliente);

            afi = afiliados[0];
            if (this.txtClave.Text.Trim().Equals(string.Empty))
            {
                throw new Exception("Su nueva clave es requerida");
            }
            if (this.txtClave.Text.Trim().Length < 8)
            {
                throw new Exception("Su nueva clave debe tener al menos 8 caracteres");
            }
            if (this.txtClaveConfirmar.Text.Trim().Equals(string.Empty))
            {
                throw new Exception("La confirmación de su nueva clave es requerida");
            }
            //Modificado 27/08/2018 por Liliana Guerra clave mayuscula
            //if (!this.txtClave.Text.Trim().Equals(this.txtClaveConfirmar.Text.Trim()))
            if (!this.txtClave.Text.Trim().ToUpper().Equals(this.txtClaveConfirmar.Text.Trim().ToUpper()))
            {
                throw new Exception("La nueva clave y su confirmación no coinciden");
            }
            if (!(new Regex("^(?=.*[A-Za-z])(?=.*\\d)(?=.*[$@!%*#?&\\.])[A-Za-z\\d$@!%*#?&\\.]{8,10}$")).IsMatch(this.txtClave.Text.Trim()))
            {
                throw new Exception("Su nueva clave debe tener al menos un (4) caracteres alfabéticos, un (4) caracteres numéricos, un (1) caracter especial, de longitud mínima 8 y máximo 10");
            }
            // //*************** IMPLEMENTACIÓN REGULACION 641-10 ******************************************************//
            ClaveNombre(this.afi.sCO_Nombres, this.txtClave.Text.Trim());
            ClaveUser(this.afi.sAF_NombreUsuario, this.txtClave.Text.Trim());
            ClaveTelefono(this.afi.CO_Celular, this.txtClave.Text.Trim());
            ClaveCedula(this.afi.sCedula, this.txtClave.Text.Trim());
            ClaveCuenta(this.txtClave.Text.Trim());
            PoliticaUsuarioClave.validaPoliticaClave(this.afi.sAF_NombreUsuario, this.txtClave.Text, this.txtClaveConfirmar.Text);
        }
Exemplo n.º 2
0
        public override string EjecutarAccion()
        {
            string empty = string.Empty;

            HelperAfiliado.SMSContactoCelularUpdate(base.Afiliado.nAF_Id, this.Correo, this.Celular);
            return(empty);
        }
Exemplo n.º 3
0
        public bool ValidarPreguntasRespuestas(long afiliado)
        {
            bool flag = false;
            List <KeyValuePair <short, string> > preguntasRespuestas = this.getPreguntasRespuestas();
            short  key   = preguntasRespuestas[0].Key;
            short  num   = preguntasRespuestas[1].Key;
            string value = preguntasRespuestas[0].Value;
            KeyValuePair <short, string> item = preguntasRespuestas[1];

            flag = HelperAfiliado.PreguntasAfiliadoValidate(afiliado, key, num, value, item.Value);
            return(flag);
        }
Exemplo n.º 4
0
        protected void btnContinuarSMS_Click(object sender, EventArgs e)
        {
            this.panelMSG.Visible          = false;
            this.panelConfirmacion.Visible = true;
            string str = HelperAfiliado.CrearClaveTransaccionTemporal(base.Afiliado.nAF_Id);

            HelperEnvioCorreo.EnviarCorreoClaveTemporal(string.Concat(base.Afiliado.sCO_Nombres, " ", base.Afiliado.sCO_Apellidos), base.Afiliado.CO_Email, str);
            if (!string.IsNullOrEmpty(base.Afiliado.CO_Celular))
            {
                HelperTedexis.sendSMS(base.Afiliado.CO_Celular, string.Concat("BAV informa que su Clave de Transacciones Temporal es: ", str, ". Si usted no esta realizando esta operacion llame al 0500-288.00.01"));
            }
            this.Session.Add("SMS", true);
        }
Exemplo n.º 5
0
        public bool ValidarPreguntasRespuestas()
        {
            bool      flag = false;
            Principal page = this.Page as Principal;
            List <KeyValuePair <short, string> > preguntasRespuestas = this.getPreguntasRespuestas();
            long   nAFId = page.Afiliado.nAF_Id;
            short  key   = preguntasRespuestas[0].Key;
            short  num   = preguntasRespuestas[1].Key;
            string value = preguntasRespuestas[0].Value;
            KeyValuePair <short, string> item = preguntasRespuestas[1];

            flag = HelperAfiliado.PreguntasAfiliadoValidate(nAFId, key, num, value, item.Value);
            return(flag);
        }
Exemplo n.º 6
0
        public void llenarPreguntasAfiliado(long af_id)
        {
            List <KeyValuePair <short, string> > keyValuePairs = HelperAfiliado.PreguntasAfiliadoGet(af_id);

            if (this.TipoRepeater != PreguntasDesafio.EnumTipoRepeater.Div)
            {
                this.rptPreguntas2.DataSource = keyValuePairs;
                this.rptPreguntas2.DataBind();
            }
            else
            {
                this.rptPreguntas.DataSource = keyValuePairs;
                this.rptPreguntas.DataBind();
            }
        }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.PreguntasValidadas)
            {
                this.panelValidacion.Visible = false;
                this.panelDatos.Visible      = true;
            }

            if (!HelperNotificacionIBP.VerificaNotificacion(base.Afiliado.nAF_Id))
            {
                this.btnAceptar.Visible = false;
                WebUtils.MessageBootstrap(this, string.Concat("Para usar esta opción debe tener una notificación activa. Si desea crear una notificación presione <a href=\"", base.ResolveUrl("~/pages/NotificacionViajes/NotificacionNueva.aspx"), "\">aquí</a>"), null);
            }
            else if (!HelperNotificacionIBP.ValidaDestinos(base.Afiliado.nAF_Id))
            {
                this.btnAceptar.Visible = false;
                WebUtils.MessageBootstrap(this, string.Concat("No cumple los requisitos para agregar un nuevo destino a esta notificación.<br/>Le recordamos que cada notificación tiene un máximo de 3 lugares como destino en un lapso de 6 meses.</br> presione <a href=\"", base.ResolveUrl("~/pages/NotificacionViajes/DetalleNotificacion.aspx"), "\">aquí para regresar a la consulta</a>"), null);;
            }
            else
            {
                if (!base.IsPostBack)
                {
                    this.ListaDestino.HasTextoInicial = true;
                    this.ListaDestino.TextoInicial    = "Seleccione el país";
                    this.ListaDestino.GetLista();
                    base.Afiliado            = HelperAfiliado.AfiliadosGet(base.Afiliado.nAF_Id, EnumTipoCodigo.AF_ID);
                    this.Session["Afiliado"] = base.Afiliado;
                }

                UltDestino   = Notificacion.UltimoDestino(base.Afiliado.nAF_Id);
                FechaMin     = Convert.ToDateTime(UltDestino.FechaFin);
                this.FD.Text = FechaMin.ToString("dd/MM/yyyy");

                PriDestino        = Notificacion.PrimerDestino(base.Afiliado.nAF_Id);
                FechaMax          = Convert.ToDateTime(PriDestino.FechaInicio);
                this.maximo.Value = FechaMax.ToString("dd/MM/yyyy");
            }
        }
Exemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (this.PreguntasValidadas)
            {
                this.panelValidacion.Visible = false;
                this.panelDatos.Visible      = true;
            }

            if (HelperNotificacionIBP.VerificaNotificacion(base.Afiliado.nAF_Id))
            {
                this.btnAceptar.Visible = false;
                WebUtils.MessageBootstrap(this, string.Concat("Ya posee una notificación activa. Si desea agregar otros destinos a esta notificación o eliminarla  presione <a href=\"", base.ResolveUrl("~/pages/NotificacionViajes/DetalleNotificacion.aspx"), "\">aquí</a>"), null);
            }

            if (!base.IsPostBack)
            {
                this.ListaDestino.HasTextoInicial = true;
                this.ListaDestino.TextoInicial    = "Seleccione el país";
                this.ListaDestino.GetLista();
                base.Afiliado            = HelperAfiliado.AfiliadosGet(base.Afiliado.nAF_Id, EnumTipoCodigo.AF_ID);
                this.Session["Afiliado"] = base.Afiliado;
            }
        }
Exemplo n.º 9
0
 protected void btnhome_Click(object sender, EventArgs e)
 {
     if ((!base.IsPostBack ? false : base.Tipo_Seguridad == 1))
     {
         if (this.Session["SMS"] == null)
         {
             string str = HelperAfiliado.CrearClaveTransaccionTemporal(base.Afiliado.nAF_Id);
             if (!string.IsNullOrEmpty(base.Afiliado.CO_Celular))
             {
                 HelperTedexis.sendSMS(base.Afiliado.CO_Celular, string.Concat("BAV informa que su Clave de Transacciones Temporal es: ", str, ". Si usted no esta realizando esta operacion llame al 0500-288.00.01"));
                 this.Session.Add("SMS", true);
                 this.panelDatos.Visible = false;
                 this.panelHome.Visible = false;
                 this.panelValidacion.Visible = true;
             }
         }
         else
         {
             this.panelValidacion.Visible = true;
             this.panelHome.Visible = false;
             this.panelDatos.Visible = false;
         }
     }
 }
Exemplo n.º 10
0
 protected void rptPreguntas_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if ((e.Item.ItemType == ListItemType.Item ? true : e.Item.ItemType == ListItemType.AlternatingItem))
     {
         Literal str = e.Item.FindControl("liNro") as Literal;
         if (this.TipoPreguntas == PreguntasDesafio.EnumTipoPreguntas.Preguntas)
         {
             short        num          = Convert.ToInt16(e.Item.DataItem);
             DropDownList dropDownList = e.Item.FindControl("ddlPreguntas") as DropDownList;
             dropDownList.Visible = true;
             foreach (KeyValuePair <short, string> keyValuePair in HelperAfiliado.PreguntasGet(num))
             {
                 ListItemCollection items = dropDownList.Items;
                 string             value = keyValuePair.Value;
                 short key = keyValuePair.Key;
                 items.Add(new ListItem(value, key.ToString()));
             }
         }
         else if (this.TipoPreguntas == PreguntasDesafio.EnumTipoPreguntas.PreguntasAfiliado)
         {
             KeyValuePair <short, string> dataItem = (KeyValuePair <short, string>)e.Item.DataItem;
             Literal literal = e.Item.FindControl("liId") as Literal;
             literal.Text = dataItem.Key.ToString();
             Literal value1 = e.Item.FindControl("liPregunta") as Literal;
             value1.Text = dataItem.Value;
             TextBox textBox = e.Item.FindControl("txtRespuesta") as TextBox;
             textBox.TextMode = TextBoxMode.SingleLine;
             if (this.MaskedInputs)
             {
                 textBox.TextMode = TextBoxMode.Password;
             }
         }
         this.nro++;
         str.Text = this.nro.ToString();
     }
 }
Exemplo n.º 11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.PreguntasValidadas)
     {
         this.panelValidacion.Visible = false;
         this.panelDatos.Visible      = true;
     }
     if (!base.IsPostBack)
     {
         base.Afiliado            = HelperAfiliado.AfiliadosGet(base.Afiliado.nAF_Id, EnumTipoCodigo.AF_ID);
         this.Session["Afiliado"] = base.Afiliado;
         if (!string.IsNullOrEmpty(base.Afiliado.CO_Celular))
         {
             this.liNumeroActual.Text = Formatos.formatoTarjeta(base.Afiliado.CO_Celular);
         }
         else
         {
             this.liNumeroActual.Text = "No Afiliado";
         }
         this.liCorreoActual.Text = Formatos.formatoEmail(base.Afiliado.CO_Email);
         this.tg = this.Context.Items["TipoTransaccionGenerica"] as TipoTransaccionGenerica;
     }
     if (this.tg != null)
     {
         StringBuilder stringBuilder = new StringBuilder("<script>setTimeout(function(){");
         this.panelDatos.Visible      = true;
         this.panelValidacion.Visible = false;
         GActualizarDatos objetoTransaccion = this.tg.ObjetoTransaccion as GActualizarDatos;
         if ((string.IsNullOrEmpty(objetoTransaccion.Correo) ? false : !base.IsPostBack))
         {
             this.rdoEmailSi.Checked      = true;
             this.rdoEmailNo.Checked      = false;
             this.txtCorreo.Text          = objetoTransaccion.Correo;
             this.txtCorreoConfirmar.Text = objetoTransaccion.Correo;
             stringBuilder.Append(string.Concat("$('#", this.rdoEmailSi.ClientID, "').prop('checked',true).trigger('change');"));
         }
         if ((string.IsNullOrEmpty(objetoTransaccion.Celular) ? false : !base.IsPostBack))
         {
             this.rdoCelSi.Checked = true;
             this.rdoCelNo.Checked = false;
             string celular = objetoTransaccion.Celular;
             string str     = celular.Substring(0, 4);
             this.ddlistNumeroMovil.ClearSelection();
             this.ddlistNumeroMovil.Items.FindByValue(str).Selected = true;
             this.ddlistNumeroMovilConfirm.ClearSelection();
             this.ddlistNumeroMovilConfirm.Items.FindByValue(str).Selected = true;
             TextBox textBox  = this.txtNumeroMovil;
             TextBox textBox1 = this.txtNumeroMovilConfirm;
             string  str1     = celular.Substring(4, celular.Length - 4);
             string  str2     = str1;
             textBox1.Text = str1;
             textBox.Text  = str2;
             stringBuilder.Append(string.Concat("$('#", this.rdoCelSi.ClientID, "').prop('checked',true).trigger('change');"));
         }
         stringBuilder.Append("}, 150);</script>");
         if (!base.IsPostBack)
         {
             this.liScript.Text = stringBuilder.ToString();
         }
     }
 }
Exemplo n.º 12
0
        protected void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                this.ValidarCampos();
                List <KeyValuePair <short, string> > preguntasRespuestas = this.PreguntasDesafio.getPreguntasRespuestas();
                Contactos contacto = new Contactos()
                {
                    sCO_Nombres      = this.lblNombreCompleto.Text,
                    sCO_Apellidos    = string.Empty,
                    nTI_id           = 10,
                    nES_id           = (long)2,
                    sCO_DocId        = this.lblCedula.Text.Substring(1, this.lblCedula.Text.Length - 1),
                    nCO_TipoDocId    = 1,
                    sCO_Email        = this.txtCorreo.Text.Trim(),
                    sCO_Telefono     = string.Empty,
                    sCO_EdificioCasa = string.Empty,
                    sCO_Calle        = string.Empty,
                    sCO_Urbanizacion = string.Empty,
                    sCO_CodigoPostal = string.Empty,
                    sCO_Ciudad       = string.Empty,
                    sCO_Estado       = string.Empty,
                    sCO_Pais         = "Venezuela",
                    sCO_Empresa      = string.Empty,
                    nCA_Id           = 2,
                    sCO_Email2       = string.Empty,
                    sCO_Telefono2    = string.Empty,
                    sCO_Celular      = this.afi.CO_Celular
                };
                this.afi.sAF_NombreUsuario = this.txtUsuario.Text.Trim();
                //Modificado 27/08/2018 por Liliana Guerra clave a mayuscula
                //this.afi.sAF_Password = CryptoUtils.EncryptMD5(this.txtClave.Trim());
                this.afi.sAF_Password        = CryptoUtils.EncryptMD5(this.txtClave.Text.Trim().ToUpper());
                this.afi.nTI_Id              = contacto.nTI_id;
                this.afi.nCO_Id              = contacto.nCO_id;
                this.afi.sAF_PreguntaDesafio = "";
                this.afi.sAF_RespuestaPD     = "";
                this.afi.nES_Id              = contacto.nES_id;
                this.afi.sIP             = WebUtils.GetClientIP(this);
                this.afi.AF_DiasPassword = int.Parse(this.ddlDiasCaducidad.SelectedValue);

                //WebUtils.MessageBox(this, this.afi+"/Fin AFI/ "+contacto+"/Fin Contactos/ "+string.Empty+"/Fin Empty/ "+string.Empty+"/Fin Empty/ "+preguntasRespuestas+"/Fin Preguntas Respuestas /");
                if (!HelperAfiliado.GuardarAfiliado(this.afi, contacto, string.Empty, string.Empty, preguntasRespuestas))
                {
                    this.liTitulo.Text   = "Problemas en la Afiliación del usuario";
                    this.liMensaje1.Text = "Ocurrió un error al realizar la Afiliación";
                    this.liMensaje2.Text = "Por favor intente mas tarde.";
                    this.liMensaje3.Text = string.Empty;
                }
                else
                {
                    string text = this.txtCorreo.Text;
                    if (text != string.Empty)
                    {
                        string empty  = string.Empty;
                        string str    = this.lblNombreCompleto.Text;
                        string empty1 = string.Empty;
                        string str1   = string.Empty;
                        string empty2 = string.Empty;
                        string str2   = string.Empty;
                        string empty3 = string.Empty;
                        string str3   = string.Empty;
                        string empty4 = string.Empty;
                        string str4   = string.Empty;
                        string empty5 = string.Empty;
                        string str5   = string.Empty;
                        string empty6 = string.Empty;
                        string str6   = string.Empty;
                        string empty7 = string.Empty;
                        string str7   = string.Empty;
                        HelperEnvioCorreo.BuscarCamposCorreo(46, str, text, new decimal(0), empty3, empty1, str1, empty2, str2, str3, empty4, str4, empty5, empty6, str6, empty7, str7, empty);

                        this.liTitulo.Text   = "Afiliación Exitosa";
                        this.liMensaje1.Text = "El proceso de Afiliación se ha realizado exitosamente";
                        this.liMensaje2.Text = "Te informamos que de ahora en adelante, debes utilizar este Usuario y Clave para ingresar a BAV en línea";
                        this.liMensaje3.Text = "Haz \"Click\" en ACEPTAR para ingresar a BAV en línea.";
                    }
                }
                this.panelAfiliacionExitosa.Visible = true;
                this.panelNuevoAfiliado.Visible     = false;
            }
            catch (IBException bException)
            {
                WebUtils.MessageBox(this, bException.IBMessage);
            }
            catch (Exception exception)
            {
                WebUtils.MessageBox(this, exception.Message);
            }
        }
Exemplo n.º 13
0
        private void ValidarCampos()
        {
            Regex regex = new Regex("([a-z|A-Z|0-9]){6,10}$");

            if (this.txtUsuario.Text.Trim().Equals(string.Empty))
            {
                throw new Exception("La identificación de usuario es requerida");
            }
            if (!regex.IsMatch(this.txtUsuario.Text.Trim()))
            {
                throw new Exception("El nombre de usuario debe tener entre 6 y 10 letras y/o números, sin espacios, comas ni puntos");
            }
            if (this.txtUsuario.Text.Trim().Contains(" "))
            {
                throw new Exception("El nombre de usuario debe tener entre 6 y 10 letras y/o números, sin espacios, comas ni puntos");
            }
            if (HelperAfiliado.ExisteAfiliado(string.Empty, string.Empty, this.txtUsuario.Text.Trim()))
            {
                throw new Exception(string.Concat("Ya existe un usuario con este nombre: ", this.txtUsuario.Text.Trim()));
            }
            if (HelperAfiliado.ExisteAfiliado(this.afi.cedRIF, string.Empty, string.Empty))
            {
                throw new Exception(string.Concat("Ya existe un usuario con esta identificación: ", this.afi.cedRIF));
            }
            if (this.txtClave.Text.Trim().Equals(string.Empty))
            {
                throw new Exception("La clave de usuario es requerida");
            }
            if (this.txtClave.Text.Trim().Length < 8)
            {
                throw new Exception("La clave de usuario debe tener entre 8 y 10 caracteres");
            }
            if (!(new Regex("^(?=.*[A-Za-z])(?=.*\\d)(?=.*[$@!%*#?&\\.])[A-Za-z\\d$@!%*#?&\\.]{8,10}$")).IsMatch(this.txtClave.Text.Trim()))
            {
                throw new Exception("Su nueva clave debe tener al menos 1 caracter alfabético, 1 caracter numérico, 1 caracter especial, de longitud mínima 8 y máximo 10");
            }
            if (this.txtClaveConfirmar.Text.Trim().Equals(string.Empty))
            {
                throw new Exception("La confirmacón de clave de usuario es requerida");
            }
            if (this.txtClaveConfirmar.Text.Trim().Length < 8)
            {
                throw new Exception("La clave de usuario debe tener entre 8 y 10 caracteres");
            }
            //Modificado 27/08/2018 por Liliana Guerra clave a mayuscula
            //if (!this.txtClave.Text.Trim().Equals(this.txtClaveConfirmar.Text))
            if (!this.txtClave.Text.Trim().ToUpper().Equals(this.txtClaveConfirmar.Text.Trim().ToUpper()))
            {
                throw new Exception("La clave y la confirmación no son iguales");
            }
            if (this.txtCorreo.Text.Trim().Equals(string.Empty))
            {
                throw new Exception("El correo electrónico es requerido");
            }
            if (!Tools.TestEmailRegex(this.txtCorreo.Text.Trim()))
            {
                throw new Exception("El correo electrónico es inválido");
            }
            if (this.txtCorreoConfirmar.Text.Trim().Equals(string.Empty))
            {
                throw new Exception("El correo electrónico es requerido");
            }
            if (!Tools.TestEmailRegex(this.txtCorreoConfirmar.Text.Trim()))
            {
                throw new Exception("El correo electrónico es inválido");
            }
            if (!this.txtCorreo.Text.Trim().Equals(this.txtCorreoConfirmar.Text.Trim()))
            {
                throw new Exception("El correo electrónico y su confirmación no son iguales");
            }
            //////*************** IMPLEMENTACIÓN REGULACION 641-10 ******************************************************//
            ValUserNombre(this.afi.sCO_Nombres, this.txtUsuario.Text.Trim());
            ValUserTelefono(this.afi.CO_Celular, this.txtUsuario.Text.Trim());
            ValUserCedula(this.lblCedula.Text.Substring(1), this.txtUsuario.Text.Trim());
            ValUserCuenta(this.txtUsuario.Text.Trim());
            ClaveNombre(this.afi.sCO_Nombres, this.txtClave.Text.Trim());
            ClaveUser(this.txtUsuario.Text.Trim(), this.txtClave.Text.Trim());
            ClaveTelefono(this.afi.CO_Celular, this.txtClave.Text.Trim());
            ClaveCedula(this.lblCedula.Text.Substring(1), this.txtClave.Text.Trim());
            ClaveCuenta(this.txtClave.Text.Trim());
            PoliticaUsuarioClave.validaPoliticaUsuario(this.txtUsuario.Text.Trim());
            PoliticaUsuarioClave.validaPoliticaClave(this.txtUsuario.Text.Trim(), this.txtClave.Text.Trim(), this.txtClaveConfirmar.Text.Trim());
        }
Exemplo n.º 14
0
        protected void btnlogin_Click(object sender, EventArgs e)
        {
            this.liScript.Text  = string.Empty;
            this.sError.Visible = false;
            base.ResolveUrl("~");
            this.login = this.AF_Login.Text;
            //Modificado 24/08/2018 por Liliana Guerra clave mayuscula
            //this.password = this.txtAF_Password.Text;
            this.password = this.txtAF_Password.Text.ToUpper();
            string empty = string.Empty;
            string str   = "~/frame.aspx";

            this.sError.Text = "Error en Usuario y/o Clave Personal";

            try
            {
                if (this.login.Trim().Length == 0)
                {
                    throw new Exception("El Código de usuario no puede ser blanco o nulo.");
                }
                if (this.password.Trim().Length == 0)
                {
                    throw new Exception("Debe ingresar la Clave");
                }
                this.oAfiliado = HelperAfiliado.AutenticarAfiliado(this.login, this.password, WebUtils.GetClientIP(this));
                if (this.oAfiliado != null)
                {
                    if (this.oAfiliado.AF_FechaPassword == new DateTime(2000, 1, 1))
                    {
                        this.Context.Items.Add("Afiliado", this.oAfiliado);
                        this.Context.Items.Add("type", "0");
                        base.Server.Transfer("~/pages/IB/Claves/CaducoClave.aspx");
                    }
                    else if ((this.oAfiliado.AF_DiasPassword == 0 ? false : DateAndTime.DateDiff(DateInterval.Day, this.oAfiliado.AF_FechaPassword, DateTime.Now) >= (long)this.oAfiliado.AF_DiasPassword))
                    {
                        this.Context.Items.Add("Afiliado", this.oAfiliado);
                        this.Context.Items.Add("type", "1");
                        base.Server.Transfer("~/pages/IB/Claves/CaducoClave.aspx");
                    }
                    SessionAfiliado sessionAfiliado = new SessionAfiliado();
                    try
                    {
                        sessionAfiliado = HelperSession.SA_CreateSession(this.oAfiliado.nAF_Id);
                    }
                    catch (IBException bException)
                    {
                        base.Response.Redirect("~/forcelogout.aspx", false);
                        return;
                    }
                    empty = "redirect.aspx";
                    this.oAfiliado.sIP = WebUtils.GetClientIP(this);
                    this.Session.Add("SessionID", sessionAfiliado.Sesion);
                    string[] strArrays = IBBAVConfiguration.SessionTimeOut.Split(new char[] { ':' });
                    int      num       = int.Parse(strArrays[0]) * 60 + int.Parse(strArrays[1]);
                    this.Session.Timeout = num / 60;
                    this.Session.Add("Afiliado", this.oAfiliado);
                    this.sError.Text = string.Empty;
                }
            }
            catch (IBException bException2)
            {
                IBException bException1 = bException2;
                this.txtAF_Password.Text = string.Empty;
                if (bException1.ReturnCode == "1000")
                {
                    StringBuilder stringBuilder = new StringBuilder(50);
                    stringBuilder.Append("<script language='javascript' type='text/javascript'>");
                    stringBuilder.Append("var w = window.open('pages/IB/Claves/RecuperarClave.aspx?restore=','restorepass','width=1100,height=768,menubar=0,resizable=0,toolbar=0,left=300,top=150');");
                    stringBuilder.Append("w.focus(); ");
                    stringBuilder.Append("</script>");
                    this.liScript.Text = stringBuilder.ToString();
                }
                else
                {
                    this.sError.Text    = bException1.IBMessage;
                    this.sError.Visible = true;
                    this.divmsg.Visible = true;
                    return;
                }
            }
            catch (Exception exception)
            {
                this.sError.Text    = exception.Message;
                this.sError.Visible = true;
                return;
            }
            if (!empty.Equals(string.Empty))
            {
                this.LogLoginSuccessfull();
                base.Response.Redirect(str);
            }
        }
Exemplo n.º 15
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.º 16
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);
            }
        }