コード例 #1
0
ファイル: Reader.cs プロジェクト: meslex/TermPaperGit
 private bool RequestBooksReadingRoom(string[] wishlist)
 {
     if (library != null)
     {
         //Print(String.Format("{1} requested {0} books to read in reading room;", wishlist.Count(), Name));
         Card = library.GiveBooksForReadingRoom(this, wishlist);
         if (Card != null)
         {
             if (Card.Count == wishlist.Length)
             {
                 PrintToLog(String.Format("Our reader had requested a few books:{0}and library has allowed him to read them.", ConvertArrayToString(wishlist)));
             }
             else
             {
                 PrintToLog(String.Format("Alas, our reader had requested a few books:{0}but he was given only those:{1}",
                                          ConvertArrayToString(wishlist), ConvertArrayToString <Book>(Card.ToArray())));
             }
             return(true);
         }
         else
         {
             //Print(String.Format("Library can't allow to requested books.", Name));
             PrintToLog(String.Format("Library can't allow to read requested books.", Name));
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }