示例#1
0
        static void Main(string[] args)
        {
            int wybor;

            Console.WriteLine("Co chcesz zrobić ? Wpisz odpowiedni numer:");
            Console.WriteLine("1.DODAJ CZASOPISMO");
            Console.WriteLine("2.DODAJ KSIAZKE");
            Console.WriteLine("3.WYSZUKAJ PO TYTULE");
            Console.WriteLine("4.WYSZUKAJ PO ID");
            Console.WriteLine("5.POKAZ ZAWARTOSC");
            Console.WriteLine("6.WYJDZ");
            Katalog nowy = new Katalog("lallala");

            nowy.Tes();
            nowy.WypiszWszystko();
            Console.ReadKey();
        }
示例#2
0
        static void Main(string[] args)
        {
            int     wybor, numer, rokWydania, id, liczbaStron;
            string  tytul, wydawnictwo, imie, nazwisko;
            Katalog nowy = new Katalog("lallala");

            nowy.Test();  //wywołanie metody test
            do
            {
                Console.WriteLine("Co chcesz zrobić ? Wpisz odpowiedni numer:");
                Console.WriteLine("1.DODAJ CZASOPISMO");
                Console.WriteLine("2.DODAJ KSIAZKE");
                Console.WriteLine("3.WYSZUKAJ PO TYTULE");
                Console.WriteLine("4.WYSZUKAJ PO ID");
                Console.WriteLine("5.POKAZ ZAWARTOSC");
                Console.WriteLine("6.WYJDZ");
                wybor = int.Parse(Console.ReadLine());
                switch (wybor)
                {
                case 1:
                    Console.WriteLine("Tytuł:");
                    tytul = Console.ReadLine();
                    Console.WriteLine("ID:");
                    id = int.Parse(Console.ReadLine());
                    Console.WriteLine("Wydawnictwo:");
                    wydawnictwo = Console.ReadLine();
                    Console.WriteLine("rok wydania");
                    rokWydania = int.Parse(Console.ReadLine());
                    Console.WriteLine("numer");
                    numer = int.Parse(Console.ReadLine());
                    nowy.DodajPozycje(tytul, id, wydawnictwo, rokWydania, numer);
                    break;

                case 2:
                    Console.WriteLine("Tytuł:");
                    tytul = Console.ReadLine();
                    Console.WriteLine("ID:");
                    id = int.Parse(Console.ReadLine());
                    Console.WriteLine("Wydawnictwo:");
                    wydawnictwo = Console.ReadLine();
                    Console.WriteLine("rok wydania");
                    rokWydania = int.Parse(Console.ReadLine());
                    Console.WriteLine("Liczba stron:");
                    liczbaStron = int.Parse(Console.ReadLine());
                    Console.WriteLine("Imie");
                    imie = Console.ReadLine();
                    Console.WriteLine("Nazwisko");
                    nazwisko = Console.ReadLine();
                    nowy.DodajPozycje(tytul, id, wydawnictwo, rokWydania, liczbaStron, imie, nazwisko);
                    break;

                case 3:
                    Console.WriteLine("Podaj tytul:");
                    tytul = Console.ReadLine();
                    nowy.WyszukajPoTytule(tytul);
                    break;

                case 4:
                    Console.WriteLine("Podaj Id");
                    id = int.Parse(Console.ReadLine());
                    nowy.WyszukajPoId(id);
                    break;

                case 5:
                    nowy.WypiszWszystko();
                    break;

                case 6:
                    Console.ReadKey();
                    break;

                default:
                    Console.WriteLine("PODALES ZLA LICZBE !!!!!");
                    break;
                }
            } while (wybor != 6);
            Console.WriteLine("DO ZOBACZENIA !!!!");

            Console.ReadKey();
        }