//Method Name: ShoppingCartViewModel //Purpose of the Method: Upon construction this should take the context and send a list of select items of the type PaymentType to the View. They should be the paymentTypes of the active customer. //Arguments in Method: BangazonUserAuthContext public ShoppingCartViewModel(BangazonWebContext ctx) : base(ctx) { context = ctx; this.ListOfPaymentTypes = context.PaymentType .Where(pt => pt.CustomerId == singleton.Customer.CustomerId) .AsEnumerable() .Select(pt => new SelectListItem { Text = $"{pt.FirstName} {pt.LastName} {pt.Processor} {pt.ExpirationDate}", Value = pt.PaymentTypeId.ToString() }).ToList(); this.ListOfPaymentTypes.Insert(0, new SelectListItem { Text = "Choose Payment Type" }); }
public BaseViewModel(BangazonWebContext ctx) { context = ctx; this.ListOfCustomers = context.Customer .OrderBy(l => l.LastName) .AsEnumerable() .Select(li => new SelectListItem { Text = $"{li.FirstName} {li.LastName}", Value = li.CustomerId.ToString() }).ToList(); this.ListOfCustomers.Insert(0, new SelectListItem { Text = "Choose Customer" }); }
public ProductTypesListViewModel(BangazonWebContext ctx) : base(ctx) { context = ctx; this.ProductTypesList = context.ProductType .OrderBy(type => type.Name) .AsEnumerable() .Select(li => new SelectListItem { Text = $"{li.Name}", Value = li.ProductTypeId.ToString() }).ToList(); this.ProductTypesList.Insert(0, new SelectListItem { Text = "Choose Product Category", Value = "" }); this.SubProductTypesList = new List <SelectListItem>(); this.SubProductTypesList.Insert(0, new SelectListItem { Text = "Choose a Product Category to See Sub-Categories", Value = "" }); }
public AllProductsViewModel(BangazonWebContext ctx) : base(ctx) { }
} //Displayed on detail view to show sellers name. public SingleProductViewModel(BangazonWebContext ctx) : base(ctx) { }
public AllSubProductTypesViewModel(BangazonWebContext ctx) : base(ctx) { }
public ProductsController(BangazonWebContext ctx) { context = ctx; }
public PaymentTypeViewModel(BangazonWebContext ctx) : base(ctx) { }
public TimelyReportsController(BangazonWebContext ctx) { context = ctx; }
public NewCustomerViewModel(BangazonWebContext ctx) : base(ctx) { }
public CustomersController(BangazonWebContext ctx) { context = ctx; }