private void UpdateAdapter(ShopItemJson obj) { Deployment.Current.Dispatcher.BeginInvoke(() => { this.ShopItem = obj; IsLoading = false; }); }
public JsonResult SearchAllMerch(int p, int c, string s) { List<StoreItem> names = SiteCache.SearchPublishedStoreItems(c, p, s); ShopsJson shop = new ShopsJson(); shop.Items = new List<ShopItemJson>(); shop.Count = c; shop.Page = p; for (int i = 0; i < names.Count; i++) { ShopItemJson j = new ShopItemJson(); j.Description = names[i].Description; j.Name = names[i].Name; j.AcceptsPayPal = names[i].AcceptsPayPal; j.AcceptsStripe = names[i].AcceptsStripe; j.CanRunOutOfStock = names[i].CanRunOutOfStock; for (int js = 0; js < names[i].Colors.Count; js++) { j.Colors.Add(names[i].Colors[js].HexColor); } j.IsPublished = names[i].IsPublished; j.ItemSize = names[i].ItemSize; j.ItemType = names[i].ItemType; j.Notes = RDN.Utilities.Strings.StringExt.ConvertTextAreaToHtml(names[i].Note); for (int js = 0; js < names[i].Photos.Count; js++) { j.PhotoUrls.Add(names[i].Photos[js].ImageUrl); j.PhotoUrlsThumbs.Add(names[i].Photos[js].ImageThumbUrl); } j.Shipping = names[i].Shipping; j.Price = names[i].Price; j.QuantityInStock = names[i].QuantityInStock; j.SoldBy = names[i].Store.Name; j.SoldById = names[i].Store.MerchantId.ToString().Replace("-", ""); j.StoreItemId = names[i].StoreItemId; j.Views = names[i].Views; j.RDNUrl = ServerConfig.WEBSITE_STORE_DEFAULT_LOCATION + "/roller-derby-item/" + RDN.Utilities.Strings.StringExt.ToSearchEngineFriendly(j.Name) + "/" + j.StoreItemId; shop.Items.Add(j); } return Json(shop, JsonRequestBehavior.AllowGet); }
public ShopViewController(ShopItemJson shop) { _shop = shop; }
protected override void OnCreate(Bundle bundle) { try { RequestWindowFeature(WindowFeatures.NoTitle); base.OnCreate(bundle); LoggerMobile.Instance.logMessage("Opening ShopActvitiy", LoggerEnum.message); var eventString = Intent.GetStringExtra("shopItem"); ev = Json.DeserializeObject<ShopItemJson>(eventString); SetContentView(Resource.Layout.PublicShopItem); LegacyBar = FindViewById<LegacyBar.Library.Bar.LegacyBar>(Resource.Id.actionbar); LegacyBar.SeparatorColor = Color.Purple; LegacyBar.SetHomeAction(new BackAction(this, null, Resource.Drawable.shop, this)); LegacyBar.Title = ev.Name; // Get our button from the layout resource, // and attach an event to it try { Gallery gallery = (Gallery)FindViewById<Gallery>(Resource.Id.shopItemImage); if (ev.PhotoUrlsThumbs != null && ev.PhotoUrlsThumbs[0] != null) gallery.Adapter = new ImageAdapter(this, ev.PhotoUrlsThumbs); else gallery.Adapter = new ImageAdapter(this, ev.PhotoUrls); } catch (Exception exception) { ErrorHandler.Save(exception, MobileTypeEnum.Android, (Context)this); } TextView shopItemName = FindViewById<TextView>(Resource.Id.shopItemName); shopItemName.Text = ev.Name; shopItemSoldBy = FindViewById<TextView>(Resource.Id.shopItemSoldBy); shopItemSoldBy.Text = ev.SoldBy; shopItemSoldBy.PaintFlags = PaintFlags.UnderlineText; shopItemSoldBy.Clickable = true; //shopItemSoldBy.Click += eventLocation_Click; shopItemPrice = FindViewById<TextView>(Resource.Id.shopItemPrice); shopItemPrice.Text = ev.Price.ToString(); shopItemDescription = FindViewById<TextView>(Resource.Id.shopItemDescription); if (!String.IsNullOrEmpty(ev.Notes)) shopItemDescription.Text = Html.FromHtml(ev.Notes).ToString(); Button shopItemBuyNow = FindViewById<Button>(Resource.Id.shopItemBuyNow); shopItemBuyNow.Click += shopItemBuyNow_Click; m_AdView = FindViewById(Resource.Id.adView); if (SettingsMobile.Instance.User != null && SettingsMobile.Instance.User.IsValidSub) { } } catch (Exception exception) { ErrorHandler.Save(exception, MobileTypeEnum.Android, (Context)this); } }