这一段代码,在同一个表单界面内,想通过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.updateWprocess(this, f3);//0407增加;
updateUnit(sender,e);
}
public void updateUnit(object sender, EventArgs e) //20240528 通过工序,自动关联出单位和班组
{
comunit.Items.Clear();
comteams.Items.Clear();
string selectedProcess = comprocess.SelectedItem.ToString();
if ((selectedProcess == "异形片流水线") || (selectedProcess == "片剂流水线") || (selectedProcess == "制剂1手包")
|| (selectedProcess == "制剂1喷扫") || (selectedProcess == "平板机包") || (selectedProcess == "胶囊机包线"))
{
comunit.Items.Add("盒");
comunit.SelectedIndex = 0;
comteams.Items.Add("片剂外包");
comteams.SelectedIndex = 0;
}
}