示例#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);
 }