Beispiel #1
0
 public bool VerifyUser(string name, string password)
 {
     Users = file.Load();
         foreach (var user in Users)
         {
             if (user.namee.ToUpper().Equals(name) && user.password.Equals(password))
             {
                 X = user;
                 return true;
             }
         }
         return false;
 }
Beispiel #2
0
        public void MenuOp(string choice)
        {
            switch (choice)
            {
                case "Y":
                    string name = input.GetString("\n\nName: ");
                    string password = input.GetString("\n\nPassWord: "******"Does not Exists the user");
                        Console.ReadKey();
                        PreviewMenu();
                    break;

                case "N":
                    Console.WriteLine("\nGive Information About You: ");
                    X = new UserOwner(input.GetString("\n\nName: "), input.GetString("Age: "),input.GetString("Pasword"));
                    Users = file.Load();
                    Users.Add(X);
                    file.Save(Users);
                    DisplayMainMenu();
                    break;
                default:
                    Console.WriteLine("\nError");
                    Console.ReadKey();
                    PreviewMenu();
                    break;
            }
        }