/// <summary> /// 获取工厂通过线上仓 /// </summary> /// <param name="dataTable">线上仓</param> public string GetFactoryByStore(string store) { DataSet dsReturn = new DataSet(); try { IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject(); if (null != serverFactory) { dsReturn = serverFactory.CreatIReceiveMaterialEngine().GetFactoryByStore(store); _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn); } } catch (Exception ex) { _errorMsg = ex.Message; } finally { CallRemotingService.UnregisterChannel(); } if (dsReturn.Tables[0].Rows.Count > 0) { return(dsReturn.Tables[0].Rows[0][0].ToString()); } else { return("StoreFactoryNull"); } }
/// <summary> /// 获取物料明细记录并绑定到GridControl控件中。 /// </summary> public void BindMaterialDetail() { string sapOperation = GetSapOperation(); string storeNameList = GetStoreNameList(); DataSet dsReturn = new DataSet(); string msg = string.Empty; try { //创建远程调用的工厂对象。 IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject(); if (null != serverFactory)//工厂对象不为null { dsReturn = serverFactory.CreatIReceiveMaterialEngine().GetMaterialDetail(sapOperation, storeNameList); msg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn); if (msg != string.Empty) { MessageService.ShowError(msg); } else { dsReturn.Tables[0].Columns.Add(new DataColumn("IsSelected", typeof(Boolean))); dsReturn.Tables[0].Columns.Add(new DataColumn("Operation", typeof(string))); dsReturn.Tables[0].Columns.Add(new DataColumn("OnlineWarehouse", typeof(string))); foreach (DataRow dr in dsReturn.Tables[0].Rows) { string strWorkOrder = dr["AUFNR"].ToString(); string strMaterialCode = dr["MATNR"].ToString(); string strStores = PropertyService.Get(PROPERTY_FIELDS.STORES); ReceiveMaterialEntity entity = new ReceiveMaterialEntity(); DataTable dt = entity.GetStoreByMaterialCode(strWorkOrder, strMaterialCode, strStores); if (entity.ErrorMsg == string.Empty)//成功获取线上仓数据。 { string defaultLineStore = dt.Rows.Count > 0 ? dt.Rows[0][0].ToString() : string.Empty; string defaultOperation = defaultLineStore != string.Empty ? GetOperationNameByStore(defaultLineStore) : string.Empty; dr["OnlineWarehouse"] = defaultLineStore; dr["Operation"] = defaultOperation; } } gdcData.MainView = gdvMaterialDefault; gdcData.DataSource = dsReturn.Tables[0]; } } } finally { CallRemotingService.UnregisterChannel(); } }
/// <summary> /// 为工单BOM添加自备料。 /// </summary> /// <param name="orderNumber">工单号。</param> /// <param name="materialCode">物料编码。</param> /// <param name="materialDescription">物料描述。</param> public void CreateWOBomOwnMaterial(string orderNumber, string materialCode, string materialDescription) { try { IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject(); DataSet dsReturn = serverFactory.CreatIReceiveMaterialEngine().CreateWOBomOwnMaterial(orderNumber, materialCode, materialDescription); _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn); } catch (Exception ex) { _errorMsg = ex.Message; } finally { CallRemotingService.UnregisterChannel(); } }
/// <summary> /// 通过工序名称和车间主键获取线上仓 /// </summary> /// <param name="operation">工序名称,</param> /// <param name="roomKey">车间主键,</param> /// <param name="stores">拥有权限的线上仓名称。使用逗号分隔。</param> /// <returns>线上仓集合</returns> public DataSet GetStores(string operation, string roomKey, string stores) { DataSet dsReturn = new DataSet(); try{ IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject(); dsReturn = serverFactory.CreatIReceiveMaterialEngine().GetStores(operation, roomKey, stores); _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn); } catch (Exception ex) { _errorMsg = ex.Message; } finally{ CallRemotingService.UnregisterChannel(); } return(dsReturn); }
/// <summary> /// 手工输入并保存接收的物料信息。 /// </summary> /// <param name="ht">包含输入数据的哈希表对象。</param> /// <returns>包含执行结果的数据集。</returns> public DataSet ManualSaveReceiveMaterial(Hashtable ht) { DataSet dsReturn = new DataSet(); try { IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject(); dsReturn = serverFactory.CreatIReceiveMaterialEngine().ManualSaveReceiveMaterial(ht); _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn); } catch (Exception ex) { _errorMsg = ex.Message; } finally { CallRemotingService.UnregisterChannel(); } return(dsReturn); }
/// <summary> /// 获取物料清单列表 /// </summary> /// <param name="paramTable">包含查询条件的数据表。</param> /// <returns>获取物料清单列表</returns> public DataSet GetReceiveMaterialHistory(DataTable paramTable, ref PagingQueryConfig config) { DataSet dsReturn = new DataSet(); try { IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject(); dsReturn = serverFactory.CreatIReceiveMaterialEngine().GetReceiveMaterialHistory(paramTable, ref config); _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn); } catch (Exception ex) { _errorMsg = ex.Message; } finally { CallRemotingService.UnregisterChannel(); } return(dsReturn); }
/// <summary> /// 来料接收 /// </summary> /// <param name="dataTable">来料接收,选择工单信息</param> public void ReceiveLineMaterial(DataTable dataTable) { DataSet dsReturn = new DataSet(); try { IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject(); if (null != serverFactory) { dsReturn = serverFactory.CreatIReceiveMaterialEngine().ReceiveLineMaterial(dataTable); _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn); } } catch (Exception ex) { _errorMsg = ex.Message; } finally { CallRemotingService.UnregisterChannel(); } }
/// <summary> /// 通过物料编码获取线上仓 /// </summary> /// <param name="workOrder">工单号。</param> /// <param name="materialCode">物料编码。</param> /// <param name="stores">线上仓名称。</param> /// <returns>包含线上仓名称的数据集。</returns> public DataTable GetStoreByMaterialCode(string workOrder, string materialCode, string stores) { DataSet dsReturn = new DataSet(); try { IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject(); if (null != serverFactory) { dsReturn = serverFactory.CreatIReceiveMaterialEngine().GetStoreByMaterialCode(workOrder, materialCode, stores); _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn); } } catch (Exception ex) { _errorMsg = ex.Message; } finally { CallRemotingService.UnregisterChannel(); } return(dsReturn.Tables[0]); }
/// <summary> /// 通过线上仓获取工序 /// </summary> /// <param name="lineStore">线上仓名称</param> /// <returns>工序名称</returns> public string GetOperationByLineStore(string lineStore) { DataSet dsReturn = new DataSet(); try { IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject(); if (null != serverFactory) { dsReturn = serverFactory.CreatIReceiveMaterialEngine().GetOperationByLineStore(lineStore); _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn); } } catch (Exception ex) { _errorMsg = ex.Message; } finally { CallRemotingService.UnregisterChannel(); } return(dsReturn.Tables[0].Rows[0]["OPERATION_NAME"].ToString().Trim()); }