Exemple #1
0
        public void AddCodeFromPot(Artwork artwork)
        {
            try
            {
                Artworks.Add(artwork);
            }

            catch (IOException e)
            {
                Console.WriteLine("An error occurred!");
                Console.WriteLine(e.Message);
            }
        }
Exemple #2
0
 public void LoadCodePack(List <string> listOfArtworks)
 {
     try
     {
         for (int i = 0; i < 100; i++) // i < "n" ---> "n" represents total number of codes ownered by the author.
         {
             var artworkCode = listOfArtworks.First();
             listOfArtworks.RemoveAt(0);
             string[] artwork       = artworkCode.Split(',');
             int      artworkId     = int.Parse(artwork[0]);
             string   artworkNumber = artwork[1];
             Artwork  artworkx      = new Artwork(artworkId, artworkNumber);
             artworkx.OwnerID = Id;
             Artworks.Add(artworkx);
         }
     }
     catch (IOException e)
     {
         Console.WriteLine("An error occurred!");
         Console.WriteLine(e.Message);
     }
 }