internal static List <Billing> GetCardsOnFileForCustomer(Customer CurrentCustomer) { List <Billing> CardOptions = new List <Billing>(); using (var DB = new P0Context()) { CustomerBillingDAO.LoadCustomersBillingList(DB); BillingDAO.LoadBillingList(DB); foreach (CustomerBilling cb in DB.CustomerBillingList) { if (cb.CustomerID == CurrentCustomer.CustomerID) { foreach (Billing b in DB.BillingInformationList) { if (cb.BillingID == b.BillingID) { CardOptions.Add(b); } } } } } return(CardOptions); }
internal static void AddNewCardInformationToUser(Billing CardInfoEntered, Customer CurrentCustomer) { using (var DB = new P0Context()) { BillingDAO.AddBilling(CardInfoEntered, DB); CustomerBilling CB = new CustomerBilling { CustomerID = CurrentCustomer.CustomerID, BillingID = CardInfoEntered.BillingID }; CustomerBillingDAO.AddCustomerBilling(CB, DB); } }
internal static void AddNewCardInformationToUser(Billing CardInfoEntered, Customer CurrentCustomer, P1Context _context) { var DB = _context; BillingDAO.AddBilling(CardInfoEntered, DB); CustomerBilling CB = new CustomerBilling { CustomerID = CurrentCustomer.CustomerID, BillingID = CardInfoEntered.BillingID }; CustomerBillingDAO.AddCustomerBilling(CB, DB); }