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);
        }
Esempio n. 2
0
 public static void AddRequest(BookRequest request)
 {
     requests.Add(request);
 }
 public void AddRequest(BookRequest request)
 {
     requests.Add(request.Id);
 }