public void Checkout() { if (customerInfo == null) // no previous transactions { if (customerRegistrationInfo == null) // unregistered customer { IgniteDataAccess.CreateNewTransaction(ItemGiveaway.ItemId, ItemGiveaway.ProductQty, IgniteDataAccess.UNREGISTERED_CUSTOMERID); } else { IgniteDataAccess.CreateNewTransaction(ItemGiveaway.ItemId, ItemGiveaway.ProductQty, customerRegistrationInfo.CustomerFaceHash); } } else { IgniteDataAccess.CreateNewTransaction(ItemGiveaway.ItemId, ItemGiveaway.ProductQty, customerInfo.CustomerFaceHash); } // TODO: report transaction success status // Prepare for the next customer UpdateCustomer(null); ItemGiveaway.Reset(IgniteDataServices.GetLocatedProduct(), 1); TotalItems = 1; IsWarningNoCheckout = false; }
public CheckoutViewModel() { // Ideally, both customer and item should be recognized somehow, but here // intialize with unrecognized customer and default located product ItemGiveaway = new ProductViewModel(); Product locatedProd = IgniteDataServices.GetLocatedProduct(); ItemGiveaway.Reset(locatedProd, 1); // one item at a time please TotalItems = 1; ProductChoices = new ObservableCollection <Product>(ProductCatalog.Instance.Products); // Limit choices to similar items //ProductChoices = new ObservableCollection<Product>(from prod in ProductCatalog.Instance.Products // where prod.ProductHierarchyName == locatedProd.ProductHierarchyName // select prod); }
public void Update() { FaqUri = new System.Uri(IgniteDataServices.GetLocatedProduct().ProductFaqSrc); }