From 03e2a1f9bd9294e8db7537ee9b63a87d9afde9ca Mon Sep 17 00:00:00 2001 From: tnnkrt Date: Thu, 10 Jul 2014 11:45:10 -0700 Subject: [PATCH] fixed bug @ storeitem modified: Quyd/Quyd.v12.suo modified: Quyd/Quyd/Controls/ControlItemDetail.xaml.cs modified: Quyd/Quyd/Controls/ControlPost.xaml.cs modified: Quyd/Quyd/Models/Item.cs modified: Quyd/Quyd/PagePost.xaml.cs modified: Quyd/Quyd/PivotPage1.xaml modified: Quyd/Quyd/PivotPage1.xaml.cs Quyd/Quyd/Resources/Images/HDPE.jpg Quyd/Quyd/Resources/Images/LDPE.jpg Quyd/Quyd/Resources/Images/Other.jpg Quyd/Quyd/Resources/Images/PETE.jpg Quyd/Quyd/Resources/Images/PP.jpg Quyd/Quyd/Resources/Images/PS.jpg Quyd/Quyd/Resources/Images/V.jpg --- Quyd/Quyd.v12.suo | Bin 168960 -> 168960 bytes Quyd/Quyd/Controls/ControlItemDetail.xaml.cs | 2 +- Quyd/Quyd/Controls/ControlPost.xaml.cs | 2 +- Quyd/Quyd/Models/Item.cs | 24 +++++++++---------- Quyd/Quyd/PagePost.xaml.cs | 12 ++++++---- Quyd/Quyd/PivotPage1.xaml | 4 ++-- Quyd/Quyd/PivotPage1.xaml.cs | 9 +++---- 7 files changed, 29 insertions(+), 24 deletions(-) diff --git a/Quyd/Quyd.v12.suo b/Quyd/Quyd.v12.suo index ffbdc412b0758ead0b3373f6d27019cc5ff57e66..ae279bf2182e6ddba6121c27ca9e38a7935a9a44 100644 GIT binary patch delta 334 zcmWm7OG^R)5C`y?b(LCVQ|w`gu!Lbz)J7X&;z2SfB%&|Sr95hBOVCXU!b3^x1f7D) zM@#f{Z=LGg#Sc)?(MuqN$K1xlkN*ra%;ZfeZ%U^sf-w_7d|p)qF=>paDJvYJX|;t# zjC5?<)&M|506*snlbM(K7?14$r^rHVl$DuH*`5iUqYH6|{qb(s64$dV&c;~x zN0^htE;;+f7}wx_%uDlscoaUd2bUP@8pOQx;gK`N9( zUL8`91_d@@8#1s9`nhq5!irD}QdEj%b56|q(nT>rR_ BZ14a8 delta 262 zcmZoz!PT&WYk~nI(?mmQM&^ya3QWwa_V{itV4J`=iNzw-gn@zKKM-*Kx_cSAURGTZ4Ja?ljpLS zix>e}fk6BhCx)2i*8JeJ51vWwxp%-}^65`=CkxhyPOkQDU6jYRNQ-Iuqy>x;n query; if (userItems == null) { - query = from storeItem in ParseObject.GetQuery("StoreItem") - where storeItem.ObjectId == store.Object.ObjectId + query = from storeItem in ParseObject.GetQuery("StoreItem").Include("item") + where storeItem.Get("store") == store.Object where storeItem["item"] == item - where storeItem.CreatedAt <= atDateTime - where storeItem.Get("validTo") >= atDateTime + //where storeItem.CreatedAt <= atDateTime + //where storeItem.Get("validTo") >= atDateTime orderby storeItem["name"] ascending select storeItem; } else { - query = from storeItem in ParseObject.GetQuery("StoreItem") - where storeItem.ObjectId == store.Object.ObjectId + query = from storeItem in ParseObject.GetQuery("StoreItem").Include("item") + where storeItem.Get("store") == store.Object where userItems.itemList.Contains(storeItem.Get("item")) - where storeItem.CreatedAt <= atDateTime - where storeItem.Get("validTo") >= atDateTime + //where storeItem.CreatedAt <= atDateTime + //where storeItem.Get("validTo") >= atDateTime orderby storeItem["name"] ascending select storeItem; } @@ -141,10 +141,10 @@ orderby storeItem["name"] ascending } } - if (storeItem_result.ObjectId == null) - { - await storeItem_result.SaveAsync(); - } + //if (storeItem_result.ObjectId == null) + //{ + // await storeItem_result.SaveAsync(); + //} itemList.Add(new StoreItem(storeItem_result)); } diff --git a/Quyd/Quyd/PagePost.xaml.cs b/Quyd/Quyd/PagePost.xaml.cs index d8a5716..ac22630 100644 --- a/Quyd/Quyd/PagePost.xaml.cs +++ b/Quyd/Quyd/PagePost.xaml.cs @@ -60,10 +60,14 @@ private async void Button_Click(object sender, RoutedEventArgs e) ItemList itemList = await post.getUserItem(); foreach (var item in (itemList)) { - (item as PostItem).Quantity = Convert.ToInt32((StackItem.Children.ElementAt(i) as Quyd.Controls.ControlItemDetail).BoxValue.Text); - i++; - (item as PostItem).Post = post; - await (item as PostItem).saveAsync(); + int q = Convert.ToInt32((StackItem.Children.ElementAt(i) as Quyd.Controls.ControlItemDetail).BoxValue.Text); + if (q > 0) + { + (item as PostItem).Quantity = q; + i++; + (item as PostItem).Post = post; + await (item as PostItem).saveAsync(); + } } NavigationService.GoBack(); diff --git a/Quyd/Quyd/PivotPage1.xaml b/Quyd/Quyd/PivotPage1.xaml index ef168de..90239ce 100644 --- a/Quyd/Quyd/PivotPage1.xaml +++ b/Quyd/Quyd/PivotPage1.xaml @@ -58,11 +58,11 @@ - +