Esempio n. 1
0
        /// <summary>
        /// 根据管控数据组主键获取需要管控项信息。需要先设置属性<see cref="EdcKey"/>的值。
        /// </summary>
        /// <returns>
        /// 包含管控项数据的数据集。
        /// 【A.PARAM_KEY,A.PARAM_NAME,A.MANDATORY,A.ISDERIVED,A.DATA_TYPE,A.DEVICE_TYPE】
        /// </returns>
        public DataSet GetParams()
        {
            DataSet   dsReturn          = new DataSet();
            Hashtable mainDataHashTable = new Hashtable();
            DataTable mainDataTable     = new DataTable();
            DataSet   dataSet           = new DataSet();

            mainDataHashTable.Add(EDC_MAIN_INS_FIELDS.FIELD_EDC_KEY, _edcKey);
            mainDataTable           = FanHai.Hemera.Share.Common.CommonUtils.ParseToDataTable(mainDataHashTable);
            mainDataTable.TableName = TRANS_TABLES.TABLE_PARAM;
            dataSet.Tables.Add(mainDataTable);
            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                if (null != serverFactory)
                {
                    dsReturn  = serverFactory.CreateIEDCEngine().GetParams(dataSet);
                    _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Esempio n. 2
0
        /// <summary>
        /// 根据批次主键获取批次采集的数据。
        /// </summary>
        /// <param name="lotKey">批次主键。</param>
        /// <returns>包含批次采集数据的数据集。
        /// 【EDC_KEY,SP_COUNT,SP_UNITS,EDC_INS_KEY】
        /// </returns>
        public DataSet GetEDCMainIN(string lotKey)
        {
            DataSet dsReturn = new DataSet();

            if (lotKey != "")
            {
                try
                {
                    IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                    if (null != serverFactory)
                    {
                        dsReturn  = serverFactory.CreateIEDCEngine().GetEDCMainIN(lotKey);
                        _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                    }
                }
                catch (Exception ex)
                {
                    _errorMsg = ex.Message;
                }
                finally
                {
                    CallRemotingService.UnregisterChannel();
                }
            }
            return(dsReturn);
        }
Esempio n. 3
0
 public DataTable GetEDC()
 {
     try
     {
         IServerObjFactory factor = CallRemotingService.GetRemoteObject();
         if (null != factor)
         {
             DataSet dsReturn = factor.CreateIEDCEngine().SearchEdcMain(null);
             string  msg      = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
             if (msg != string.Empty)
             {
                 MessageService.ShowError(msg);
             }
             else
             {
                 return(dsReturn.Tables[EDC_MAIN_FIELDS.DATABASE_TABLE_NAME]);
             }
         }
     }
     catch (Exception ex)
     {
         MessageService.ShowError(ex);
     }
     finally
     {
         CallRemotingService.UnregisterChannel();
     }
     return(null);
 }
Esempio n. 4
0
 public void GetEdcByKey(string edcKey)
 {
     try
     {
         string            msg      = string.Empty;
         DataSet           dsReturn = null;
         IServerObjFactory factor   = CallRemotingService.GetRemoteObject();
         if (null != factor)
         {
             dsReturn = factor.CreateIEDCEngine().GetEdcByKey(edcKey);
             msg      = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
             if (msg != string.Empty)
             {
                 MessageService.ShowError(msg);
             }
             else
             {
                 SetEdcProperties(dsReturn.Tables[EDC_MAIN_FIELDS.DATABASE_TABLE_NAME]);
                 SetParamProperties(dsReturn.Tables[BASE_PARAMETER_FIELDS.DATABASE_TABLE_NAME]);
             }
         }
     }
     catch (Exception ex)
     {
         MessageService.ShowError(ex);
     }
     finally
     {
         CallRemotingService.UnregisterChannel();
     }
 }
Esempio n. 5
0
        public override bool Delete()
        {
            try
            {
                string            msg      = string.Empty;
                DataSet           dsReturn = null;
                IServerObjFactory factor   = CallRemotingService.GetRemoteObject();
                if (null != factor)
                {
                    dsReturn = factor.CreateIEDCEngine().DeleteEdcAndParam(_edcKey);
                    msg      = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                    if (msg != string.Empty)
                    {
                        MessageService.ShowError(msg);
                        return(false);
                    }
                    else
                    {
                        MessageService.ShowMessage("${res:Global.SuccessMessage}", "${res:Global.SystemInfo}");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }

            return(true);
        }
Esempio n. 6
0
        /// <summary>
        /// EDC名称信息进行数据绑定
        /// </summary>
        private void BindEDCNameToControl(IServerObjFactory iServerObjFactory)
        {
            DataSet dsLines = iServerObjFactory.CreateIEDCEngine().GetEDC_MAIN();

            if (dsLines != null && dsLines.Tables.Count > 0)
            {
                lueEDCName.Properties.DataSource    = dsLines.Tables[0];
                lueEDCName.Properties.DisplayMember = EDC_MAIN_FIELDS.FIELD_EDC_NAME;
                lueEDCName.Properties.ValueMember   = EDC_MAIN_FIELDS.FIELD_EDC_KEY;
                if (dsLines.Tables[0].Rows.Count > 0)
                {
                    lueEDCName.ItemIndex = 0;
                }
            }
        }
Esempio n. 7
0
        /// <summary>
        /// 保存在线采集到的数据。
        /// </summary>
        /// <param name="dataset">包含管控项数据值的数据集。</param>
        /// <param name="otherParamCount">参数采集数的个数。</param>
        /// <param name="lotKey">批次主键。</param>
        /// <param name="edcInsKey">数据采集实例主键。</param>
        /// <param name="isHold">是否HOLD批次。true:HOLD批次,false:不HOLD批次。</param>
        /// <param name="holdComment">HOLD原因,只有<see cref="isHold"/>=true时,才有意义。</param>
        public void SaveOnlineEDCData(DataSet dataset, int paramCount, string lotKey, string edcInsKey,
                                      bool isHold, string holdComment)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                if (isHold == true)
                {
                    DataTable mainDataTable     = new DataTable();
                    Hashtable mainDataHashTable = new Hashtable();
                    Shift     shift             = new Shift();
                    string    shiftName         = shift.GetCurrShiftName();
                    string    shiftKey          = string.Empty;// shift.IsShiftValueExists(shiftName);
                    string    operComputerName  = PropertyService.Get(PROPERTY_FIELDS.COMPUTER_NAME);
                    mainDataHashTable.Add(POR_LOT_FIELDS.FIELD_LOT_KEY, lotKey);
                    mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_TRANSACTION_KEY, CommonUtils.GenerateNewKey(0));
                    mainDataHashTable.Add(WIP_HOLD_RELEASE_FIELDS.FIELD_REASON_CODE_KEY, string.Empty);
                    mainDataHashTable.Add(WIP_HOLD_RELEASE_FIELDS.FIELD_REASON_CODE_NAME, string.Empty);
                    mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_ACTIVITY_COMMENT, holdComment);
                    mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_EDITOR, PropertyService.Get(PROPERTY_FIELDS.USER_NAME));
                    mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_EDIT_TIMEZONE_KEY, PropertyService.Get(PROPERTY_FIELDS.TIMEZONE));
                    mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_OPERATOR, _operator);
                    mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_SHIFT_NAME, shiftName);
                    mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_SHIFT_KEY, shiftKey);
                    mainDataHashTable.Add(WIP_TRANSACTION_FIELDS.FIELD_OPR_COMPUTER, operComputerName);
                    mainDataTable           = FanHai.Hemera.Share.Common.CommonUtils.ParseToDataTable(mainDataHashTable);
                    mainDataTable.TableName = TRANS_TABLES.TABLE_MAIN_DATA;
                    dataset.Tables.Add(mainDataTable);
                }

                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                if (null != serverFactory)
                {
                    dataset.ExtendedProperties.Add(EDC_MAIN_INS_FIELDS.FIELD_EDITOR, _operator);
                    dsReturn  = serverFactory.CreateIEDCEngine().SaveOnlineEDCData(dataset, paramCount, lotKey, edcInsKey);
                    _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Tool Bar Query Click
        /// </summary>
        private void toolbarQuery_Click(object sender, EventArgs e)
        {
            try
            {
                Hashtable edcHashTable = new Hashtable();
                DataSet   dataSet      = new DataSet();

                string edcName = this.txtEDC.Text.Trim();

                if (edcName.Length > 0)
                {
                    edcHashTable.Add(EDC_MAIN_FIELDS.FIELD_EDC_NAME, edcName);
                }

                DataTable edcDataTable = FanHai.Hemera.Share.Common.CommonUtils.ParseToDataTable(edcHashTable);
                edcDataTable.TableName = EDC_MAIN_FIELDS.DATABASE_TABLE_NAME;
                dataSet.Tables.Add(edcDataTable);

                string            msg           = string.Empty;
                DataSet           dsReturn      = new DataSet();
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();

                if (serverFactory != null)
                {
                    dsReturn = serverFactory.CreateIEDCEngine().SearchEdcMain(dataSet);
                    msg      = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                    if (msg != string.Empty)
                    {
                        MessageService.ShowError(msg);
                    }
                    else
                    {
                        grdCtrlEdc.MainView   = gridViewEdc;
                        grdCtrlEdc.DataSource = dsReturn.Tables[EDC_MAIN_FIELDS.DATABASE_TABLE_NAME];
                    }
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
                btnAdd.Enabled    = false;
                btnDelete.Enabled = false;
            }
        }
Esempio n. 9
0
        public override bool UpdateStatus()
        {
            //get all informations of Edc and put them into hashtable
            Hashtable edcHashTable = new Hashtable();
            DataSet   dataSet      = new DataSet();

            // Add "Edc Data"
            edcHashTable.Add(EDC_MAIN_FIELDS.FIELD_EDC_KEY, _edcKey);
            edcHashTable.Add(EDC_MAIN_FIELDS.FIELD_STATUS, Convert.ToInt32(_edcStatus).ToString());

            DataTable edcDataTable = FanHai.Hemera.Share.Common.CommonUtils.ParseToDataTable(edcHashTable);

            edcDataTable.TableName = EDC_MAIN_FIELDS.DATABASE_TABLE_NAME;
            dataSet.Tables.Add(edcDataTable);

            try
            {
                string            msg      = string.Empty;
                DataSet           dsReturn = null;
                IServerObjFactory factor   = CallRemotingService.GetRemoteObject();
                if (null != factor)
                {
                    dsReturn = factor.CreateIEDCEngine().UpdateEdcAndParam(dataSet);
                    msg      = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                    if (msg != string.Empty)
                    {
                        MessageService.ShowError(msg);
                        return(false);
                    }
                    else
                    {
                        MessageService.ShowMessage("${res:Global.UpdateStatusMessage}", "${res:Global.SystemInfo}");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }

            return(true);
        }
Esempio n. 10
0
        /// <summary>
        /// 根据批次号获取批次数据采集信息。
        /// </summary>
        /// <param name="lotNumber">批次号码。</param>
        /// <returns>包含批次数据采集信息的数据集对象。该数据集对象包含两个数据表对象。
        /// 一个是包含批次数据采集信息的数据表对象。
        /// 一个名称为paraTable的数据表对象。paraTable的数据表对象存放查询的执行结果,
        /// paraTable数据表对象中包含两列“ATTRIBUTE_KEY”和“ATTRIBUTE_VALUE”。
        /// 最多包含两行:“ATTRIBUTE_KEY”列等于“CODE”的行和“ATTRIBUTE_KEY”列等于“MESSAGE”的行。
        /// </returns>
        /// comment by peter 2012-2-17
        public DataSet GetLotParamsCollection(string lotNumber)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                //创建远程调用的工厂对象。
                IServerObjFactory factory = CallRemotingService.GetRemoteObject();
                dsReturn  = factory.CreateIEDCEngine().GetLotParamsCollection(lotNumber);
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            return(dsReturn);
        }
Esempio n. 11
0
        /// <summary>
        /// 物料编号信息进行数据绑定
        /// </summary>
        private void BindPartNameToControl(IServerObjFactory iServerObjFactory)
        {
            DataSet dsLines = iServerObjFactory.CreateIEDCEngine().GetPOR_PART();

            if (dsLines != null && dsLines.Tables.Count > 0)
            {
                dsLines.Tables[0].Rows.InsertAt(dsLines.Tables[0].NewRow(), 0);
                luePartName.Properties.DataSource    = dsLines.Tables[0];
                luePartName.Properties.DisplayMember = POR_PART_FIELDS.FIELD_PART_NAME;
                luePartName.Properties.ValueMember   = POR_PART_FIELDS.FIELD_PART_KEY;

                if (dsLines.Tables[0].Rows.Count > 0)
                {
                    luePartName.ItemIndex = 0;
                }
            }
        }
Esempio n. 12
0
 /// <summary>
 /// 绑定工序名称。
 /// </summary>
 private void BindOperationName(string routeKey)
 {
     if (string.IsNullOrEmpty(routeKey))
     {
         IServerObjFactory iServerObjFactory = CallRemotingService.GetRemoteObject();
         DataSet           ds = iServerObjFactory.CreateIEDCEngine().GetPOR_ROUTE_OPERATION_VER();
         if (ds != null && ds.Tables.Count > 0)
         {
             lueOperationName.Properties.DataSource                = ds.Tables[0];
             lueOperationName.Properties.DisplayMember             = POR_ROUTE_OPERATION_VER_FIELDS.FIELD_ROUTE_OPERATION_NAME;
             lueOperationName.Properties.ValueMember               = POR_ROUTE_OPERATION_VER_FIELDS.FIELD_ROUTE_OPERATION_VER_KEY;
             this.lueOperationName.Properties.Columns[0].FieldName = POR_ROUTE_OPERATION_VER_FIELDS.FIELD_ROUTE_OPERATION_NAME;
             if (ds.Tables[0].Rows.Count > 0)
             {
                 lueOperationName.ItemIndex = 0;
             }
         }
         else
         {
             this.lueOperationName.Properties.DataSource = null;
         }
         CallRemotingService.UnregisterChannel();
     }
     else
     {
         RouteQueryEntity entity = new RouteQueryEntity();
         DataSet          ds     = entity.GetRouteStepDataByRouteKey(routeKey);
         if (string.IsNullOrEmpty(entity.ErrorMsg))
         {
             this.lueOperationName.Properties.DataSource           = ds.Tables[0];
             this.lueOperationName.Properties.ValueMember          = POR_ROUTE_STEP_FIELDS.FIELD_ROUTE_OPERATION_VER_KEY;
             this.lueOperationName.Properties.DisplayMember        = POR_ROUTE_STEP_FIELDS.FIELD_ROUTE_STEP_NAME;
             this.lueOperationName.Properties.Columns[0].FieldName = POR_ROUTE_STEP_FIELDS.FIELD_ROUTE_STEP_NAME;
             if (ds.Tables[0].Rows.Count > 0)
             {
                 this.lueOperationName.ItemIndex = 0;
             }
         }
         else
         {
             this.lueOperationName.Properties.DataSource = null;
         }
     }
 }
Esempio n. 13
0
        /// <summary>
        /// 保存离线采集到的数据。
        /// </summary>
        /// <param name="dataset">包含管控项数据值的数据集。</param>
        public void SaveOfflineEDCData(DataSet dataset)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                dsReturn  = serverFactory.CreateIEDCEngine().SaveOfflineEDCData(dataset);
                _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
        }
Esempio n. 14
0
        /// <summary>
        /// 保存数据采集实例数据到数据库中。
        /// </summary>
        public void SaveEDCMainIN()
        {
            DataSet   dsReturn          = new DataSet();
            Hashtable mainDataHashTable = new Hashtable();
            DataTable mainDataTable     = new DataTable();
            DataSet   dataSet           = new DataSet();

            mainDataHashTable.Add(EDC_MAIN_INS_FIELDS.FIELD_EDC_INS_KEY, _edcInsKey);
            mainDataHashTable.Add(EDC_MAIN_INS_FIELDS.FIELD_EDC_KEY, _edcKey);
            mainDataHashTable.Add(EDC_MAIN_INS_FIELDS.FIELD_EDC_NAME, _edcName);
            mainDataHashTable.Add(EDC_MAIN_INS_FIELDS.FIELD_EDC_SP_KEY, _samplingKey);
            mainDataHashTable.Add(EDC_MAIN_INS_FIELDS.FIELD_ENTERPRISE_KEY, _enterpriseKey);
            mainDataHashTable.Add(EDC_MAIN_INS_FIELDS.FIELD_LOT_KEY, _lotKey);
            mainDataHashTable.Add(EDC_MAIN_INS_FIELDS.FIELD_LOT_NUMBER, _lotNumber);
            mainDataHashTable.Add(EDC_MAIN_INS_FIELDS.FIELD_PART_KEY, _partKey);
            mainDataHashTable.Add(EDC_MAIN_INS_FIELDS.FIELD_ROUTE_KEY, _routeKey);
            mainDataHashTable.Add(EDC_MAIN_INS_FIELDS.FIELD_SP_COUNT, _spCount);
            mainDataHashTable.Add(EDC_MAIN_INS_FIELDS.FIELD_SP_UNITS, _spUnits);
            mainDataHashTable.Add(EDC_MAIN_INS_FIELDS.FIELD_STEP_KEY, _stepKey);
            mainDataHashTable.Add(EDC_MAIN_INS_FIELDS.FIELD_WORK_ORDER_KEY, _workOrderKey);
            mainDataHashTable.Add(COMMON_FIELDS.FIELD_COMMON_EDITOR, PropertyService.Get(PROPERTY_FIELDS.USER_NAME));
            mainDataTable           = FanHai.Hemera.Share.Common.CommonUtils.ParseToDataTable(mainDataHashTable);
            mainDataTable.TableName = EDC_MAIN_INS_FIELDS.DATABASE_TABLE_NAME;
            dataSet.Tables.Add(mainDataTable);
            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                if (null != serverFactory)
                {
                    dsReturn  = serverFactory.CreateIEDCEngine().SaveEDCMainIN(dataSet);
                    _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
        }
Esempio n. 15
0
        /// <summary>
        /// 根据抽检点设置主键获取采样参数点集合。
        /// </summary>
        /// <param name="pointKey">抽检点设置主键。</param>
        /// <returns>
        /// 包含批次采样参数点集合的数据集对象。
        /// [ROW_KEY,EDC_POINT_ROWKEY,EDC_NAME,EDC_VERSION,PARAM_NAME,UPPER_BOUNDARY,
        /// UPPER_SPEC,UPPER_CONTROL,TARGET,LOWER_CONTROL,LOWER_SPEC,LOWER_BOUNDARY,
        /// PARAM_COUNT,PARAM_INDEX,PARAM_KEY,PARAM_FORMULA,Device_Type,DATA_TYPE,ISDERIVED,CALCULATE_TYPE]
        /// </returns>
        /// comment by peter 2012-2-28
        public DataSet GetPointParamsByPointKey(string pointKey)
        {
            DataSet dsParams = new DataSet();

            try
            {
                IServerObjFactory factor = CallRemotingService.GetRemoteObject();
                dsParams = factor.CreateIEDCEngine().GetPointParamsByPointKey(pointKey);
                ErrorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsParams);
            }
            catch (Exception ex)
            {
                ErrorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsParams);
        }
Esempio n. 16
0
        /// <summary>
        /// 参数分组名称和参数分组主键相互转换。
        /// </summary>
        /// <param name="inputParam">查询条件(EDC_NAME或EDC_KEY)。</param>
        /// <param name="symBol">I:查询条件为EDC_NAME。 O(字母):查询条件为EDC_KEY。</param>
        /// <returns>
        /// I:返回EDC_KEY。 O(字母):返回EDC_NAME。
        /// </returns>
        protected string ConvertEdcKeyOrName(object inputParam, string symBol)
        {
            try
            {
                IServerObjFactory factory = CallRemotingService.GetRemoteObject();
                if (null != factory)
                {
                    string strResult = factory.CreateIEDCEngine().ConvertEdcKeyOrName(inputParam.ToString(), symBol);

                    if (strResult != string.Empty)
                    {
                        return(strResult);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex);
            }

            return(string.Empty);
        }
Esempio n. 17
0
        public bool EdcNameValidate()
        {
            try
            {
                string            msg      = string.Empty;
                DataSet           dsReturn = null;
                IServerObjFactory factor   = CallRemotingService.GetRemoteObject();
                if (null != factor)
                {
                    dsReturn = factor.CreateIEDCEngine().GetDistinctEdcName();
                    msg      = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                    if (msg != string.Empty)
                    {
                        MessageService.ShowError(msg);
                    }
                    else
                    {
                        foreach (DataRow dataRow in dsReturn.Tables[EDC_MAIN_FIELDS.DATABASE_TABLE_NAME].Rows)
                        {
                            if (_edcName == dataRow[0].ToString())
                            {
                                return(false);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }

            return(true);
        }
Esempio n. 18
0
        /// <summary>
        /// 查询离线数据采集数据。
        /// </summary>
        /// <param name="dtParams">数据采集实例。</param>
        /// <param name="config">分页配置对象。</param>
        /// <returns>包含数据采集数据的数据集对象。</returns>
        public DataSet QueryEDCData(DataTable dtParams, ref PagingQueryConfig config)
        {
            DataSet dsReturn = new DataSet();

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();
                if (null != serverFactory)
                {
                    dsReturn  = serverFactory.CreateIEDCEngine().QueryEDCData(dtParams, ref config);
                    _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                }
            }
            catch (Exception ex)
            {
                _errorMsg = ex.Message;
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            return(dsReturn);
        }
Esempio n. 19
0
        public bool Save(bool bNew)
        {
            //get all informations of Edc and put them into hashtable
            Hashtable edcHashTable = new Hashtable();
            DataSet   dataSet      = new DataSet();

            // Add "Edc Data"
            edcHashTable.Add(EDC_MAIN_FIELDS.FIELD_EDC_KEY, _edcKey);
            edcHashTable.Add(EDC_MAIN_FIELDS.FIELD_EDC_NAME, _edcName);
            edcHashTable.Add(EDC_MAIN_FIELDS.FIELD_STATUS, Convert.ToInt32(_edcStatus).ToString());
            edcHashTable.Add(EDC_MAIN_FIELDS.FIELD_DESCRIPTIONS, _edcDescription);
            edcHashTable.Add(EDC_MAIN_FIELDS.FIELD_EDITOR, PropertyService.Get(PROPERTY_FIELDS.USER_NAME));

            DataTable edcDataTable = FanHai.Hemera.Share.Common.CommonUtils.ParseToDataTable(edcHashTable);

            edcDataTable.TableName = EDC_MAIN_FIELDS.DATABASE_TABLE_NAME;
            dataSet.Tables.Add(edcDataTable);

            if (paramTable.Rows.Count > 0)
            {
                dataSet.Merge(paramTable, false, MissingSchemaAction.Add);
            }


            //Call Remoting Service
            try
            {
                string            msg      = string.Empty;
                DataSet           dsReturn = null;
                IServerObjFactory factor   = CallRemotingService.GetRemoteObject();
                if (null != factor)
                {
                    if (bNew)
                    {
                        dsReturn = factor.CreateIEDCEngine().AddEdcAndParam(dataSet);
                    }
                    else
                    {
                        dsReturn = factor.CreateIEDCEngine().UpdateEdcAndParam(dataSet);
                    }
                    msg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                    if (msg != string.Empty)
                    {
                        MessageService.ShowError(msg);
                        return(false);
                    }
                    else
                    {
                        MessageService.ShowMessage("${res:Global.SuccessMessage}", "${res:Global.SystemInfo}");
                    }
                }
            }
            catch (Exception)
            {
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }

            return(true);
        }