示例#1
0
        private void lstPTipoCuenta_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            tbxCuenta.Focus();
            if (lstPTipoCuenta.SelectedIndex >= 0)
            {
                TipoCuentaAltaItemViewModel item = lstPTipoCuenta.SelectedItem as TipoCuentaAltaItemViewModel;
                if (!object.ReferenceEquals(item, null))
                {
                    _vm.TipoCuentaSeleccionada = item;
                    BancoItemViewModel bancoSelected = new BancoItemViewModel();

                    if (!_vm.TipoCuentaSeleccionada.Clave.Equals(ClavesOtros.TipoCuentaTercero) &&
                        !_vm.TipoCuentaSeleccionada.Clave.Equals(ClavesOtros.TipoCuentaDestino))
                    {
                        if (lstPBanco.Items.Count <= 0)
                        {
                            lstPBanco.ItemsSource = _vm.Bancos;
                        }
                        bancoSelected = _vm.Bancos.Where(_ => _.Clave.Equals(ClavesOtros.BancoSantander)).FirstOrDefault();
                        if (!object.ReferenceEquals(bancoSelected, null))
                        {
                            if (bancoSelected.Nombre.Equals(ClavesOtros.NombreBancoSantander))
                            {
                                _vm.Bancos.Remove(bancoSelected);
                                lstPBanco.ItemsSource = _vm.Bancos;
                                bancoSelected = _vm.Bancos.Where(_ => !_.Clave.Equals(ClavesOtros.BancoSantander)).FirstOrDefault();
                                if (!object.ReferenceEquals(bancoSelected, null))
                                {
                                    try
                                    {
                                        lstPBanco.SelectedItem = bancoSelected;
                                    }
                                    catch
                                    { }
                                }
                            }
                        }
                        else
                        {
                            bancoSelected = _vm.Bancos.Where(_ => !_.Clave.Equals(ClavesOtros.BancoSantander)).FirstOrDefault();
                            if (!object.ReferenceEquals(bancoSelected, null))
                            {
                                try
                                {
                                    lstPBanco.SelectedItem = bancoSelected;
                                }
                                catch
                                { }
                            }
                        }
                        if (_vm.TipoCuentaSeleccionada.TipoCuenta.ToString().Equals(Santander.TipoCuenta.CI.ToString()))
                        {
                            lstPBanco.IsEnabled = false;
                            try
                            {
                                BancoItemViewModel bancoSelectedST = new BancoItemViewModel();
                                bancoSelectedST.Clave = "";
                                bancoSelectedST.Nombre = "";
                                bancoSelected = _vm.Bancos.Where(_ => _.Clave.Equals(string.Empty)).FirstOrDefault();
                                if (!object.ReferenceEquals(bancoSelected, null))
                                {
                                    try
                                    {
                                        lstPBanco.SelectedItem = bancoSelected;
                                    }
                                    catch
                                    { }
                                }
                                else
                                {
                                    _vm.Bancos.Add(bancoSelectedST);
                                    bancoSelected = _vm.Bancos.Where(_ => _.Clave.Equals(string.Empty)).FirstOrDefault();
                                    if (!object.ReferenceEquals(bancoSelected, null))
                                    {
                                        try
                                        {
                                            lstPBanco.SelectedItem = bancoSelected;
                                        }
                                        catch
                                        { }
                                    }
                                }
                            }
                            catch
                            { }
                        }
                        else
                        {
                            lstPBanco.IsEnabled = true;
                        }
                    }
                    else
                    {
                        BancoItemViewModel bancoSelectedST = new BancoItemViewModel();
                        bancoSelectedST.Clave = ClavesOtros.BancoSantander;
                        bancoSelectedST.Nombre = ClavesOtros.NombreBancoSantander;
                        bancoSelected = _vm.Bancos.Where(_ => _.Clave.Equals(ClavesOtros.BancoSantander)).FirstOrDefault();
                        if (lstPBanco.Items.Count <= 0)
                        {
                            _vm.Bancos.Add(bancoSelectedST);
                            lstPBanco.ItemsSource = _vm.Bancos;
                            bancoSelected = _vm.Bancos.Where(_ => _.Clave.Equals(ClavesOtros.BancoSantander)).FirstOrDefault();
                            if (!object.ReferenceEquals(bancoSelected, null))
                            {
                                try
                                {
                                    lstPBanco.SelectedItem = bancoSelected;
                                }
                                catch
                                { }
                            }
                        }
                        else if (!object.ReferenceEquals(bancoSelected, null))
                        {
                            if (!bancoSelected.Nombre.Equals(ClavesOtros.NombreBancoSantander))
                            {
                                _vm.Bancos.Add(bancoSelectedST);
                                bancoSelected = _vm.Bancos.Where(_ => _.Clave.Equals(ClavesOtros.BancoSantander)).FirstOrDefault();
                                if (!object.ReferenceEquals(bancoSelected, null))
                                {
                                    try
                                    {
                                        lstPBanco.SelectedItem = bancoSelected;
                                    }
                                    catch
                                    { }
                                }
                            }
                        }
                        else
                        {
                            _vm.Bancos.Add(bancoSelectedST);
                            bancoSelected = _vm.Bancos.Where(_ => _.Clave.Equals(ClavesOtros.BancoSantander)).FirstOrDefault();
                            if (!object.ReferenceEquals(bancoSelected, null))
                            {
                                try
                                {
                                    lstPBanco.SelectedItem = bancoSelected;
                                }
                                catch
                                { }
                            }
                        }
                        lstPBanco.IsEnabled = false;
                    }

                    InputScope scope = new InputScope();
                    InputScopeName name = new InputScopeName();

                    if (item.IsMovil)
                    {
                        name.NameValue = InputScopeNameValue.TelephoneNumber;
                        tbxCuenta.MaxLength = 10;
                        gContactos.Visibility = System.Windows.Visibility.Visible;
                        tbCuentaOrigen.Text = TextosPantallas.tNumeroTelefonoMovil;
                    }
                    else
                    {
                        name.NameValue = InputScopeNameValue.Number;
                        gContactos.Visibility = System.Windows.Visibility.Collapsed;
                        tbCuentaOrigen.Text = TextosPantallas.tCuentaAlta;
                        if (_vm.TipoCuentaSeleccionada.Clave.Equals(ClavesOtros.CuentaInterbancaria))
                        {
                            tbxCuenta.MaxLength = 18;
                        }
                        else
                        {
                            tbxCuenta.MaxLength = 11;
                        }
                    }

                    scope.Names.Add(name);
                    tbxCuenta.InputScope = scope;
                }
            }
        }
示例#2
0
        private void Paso2_3()
        {
            Resultado res = 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(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;
            w2_3.Visibility = System.Windows.Visibility.Visible;
            w3_3.Visibility = System.Windows.Visibility.Collapsed;
            btnProcess.Content = TextosBotones.bConfirmar;

            if (_vm.TipoCuentaSeleccionada.IsMovil)
            {
                tbTitular.Visibility = System.Windows.Visibility.Collapsed;
                tbTitularResult.Visibility = System.Windows.Visibility.Collapsed;

                tbTitularMovil.Visibility = System.Windows.Visibility.Visible;
                tbTitularMovilResult.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                tbTitular.Visibility = System.Windows.Visibility.Visible;
                tbTitularResult.Visibility = System.Windows.Visibility.Visible;

                tbTitularMovil.Visibility = System.Windows.Visibility.Collapsed;
                tbTitularMovilResult.Visibility = System.Windows.Visibility.Collapsed;
            }

            string tipo = _vm.TipoCuentaSeleccionada.TipoCuenta.ToString();
            if (!string.IsNullOrEmpty(_vm.Banco) && tipo.Equals(Santander.TipoCuenta.CI.ToString()))
            {
                BancoItemViewModel bancoSelected = _vm.Bancos.Where(_ => _.Nombre.Equals(_vm.Banco)).FirstOrDefault();
                if (!object.ReferenceEquals(bancoSelected, null))
                {
                    try
                    {
                        lstPBanco.SelectedItem = bancoSelected;
                    }
                    catch
                    { }
                }
                else
                {
                    BancoItemViewModel bancoSelectedST = new BancoItemViewModel();
                    bancoSelectedST.Clave = tbxCuenta.Text.Substring(0, 3).ToString();
                    bancoSelectedST.Nombre = _vm.Banco;
                    bancoSelected = _vm.Bancos.Where(_ => _.Clave.Equals(bancoSelectedST.Clave)).FirstOrDefault();
                    if (!object.ReferenceEquals(bancoSelected, null))
                    {
                        try
                        {
                            lstPBanco.SelectedItem = bancoSelected;
                        }
                        catch
                        { }
                    }
                    else
                    {
                        _vm.BancoSeleccionado = bancoSelectedST;
                    }
                    
                }
            }

            _vm.Titular = !string.IsNullOrEmpty(_vm.Titular) ? _vm.Titular : tbxTitular.Text;
            _vm.Alias = tbxAlias.Text;
            _flujo = FlujoAltaCuenta.Confirmacion;
        }