protected void ttbBoxNo_TextChanged(object sender, EventArgs e) { try { // 清除資料與使用者介面 ClearField(); var convertInfo = WIPConvertInfoEx.GetWIPConvertInfoByTargetLot(ttbBoxNo.Text.Trim()); if (convertInfo == null) { throw new RuleCimesException(TextMessage.Error.T00030(lblBoxNo.Text, ttbBoxNo.Text.Trim()), ttbBoxNo); } // 取得批號 _ProcessLot = LotInfo.GetLotByLot(ttbBoxNo.Text.Trim()); // 若批號不存在拋錯 if (_ProcessLot == null) { throw new RuleCimesException(TextMessage.Error.T00045(GetUIResource("Lot"))); } // 取得批號的所有資單元 _ComponentList = ComponentInfo.GetLotAllComponents(_ProcessLot); // 資料繫結 gvComponent.SetDataSource(_ComponentList, true); } catch (Exception ex) { HandleError(ex); } }
protected void ttbBoxNo_TextChanged(object sender, EventArgs e) { try { // 清除資料與使用者介面 ClearField(); var convertInfo = WIPConvertInfoEx.GetWIPConvertInfoByTargetLot(ttbBoxNo.Text.Trim()); if (convertInfo == null) { throw new RuleCimesException(TextMessage.Error.T00030(lblUnPackingInventoryLot.Text, ttbBoxNo.Text.Trim()), ttbBoxNo); } // 取得批號 _ProcessLot = LotNonActiveInfo.GetLotNonActiveByLot(ttbBoxNo.Text.Trim()); // 若批號不存在拋錯 if (_ProcessLot == null) { throw new RuleCimesException(TextMessage.Error.T00045(lblUnPackingInventoryLot.Text), ttbBoxNo); } if (_ProcessLot.Status != "Finished") { // [01203]批號狀態不正確, 應為 {0} ! throw new RuleCimesException(TextMessage.Error.T01203("Finished"), ttbBoxNo); } if (_ProcessLot.OperationName != "入庫") { //[00361]批號({ 0})所在工作站({ 1}) 與({ 2}) 不同 ! throw new RuleCimesException(TextMessage.Error.T00361(_ProcessLot.Lot, _ProcessLot.OperationName, "入庫"), ttbBoxNo); } _ComponentList = ComponentNonactiveInfoEx.GetDataByInvBoxNo(_ProcessLot.Lot); // 資料繫結 gvComponent.SetDataSource(_ComponentList, true); } catch (Exception ex) { HandleError(ex); } }