public void LogIn()
        {
            while (true)
            {
                Console.Clear();

                string email;
                string password;

                Console.Write("Email : ");
                email = Console.ReadLine();

                if (_provider.IsEmailExist(email))
                {
                    Console.Write("Password : "******"Uncorrect password, press any key to try again");
                        Console.ReadKey();
                    }
                }
                else
                {
                    ShowErrorMessage("User with this email not found, press 0 to go to previous page, pressany any other key try again");
                    if (Console.ReadKey().Key == ConsoleKey.D0)
                    {
                        Console.Clear();
                        this.Init();
                        break;
                    }

                    Console.Clear();
                }
            }
        }
示例#2
0
        public void AddNewUserToGroup()
        {
            while (true)
            {
                Console.Write("Enter user email : ");
                string email = Console.ReadLine();
                if (_provider.IsEmailExist(email))
                {
                    UserDTO newMember = _provider.GetUserByEmail(email);

                    _provider.AddUserToGroup(newMember, _group);

                    ShowSuccessMessage($"{newMember.Name} successfully joined to group, press any key to continue");
                    Console.ReadKey();
                    buttons[CurrentPosition].ToUsual();
                    _currentPosition = 0;
                    this.Init();
                    break;
                }
                else
                {
                    ShowErrorMessage("User with this email not found, press Enter to try again, press any other key to go back");

                    if (Console.ReadKey().Key != ConsoleKey.Enter)
                    {
                        buttons[CurrentPosition].ToUsual();
                        _currentPosition = 0;
                        this.Init();
                        break;
                    }
                    else
                    {
                        //Console.WriteLine();
                    }
                }
            }
        }