private void AddSecondStreetItemPanel(SecondStreetListItem item) { SecondStreetItemPanel panel = new SecondStreetItemPanel(item); panel.Tag = item; panel.TabStop = false; this.flowLayoutPanel1.Controls.Add(panel); this.flowLayoutPanel1.AutoScrollPosition = new Point(0, 0); if (SettingForm.getAutoScroll()) { panel.SetFocusBuyButton(); this.flowLayoutPanel1.AutoScrollPosition = new Point(0, 0); nowfocus = 0; } else { nowfocus++; } }
public SecondStreetItemPanel(SecondStreetListItem item) { try { InitializeComponent(); ChangeComponentSize(); this.item = item; this.itemNameLabel.Text = item.goods_name; this.shopNameLabel.Text = item.shop_name; this.brandNameLabel.Text = item.brand_name; this.sizeLabel.Text = item.size_detail; if (!string.IsNullOrEmpty(item.image_url)) { this.pictureBox1.ImageLocation = item.image_url; } this.PriceLabel.Text = String.Format("{0:#,0} 円", item.price); ChangeComponentSize(); } catch (Exception ex) { Log.Logger.Error("FrilItemPanel error"); } }
public async void BuyItem(SecondStreetListItem item) { if (SettingForm.getShowPrompt()) { if (DialogResult.OK != MessageBox.Show(string.Format("{0}を購入しますか?", item.goods_name), "確認", MessageBoxButtons.OKCancel, MessageBoxIcon.Question)) { return; } } this.toolStripStatusLabel1.Text = string.Format("購入処理開始:{0}", item.goods_name); bool res = await Task.Run(() => ExecuteItem(item.shops_id.ToString(), item.goods_id.ToString())); if (res) { this.toolStripStatusLabel1.Text = string.Format("購入成功: {0}", item.goods_name); MessageBox.Show(string.Format("{0}を購入しました", item.goods_name), "確認", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { this.toolStripStatusLabel1.Text = string.Format("購入失敗: {0}", item.goods_name); MessageBox.Show(string.Format("{0}の購入に失敗しました", item.goods_name), "確認", MessageBoxButtons.OK, MessageBoxIcon.Error); } }