Advertisement
Guest User

Untitled

a guest
Jan 27th, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.77 KB | None | 0 0
  1. Console.WriteLine("Wypożyczalnia narzędzi. Wybierz operację: 1. Narzędzia, 2. Klienci, 3. Pracownicy");
  2.             string wybranaOperacja = Convert.ToString(Console.ReadLine());
  3.             //if (wybranaOperacja == "1")
  4.             //{
  5.             //    Console.Clear();
  6.             //    Console.WriteLine("1. Wyświetl dostępne narzędzia, 2. Wypożycz, 3. Zwróć, 4. Dodaj narzędzie, 5. Usuń narzędzie");
  7.             //    string wybranaOperacjaNarz = Convert.ToString(Console.ReadLine());
  8.             //    if (wybranaOperacjaNarz == "1")
  9.             //    {
  10.             //        Console.WriteLine("Dostępne narzędzia: ");
  11.             //        narz.WypiszElementy();
  12.             //    }
  13.             //    else if (wybranaOperacjaNarz == "2")
  14.             //    {
  15.             //        Console.Write("Podaj nazwę wypożyczanego narzędzia: ");
  16.             //        string wypozyczanenarzedzie = Convert.ToString(Console.ReadLine());
  17.             //        Console.Write("Podaj nazwisko wypożyczającego klienta: ");
  18.             //        string wypozyczajacyklient = Convert.ToString(Console.ReadLine());
  19.             //        int? e = klie.Wyszukaj(wypozyczajacyklient);
  20.             //        if (e.HasValue)
  21.             //        {
  22.             //            narz.Wypożycz(wypozyczanenarzedzie, klie.Klienci[(int)e]);
  23.             //        }
  24.             //        else
  25.             //        {
  26.             //            Console.WriteLine("Nie ma takiego klienta.");
  27.             //        }
  28.             //    }
  29.             //    else if (wybranaOperacjaNarz == "3")
  30.             //    {
  31.             //        Console.Write("Podaj nazwę narzędzia do zwrotu: ");
  32.             //        string zwracanenarzedzie = Convert.ToString(Console.ReadLine());
  33.             //        narz.Zwróć(zwracanenarzedzie);
  34.             //    }
  35.             //    else if (wybranaOperacjaNarz == "4")
  36.             //    {
  37.             //        Console.Write("Podaj nazwę nowego narzędzia: ");
  38.             //        string narzedziedododania = Convert.ToString(Console.ReadLine());
  39.             //        narz.Dodaj(new Narzędzie(narzedziedododania));
  40.             //    }
  41.             //    else if (wybranaOperacjaNarz == "5")
  42.             //    {
  43.             //        Console.Write("Podaj nazwę narzędzia do usunięcia: ");
  44.             //        string narzedziedousuniecia = Convert.ToString(Console.ReadLine());
  45.             //        narz.Usuń(narzedziedousuniecia);
  46.             //    }
  47.             //    else
  48.             //    {
  49.             //        Console.WriteLine("Wybierz poprawny numer.");
  50.             //    }
  51.             //}
  52.             //else if (wybranaOperacja == "2")
  53.             //{
  54.             //    Console.Clear();
  55.             //    Console.WriteLine("1. Wyświetl wszystkich klientów, 2. Dodaj klienta, 3. Usuń klienta");
  56.             //    string wybranaOperacjaKlie = Convert.ToString(Console.ReadLine());
  57.             //    if (wybranaOperacjaKlie == "1")
  58.             //    {
  59.             //        Console.WriteLine("Wszyscy klienci: ");
  60.             //        klie.WypiszElementy();
  61.             //    }
  62.             //    else if (wybranaOperacjaKlie == "2")
  63.             //    {
  64.             //        Console.Write("Podaj nazwisko nowego klienta: ");
  65.             //        string klientdododania = Convert.ToString(Console.ReadLine());
  66.             //        if (klientdododania.Any(c => char.IsDigit(c)))
  67.             //        {
  68.             //            Console.WriteLine("Nazwisko niepoprawne (nie może zawierać cyfr).");
  69.             //        }
  70.             //        else
  71.             //        {
  72.             //            klie.Dodaj(new Klient(klientdododania));
  73.             //        }
  74.             //    }
  75.             //    else if (wybranaOperacjaKlie == "3")
  76.             //    {
  77.             //        Console.Write("Podaj nazwisko klienta do usunięcia: ");
  78.             //        string klientdousuniecia = Convert.ToString(Console.ReadLine());
  79.             //        klie.Usuń(klientdousuniecia);
  80.             //    }
  81.             //    else
  82.             //    {
  83.             //        Console.WriteLine("Wybierz poprawny numer.");
  84.             //    }
  85.             //}
  86.             //else if (wybranaOperacja == "3")
  87.             //{
  88.             //    Console.Clear();
  89.             //    Console.WriteLine("1. Wyświetl wszystkich pracowników, 2. Dodaj pracownika, 3. Usuń pracownika");
  90.             //    string wybranaOperacjaPrac = Convert.ToString(Console.ReadLine());
  91.             //    if (wybranaOperacjaPrac == "1")
  92.             //    {
  93.             //        Console.WriteLine("Wszyscy pracownicy: ");
  94.             //        prac.WypiszElementy();
  95.             //    }
  96.             //    else if (wybranaOperacjaPrac == "2")
  97.             //    {
  98.             //        Console.Write("Podaj nazwisko nowego pracownika: ");
  99.             //        string pracownikdododania = Convert.ToString(Console.ReadLine());
  100.             //        if (pracownikdododania.Any(c => char.IsDigit(c)))
  101.             //        {
  102.             //            Console.WriteLine("Nazwisko niepoprawne (nie może zawierać cyfr).");
  103.             //        }
  104.             //        else
  105.             //        {
  106.             //            prac.Dodaj(new Pracownik(pracownikdododania));
  107.             //        }
  108.             //    }
  109.             //    else if (wybranaOperacjaPrac == "3")
  110.             //    {
  111.             //        Console.Write("Podaj nazwisko pracownika do usunięcia: ");
  112.             //        string pracownikdousuniecia = Convert.ToString(Console.ReadLine());
  113.             //        prac.Usuń(pracownikdousuniecia);
  114.             //    }
  115.             //    else
  116.             //    {
  117.             //        Console.WriteLine("Wybierz poprawny numer.");
  118.             //    }
  119.             //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement