Ejemplo n.º 1
0
 private void AddAdminCommands()
 {
     _adminCommands.Add(":quit", (string[] command) =>
     {
         TestArgumentNumber(command, 1);
         SUI.Close();
     });
     _adminCommands.Add(":q", (string[] command) =>
     {
         TestArgumentNumber(command, 1);
         SUI.Close();
     });
     _adminCommands.Add(":activate", (string[] command) =>
     {
         TestArgumentNumber(command, 2);
         S.GetProductByID(Convert.ToInt32(command[1])).Active = true;
     });
     _adminCommands.Add(":deactivate", (string[] command) =>
     {
         TestArgumentNumber(command, 2);
         S.GetProductByID(Convert.ToInt32(command[1])).Active = false;
     });
     _adminCommands.Add(":crediton", (string[] command) =>
     {
         TestArgumentNumber(command, 2);
         S.GetProductByID(Convert.ToInt32(command[1])).CanBeBoughtOnCredit = true;
     });
     _adminCommands.Add(":creditoff", (string[] command) =>
     {
         TestArgumentNumber(command, 2);
         S.GetProductByID(Convert.ToInt32(command[1])).CanBeBoughtOnCredit = false;
     });
     _adminCommands.Add(":addcredits", (string[] command) =>
     {
         TestArgumentNumber(command, 3);
         SUI.DisplayInserCashTransation(S.AddCreditsToAccount(S.GetUserByUsername(command[1]),
                                                              Convert.ToInt32(command[2])));
     });
 }