コード例 #1
0
ファイル: ServicesAsync.cs プロジェクト: jfrausto914/FSW
        public static void ValidaNip(ServiceRequest2 serviceRequest, ServiceRequestEventHandler<DtoValidarNip> asyncCallback, ReqValidarNip requestData, TipoNip tipoNip)
        {
            switch (tipoNip)
            {
                case TipoNip.BancaTelefonica:
#if OFFLINE
                    serviceRequest.BeginWebRequestOffline<ResValidarNip, DtoValidarNip>(service._serviceValidaNipBancaTelefonica, asyncCallback, json._jsonValidaNip);
#else
                    new Thread(() => { serviceRequest.BeginWebRequest<ResValidarNip, DtoValidarNip, ReqValidarNip>(service._serviceValidaNipBancaTelefonica, asyncCallback, requestData); }).Start();
#endif
                    break;
                case TipoNip.Supernet:
#if OFFLINE
                    serviceRequest.BeginWebRequestOffline<ResValidarNip, DtoValidarNip>(service._serviceValidaNipSupernet, asyncCallback, json._jsonValidaNip);
#else
                    new Thread(() => { serviceRequest.BeginWebRequest<ResValidarNip, DtoValidarNip, ReqValidarNip>(service._serviceValidaNipSupernet, asyncCallback, requestData); }).Start();
#endif
                    break;
            }
        }
コード例 #2
0
ファイル: Validaciones.cs プロジェクト: jfrausto914/FSW
        public static bool ValidaNip(string nip, ref TipoNip tipoNip)
        {
            if (!string.IsNullOrEmpty(nip))
            {
                string patternA = "^[\\w]{8}$";
                string patternN = "^[\\d]{6}$";
                if (nip.Length == 6)
                {
                    Regex regex = new Regex(patternN);
                    if (regex.IsMatch(nip)) { tipoNip = TipoNip.BancaTelefonica; return true; } else return false;
                }
                else if (nip.Length == 8)
                {
                    Regex regex = new Regex(patternA);
                    if (regex.IsMatch(nip)) tipoNip = TipoNip.Supernet; return true;
                }

                return false;
            }
            else
            {
                return false;
            }
        }
コード例 #3
0
        public void validarDesbloqueoBancaSuper(string claveCliente, string nip, TipoClaveUsuario tipoUsuario, TipoNip tipoNip, out bool validado, int tipoCodigoDesbloqueo)
        {

            if (Validaciones.ValidaClaveUsuario(ref claveCliente, ref tipoUsuario))
            {
                if (Validaciones.ValidaNip(nip, ref tipoNip))
                {
                    requestLogin(claveCliente, nip, tipoUsuario, tipoNip, tipoCodigoDesbloqueo);
                    validado = true;
                }
                else
                {
                    validado = false;
                }
            }
            else
            {
                validado = false;
            }

        }
コード例 #4
0
 private void validaAccesoBancaTelefonicaSuperNet(ReqValidarNip source, TipoNip tipoNip)
 {
     if (tipoNip == TipoNip.Supernet)
     {
         if (source.tipoOperacion == ClavesOperacion.TarjetaDebito || source.tipoOperacion == ClavesOperacion.NumeroCuenta)
             Services.ValidaNip(base.ServiceRequest, responseValidaNipAsyncComplete, source, tipoNip);
         else
             Services.ValidaNip(base.ServiceRequest, responseValidaNipAsyncComplete2, source, tipoNip);
     }
     else if (tipoNip == TipoNip.BancaTelefonica)
         Services.ValidaNip(base.ServiceRequest, responseValidaNipAsyncComplete2, source, tipoNip);
 }
コード例 #5
0
 private void requestLogin(string claveClient, string nip, TipoClaveUsuario tipoUsuario, TipoNip tipoNip, int tipoCodigoDesbloqueo)
 {
     ReqLogin login = new ReqLogin() { claveCliente = claveClient, nip = nip };
     this._tipoNip = tipoNip;
     this._claveCliente = login.claveCliente;
     this._nip = login.nip;
     this.codigoDesbloqueo = tipoCodigoDesbloqueo;
     Services.Login(base.ServiceRequest, ResponseLogin, login, tipoUsuario);
 }
コード例 #6
0
        private void OnButton_Click(object sender, RoutedEventArgs e)
        {
            string mensaje = string.Empty;
            if (Validaciones(ref mensaje))
            {
                switch (this._flujo)
                {
                    case Flujo.TipoIdentificacion:
                        navigateSelectVista(DesbloqueoViews.Desbloqueo1de3);
                        break;
                    case Flujo.Identificacion:
                        if (Nip1de3TxB.Password.Length >= 6)
                        {
                            if (Nip1de3TxB.Password.Length == 6)
                                tipo = TipoNip.BancaTelefonica;
                            else if (Nip1de3TxB.Password.Length == 8)
                                tipo = TipoNip.Supernet;
                            else
                                tipo = TipoNip.NoValido;
                            if (tipo != TipoNip.NoValido)
                            {
                                this._codigoCliente = CredencialesTxB.Password;
                                this._nip = Nip1de3TxB.Password;
                                this.progress.Show();
                                Santander.TipoClaveUsuario tipoClaveUsuario = TipoClaveUsuario.NoValido;
                                Santander.TipoNip tipoNip = TipoNip.NoValido;
                                string message = string.Empty;
                                if (Santander.Validaciones.ValidaClaveUsuario(ref this._codigoCliente, ref tipoClaveUsuario))
                                {
                                    if (Santander.Validaciones.ValidaNip(this._nip, ref tipoNip))
                                    {
                                        this._desbloqueoDeNipViewModel.GetEstatusNipAccesoAfiliacion(this._codigoCliente, this._nip, (ListaCredencialesDesbloqueo.SelectedItem as ClaveUsuarioItemViewModel).Clave);
                                    }
                                    else
                                    {
                                        MessageBox.Show(TextosPantallas.tMensajeAltaServicio1);
                                    }
                                }
                                else
                                {
                                    MessageBox.Show(TextosPantallas.tIdentificacionNoValida);
                                }
                            }
                            else
                            {
                                MessageBox.Show(TextosFront.frontMensajeNIPIncorrecto);
                            }
                        }
                        else
                        {
                            MessageBox.Show(TextosFront.frontMensajeNIPIncorrecto);
                        }
                        break;
                    case Flujo.NuevoNIPAcceso:
                        bool isValid = true;
                        (App.Current as App).CodigoCliente = this._codigoCliente;
                        if (!string.IsNullOrEmpty(RegistroNipAccesoTxB.Password))
                        {
                            if (!string.IsNullOrEmpty(Nip2de3TxB.Password))
                            {
                                if (RegistroNipAccesoTxB.Password.Equals(Nip2de3TxB.Password))
                                {
                                    TipoNip tipoNip = TipoNip.NoValido;
                                    if (Santander.Validaciones.ValidaNip(RegistroNipAccesoTxB.Password, ref tipoNip))
                                    {
                                        if (Santander.Validaciones.ValidaNuevoNipAcceso(RegistroNipAccesoTxB.Password, () =>
                                        {
                                            this._desbloqueoDeNipViewModel.DiccionarioDatos.ForEach((_) =>
                                            {
                                                if (_.ToLower().Equals(RegistroNipAccesoTxB.Password.ToLower()))
                                                {
                                                    isValid = false;
                                                }
                                            });
                                            return isValid;
                                        }))
                                        {
                                            if (this._desbloqueoDeNipViewModel.SolicitaToken)
                                            {
                                                resDesbloqueo = CasosDeUso.getResultado((Application.Current as App).matrix, CasosDeUso.DESBLOQUEO_NIP.codigoCU, (int)(Application.Current as App).EstatusToken, (int)(Application.Current as App).EstatusSoftToken);
                                                if (null != resDesbloqueo && "TF".Equals(resDesbloqueo.token))
                                                {
                                                    token.Show();
                                                }
                                                else if (null != resDesbloqueo && "ST".Equals(resDesbloqueo.token))
                                                {
                                                    if ("T".Equals(resDesbloqueo.estado) || "B".Equals(resDesbloqueo.estado))
                                                    {
                                                        MessageBox.Show(App.Current.Resources["menuST_msj_XX1"] as String);
                                                    }
                                                    else if ("E".Equals(resDesbloqueo.estado))
                                                    {
                                                        MessageBox.Show(App.Current.Resources["menuST_msj_029"] as String);
                                                        this.NavigateTo(Views._ActivacionView);
                                                    }
                                                    else
                                                    {
                                                        TokenManager.obtenerCore();
                                                        String error = TokenManager.coreInicializadoCorrecto();
                                                        if ("".Equals(error))
                                                        {
                                                            introducirPin.Show(this._desbloqueoDeNipViewModel.IsTokenFinal, CasosDeUso.CODIGO311.tipoOperacion, ((App.Current as App).CodigoCliente.Length == 16 ? (App.Current as App).CodigoCliente.Substring(4) : (App.Current as App).CodigoCliente));
                                                        }
                                                        else
                                                        {
                                                            token.Title = "NIP Dinámico SuperToken";
                                                            token.Show();
                                                        }
                                                    }
                                                }
                                            }
                                            else
                                            {
                                                this.progress.Show();
                                                this._desbloqueoDeNipViewModel.ValidarNipDesbloqueo(RegistroNipAccesoTxB.Password);
                                            }
                                        }
                                        else
                                        {
                                            mensaje = TextosPantallas.tCampoObligatorio8Afiliacion;
                                            isValid = false;
                                        }
                                    }
                                    else
                                    {
                                        mensaje = TextosPantallas.tNIPNoValidoMensajeCompleto;
                                        RegistroNipAccesoTxB.Password = string.Empty;
                                        Nip2de3TxB.Password = string.Empty;
                                        isValid = false;
                                    }
                                }
                                else
                                {
                                    mensaje = TextosPantallas.tNIPConfirmacionNoCorresponde;
                                    RegistroNipAccesoTxB.Password = string.Empty;
                                    Nip2de3TxB.Password = string.Empty;
                                    isValid = false;
                                }
                            }
                            else
                            {
                                mensaje = TextosPantallas.tCampoObligatorio6Afiliacion;
                                isValid = false;
                            }
                        }
                        else
                        {
                            mensaje = TextosPantallas.tCampoObligatorio5Afiliacion;
                            isValid = false;
                        }

                        if (!isValid)
                        {
                            MessageBox.Show(mensaje);
                        }
                        break;
                    case Flujo.Confirmacion:
                        this.NavigateTo(Views._LoginView);
                        break;
                    default:
                        break;
                }
            }
            else
            {
                MessageBox.Show(mensaje);
            }
        }