Пример #1
0
        public LoginView()
        {
            InitializeComponent();

            Timer          = new DispatcherTimer();
            Timer.Interval = TimeSpan.FromMilliseconds(300);
            Timer.Tick    += new EventHandler(RefreshUIListaFisioterapuetas);
            Timer.Start();
            txtUsuario.Focus();
            Loading.Visibility = System.Windows.Visibility.Hidden;


            worker.DoWork             += worker_DoWork;
            worker.RunWorkerCompleted += worker_RunWorkerCompleted;

            lblChangePassword.Visibility   = System.Windows.Visibility.Hidden;
            btnCrearCuentaAdmin.Visibility = System.Windows.Visibility.Hidden;


            //Validate if admin user exist
            blnUserAdminExist = AdministradorDL.UserAdminExist();
            if (!blnUserAdminExist)
            {
                btnLogin.Visibility            = System.Windows.Visibility.Hidden;
                btnCancel.Visibility           = System.Windows.Visibility.Hidden;
                lblChangePassword.Visibility   = System.Windows.Visibility.Visible;
                btnCrearCuentaAdmin.Visibility = System.Windows.Visibility.Visible;
            }
        }
Пример #2
0
        private void btnCrearCuentaAdmin_Click(object sender, RoutedEventArgs e)
        {
            var passwordBox = pbContrasena as PasswordBox;

            if (ValidateFields(passwordBox.Password, txtUsuario.Text))
            {
                if (AdministradorDL.ActualizarAdministradorPassword(txtUsuario.Text, passwordBox.Password.ToString()))
                {
                    btnLogin.Visibility            = System.Windows.Visibility.Visible;
                    btnCancel.Visibility           = System.Windows.Visibility.Visible;
                    lblChangePassword.Visibility   = System.Windows.Visibility.Hidden;
                    btnCrearCuentaAdmin.Visibility = System.Windows.Visibility.Hidden;
                }
            }
        }