using ButcherFactory.BO.LocalBL; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using WinFormControl; namespace ButcherFactory.Dialogs { public partial class SelectStoreDialog : Form { public Tuple Result; public SelectStoreDialog() { InitializeComponent(); var stores = DialogBL.GetStoreList(); var flw = new FlowLayoutPanel() { Dock = DockStyle.Fill }; foreach (var item in stores) { var btn = new UButton() { Width = 100, Height = 60, Text = item.StringExt1.ToString(), Tag = item.LongExt1, Font = new Font("宋体", 10), Margin = new Padding(12) }; btn.Click += BtnClick; flw.Controls.Add(btn); } this.Controls.Add(flw); } private void BtnClick(object sender, EventArgs e) { var btn = sender as UButton; Result = new Tuple(btn.Text, Convert.ToInt64(btn.Tag)); DialogResult = DialogResult.OK; this.Close(); } } }