/// <summary> /// This method prompts the user options and takes a UserFunctionChoice input from user /// </summary> /// <returns>Returns the Users Choice of Action </returns> private static TelephoneBillSystemChoices PromptUsersChoice() { Console.Write(ConfigurationManager.AppSettings.Get("UserDisplayOptions")); TelephoneBillSystemChoices userChoice = UserInputGathering.GetUsersChoice(); return(userChoice); }
/// <summary> /// This method accepts a character input and validates if it is a letter. /// </summary> /// <param name="descriptionString">Description String for display</param> /// <returns>character Input</returns> private static char GetCharacterInput(string descriptionString) { var character = UserInputGathering.GetCharacterInput(descriptionString); if (!UserInputValidation.IsValidLetter(character)) { throw new InvalidOperationException(" "); } return(character); }
/// <summary> /// This method accepts and validates the String Input /// </summary> /// <returns>Returns the String inputted by User</returns> internal static string GetUserInputString() { var userInputString = UserInputGathering.GetStringInput(); if (!UserInputValidation.IsValidString(userInputString)) { throw new InvalidOperationException(" "); } return(userInputString); }
/// <summary> /// This method prompts user for height of triangle /// </summary> internal static int SetHeightOfTriangle() { var heightOfTriangle = UserInputGathering.GetIntergerInput("Please enter the height of star triangle"); if (UserInputValidation.IsValidHeightofTriangle(heightOfTriangle) == false) { throw new InvalidOperationException(" "); } return(heightOfTriangle); }
internal static int GetEmployeeId() { var employeeId = UserInputGathering.GetIntergerInput("Please enter the Employee ID"); if (UserInputValidation.IsValidIntegerValue(employeeId) == false) { throw new InvalidOperationException(" "); } return(employeeId); }
internal static string GetCustomerEmail() { var customerEmailAddress = UserInputGathering.GetStringInput("Enter Customer Email"); if (!UserInputValidation.IsValidEmailAddress(customerEmailAddress)) { throw new InvalidOperationException(" "); } return(customerEmailAddress); }
internal static string GetBillPaymemtMode() { var billPaymentMode = UserInputGathering.GetStringInput("Enter Bill Payment Mode"); if (!UserInputValidation.IsValidString(billPaymentMode)) { throw new InvalidOperationException(" "); } return(billPaymentMode); }
internal static string GetCustomerIdentity() { var customerIdentity = UserInputGathering.GetStringInput("Enter Customer Identity Type"); if (!UserInputValidation.IsValidCustomerIdentity(customerIdentity)) { throw new InvalidOperationException(" "); } return(customerIdentity); }
internal static string GetCustomerName() { var customerName = UserInputGathering.GetStringInput("Enter Customer Name"); if (!UserInputValidation.IsValidString(customerName)) { throw new InvalidOperationException(" "); } return(customerName); }
internal static int GetMobileNumber() { var mobileNumber = UserInputGathering.GetIntergerInput("Please enter the Customer Mobile Number"); if (UserInputValidation.IsValidMobileNumber(mobileNumber) == false) { throw new InvalidOperationException("Mobile Number not valid "); } return(mobileNumber); }
internal static decimal GetBillAmount() { var amount = UserInputGathering.GetStringInput("Enter Bill Amount"); var billAmount = Decimal.Parse(amount); if (billAmount <= 0 || billAmount >= 1000000) { Console.WriteLine("Bad Amount Value"); throw new InvalidOperationException(" "); } return(billAmount); }
/// <summary> /// This method prompts the user options and takes a UserFunctionChoice input from user /// </summary> /// <returns>Returns the Users Choice of Action </returns> private static UsersFunctionChoices PromptUsersChoice() { Console.Write("\nPlease enter the action to perform " + "\n1) Print Triangular Output using String" + "\n2) Print Triangular Output using Start, End Characters" + "\n3) Count Distinct String Characters(Case Sensitive)" + "\n4) Count Distinct String Characters(Case InSensitive)" + "\n5) Print *** Triagle" + "\n6) End Application\n\nPlease enter your choice : "); var userChoice = UserInputGathering.GetUsersChoice(); return(userChoice); }