这一段代码,我希望通过process工序下拉菜单的选择后,能引起另外两个下拉菜单,单位(unit)和班组(teams)的自动关联更新,但在实际运行中,没有反应,选择对应的工序(process)后,相关的这两个选项,没有自动带出,请问是什么原因;
private void comprocess_SelectedIndexChanged(object sender, EventArgs e) //将工序内容,传递给工时、设备和人员表单的对应菜单;
{
prohouradd f1 = new prohouradd();
f1.Owner = this;
this.updatePprocess(this, f1);
Equhouradd f2 = new Equhouradd();
f2.Owner = this;
this.UpdateEquMenu(this, f2);
this.updateEprocess(this, f2);//0407增加;
workhour f3 = new workhour(comproduct.SelectedItem.ToString(),comprocess.SelectedItem.ToString());
f3.Owner = this;
//this.UpdateworkerMenu(this, f3);
this.updateWprocess(this, f3);//0407增加;
updateUnit(comprocess.SelectedItem.ToString());
}
public void updateUnit(string selectedProcess) //20240528 通过工序,自动关联出单位和班组
{
this.comunit.Items.Clear();
this.comteams.Items.Clear();
if ((comprocess.SelectedItem.ToString() == "异形片流水线") || (comprocess.SelectedItem.ToString() == "片剂流水线") || (comprocess.SelectedItem.ToString() == "片剂流水线") || (comprocess.SelectedItem.ToString() == "制剂1手包")
|| (comprocess.SelectedItem.ToString() == "制剂1喷扫") || (comprocess.SelectedItem.ToString() == "平板机包") || (comprocess.SelectedItem.ToString() == "胶囊机包线") || (comprocess.SelectedItem.ToString() == "胶囊机包线"))
{
comunit.Items.AddRange(new string[] { "盒"});
comteams.Items.AddRange(new string[] { "片剂外包" });
}
}