Beispiel #1
0
        private void Paso2_3()
        {
            res = CasosDeUso.getResultado((App.Current as App).matrix, CasosDeUso.ACTUALIZACION_DATOS.codigoCU, (int)(App.Current as App).EstatusToken, (int)(App.Current as App).EstatusSoftToken);
            if (!("TF".Equals(res.token))){
                TokenManager.obtenerCore();
                String error = TokenManager.coreInicializadoCorrecto();
                if ("".Equals(error))
                {
                    tLeyendaJuridicoSuperToken.Text = TextosPantallas.tLeyendaJuridicoSuperToken + TextosBotones.bConfirmar;
                    w2_3_ST.Visibility = System.Windows.Visibility.Visible;
                }                
            }
            w1_3.Visibility = System.Windows.Visibility.Collapsed;
            w1_3_MensajeAltaST2.Visibility = System.Windows.Visibility.Collapsed;
            w2_3.Visibility = System.Windows.Visibility.Visible;
            w3_3.Visibility = System.Windows.Visibility.Collapsed;

            this._vm.TelefonoCelular = tbxTelefonoCelular.Text;
            this._vm.CorreoElectronico = tbxCorreoElectronico.Text;

            tClienteCompania.Text = tbxCompaniaCelular.Text;
            tClienteTelefono.Text = tbxTelefonoCelular.Text;
            tClienteEmail.Text = tbxCorreoElectronico.Text;
            btnProceso.Content = TextosBotones.bConfirmar;
            this._flujo = Flujo.Confirmacion;
            progress.Hide();
        }
Beispiel #2
0
        private void btnProceso_Click(object sender, RoutedEventArgs e)
        {
            string mensaje = string.Empty;
            switch (this._flujo)
            {
                case Flujo.Datos:
                    if (Valida1_3(ref mensaje))
                    {
                        if (Validaciones.ValidaCorreoElectronico(tbxCorreoElectronico.Text))
                        {
                            Paso2_3();
                        }
                        else
                        {
                            mensaje = TextosPantallas.tEmailNoValido;
                        }
                    }
                    break;
                case Flujo.Confirmacion:
                    res = CasosDeUso.getResultado((App.Current as App).matrix, CasosDeUso.ACTUALIZACION_DATOS.codigoCU, (int)(App.Current as App).EstatusToken, (int)(App.Current as App).EstatusSoftToken);
                            TokenManager.obtenerCore();
                            String mensajeError = TokenManager.coreInicializadoCorrecto();
                        
                            if ("TF".Equals(res.token))
                            {
                                token.Show();
                            }
                            else if (!"".Equals(mensajeError))
                            {
                                token.Title = "NIP Dinámico SuperToken";
                                token.Show();
                            }
                            else
                            {                                
                                introducirPin.Show(_vm.IsTokenFinal, ClavesOperacion.AltaSuperToken, (App.Current as App).CodigoCliente);                                
                            }
                        
                    
                    break;
                case Flujo.Actualizar:
                    //NavigationService.GoBack();
                    btnProceso.Visibility = System.Windows.Visibility.Collapsed;
                    this.NavigateTo(Views._ActivacionView + "?privado=" + 1);
                    break;
            }

            if (!string.IsNullOrEmpty(mensaje))
            {
                MessageBox.Show(mensaje);
            }
        }
        private void capturarToken(String operacion)
        {
             resul = CasosDeUso.getResultado((Application.Current as App).matrix, CasosDeUso.getCodigoCU(operacion), (int)(Application.Current as App).EstatusToken, (int)(Application.Current as App).EstatusSoftToken);

            if (this._vm.IsTokenInicial)
            {
                progress.Hide();
                if ("TF".Equals(resul.token))
                {
                    token.Show();
                }
                else
                {
                    TokenManager.obtenerCore();
                    String error = TokenManager.coreInicializadoCorrecto();

                    if ("".Equals(error))
                    {
                        introducirPin.Show(this._vm.IsTokenFinal, ClavesOperacion.Codigo311, (App.Current as App).CodigoCliente);
                    }
                    else
                    {
                        token.Title = "NIP Dinámico SuperToken";
                        token.Show();
                        //MessageBox.Show(error);
                    }
                }
            }
        }
Beispiel #4
0
        void _vm_ProcesoError(Global.ViewModelEventArgs e)
        {
            progress.Hide();
            if (e.ErrorInMakingRequest)
            {
                MessageBox.Show(TextosFront.frontMensajeErrorConexion);
            }
            else
            {
                e.Error.message = !string.IsNullOrEmpty(e.Error.message) ? e.Error.message : TextosFront.frontMensajeErrorConexion;
                switch (e.Error.clave)
                {
                    case Errors.Token.BLOQUEO_TEMPORAL_TOKEN:
                        res = CasosDeUso.getResultado((App.Current as App).matrix, CasosDeUso.ACTUALIZACION_DATOS.codigoCU, (int)(App.Current as App).EstatusToken, (int)(App.Current as App).EstatusSoftToken);
                        if ((EstatusToken)Enum.Parse(typeof(EstatusToken), res.getEstado(), true) != EstatusToken.T)
                        {
                            if ("TF".Equals(res.token))
                            {
                                (Application.Current as App).EstatusToken = EstatusToken.T;
                            }
                            else
                            {
                                (Application.Current as App).EstatusSoftToken = EstatusToken.T;
                            }
                        }

                        MessageBox.Show(TextosFront.frontMensajeTokenBloqueadoTemporal2, string.Empty, MessageBoxButton.OK);
                        break;
                    default:
                        MessageBox.Show(e.Error.message);
                        break;
                }
            }
        }
        void _vm_ValidaAccesoComplete(Model.Dto.DtoValidaAcceso e)
        {
            progress.Hide();
            string operacion = !string.IsNullOrEmpty(e.operacion) ? e.operacion : ClavesOperacion.TransferenciaCuentasTerceros;


            if (operacion.Equals(ClavesOperacion.ConsultaCuentasRegistradas))
            {
                this._navigation = Navigation.ConsultaCuentasRegistradas;
            }
            if (operacion.Equals(ClavesOperacion.AltaCuenta))
            {
                this._navigation = Navigation.AltaCuenta;
            }
            if (operacion.Equals(ClavesOperacion.BajaCuenta))
            {
                this._navigation = Navigation.BajaCuenta;
            }
            if (operacion.Equals(ClavesOperacion.TransferenciaCuentasTerceros))
            {
                this._navigation = Navigation.CuentasTerceros;
            }

            if (!this._vm.EstatusTokenValido)
            {
                Redirect();
                return;
            }
            else
            {
                if (this._vm.IsTokenInicial)
                {
                     resul = CasosDeUso.getResultado((Application.Current as App).matrix, CasosDeUso.getCodigoCU(operacion), (int)(Application.Current as App).EstatusToken, (int)(Application.Current as App).EstatusSoftToken);
                    if (null != resul && "TF".Equals(resul.token))
                    {
                        token.Show();
                    }
                    else if (null != resul && "ST".Equals(resul.token))
                    {
                        TokenManager.obtenerCore();
                        String error = TokenManager.coreInicializadoCorrecto();
                        if ("".Equals(error))
                        {
                            if (operacion.Equals(ClavesOperacion.TransferenciaCuentasTerceros))
                            {
                                introducirPin.Show(this._vm.IsTokenFinal, e.operacion != null ? e.operacion : ClavesOperacion.TransferenciaCuentasTerceros, (App.Current as App).CodigoCliente, CasosDeUso.Mexicanpeso, tbxImporte.Text, this._vm.CuentaOrigen.NoCuenta, this._vm.CuentaDestino.NumeroCuenta);
                            }
                            else
                            {
                                introducirPin.Show(this._vm.IsTokenFinal, operacion, (App.Current as App).CodigoCliente);
                            }
                        }
                        else
                        {
                            token.Title = "NIP Dinámico SuperToken";
                            token.Show();
                        }
                    }
                }
                else
                {
                    switch (this._navigation)
                    {
                        case Navigation.ConsultaCuentasRegistradas:
                            this.NavigateTo(Views._ConsultaCuentasRegistradasView);
                            break;
                        case Navigation.AltaCuenta:
                            InitAltaCuentaViewModel();
                            break;
                        case Navigation.BajaCuenta:
                            InitBajaCuentaViewModel();
                            break;
                    }
                }
            }
        }
        private void btnProcess_Click(object sender, RoutedEventArgs e)
        {
            switch (this._flujo)
            {
                case FlujoTransferenciaTercero.Cuentas:
                    string mensaje = string.Empty;
                    if (Valida_1_3(ref mensaje))
                    {
                        Resultado res = CasosDeUso.getResultado((Application.Current as App).matrix, CasosDeUso.getCodigoCU(ClavesOperacion.TransferenciaCuentasTerceros), (int)(Application.Current as App).EstatusToken, (int)(Application.Current as App).EstatusSoftToken);
                        if (!("TF".Equals(res.token))){
                            TokenManager.obtenerCore();
                            String error = TokenManager.coreInicializadoCorrecto();
                            if ("".Equals(error))
                            {
                                tLeyendaJuridicoSuperToken.Text = TextosPantallas.tLeyendaJuridicoSuperToken + TextosBotones.bConfirmar;
                                w2_3_ST.Visibility = System.Windows.Visibility.Visible;
                            }                                                     
                        }
                        Paso2_3();
                    }
                    else
                    {
                        MessageBox.Show(mensaje);
                    }
                    break;
                case FlujoTransferenciaTercero.Confirmacion:
                    if (this._vm.IsTokenFinal)
                    {
                         resul = CasosDeUso.getResultado((Application.Current as App).matrix, CasosDeUso.getCodigoCU(ClavesOperacion.TransferenciaCuentasTerceros), (int)(Application.Current as App).EstatusToken, (int)(Application.Current as App).EstatusSoftToken);
                        if ("TF".Equals(resul.token))
                        {
                            token.Show(true);
                        }
                        else
                        {
                            TokenManager.obtenerCore();
                            String error = TokenManager.coreInicializadoCorrecto();
                            if ("".Equals(error))
                            {
                                introducirPin.Show(this._vm.IsTokenFinal, ClavesOperacion.TransferenciaCuentasTerceros, (App.Current as App).CodigoCliente, CasosDeUso.Mexicanpeso, tbxImporte.Text, this._vm.CuentaOrigen.NoCuenta, this._vm.CuentaDestino.NumeroCuenta, "", "", "", "");
                            }
                            else
                            {
                                token.Title = "NIP Dinámico SuperToken";
                                token.Show();
                            }

                        }
                    }
                    else
                    {
                        progress.Show();
                        double importe = !string.IsNullOrEmpty(tbxImporte.Text) ? Convert.ToDouble(tbxImporte.Text) : 0;
                        double iva = !string.IsNullOrEmpty(tbxIva.Text) ? Convert.ToDouble(tbxIva.Text) : 0;
                        this._vm.TransferirCuentaTercero(importe, tbxConcepto.Text, tbxRFC.Text, iva);
                        this._vm.emptyValues();
                    }
                    break;
            }
        }
Beispiel #7
0
        private void btnProcess_Click(object sender, RoutedEventArgs e)
        {
            switch (this._flujo)
            {
                case FlujoAltaCuenta.Cuenta:
                    _vm.Titular = tbxTitular.Text;
                    string numeroCuenta = tbxCuenta.Text;
                    string mensaje = string.Empty;
                    if (ValidaCampos(ref mensaje))
                    {
                        progress.Show();
                        this._vm.ValidaCuenta(numeroCuenta, this._vm.BancoSeleccionado.Clave);
                    }
                    else
                    {
                        MessageBox.Show(mensaje);
                    }
                    break;
                case FlujoAltaCuenta.Confirmacion:

                    if (this._vm.IsTokenFinal)
                    {
                        resul = CasosDeUso.getResultado((Application.Current as App).matrix, CasosDeUso.getCodigoCU(ClavesOperacion.AltaCuenta), (int)(Application.Current as App).EstatusToken, (int)(Application.Current as App).EstatusSoftToken);
                        if ("TF".Equals(resul.token))
                        {
                            token.Show();
                        }
                        else
                        {
                            TokenManager.obtenerCore();
                            String error = TokenManager.coreInicializadoCorrecto();

                            if ("".Equals(error))
                            {
                                String cuenta = tbxCuenta.Text.Length > 12 ? tbxCuenta.Text.Substring(tbxCuenta.Text.Length - 12) : tbxCuenta.Text;
                                introducirPin.Show(this._vm.IsTokenFinal, ClavesOperacion.AltaCuenta, (App.Current as App).CodigoCliente, "", "", "", cuenta);
                            }
                            else
                            {
                                token.Title = "NIP Dinámico SuperToken";
                                token.Show();
                            }
                        }
                    }
                    else
                    {
                        progress.Show();
                        this._vm.RegistraCuenta();
                    }
                    break;
            }
        }
        private void btnProceso_Click(object sender, RoutedEventArgs e)
        {
            string mensaje = string.Empty;
            switch (this._flujo)
            {
                case Flujo.Datos:
                    if (Valida1_3(ref mensaje))
                    {
                        if (Validaciones.ValidaCorreoElectronico(tbxCorreoElectronico.Text))
                        {
                            Paso2_3();
                        }
                        else
                        {
                            mensaje = TextosPantallas.tEmailNoValido;
                        }
                    }
                    break;
                case Flujo.Confirmacion:
                    resu = CasosDeUso.getResultado((App.Current as App).matrix, CasosDeUso.ACTUALIZACION_DATOS.codigoCU, (int)(App.Current as App).EstatusToken, (int)(App.Current as App).EstatusSoftToken);
                    if ((EstatusToken)Enum.Parse(typeof(EstatusToken), resu.getEstado(), true) != EstatusToken.A)
                    {
                        mensaje = TextosFront.frontMensajeActualizarDatos01;
                    }
                    else
                    {
                        if (this._vm.IsTokenFinal)
                        {
                            if ("TF".Equals(resu.token))
                            {
                                token.Show();
                            }
                            else
                            {
                                TokenManager.obtenerCore();
                                mensaje = TokenManager.coreInicializadoCorrecto();
                                if ("".Equals(mensaje))
                                {
                                    introducirPin.Show(_vm.IsTokenFinal, ClavesOperacion.ActualizarDatosPersonales, (App.Current as App).CodigoCliente);
                                }
                                else
                                {
                                    token.Title = "NIP Dinámico SuperToken";
                                    token.Show();
                                    mensaje = string.Empty;
                                }
                            }
                        }
                        else
                        {
                            progress.Show();
                            this._vm.ActualizarDatosCliente();
                            return;
                        }
                    }
                    break;
                case Flujo.Actualizar:
                    NavigationService.GoBack();
                    break;
            }

            if (!string.IsNullOrEmpty(mensaje))
            {
                MessageBox.Show(mensaje);
            }
        }
        private void insertToken(Resultado res, string operacion = "")
        {
            Progress.Hide();
            if ("TF".Equals(res.token))
            {
                token.Show();
            }
            else if ("ST".Equals(res.token))
            {
                TokenManager.obtenerCore();
                String error = TokenManager.coreInicializadoCorrecto();

                if ("".Equals(error))
                {
                    introducirPin.Show(this._movimientosCuentasViewModel.IsTokenFinal, "".Equals(operacion) ? ClavesOperacion.ConsultaBitacora : operacion, (App.Current as App).CodigoCliente);
                }
                else
                {
                    token.Title = "NIP Dinámico SuperToken";
                    token.Show();
                }
            }
        }
Beispiel #10
0
        void _vm_ValidaAccesoComplete(Model.Dto.DtoValidaAcceso e)
        {
            progress.Hide();
            if (!string.IsNullOrEmpty(e.operacion))
            {
                string operacion = e.operacion;
                if (operacion.Equals(ClavesOperacion.ConsultaCuentasRegistradas))
                {
                    this._navigation = Navigation.ConsultaCuentasRegistradas;
                }
            }
            else
            {
                this._navigation = Navigation.AltaCuenta;
            }

            if (!this._vm.EstatusTokenValido)
            {
                Redirect();
                return;
            }
            else
            {
                if (this._vm.IsTokenInicial)
                {
                    resul = CasosDeUso.getResultado((Application.Current as App).matrix, CasosDeUso.getCodigoCU(e.operacion), (int)(Application.Current as App).EstatusToken, (int)(Application.Current as App).EstatusSoftToken);
                    if ("TF".Equals(resul.token))
                    {
                        token.Show();
                    }
                    else
                    {
                        TokenManager.obtenerCore();
                        String error = TokenManager.coreInicializadoCorrecto();

                        if ("".Equals(error))
                        {
                            if (e.operacion.Equals(ClavesOperacion.ConsultaCuentasRegistradas))
                            {
                                introducirPin.Show(this._vm.IsTokenFinal, ClavesOperacion.ConsultaCuentasRegistradas, (App.Current as App).CodigoCliente);
                            }
                            else
                            {
                                String cuenta = tbxCuenta.Text.Length > 12 ? tbxCuenta.Text.Substring(tbxCuenta.Text.Length - 12) : tbxCuenta.Text;
                                introducirPin.Show(this._vm.IsTokenFinal, ClavesOperacion.AltaCuenta, (App.Current as App).CodigoCliente, "", "", "", cuenta);
                            }

                        }
                        else
                        {
                            token.Title = "NIP Dinámico SuperToken";
                            token.Show();
                        }
                    }
                }
                else
                {
                    switch (this._navigation)
                    {
                        case Navigation.ConsultaCuentasRegistradas:
                            this.NavigateTo(Views._ConsultaCuentasRegistradasView);
                            break;
                    }
                }
            }
        }
        void _movimientosCuentasViewModel_ValidaAccesoComplete(Model.Dto.DtoValidaAcceso e)
        {
            string operacion = e.operacion;


            this._movimientosCuentasViewModel.IsTokenInicial = Convert.ToBoolean(e.isToken);
            this._movimientosCuentasViewModel.IsTokenFinal = Convert.ToBoolean(e.isTokenFinal);

            this._limiteImporte = !string.IsNullOrEmpty(e.limiteImporte) ? Convert.ToDouble(e.limiteImporte) : 0;
            this._limiteAcumulado = !string.IsNullOrEmpty(e.limiteAcumulado) ? Convert.ToDouble(e.limiteAcumulado) : 0;

            if (!string.IsNullOrEmpty(operacion))
            {
                int cu = CasosDeUso.getCodigoCU(operacion);
                resul = CasosDeUso.getResultado((Application.Current as App).matrix, cu, (int)(Application.Current as App).EstatusToken, (int)(Application.Current as App).EstatusSoftToken);
                EstatusToken estado = (EstatusToken)Enum.Parse(typeof(EstatusToken), resul.estado, true);

                if (operacion.Equals(ClavesOperacion.DetalleDeCuentaCheques))
                {
                    if (this._movimientosCuentasViewModel.IsTokenInicial)
                    {
                        if (this._movimientosCuentasViewModel.EstatusTokenValido)
                        {
                            insertToken(resul, ClavesOperacion.DetalleDeCuentaCheques);
                        }
                        else
                            Redirect(estado);
                    }
                    else
                    {
                        if (this._movimientosCuentasViewModel.EstatusTokenValido)
                        {
                            NavigationService.Navigate(new Uri(String.Format(Application.Current.Resources["DetalleDeCuentaView"] as string + "?AppTitle={0}&Cuenta={1}&divisa={2}"
                              , _pageTitle, _noCuenta, _divisa), UriKind.Relative));
                            desactivaEventos();
                        }
                        else
                            Redirect(estado);
                    }
                }

                if (operacion.Equals(ClavesOperacion.ConsultaBitacora))
                {
                    if (this._movimientosCuentasViewModel.IsTokenInicial)
                    {
                        if (this._movimientosCuentasViewModel.EstatusTokenValido)
                        {
                            insertToken(resul);
                        }
                        else
                            Redirect(estado);

                    }
                    else
                    {
                        if (this._movimientosCuentasViewModel.EstatusTokenValido)
                        {
                            NavigationService.Navigate(new Uri(String.Format(Application.Current.Resources["ConsultaBitacoraOperacionesView"] as string + "?NoCuenta={0}&divisa={1}&isTokenFinal={2}"
                            , _noCuenta, _divisa, this._movimientosCuentasViewModel.IsTokenFinal), UriKind.Relative));
                            desactivaEventos();
                        }
                        else
                            Redirect(estado);
                    }
                }

                if (operacion.Equals(ClavesOperacion.TransferenciaCuentasPropias))
                {
                    if (this._limiteImporte <= this._limiteAcumulado)
                    {
                        MessageBox.Show(TextosFront.frontMensajeLimiteImporte1);
                    }
                    else
                    {
                        if (this._movimientosCuentasViewModel.IsTokenInicial)
                        {
                            if (this._movimientosCuentasViewModel.EstatusTokenValido)
                            {
                                insertToken(resul);
                            }
                            else
                                Redirect(estado);
                        }
                        else
                        {
                            if (this._movimientosCuentasViewModel.EstatusTokenValido)
                            {
                                InitViewModel(this._navigation);
                            }
                            else
                                Redirect(estado);
                        }
                    }
                }


                if (operacion.Equals(ClavesOperacion.TransferenciaCuentasTerceros))
                {
                    if (this._limiteImporte <= this._limiteAcumulado)
                    {
                        MessageBox.Show(TextosFront.frontMensajeLimiteImporte1);
                    }
                    else
                    {
                        if (this._movimientosCuentasViewModel.IsTokenInicial)
                        {
                            if (this._movimientosCuentasViewModel.EstatusTokenValido)
                            {
                                insertToken(resul);
                            }
                            else
                                Redirect(estado);
                        }
                        else
                        {
                            if (this._movimientosCuentasViewModel.EstatusTokenValido)
                            {
                                InitViewModel(this._navigation);
                            }
                            else
                                Redirect(estado);
                        }
                    }
                }

                if (operacion.Equals(ClavesOperacion.TransferenciaOtrosBancos))
                {
                    if (this._limiteImporte <= this._limiteAcumulado)
                    {
                        MessageBox.Show(TextosFront.frontMensajeLimiteImporte1);
                        Progress.Hide();
                    }
                    else
                    {
                        if (!this._movimientosCuentasViewModel.EstatusTokenValido)
                        {
                            Redirect(estado);
                            return;
                        }
                        else
                        {
                            if (this._movimientosCuentasViewModel.IsTokenInicial)
                            {
                                insertToken(resul);
                            }
                            else
                            {
                                InitViewModel(this._navigation);
                            }
                        }
                    }
                }

                if (operacion.Equals(ClavesOperacion.PagoServicio))
                {
                    if (this._movimientosCuentasViewModel.IsTokenInicial)
                    {
                        if (this._movimientosCuentasViewModel.EstatusTokenValido)
                        {
                            insertToken(resul);
                        }
                        else
                            Redirect(estado);
                    }
                    else
                    {
                        if (this._movimientosCuentasViewModel.EstatusTokenValido)
                        {
                            InitViewModel(this._navigation);
                        }
                        else
                            Redirect(estado);
                    }

                }

            }
            else
            {
                Progress.Hide();
                MessageBox.Show(TextosFront.frontMensajeErrorConexion);
                this._navigation = MovimientosViews.MovimientosCuentasView;
            }
        }
        private void btnProceso_Click(object sender, RoutedEventArgs e)
        {
            switch (this._flujo)
            {
                case Flujo.Confirmacion:
                    if (this._vm.IsTokenFinal)
                    {
                        resul = CasosDeUso.getResultado((Application.Current as App).matrix, CasosDeUso.getCodigoCU(ClavesOperacion.AltaPagoServicio), (int)(Application.Current as App).EstatusToken, (int)(Application.Current as App).EstatusSoftToken);
                        if ("TF".Equals(resul.token))
                        {
                            token.Show(true);
                        }
                        else if ("ST".Equals(resul.token))
                        {
                            TokenManager.obtenerCore();
                            String error = TokenManager.coreInicializadoCorrecto();

                            if ("".Equals(error))
                            {
                                //TODO De momento ponemos la emisora porque aparentemente no tiene cuenta
                                introducirPin.Show(this._vm.IsTokenFinal, ClavesOperacion.AltaPagoServicio, (App.Current as App).CodigoCliente, "", "", "", this._vm.Servicio.Source.convenio.Trim());
                            }
                            else
                            {
                                token.Title = "NIP Dinámico SuperToken";
                                token.Show();
                            }
                        }
                    }
                    else
                    {
                        //TODO Que pasaria si ocurre esto con TipoOtp?
                        progress.Show();
                        this._vm.RegistrarSrv();
                    }
                    break;
                case Flujo.AltaServicio:
                    NavigationService.GoBack();
                    break;
            }
        }
Beispiel #13
0
        public static Resultado[, ,] cargarCSVResToken()
        {
            Resultado[, ,] matrix = new Resultado[27, 5, 5];
            String line = "";
            try
            {

                var ResrouceStream = Application.GetResourceStream(new Uri("Resources/ValidacionesAccesoModulo.csv", UriKind.Relative));
                if (ResrouceStream != null)
                {
                    Stream myFileStream = ResrouceStream.Stream;
                    if (myFileStream.CanRead)
                    {
                        StreamReader myStreamReader = new StreamReader(myFileStream);

                        while ((line = myStreamReader.ReadLine()) != null)
                        {
                            String[] RowData = line.Split(';');
                            Resultado res = null;
                            int cu = Int32.Parse(RowData[0]);
                            String statusTK = RowData[1];
                            String statusST = RowData[2];
                            String resToken = RowData[3];
                            String tokenPrevalece = RowData[4];
                            res = new Resultado(resToken, tokenPrevalece);
                            matrix[cu % 201, (int)EstadoToken.crear(statusTK), (int)EstadoToken
                                    .crear(statusST)] = res;
                        }
                        myStreamReader.Close();
                        return matrix;
                    }
                }
            }
            catch (Exception)
            {
                Debug.WriteLine("Error al leer el archivo");
            }
            return null;
        }
Beispiel #14
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);
            }
        }
 private static bool isShowMensaje(Resultado res)
 {
     bool isShow = false;
     switch ((EstatusToken)Enum.Parse(typeof(EstatusToken), res.estado, true))
     {
         case EstatusToken.N:
             MessageBox.Show(App.Current.Resources["menuST_msj_023"] as String);
             isShow = true;
             break;
         case EstatusToken.E:
             if ("ST".Equals(res.token))
             {
                 if (MessageBox.Show(App.Current.Resources["menuST_msj_035"] as String) == MessageBoxResult.OK)
                 {
                     navegarActivacion = "OK";
                 }
                 else
                 {
                     navegarActivacion = "";
                 }
             }
             else
             {
                 MessageBox.Show(App.Current.Resources["menuST_msj_024"] as String);
             }
             isShow = true;
             break;
         case EstatusToken.B:
             MessageBox.Show(App.Current.Resources["menuST_msj_024"] as String);
             isShow = true;
             break;
         case EstatusToken.T:
             String mensaje = App.Current.Resources["menuST_msj_022"] as String;
             MessageBox.Show(mensaje.Replace("(nombre del cliente)", (App.Current as App).dtoLogin.nombre));
             isShow = true;
             break;
     }
     return isShow;
 }
        private void OnLimitesImportes2de3Button_Click(object sender, RoutedEventArgs e)
        {
            this._view = views.LimitesImportes3de3;
            resul = CasosDeUso.getResultado((App.Current as App).matrix, CasosDeUso.CONFIGURACION_LIMITE_IMPORTES.codigoCU, (int)(App.Current as App).EstatusToken, (int)(App.Current as App).EstatusSoftToken);
            if ("TF".Equals(resul.token))
            {
                token.Show(true);
            }
            else
            {
                TokenManager.obtenerCore();
                String error = TokenManager.coreInicializadoCorrecto();

                if ("".Equals(error))
                {
                    introducirPin.Show(this._vm.IsTokenFinal, ClavesOperacion.ConfiguracionLimitesImportes, (App.Current as App).CodigoCliente);
                }
                else
                {
                    token.Title = "NIP Dinámico SuperToken";
                    token.Show();                 
                }
            }

        }
Beispiel #17
0
 public static Resultado getResultado(Resultado[, ,] matrix, int cu, int statusTF, int statusST)
 {
     Resultado res = matrix[cu % 201, statusTF, statusST];
     if (res == null)
     {
         res = matrix[CONSULTA_BITACORA.codigoCU % 201, statusTF, statusST];
     }
     return res;
 }