コード例 #1
0
        public Offer Responce(BookRequest request)
        {
            Client client = request.GetClient();
            Book   book   = request.GetBook();

            if (client.Balance < book.DepositCost)
            {
                throw new Exception("Not enough money");
            }
            if (Archive.Books[book.Isbn] == null || Archive.Amounts[book.Isbn] == 0)
            {
                throw new Exception("No such a book");
            }
            Offer responce = new Offer(client, book);

            return(responce);
        }
コード例 #2
0
 public static void AddRequest(BookRequest request)
 {
     requests.Add(request);
 }
コード例 #3
0
 public void AddRequest(BookRequest request)
 {
     requests.Add(request.Id);
 }