public void CreateNewMagazine(Newspaper newspaper)
        {
            newspaper.ID = nextID;
            nextID++;

            newspapers.Add(newspaper);
        }
        string FormatingNewspaperToString(Newspaper newspaper)
        {
            var returnedLine = newspaper.ID + "|" +
                               newspaper.NameBook + "|" +
                               newspaper.PublishingHouse + "|" +
                               newspaper.PublishingYear + "|" +
                               newspaper.Release;

            return(returnedLine);
        }
 public void ChangeMagazinInfo(Newspaper magazine)
 {
     for (int i = 0; i < newspapers.Count; i++)
     {
         if (newspapers[i].ID == magazine.ID)
         {
             magazine.Article = newspapers[i].Article;
             newspapers[i]    = magazine;
             break;
         }
     }
 }
        Newspaper FormatingStringToNewspaper(string str)
        {
            var line = str.Split('|');

            var returdedBook = new Newspaper();

            returdedBook.ID              = Int32.Parse(line[0]);
            returdedBook.NameBook        = line[1];
            returdedBook.PublishingHouse = line[2];
            returdedBook.PublishingYear  = line[3];
            returdedBook.Release         = Int32.Parse(line[4]);
            returdedBook.Article         = new List <Book>();

            return(returdedBook);
        }