public PenaltyDto ReturnBook(string Username, string BookName, DateTime returnDate) 
        {
            BookingDto NewBookingDto = this.GetBooking(Username, BookName);
            BookingEntity bookingEntity = new BookingEntity();

            bookingEntity.BookId = NewBookingDto.BookId;
            bookingEntity.EndBookingDate = NewBookingDto.EndBookingDate;
            bookingEntity.LibraryAppUsername = NewBookingDto.LibraryAppUsername;
            bookingEntity.StartBookingDate = NewBookingDto.StartBookingDate;
            _dblibrary.ReturnBook(bookingEntity);

            if (NewBookingDto.EndBookingDate < returnDate)
            {
                PenaltyEntity penalty = new PenaltyEntity();
                penalty.BookingId = bookingEntity.Id;
                penalty.BookId = bookingEntity.BookId;
                penalty.LibraryAppUsername = bookingEntity.LibraryAppUsername;
                _dblibrary.CreatePenalty(penalty);

                PenaltyDto penaltyDto = new PenaltyDto();
                penaltyDto.Id = penalty.Id;
                penaltyDto.BookId = penalty.BookId;
                penaltyDto.BookingId = penalty.BookingId;
                penaltyDto.LibraryAppUsername = penalty.LibraryAppUsername;
                return(penaltyDto);
            }
            else 
            {
                _dblibrary.ReturnBook(bookingEntity);             
                return null;
            }
        }
 public bool PayPenalty(PenaltyDto Penalty) 
 {
     _dblibrary.PayPenalty(Penalty.Id);
     return (true);
 }
 public PenaltyDto GetPenalty(string username, string bookTitle) 
 {
     PenaltyEntity penaltyEntity = _dblibrary.GetPenalty(username, bookTitle);
     PenaltyDto PenaltyDto = new PenaltyDto();
     PenaltyDto.BookId = penaltyEntity.BookId;
     PenaltyDto.BookingId = penaltyEntity.BookingId;
     PenaltyDto.Id = penaltyEntity.Id;
     PenaltyDto.LibraryAppUsername = penaltyEntity.LibraryAppUsername;
     return (PenaltyDto);
 }