예제 #1
0
 public List <BorrowReport> GetReport()
 {
     if (account.AccountLevel >= AccountLevelEnums.Manager)
     {
         return(BorrowMehod.GetReport());
     }
     throw new NotImplementedException();
 }
예제 #2
0
 public List <Account> BookHistory(int bookId)
 {
     if (account.AccountLevel >= AccountLevelEnums.Librarian)
     {
         throw new NotImplementedException();
     }
     return(BorrowMehod.BookHistory(bookId));
 }
예제 #3
0
 public List <JoinBorrow> BorrowHistory()
 {
     if (account.AccountLevel < AccountLevelEnums.Librarian)
     {
         return(new List <JoinBorrow>());
     }
     return(BorrowMehod.Read());
 }
예제 #4
0
        public JoinBorrow BorrowHistory(int id)
        {
            bool isValid = id > 0 && account.AccountLevel >= AccountLevelEnums.Librarian;

            if (!isValid)
            {
                throw new NotImplementedException();
            }
            return(BorrowMehod.Read(id));
        }
예제 #5
0
        public List <JoinBorrow> FindBorrowHistory(string search)
        {
            bool isValid = !IsStringEmpty(search) && account.AccountLevel >= AccountLevelEnums.Librarian;

            if (!isValid)
            {
                throw new NotImplementedException();
            }
            return(BorrowMehod.Find(search));
        }
예제 #6
0
        public List <JoinBorrow> CurrentBorrowHistory()
        {
            bool isValid = account.ID > 0;

            if (!isValid)
            {
                throw new NotImplementedException();
            }
            return(BorrowMehod.AccountHistory(account.ID));
        }
예제 #7
0
        public bool ReturnAdjustFine(int borrowId, decimal fine)
        {
            bool isValid = borrowId >= 0 && fine >= 0 && account.AccountLevel >= AccountLevelEnums.Librarian;

            if (!isValid)
            {
                return(false);
            }
            BorrowMehod.Return(new Borrow(borrowId, DateTime.Today, fine), false);
            return(true);
        }
예제 #8
0
        public bool Return(int borrowId)
        {
            bool isValid = borrowId >= 0 && account.AccountLevel >= AccountLevelEnums.Patron;

            if (!isValid)
            {
                return(false);
            }
            BorrowMehod.Return(new Borrow(borrowId, DateTime.Today), false);
            return(true);
        }
예제 #9
0
        public bool Borrow(int bookId, int AccountId)
        {
            bool isValid = bookId >= 0 && AccountId >= 0 && account.AccountLevel >= AccountLevelEnums.Librarian;

            if (!isValid)
            {
                return(false);
            }
            BorrowMehod.Borrow(new Borrow(bookId, AccountId, DateTime.Today));
            return(true);
        }
예제 #10
0
 public decimal CalculateFine(DateTime borrowed, DateTime returned)
 {
     return(BorrowMehod.CalculateFine(borrowed, returned));
 }