public static void Wybor_menu(int numer) { Console.Clear(); switch (numer) { case 1: Console.WriteLine(Miejsca_podrozy.Miejsca_p()); Console.ReadLine(); Console.Clear(); break; case 2: Console.Write("Obecna promocja na loty: "); Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(Promocja_lot.Promocja()); Console.ForegroundColor = ConsoleColor.Gray; break; case 3: Console.Write("Podaj login, musi on posiadać conajmniej 8 znaków: "); string nowy_login = Console.ReadLine(); Console.Write("Podaj hasło, Twoje hasło musi zawierać conajmniej 8 znaków w tym jeden znak specjalny: "); string nowe_haslo = Console.ReadLine(); Rejestracja_(nowy_login, nowe_haslo); Console.WriteLine("Zostałeś pomyślnie zarejestrowany"); Console.WriteLine("\nNaciśnij enter aby kontynuować... "); Console.ReadLine(); break; case 4: string login = Podaj_login(); string haslo = Podaj_haslo(); if (Logowanie.Login(login) == true && Logowanie.Haslo(haslo) == true) { Panel_log(true, login, haslo); } else { Panel_log(false, login, haslo); } Console.WriteLine(); Form(); break; default: break; } }
public static void Panel_log(bool wartosc, string login, string haslo) { if (wartosc) { Console.Write("Witaj użytkowniku "); Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(login); Console.ForegroundColor = ConsoleColor.Gray; } else { Console.WriteLine("Błędny login lub hasło"); string nowy_login = Podaj_login(); string nowe_haslo = Podaj_haslo(); if (Logowanie.Login(nowy_login) == true && Logowanie.Haslo(nowe_haslo) == true) { Panel_log(true, nowy_login, nowe_haslo); } else { Panel_log(false, nowy_login, nowe_haslo); } } }