//选择品牌 private void btn_search_Click(object sender, EventArgs e) { try { string name = textBox_searchbox.Text; List <HUNHETROUGH2> list = specialtroughlist.Where(x => x.cigarettename.IndexOf(name) >= 0).ToList(); w_trough_pecial fm = new w_trough_pecial(speacilname, speaciltrough, list); fm.ShowDialog(); textBox_hunhe.Text = fm.Controls["textBox_name"].Text; label_hhdppt.Text = fm.Controls["label_troughnum"].Text; fm.Dispose(); } catch (Exception) { MessageBox.Show("选择失败,请重新选择"); } }
private void button_searchhunhe_Click(object sender, EventArgs e) { //查询当前分拣线上的混合道信息 try { string name = textBox_searchhnhe.Text; List <HUNHETROUGH2> list = specialtroughlist.Where(x => x.cigarettename.IndexOf(name) >= 0).ToList(); w_trough_pecial fm = new w_trough_pecial(speacilname, speaciltrough, list); fm.ShowDialog(); label_hunhepp.Text = fm.Controls["textBox_name"].Text == "" ? "-" : fm.Controls["textBox_name"].Text; label_hunhebh.Text = fm.Controls["label_troughnum"].Text == "品牌通道号" ? "-" : fm.Controls["label_troughnum"].Text; label_hunhebm.Text = fm.Controls["label_code"].Text == "品牌编码" ? "-" : fm.Controls["label_code"].Text; fm.Dispose(); } catch (Exception) { MessageBox.Show("选择失败,请重新选择"); } }