Beispiel #1
0
 public int AddBorrowed(UserWSDTO user, BorrowDTO record)
 {
     if (user != null && user.IsValid)
     {
         return(Manager.AddBorrowed(Translate(record)));
     }
     throw new System.Web.HttpRequestValidationException("Invalid user");
 }
Beispiel #2
0
        public BorrowDTO Translate(ControllerLayer.BorrowDTO borrow)
        {
            BorrowDTO Output = new BorrowDTO();

            Output.BID              = borrow.BID;
            Output.BorrowDate       = borrow.BorrowDate;
            Output.ActualReturnDate = borrow.ActualReturnDate;
            Output.LateFee          = borrow.LateFee;
            Output.MediaID          = borrow.MediaID;
            Output.ReturnDate       = borrow.ReturnDate;
            Output.UID              = borrow.UID;
            return(Output);
        }
Beispiel #3
0
 public ControllerLayer.BorrowDTO Translate(BorrowDTO borrow)
 {
     try
     {
         if (borrow.BID == null)
         {
             return(new ControllerLayer.BorrowDTO(borrow.UID, borrow.MediaID));
         }
         else
         {
             return(new ControllerLayer.BorrowDTO((int)borrow.BID));
         }
     }
     catch (Exceptions.ValidationException e)
     {
         throw new System.Web.HttpParseException(e.Message);
     }
 }