예제 #1
0
            public void Info(ulong id)
            {
                Publ Publ = publs.Find(x => x.Id == id);

                Publ.Info();
                Write();
            }
예제 #2
0
            public void Remove(ulong id)
            {
                Publ publ = publs.Find(x => x.Id == id);

                publs.Remove(publ);
                Write();
            }
예제 #3
0
        static void Main()
        {
            Author        author  = new Author("Лисюткин", "Михаил", "Юрьевич");
            Author        author1 = new Author("Живодер", "Илья", "");
            Publ          publ    = new Publ("Mir");
            List <Author> authors = new List <Author>
            {
                author,
                author1
            };
            Book book = new Book("Книга", 123, 1904, authors, publ);


            string json = JsonConvert.SerializeObject(authors, Formatting.Indented); //Оформление JSON файла и заполнение информацией об авторах

            Console.WriteLine(json);
            DataBook data = new DataBook("F:/books.json");

            data.Add(book);

            DataAuthors dataAuthors = new DataAuthors("F:/authors.json");

            dataAuthors.Add(author);
            dataAuthors.Add(author1);

            DataPubls dataPubls = new DataPubls("F:/publs.json");

            dataPubls.Add(publ);

            DB dB = new DB("F:/Database.db");
        }
예제 #4
0
 private List <Author> _authors = new List <Author>();                                 //Список авторов книги
 public Book(string name, ushort pages, ushort year, List <Author> authors, Publ publ) //Конструктор
 {
     Name    = name;
     Id      = ++id;
     Pages   = pages;
     Year    = year;
     Authors = authors;
     Publ    = publ;
 }
예제 #5
0
 public void Add(Publ publ)
 {
     publs.Add(publ);
 }