Пример #1
0
        private void Write()
        {
            string text = "";

            text += "Przedmiot: " + kgr.Naglowek.Przedmiot + '\n';
            text += "Tytul: " + kgr.Naglowek.Projekt + '\n';
            text += "Autorzy: \n";

            foreach (var author in kgr.Naglowek.Autor)
            {
                text += '\t' + author + '\n';
            }

            text += "Wydawcy: \n";
            foreach (var ph in kgr.Wydawcy.Wydawca)
            {
                text += '\t' + ph.Text + " (" + ph.Wydawca_id + ")\n";
            }

            text += "Gatunki: \n";
            foreach (var genree in kgr.Gatunki.Gatunek)
            {
                text += '\t' + genree.Text + " (" + genree.Gatunek_id + ")\n";
            }

            text += "Typy: \n";
            foreach (var type in kgr.Typy.Typ)
            {
                text += '\t' + type.Text + " (" + type.Typ_id + ")\n";
            }

            text += "Systemy: \n";
            foreach (var sys in kgr.Nasza_kolekcja.Sys)
            {
                text += "\tNazwa: " + sys.Nazwa + '\n';
                text += "\tWydawca: " + Getters.GetWydawca(kgr, sys).Text + '\n';
                text += "\tGatunek: " + Getters.GetGatunek(kgr, sys).Text + '\n';
                text += "\tPopularnosc: " + sys.Popularnosc + '\n';
                text += "\tFormat: " + sys.Format + '\n';

                text += "\tPodreczniki:\n";

                if (sys.Podreczniki != null)
                {
                    foreach (var hb in sys.Podreczniki.Podrecznik)
                    {
                        text += "\t\tTytuł: " + hb.Tytul + '\n';

                        if (hb.Tytul_oryginalny != null)
                        {
                            text += "\t\t\tTytul orginalny: " + hb.Tytul_oryginalny + '\n';
                        }

                        text += "\t\t\tTyp: " + Getters.GetTyp(kgr, hb).Text + '\n';
                        text += "\t\t\tData wydania: " + hb.Data_wydania + '\n';
                        text += "\t\t\tLiczba stron: " + hb.Liczba_stron + '\n';
                        text += "\t\t\tOcena podrecznika: " + hb.Ocena_podrecznika + '\n';
                        text += "\t\t\tCena podrecznika: " + hb.Cena_podrecznika + '\n';
                    }
                }
                else
                {
                    text += "\t\tbrak podrecznikow";
                }
            }

            Box.Text = text;
        }