public CheckoutVM(IDataStore dataStore) { this.dataStore = dataStore ?? throw new ArgumentNullException(nameof(dataStore)); ProductList = new ObservableCollection <Product>(); ProductList.Add(new Product(1, "African Safari", 2000.00, 0)); ProductList.Add(new Product(2, "Mexico Safari", 1500.00, 0)); ProductList.Add(new Product(3, "Australian Safari", 4200.00, 0)); ProductList.Add(new Product(4, "Antarctic Safari", 7100.00, 0)); foreach (var p in ProductList) { dataStore.AddProduct(p); } Customer c = new Customer("joe", "blow", "123 anywhere", "ephraim", "ut", "84627", "po box 123", "ephraim", "ut", "84627", "*****@*****.**"); dataStore.AddCustomer(c); Customers = new ObservableCollection <Customer>(DataStore.GetAllCustomers()); Products = new ObservableCollection <Product>(DataStore.GetAllProducts()); SelectedCustomer = new ObservableCollection <Customer>(); CustomerBool = false; VerifyBool = false; FinalBool = false; CustomerLock = false; OrderLock = false; Total = 0; }
static void Login() { string name; do { name = userInterface.GetLine("Enter your name: "); } while (name.Equals("")); currentUser = dataStore.GetCustomer(name); if (currentUser == null) { currentUser = new StoreModels.Customer(); currentUser.Name = name; currentUser.CustomerID = dataStore.AddCustomer(name, currentUser); } cart = new StoreModels.Order(); cart.Customer = currentUser; managerMenu = false; if (currentUser.IsManager) { managerMenu = userInterface.GetLine("Would you like to log in as a manager? [ y / N ]: ").ToLower().Equals("y"); } Console.Clear(); }
public ActionResult <Customer> Post([FromBody] Customer customer) { return(_dataStore.AddCustomer(customer)); }