using ButcherFactory.BO; 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; namespace ButcherFactory.SegmentProduction_ { public partial class TrunOutDialog : Form { public string backGoodsName; BindingList list; public TrunOutDialog(BindingList trunOutList) { this.list = trunOutList; InitializeComponent(); uDataGridView1.CellContentClick += uDataGridView1_CellContentClick; } protected override void OnLoad(EventArgs e) { base.OnLoad(e); uDataGridView1.DataSource = list; uDataGridView1.Refresh(); } void uDataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex != 2) return; backGoodsName = (string)uDataGridView1.CurrentRow.Cells[0].Value; DialogResult = DialogResult.OK; this.Close(); } private void closeBtn_Click(object sender, EventArgs e) { this.Close(); } } }