Ejemplo n.º 1
0
 private void buttonAskLogin_Click(object sender, EventArgs e)
 {
     if (UserBll.GetSpesialQuestion(textBoxLogin.Text) != "")
     {
         textBoxQestion.Text    = UserBll.GetSpesialQuestion(textBoxLogin.Text);
         textBoxAnswer.ReadOnly = false;
         textBoxLogin.ReadOnly  = true;
         buttonAnswer.Visible   = true;
         buttonAskLogin.Visible = false;
     }
     else
     {
         labelAskLogin.ForeColor = Color.DarkRed;
     }
 }
Ejemplo n.º 2
0
        private void ChangePassword(string login)
        {
            ConsoleKeyInfo key;
            bool           exid = false;

            do
            {
                Console.Clear();
                ChangePasswordMenu();
                key = Console.ReadKey(true);
                switch (key.Key)
                {
                case ConsoleKey.D1:
                    Console.Clear();
                    Console.WriteLine(User.GetSpesialQuestion(login));
                    Console.WriteLine();
                    Console.WriteLine("Answer:");
                    string answer = Console.ReadLine();
                    if (User.CompareAnswer(answer, login))
                    {
                        Console.WriteLine("____NEW_PASSWORD______________");
                        string new_password = Console.ReadLine();
                        User.ChangePassword(login, answer, new_password);
                        Console.WriteLine("_Pasword_has_been_changed_____");
                        exid = true;
                    }
                    else
                    {
                        Console.Clear();
                        Console.WriteLine("WRONG!!!");
                        exid = true;
                    }
                    break;
                }
            } while (key.Key != ConsoleKey.D0 && !exid);
        }