private void AddItem() { var search = new ItemSearchForm(_items); search.SelectClicked += async(o, args) => { if (!(o is ItemTemplate item)) { return; } var slot = 0; if (_merchantItems != null && _merchantItems.Count(x => x.PageNumber == _page) > 0) { slot = _merchantItems.Where(x => x.PageNumber == _page).Max(x => x.SlotPosition) + 1; } else { _merchantItems = new List <MerchantItem>(); } var merchantItem = new MerchantItem { ItemTemplateID = item.Id_nb, PageNumber = _page, SlotPosition = slot }; _merchantItems.Add(merchantItem); await Save(); }; search.ShowDialog(this); }
private void button2_Click(object sender, EventArgs e) { if (GetSelected() == null) { return; } var search = new ItemSearchForm(_items) { TopMost = true }; search.SelectClicked += async(o, args) => { var selected = GetSelected(); if (selected == null) { return; } if (!(o is ItemTemplate item)) { return; } selected.MerchantItem.ItemTemplateID = item.Id_nb; await Save(); }; search.ShowDialog(this); }
private void Search_Click(object sender, EventArgs e) { if (_showForm?.IsDisposed == false) { return; } _showForm = new ItemSearchForm { TopMost = true }; _showForm.Show(); }
private void itemSearch_Click_1(object sender, EventArgs e) { var search = new ItemSearchForm(); search.SelectClicked += (o, args) => { if (!(o is ItemTemplate item)) { return; } LoadItem(item.ObjectId); }; search.ShowDialog(this); }
private void button4_Click(object sender, EventArgs e) { var search = new ItemSearchForm(_items) { TopMost = true }; search.SelectClicked += (o, args) => { if (!(o is ItemTemplate item)) { return; } _ItemTemplateID.Text = item.Id_nb; _modelImageService.LoadItem(item.Model, pictureBox1.Width, pictureBox1.Height) .ContinueWith(x => pictureBox1.Image = x.Result); }; search.ShowDialog(this); }