async private void InitConfig() { serviceClient = new MesService.MesServiceClient(); serviceClientTest = new MesServiceTest.MesServiceClient(); this.rbtn_material_stock.CheckState = CheckState.Checked; this.cb_materialState.Items.Add("关闭"); this.cb_materialState.SelectedIndex = 0; this.cb_materialState.ForeColor = Color.Red; this.radDateTimePicker1.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); var currentProcess = await serviceClientTest.SelectCurrentTProcessAsync(); string[] array = await serviceClientTest.SelectStationListAsync(currentProcess); if (array.Length > 0) { cb_station.Items.Clear(); foreach (var station in array) { cb_station.Items.Add(station); } } DataTable dt = (await serviceClient.SelectMaterialAsync("", MesService.MaterialStockState.PUT_IN_STOCK_AND_STATEMENT)).Tables[0]; if (dt.Rows.Count < 1) { return; } this.cb_materialCode.Items.Clear(); for (int i = 0; i < dt.Rows.Count; i++) { this.cb_materialCode.Items.Add(dt.Rows[i][0].ToString()); } this.cb_materialCode.AutoCompleteSource = AutoCompleteSource.ListItems; this.cb_materialCode.AutoCompleteMode = AutoCompleteMode.SuggestAppend; //productTypeNo var productTypeNoList = await serviceClientTest.SelectAllTProcessAsync(); this.cb_typeNo.MultiColumnComboBoxElement.Columns.Add("typeNo"); foreach (var typeNo in productTypeNoList) { this.cb_typeNo.EditorControl.Rows.Add(typeNo); } this.cb_typeNo.EditorControl.ShowColumnHeaders = false; this.cb_typeNo.BestFitColumns(); this.cb_typeNo.Text = ""; this.cb_stationName.MultiColumnComboBoxElement.Columns.Add("stationName"); }
async private void Cb_typeNo_SelectedIndexChanged(object sender, EventArgs e) { var currentTypeNo = this.cb_typeNo.Text; if (currentTypeNo == "") { return; } var stationArray = await serviceClientTest.SelectStationListAsync(currentTypeNo); this.cb_stationName.EditorControl.Rows.Clear(); foreach (var station in stationArray) { this.cb_stationName.EditorControl.Rows.Add(station); } this.cb_stationName.EditorControl.ShowColumnHeaders = false; this.cb_stationName.BestFitColumns(); this.cb_stationName.Text = ""; }