public void GetPrintSetAndGoodSet(string text) { if (string.IsNullOrWhiteSpace(text)) { return; } #region 这里做流程控制,在同一个线程中操作 try { using (PrintSetServiceClient client = new PrintSetServiceClient()) { //2、获取打印配置 DataTable psdt = client.GetPrintSetByFPNum(text); if (psdt == null || psdt.Rows.Count == 0) { Speecher("Print Config is null"); return; } //3、获取成品配置 DataTable gsdt = client.GetGoodSetByFPNum(text); if (gsdt == null || gsdt.Rows.Count == 0) { Speecher("Goods Config is null"); return; } //4、获取Ro配置 DataTable rsdt = client.GetRoSetByFPNum(text); if (rsdt == null || rsdt.Rows.Count == 0) { Speecher("Ro# Config is null"); return; } button4.BackColor = Color.Green; List <PrintSet> printsetList = PrintSet.DataTableToList(psdt); List <RoSet> rosetList = RoSet.DataTableToList(rsdt); List <GoodSet> goodsetList = GoodSet.DataTableToList(gsdt); _currentPrintSet = null; _currentPrintSet = printsetList.OrderByDescending(p => p.CreateTime).First(); _currentRoSet = null; _currentRoSet = rosetList.OrderByDescending(r => r.Oid).First(); _currentGoodSetList = null; _currentGoodSetList = goodsetList; GotoNextTextBox(FinishedProductNum); } } catch (Exception ex) { LogHelper.WriteLog("GetPrintSetAndGoodSet", ex); } #endregion }