コード例 #1
0
 /// <summary>
 /// Prints generalized error message for use when user is prompted with try again/abort.
 /// Parameters for specifying error message.
 /// </summary>
 /// <param name="input1"></param>
 /// <param name="input2"></param>
 /// <returns>string</returns>
 public static string ErrorAbort(string input1 = "", string input2 = "")
 {
     Console.Clear();
     Console.WriteLine($"Something went wrong when {input1}! Either your session timed out and you have to log in again, \n" +
                       $"or {input2}");
     return(Prompts.Abort());
 }
コード例 #2
0
 /// <summary>
 /// Prints generalized error message.
 /// Parameters for specifying error message.
 /// </summary>
 /// <param name="input1"></param>
 /// <param name="input2"></param>
 public static void ErrorNoAbort(string input1 = "", string input2 = "")
 {
     Console.Clear();
     Console.WriteLine($"Something went wrong when {input1}! Either your session timed out and you have to log in again, \n" +
                       $"or {input2}");
     Prompts.ClearAndContinue();
 }
コード例 #3
0
 /// <summary>
 /// Specialized error message when API.BuyBook method returns false.
 /// </summary>
 /// <returns>string</returns>
 public static string Error()
 {
     Console.Clear();
     Console.WriteLine("Something went wrong with the purchase! Either your session timed out and you have to log in again, \n" +
                       "or the book is out of stock. Are you sure you entered the correct book Id?");
     return(Prompts.Abort());
 }
コード例 #4
0
 /// <summary>
 /// Prints message indicating that registration was successful.
 /// </summary>
 /// <param name="userName"></param>
 /// <param name="password"></param>
 public static void Success(string userName, string password)
 {
     Console.Clear();
     Console.WriteLine($"You are now registered! Your user name is \"{userName}\" and your password is \"{password}\"\n");
     Console.WriteLine("Login to start buying books!");
     Prompts.ClearAndContinue();
 }
コード例 #5
0
 /// <summary>
 /// Prints generalized success message.
 /// Parameters for specifying error message. input2 optional string parameter
 /// </summary>
 /// <param name="input1"></param>
 /// <param name="input2"></param>
 public static void SuccessWithString(string input1, string input2 = "")
 {
     Console.Clear();
     Console.WriteLine($"{input1} {input2}!");
     Prompts.ClearAndContinue();
 }
コード例 #6
0
 /// <summary>
 /// Prints message indicating that registration was unsuccessful.
 /// </summary>
 /// <returns>string</returns>
 public static string Error()
 {
     Console.Clear();
     Console.WriteLine("Something went wrong! Either the user name is already taken, or the password verification failed.");
     return(Prompts.Abort());
 }
コード例 #7
0
ファイル: LoginMessage.cs プロジェクト: Norrlandsk/WebshopMvc
 /// <summary>
 /// Prints error message when API.Login returns false.
 /// </summary>
 /// <returns>string</returns>
 public static string Error()
 {
     Console.Clear();
     Console.WriteLine("Something went wrong! Are you sure you typed in your user name and password correctly?");
     return(Prompts.Abort());
 }
コード例 #8
0
ファイル: LoginMessage.cs プロジェクト: Norrlandsk/WebshopMvc
 /// <summary>
 /// Prints Welcome userName
 /// </summary>
 /// <param name="userName"></param>
 public static void Success(string userName)
 {
     Console.Clear();
     Console.WriteLine($"Welcome {userName}!");
     Prompts.ClearAndContinue();
 }
コード例 #9
0
 /// <summary>
 /// Prints message when user is logged out
 /// </summary>
 /// <param name="user"></param>
 public static void LoggedOut(User user)
 {
     Console.Clear();
     Console.WriteLine($"You have been logged out!\n\nHope to see you back soon, {user.Name}!");
     Prompts.ClearAndContinue();
 }
コード例 #10
0
 /// <summary>
 /// Specialized success message when API.BuyBook method returns true.
 /// </summary>
 public static void Success()
 {
     Console.Clear();
     Console.WriteLine("Book purchased!");
     Prompts.ClearAndContinue();
 }
コード例 #11
0
 /// <summary>
 /// Prints message when user is not logged in.
 /// </summary>
 public static void UserNotLoggedIn()
 {
     Console.WriteLine("You have to be logged in to purchase a book!\n" +
                       "Please login or register a new user");
     Prompts.ClearAndContinue();
 }