public void CheckBookItem(BookItem bookItem) { if (bookItem.IsReferenceOnly) { throw new Exception("Kitab tek nusxedir, goture bilmezsiniz"); } if (bookItem.Status != BookStatus.AVAILABLE) { throw new Exception("Bu kitab goturmek ucun uygun deyil"); } if (this.TotalBooksCheckedout >= Constants.Constants.MAX_BOOKS_ISSUED_TO_A_USER) { throw new Exception("Siz artiq kitab gore bilmezsiniz, once kitab qaytarmalisiniz"); } bookItem.Status = BookStatus.LOANED; this.TotalBooksCheckedout++; }
public void ReturnBookItem(BookItem bookItem) { this.TotalBooksCheckedout--; bookItem.Status = BookStatus.AVAILABLE; }