Example #1
0
 public void PopulateListView()
 {
     shoppingCart.Clear ();
     lblHelp.Text = "Add items to your Shopping Cart below while you shop, then check out when you're done!";
     var db = DependencyService.Get<ISQLite> ().GetConnection ();
     var SCtable = db.Query<ShoppingCartItem> ("SELECT * FROM ShoppingCart");
     foreach (var SCitem in SCtable) {
         var table = db.Query<ItemDetails> ("SELECT * FROM ItemDetails WHERE ID = ?", SCitem.itemID);
         foreach (var item in table) {
             var img = ImageSource.FromStream (() => new MemoryStream (item.Image));
             var itemi = new ShoppingListItem (item.ID, item.Name, item.ItemPrice, img);
             shoppingCart.Add (itemi);
         }
     }
 }
 public void PopulateListView()
 {
     shoppingList.Clear ();
     lblHelp.Text = "Add items to your Shopping List below so that you don't forget them on your shop!";
     var db = DependencyService.Get<ISQLite> ().GetConnection ();
     var SLtable = db.Query<ShoppingList> ("SELECT * FROM ShoppingList");
     foreach (var SLitem in SLtable) {
         var table = db.Query<ItemDetails> ("SELECT * FROM ItemDetails WHERE ID = ?", SLitem.itemID);
         foreach (var item in table) {
             var img = ImageSource.FromStream (() => new MemoryStream (item.Image));
             var itemi = new ShoppingListItem (item.ID, item.Name, item.ItemPrice, img);
             shoppingList.Add (itemi);
         }
     }
 }