public static string RegisterScreen(int userId) { MenuStructure.DrawScreen(); MenuStructure.SetTitle("Register"); MenuStructure.WriteLine("Id: " + userId); MenuStructure.WriteLine("Enter your name: "); return(MenuStructure.ReadLine(null, ETypeRead.String)); }
internal static string ChangeName(string userName) { MenuStructure.DrawScreen(); MenuStructure.SetGoBackOption(); MenuStructure.SetTitle("Change Name"); MenuStructure.WriteLine("Name: " + userName); MenuStructure.WriteLine("Enter new name: "); return(MenuStructure.ReadLine(null, ETypeRead.String)); }
internal static bool AreYouSureScreen(string message, Action method) { MenuStructure.DrawScreen(); MenuStructure.SetTitle(message); MenuStructure.AddLine(1); MenuStructure.WriteLine("Are you sure? (Y/N) "); var anwser = MenuStructure.ReadLine(method, ETypeRead.YesOrNo); return(anwser == "Y"); }
internal static string ReadMany(string text, ETypeRead typeRead) { string input; AddLine(1); do { WriteSameLine(text); input = MenuStructure.ReadLine(null, typeRead); } while (input == "invalid"); return(input); }
public static int LoginScreen() { MenuStructure.DrawScreen(); MenuStructure.SetTitle("Login"); MenuStructure.WriteLine("Type your Id: "); string userIdStr = MenuStructure.ReadLine(null, ETypeRead.Int); if (userIdStr == "invalid") { return(0); } return(int.Parse(userIdStr)); }
internal static string ListScreen(string title, string listType, string[] optionList, Action method) { int optionIndex = 0; MenuStructure.DrawScreen(); MenuStructure.SetGoBackOption(); MenuStructure.SetTitle(title); MenuStructure.WriteNewLine("Choose one " + listType + ":"); foreach (var optionText in optionList) { optionIndex++; MenuStructure.WriteNewLine(optionIndex + " - " + optionText); } MenuStructure.AddLine(1); MenuStructure.WriteLine(listType + ": "); return(MenuStructure.ReadLine(method, ETypeRead.NumberList, optionIndex)); }