示例#1
0
 private void first(User user)                                    // it is the first enter to the system
 {
     if (itsBL.isUserAdmin(user))                                 // there exists only one username and password with which you can enter the system.
     {
         PL_CLI tmp1 = new PL_CLI(itsBL);
         tmp1.addStuff();
         MainMenu moveToMenu = new MainMenu(itsBL);                              //entered to the system, move to main menu
     }
     else
     {
         Console.Clear();
         Console.WriteLine("The username or password is incorrect, please try again: ");
         Console.Write("username: "******"password: "******"ERROR: ");
           Console.ReadKey();
           User tmp = new User();
           first(tmp); }
     }
 }
示例#2
0
 public void most(User user)                           // its not the first time
 {
     if (itsBL.isUserOk(user))                         //  the username and password that the user submit are recognize in the system
     {
         MainMenu moveToMenu = new MainMenu(itsBL);    // successfully entered to the system.  move to the next screen- the main menu
         PL_CLI   tmp1       = new PL_CLI(itsBL);
         tmp1.addStuff();
     }
     else
     {
         Console.Clear();
         Console.WriteLine("The username or password is incorrect, please try again: ");
         Console.Write("username: "******"password: "******"ERROR: ");
           Console.ReadKey();
           User tmp = new User();
           most(tmp); }
     }
 }