示例#1
0
 public static bool AddUserAdward(string IDAsward, string IDUser)
 {
     if (IDAsward == null || IDUser == null)
     {
         return(false);
     }
     try
     {
         int intIDAsward = Convert.ToInt32(IDAsward);
         int intIDUser   = Convert.ToInt32(IDUser);
         return(UserLogic.AddUserAdward(intIDUser, intIDAsward));
     }
     catch (Exception)
     {
         return(false);
     }
 }
示例#2
0
 private static void AddUserAdward()
 {
     try
     {
         Console.WriteLine("Enter reward ID to add");
         int IDAsward = Convert.ToInt32(Console.ReadLine());
         Console.WriteLine("Enter user ID");
         int IDUser = Convert.ToInt32(Console.ReadLine());
         if (!UserLogic.AddUserAdward(IDUser, IDAsward))
         {
             Console.WriteLine("No reward added");
             Console.ReadKey();
         }
     }
     catch (Exception)
     {
         Console.WriteLine("The entered data is incorrect");
         Console.ReadKey();
     }
 }