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); } }
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(); } }