static void PrintAllUsers() { var sb = new System.Text.StringBuilder(); int counter = 1; sb.Append(String.Format("{0,-15} {1,-15}\n\n", "User Number", "User Name")); foreach (var user in _sql.ReadUsers().ToList()) { sb.Append(String.Format("{0,-15} {1,-15} \n", counter, user.Name)); counter++; } Console.WriteLine(sb); }
static void PrintAllUsersEF() { foreach (var u in _sql.ReadUsers()) { Console.WriteLine(u.Name); } }
static void PrintAllUsersWithEF() { Console.WriteLine("Available users:"); foreach (var user in _sql.ReadUsers()) { System.Console.WriteLine(user.Name); } }
private static void UserLogIn() { Console.WriteLine("\nUser ID - Username"); foreach (User u1 in _sql.ReadUsers()) { Console.WriteLine(u1.Id + " - " + u1.Name); } Console.WriteLine("\nPlease type your User ID"); u = _sql.SelectUser(); Console.WriteLine("\nWelcome, " + u.Name + "!"); }