public int AddBorrowed(UserWSDTO user, BorrowDTO record) { if (user != null && user.IsValid) { return(Manager.AddBorrowed(Translate(record))); } throw new System.Web.HttpRequestValidationException("Invalid user"); }
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); }
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); } }