コード例 #1
0
        /// <summary>
        /// 修改数据中的采集点
        /// </summary>
        /// <param name="dataSet"></param>
        /// <returns></returns>
        /// Owner genchille.yang 2012-03-22 14:18:19
        public bool ModifyPoints(DataSet dataSet)
        {
            try
            {
                IServerObjFactory serverObj = CallRemotingService.GetRemoteObject();
                DataSet           dsReturn  = new DataSet();
                dsReturn = serverObj.CreateISpcEngine().ModifyPoints(dataSet);

                //if (!isMr)
                //    dsReturn = serverObj.CreateISpcEngine().ModifyPoints(dataSet);
                //else
                //    dsReturn = serverObj.CreateISpcEngine().ModifyPointsForMr(dataSet);

                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                if (_errorMsg.Length == 0)
                {
                    return(true);
                }
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            return(false);
        }
コード例 #2
0
        public bool SaveSpcControlPlan(DataSet dsSpcControl, out string controlCode)
        {
            controlCode = string.Empty;
            bool    blResult = true;
            DataSet dsReturn = new DataSet();

            try
            {
                IServerObjFactory serverObj = CallRemotingService.GetRemoteObject();
                dsReturn  = serverObj.CreateISpcEngine().SaveSpcControlPlan(dsSpcControl);
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                if (_errorMsg.Length > 0)
                {
                    blResult = false;
                    MessageService.ShowError(_errorMsg);
                }
                if (dsReturn.ExtendedProperties.ContainsKey("CONTROLCODE"))
                {
                    controlCode = dsReturn.ExtendedProperties["CONTROLCODE"].ToString();
                }
            }
            catch (Exception ex)
            {
                blResult = false;
                MessageService.ShowError(ex.Message);
            }
            return(blResult);
        }
コード例 #3
0
        /// <summary>
        /// 获得采集点信息
        /// </summary>
        /// <param name="edcInskey"></param>
        /// <returns></returns>
        public DataTable GetPointInformation(string edcInskey)
        {
            DataSet    dsReturn = new DataSet();
            DataTable  dt       = new DataTable("PointInformation");
            DataColumn dc       = null;

            dc            = new DataColumn();
            dc.ColumnName = COMMON_FIELDS.FIELD_COMMON_KEY;
            dc.Caption    = "要点";
            dt.Columns.Add(dc);

            dc            = new DataColumn();
            dc.ColumnName = COMMON_FIELDS.FIELD_COMMON_VALUE;
            dc.Caption    = "值";
            dt.Columns.Add(dc);

            try
            {
                IServerObjFactory serverObj = CallRemotingService.GetRemoteObject();
                dsReturn = serverObj.CreateISpcEngine().GetPointInformation(edcInskey);

                Dictionary <string, string> dicStr = new Dictionary <string, string>();
                DataRow dr = dsReturn.Tables[0].Rows[0];
                foreach (DataColumn dc01 in dsReturn.Tables[0].Columns)
                {
                    dt.Rows.Add(dc01.ColumnName, dr[dc01.ColumnName].ToString());
                }
                dt.AcceptChanges();
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            return(dt);
        }
コード例 #4
0
        /// <summary>
        /// 标准差,极差,均值图数据
        /// </summary>
        /// <param name="hashTable"></param>
        /// <returns></returns>
        public DataSet SearchParamValue(Hashtable hashTable, string chartType, out string err)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                err = string.Empty;
                DataTable         dataTable = FanHai.Hemera.Share.Common.CommonUtils.ParseToDataTable(hashTable);
                IServerObjFactory serverObj = CallRemotingService.GetRemoteObject();
                if (serverObj != null)
                {
                    dsReturn = serverObj.CreateISpcEngine().SearchParamValueForXbar(dataTable);
                    //if (chartType.Equals("XBAR-MR"))
                    //    dsReturn = serverObj.CreateISpcEngine().SearchParamValueForMr(dataTable);
                    //else
                    //    dsReturn = serverObj.CreateISpcEngine().SearchParamValueForXbar(dataTable);

                    err = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
            }
            catch (Exception ex)
            {
                err = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
コード例 #5
0
        /// <summary>
        /// 获得编辑信息
        /// </summary>
        /// <param name="edcInskey"></param>
        /// <returns></returns>
        public DataSet GetEditInformation(string edccolkey)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                IServerObjFactory serverObj = CallRemotingService.GetRemoteObject();
                dsReturn = serverObj.CreateISpcEngine().GetEditInformation(edccolkey);
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            return(dsReturn);
        }
コード例 #6
0
        public DataSet GetSpcControlPlan()
        {
            DataSet dsReturn = new DataSet();

            try
            {
                IServerObjFactory serverObj = CallRemotingService.GetRemoteObject();
                dsReturn  = serverObj.CreateISpcEngine().GetSPControlData();
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                if (_errorMsg.Length > 0)
                {
                    MessageService.ShowError(_errorMsg);
                }
                else
                {
                    DataTable dt01 = null, dt02 = null, dt03 = null, dt04 = null;
                    if (dsReturn.Tables.Contains(FMM_LOCATION_FIELDS.DATABASE_TABLE_NAME))
                    {
                        dt01 = dsReturn.Tables[FMM_LOCATION_FIELDS.DATABASE_TABLE_NAME];
                    }
                    if (dsReturn.Tables.Contains(EMS_EQUIPMENTS_FIELDS.DATABASE_TABLE_NAME))
                    {
                        dt02 = dsReturn.Tables[EMS_EQUIPMENTS_FIELDS.DATABASE_TABLE_NAME];
                    }

                    if (dsReturn.Tables.Contains(POR_ROUTE_OPERATION_VER_FIELDS.DATABASE_TABLE_NAME))
                    {
                        dt03 = dsReturn.Tables[POR_ROUTE_OPERATION_VER_FIELDS.DATABASE_TABLE_NAME];
                    }
                    if (dsReturn.Tables.Contains(BASE_PARAMETER_FIELDS.DATABASE_TABLE_NAME))
                    {
                        dt04 = dsReturn.Tables[BASE_PARAMETER_FIELDS.DATABASE_TABLE_NAME];
                    }
                    if (null == dt01 || null == dt02 || null == dt03 || null == dt04)
                    {
                        MessageService.ShowError("异常规则表信息出错,请与管理员联系");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex.Message);
            }
            return(dsReturn);
        }
コード例 #7
0
        /// <summary>
        /// 获得SPC表格主数据
        /// </summary>
        /// <returns></returns>
        public DataSet GetSPControlGridData()
        {
            DataSet dsReturn = new DataSet();

            try
            {
                IServerObjFactory serverObj = CallRemotingService.GetRemoteObject();
                dsReturn  = serverObj.CreateISpcEngine().GetSPControlGridData();
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                if (_errorMsg.Length > 0)
                {
                    MessageService.ShowError(_errorMsg);
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex.Message);
            }
            return(dsReturn);
        }
コード例 #8
0
        /// <summary>
        /// 删除管控计划
        /// </summary>
        /// <param name="arrLst"></param>
        /// <returns></returns>
        public bool UpdateControlPlan(List <string> arrLst)
        {
            bool    blResult = true;
            DataSet dsReturn = new DataSet();

            try
            {
                IServerObjFactory serverObj = CallRemotingService.GetRemoteObject();
                dsReturn  = serverObj.CreateISpcEngine().UpdateControlPlan(arrLst);
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                if (_errorMsg.Length > 0)
                {
                    blResult = false;
                    MessageService.ShowError(_errorMsg);
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex.Message);
            }
            return(blResult);
        }
コード例 #9
0
        //Q.0031
        public DataSet GetTableAvData(string strControlCode, string pointkeys)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                IServerObjFactory serverObj = CallRemotingService.GetRemoteObject();
                if (serverObj != null)
                {
                    dsReturn  = serverObj.CreateISpcEngine().GetTableAvData(strControlCode, pointkeys);
                    _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
コード例 #10
0
 /// <summary>
 /// 撤销操作(UndoOUTEDC)时,Spc相应操作
 /// </summary>
 /// <param name="transactionKey"></param>
 /// <returns></returns>
 public bool DeleteParamData(string transactionKey)
 {
     try
     {
         IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
         DataSet           dsReturn      = serverFactory.CreateISpcEngine().DeleteParamData(transactionKey);
         _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
         if (_errorMsg.Length > 0)
         {
             throw new Exception(_errorMsg);
         }
     }
     catch (Exception ex)
     {
         MessageService.ShowError(ex.Message);
         return(false);
     }
     finally
     {
         CallRemotingService.UnregisterChannel();
     }
     return(true);
 }
コード例 #11
0
        //public DataSet GetSpcParams()
        //{
        //    DataSet dsParams = null;
        //    try
        //    {
        //        IServerObjFactory serverObj = CallRemotingService.GetRemoteObject();
        //        dsParams=serverObj.CreateISpcEngine().GetParams();
        //        _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsParams);
        //    }
        //    catch (Exception ex)
        //    {
        //        _errorMsg = ex.Message;
        //    }
        //    return dsParams;
        //}

        //public DataSet SearchParams()
        //{
        //    DataSet dsReturn = new DataSet();
        //    try
        //    {
        //        DataSet dataSet = new DataSet();
        //        Hashtable paramHashTable = new Hashtable();
        //        if (_paramName.Length > 0)
        //        {
        //            paramHashTable.Add(BASE_PARAMETER_FIELDS.FIELD_PARAM_NAME, _paramName);
        //        }

        //        DataTable paramDataTable = FanHai.Hemera.Share.Common.CommonUtils.ParseToDataTable(paramHashTable);
        //        paramDataTable.TableName = BASE_PARAMETER_FIELDS.DATABASE_TABLE_NAME;
        //        dataSet.Tables.Add(paramDataTable);


        //        IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();

        //        if (serverFactory != null)
        //        {
        //            dsReturn = serverFactory.CreateISpcEngine().SearchParam(dataSet);
        //            _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        _errorMsg = ex.Message;
        //    }
        //    finally
        //    {
        //        CallRemotingService.UnregisterChannel();
        //    }
        //    return dsReturn;
        //}

        //public bool SaveParams(DataSet dataSet)
        //{
        //    bool bReturn = true;
        //    try
        //    {
        //        DataSet dsReturn = new DataSet();
        //        IServerObjFactory serverObj=CallRemotingService.GetRemoteObject();
        //        dsReturn = serverObj.CreateISpcEngine().SaveParams(dataSet);
        //        _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
        //        if (_errorMsg.Length > 0)
        //        {
        //            bReturn = false;
        //            MessageService.ShowError(_errorMsg);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        bReturn = false;
        //        MessageService.ShowError(ex.Message);
        //    }
        //    return bReturn;
        //}
        #endregion

        /// <summary>
        /// 保存抽检界面数据保存时,spc相应操作。
        /// </summary>
        /// <param name="dataset">包含SPC数据的数据集对象。</param>
        /// <returns>true:保存成功。false:保存失败。</returns>
        public bool SaveParamData(DataSet dataset)
        {
            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                DataSet           dsReturn      = serverFactory.CreateISpcEngine().SaveParamData(dataset);
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                if (!string.IsNullOrEmpty(_errorMsg))
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
                return(false);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(true);
        }
コード例 #12
0
        /// <summary>
        /// 移动极差数据数据
        /// </summary>
        /// <param name="hashTable"></param>
        /// <returns></returns>
        public DataSet SearchParamValueForMr(Hashtable hashTable)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                DataTable         dataTable = FanHai.Hemera.Share.Common.CommonUtils.ParseToDataTable(hashTable);
                IServerObjFactory serverObj = CallRemotingService.GetRemoteObject();
                if (serverObj != null)
                {
                    dsReturn  = serverObj.CreateISpcEngine().SearchParamValueForMr(dataTable);
                    _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }