Esempio n. 1
0
        /// <summary>
        /// 根据工单号获得工单所对应的客户类别
        /// </summary>
        /// <param name="hstable"></param>
        /// <returns></returns>
        public DataSet GetViewForWorkOrder(Hashtable hstable)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                //调用远程对象
                _errorMsg = string.Empty;
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                if (null != factor)
                {
                    dsReturn  = factor.CreateIWorkOrders().GetViewForWorkOrder(hstable);
                    _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
            }
            catch (Exception e)
            {
                _errorMsg = e.Message;
            }
            finally
            {
                //注销通道
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Esempio n. 2
0
        public DataSet GetAllWorkOrderData()
        {
            DataSet dsReturn = new DataSet();

            try
            {
                //调用远程对象
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                if (null != factor)
                {
                    dsReturn = factor.CreateIWorkOrders().GetAllWorkOrderData();
                    string returnMessage = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                    //若返回错误消息,则显示
                    if (returnMessage.Length > 0)
                    {
                        MessageService.ShowError(returnMessage);
                    }
                    else
                    {
                        return(dsReturn);
                    }
                }
            }
            catch (Exception e)
            {
                MessageService.ShowError(e);
            }
            finally
            {
                //注销通道
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Esempio n. 3
0
        /// <summary>
        /// 根据工单号查询主键
        /// </summary>
        /// <param name="pWorkOrder"></param>
        /// <returns></returns>
        public string GetWorkOrderKeyByOrder(string pWorkOrder)
        {
            string  workOrderKey = string.Empty;
            DataSet dtData       = new DataSet();

            try
            {
                //调用远程对象
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                //用远程对象的方法,根据工单号查询主键
                dtData = serverFactory.CreateIWorkOrders().GetWorkOrderKeyByOrder(pWorkOrder);
                //DataSet中有表,且第一个表中有记录时
                if (dtData.Tables.Count > 0 && dtData.Tables[0].Rows.Count > 0)
                {
                    //遍历第一个表中的每一条记录,取出每条记录的第一列赋给主键
                    //(??疑问):有多条记录时,workOrderKey值会被覆盖。
                    foreach (DataRow dr in dtData.Tables[0].Rows)
                    {
                        workOrderKey = dr[0].ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex.Message);
            }
            finally
            {
                //注销通道
                CallRemotingService.UnregisterChannel();
            }

            return(workOrderKey);
        }
Esempio n. 4
0
        /// <summary>
        /// 通过LableID获取对应的打印类型
        /// </summary>
        /// <param name="lableID">LableID</param>
        /// <returns>该LableID对应的打印类型</returns>
        public string GetLablePrinterType(string lableID)
        {
            string printerType = string.Empty;

            try
            {
                //调用远程对象
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                printerType = factor.CreateIWorkOrders().GetLablePrinterType(lableID);
            }
            catch (Exception e)
            {
                _errorMsg = e.Message;
            }
            finally
            {
                //注销通道
                CallRemotingService.UnregisterChannel();
            }
            return(printerType);
        }
Esempio n. 5
0
        public bool isUpDataPrint(string WorkOrderNumber)
        {
            bool isUpData = true;

            try
            {
                //调用远程对象
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                isUpData = factor.CreateIWorkOrders().isUpDataPrint(WorkOrderNumber);
            }
            catch (Exception e)
            {
                _errorMsg = e.Message;
            }
            finally
            {
                //注销通道
                CallRemotingService.UnregisterChannel();
            }
            return(isUpData);
        }
Esempio n. 6
0
        /// <summary>
        /// 获取绑定的工厂线别是否正确
        /// </summary>
        /// <param name="workOrderKey">工单主键</param>
        /// <param name="lineKey">线别主键</param>
        /// <returns>True:绑定线别正确、或未绑定线别。False:绑定线别但是所选线别不在绑定范围</returns>
        public bool CheckWorkOrderLineBind(string LotNumber, string lineKey)
        {
            bool isBindTrueLine = true;

            try
            {
                //调用远程对象
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                isBindTrueLine = factor.CreateIWorkOrders().CheckWorkOrderLineBind(LotNumber, lineKey);
            }
            catch (Exception e)
            {
                _errorMsg = e.Message;
            }
            finally
            {
                //注销通道
                CallRemotingService.UnregisterChannel();
            }
            return(isBindTrueLine);
        }
Esempio n. 7
0
        //工单打印信息
        public DataTable GetWoPrint(string orderNumber)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                //调用远程对象
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                dsReturn  = factor.CreateIWorkOrders().GetWoPrint(orderNumber);
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
            }
            catch (Exception e)
            {
                _errorMsg = e.Message;
            }
            finally
            {
                //注销通道
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn.Tables[0]);
        }
Esempio n. 8
0
        /// <summary>
        /// 通过分档代码获取对应的分档规则
        /// </summary>
        /// <param name="powerSetCode">分档代码</param>
        /// <returns>分档代码对应的功率分档的集合</returns>
        public DataSet GetPowerSetByPowerSetCode(string powerSetCode, string partMinPower, string partMaxPower)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                //调用远程对象
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                dsReturn  = factor.CreateIWorkOrders().GetPowerSetByPowerSetCode(powerSetCode, partMinPower, partMaxPower);
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
            }
            catch (Exception e)
            {
                _errorMsg = e.Message;
            }
            finally
            {
                //注销通道
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Esempio n. 9
0
        /// <summary>
        /// 对工单对应的产品信息进行保存
        /// </summary>
        /// <param name="workOrderProInfo">工单对应的产品信息的集合</param>
        /// <returns>操作结果</returns>
        public DataSet SaveWorkOrderProInfo(DataSet workOrderProInfo)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                //调用远程对象
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                dsReturn  = factor.CreateIWorkOrders().SaveWorkOrderProInfo(workOrderProInfo);
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
            }
            catch (Exception e)
            {
                _errorMsg = e.Message;
            }
            finally
            {
                //注销通道
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Esempio n. 10
0
        /// <summary>
        /// 通过主产品料号获取工单对应的料号信息
        /// </summary>
        /// <param name="mainPartNumber">主产品料号</param>
        /// <returns>工单对应的料号信息</returns>
        public DataSet GetPartNumberByMainPartNumber(string mainPartNumber)
        {
            DataSet dsPartNumber = new DataSet();

            try
            {
                //调用远程对象
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                dsPartNumber = factor.CreateIWorkOrders().GetPartNumberByMainPartNumber(mainPartNumber);
                _errorMsg    = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsPartNumber);
            }
            catch (Exception e)
            {
                _errorMsg = e.Message;
            }
            finally
            {
                //注销通道
                CallRemotingService.UnregisterChannel();
            }
            return(dsPartNumber);
        }
Esempio n. 11
0
        /// <summary>
        /// 获取指定工步采集参数对应的工单参数设定数据。用于比对在采集时输入的数据是否符合工单参数设定。
        /// </summary>
        /// <param name="workorderKey">工单主键。</param>
        /// <param name="stepKey">工步主键。</param>
        /// <param name="dcType">数据采集时刻。0:进站时采集 1:出站时采集</param>
        /// <returns>包含工单参数设定数据的数据集对象。</returns>
        public DataSet GetWorkOrderParam(string workorderKey, string stepKey, OperationParamDCType dcType)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                //调用远程对象
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                dsReturn       = factor.CreateIWorkOrders().GetWorkOrderParam(workorderKey, stepKey, (int)dcType);
                this._errorMsg = ReturnMessageUtils.GetServerReturnMessage(dsReturn);
            }
            catch (Exception e)
            {
                this._errorMsg = e.Message;
            }
            finally
            {
                //注销通道
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Esempio n. 12
0
        /// <summary>
        /// 根据工厂车间名称获取工单号
        /// </summary>
        /// <param name="roomName">车间名称</param>
        /// <returns>包含工单号信息的数据集。</returns>
        public DataSet GetWorkOrderByFactoryRoom(string roomName)
        {
            DataSet retDS = new DataSet();

            try
            {
                //调用远程对象
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                retDS     = factor.CreateIWorkOrders().GetWorkOrderByFactoryRoom(roomName);
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(retDS);
            }
            catch (Exception e)
            {
                _errorMsg = e.Message;
            }
            finally
            {
                //注销通道
                CallRemotingService.UnregisterChannel();
            }
            return(retDS);
        }
Esempio n. 13
0
        /// <summary>
        /// 根据条件获取工单数据。
        /// </summary>
        /// <param name="strFactory">工厂名称。</param>
        /// <param name="strWorkOrderNo">工单号。左匹配。</param>
        /// <param name="strPart">成品料号。左匹配。</param>
        /// <param name="strType">成品类型。</param>
        /// <param name="strStore">入库库位。</param>
        /// <param name="strStatus">状态。</param>
        /// <returns>包含工单数据的数据集。</returns>
        public DataSet  GetWorkOrderByCondition(string strFactory, string strWorkOrderNo, string strPart, string strType,
                                                string strStore, string strStatus, ref PagingQueryConfig config)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                //调用远程对象
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                if (null != factor)
                {
                    dsReturn = factor.CreateIWorkOrders().GetWorkOrderByCondition(strFactory, strWorkOrderNo, strPart,
                                                                                  strType, strStore, strStatus, ref config);
                    string returnMessage = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                    //若返回错误消息,则显示
                    if (returnMessage.Length > 0)
                    {
                        MessageService.ShowError(returnMessage);
                    }
                    else
                    {
                        return(dsReturn);
                    }
                }
            }
            catch (Exception e)
            {
                MessageService.ShowError(e);
            }
            finally
            {
                //注销通道
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }