public static PaymentInformation getUserCreditCard(int paymentId) { UserDAO userDataLayer = new UserDAO(); PaymentInformationDAO dataLayer = new PaymentInformationDAO(); PaymentInformation userCreditCard = dataLayer.getUserCreditCard(paymentId); return userCreditCard; }
public static List<PaymentInformation> getUserCreditCards(string username) { UserDAO userDataLayer = new UserDAO(); User user = userDataLayer.getUserDetails(username); PaymentInformationDAO paymentInfoDatalayer = new PaymentInformationDAO(); List<PaymentInformation> userPaymentInfo = paymentInfoDatalayer.getUserPaymentInfo(user); return userPaymentInfo; }
public static bool addCreditCard(string username, string creditCardType, string creditCardNumber, string creditCardCity, string creditCardState, DateTime creditCardExpDate, string securitCode) { UserDAO userDataLayer = new UserDAO(); User user = userDataLayer.getUserDetails(username); PaymentInformation newCreditCard = new PaymentInformation(); newCreditCard.setUser(user); newCreditCard.setCreditCardType(creditCardType); newCreditCard.setCreditCardNumber(creditCardNumber); newCreditCard.setCity(creditCardCity); newCreditCard.setState(creditCardState); newCreditCard.setCardExpDated(creditCardExpDate); newCreditCard.setSecurityCode(securitCode); PaymentInformationDAO Paymentdatalayer = new PaymentInformationDAO(); Boolean success = Paymentdatalayer.addNewCreditCard(newCreditCard); return success; }
public UsersManager() { dataLayer = new UserDAO(); }