Example #1
0
        public DataSet GetCurrentEquipment(string strEquipmentKey)
        {
            DataSet resDS = new DataSet();

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();

                if (serverFactory != null)
                {
                    resDS     = serverFactory.CreateIEquipmentStateEventsEngine().GetCurrentEquipment(strEquipmentKey);
                    _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(resDS);
                    if (_errorMsg.Length > 0)
                    {
                        MessageService.ShowError(_errorMsg);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageService.ShowError(ex);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }
            #region Process Output Parameters

            return(resDS);

            #endregion
        }
Example #2
0
        /// <summary>
        /// 设备状态事件记录
        /// </summary>
        /// <param name="dsSave"></param>
        /// <returns></returns>
        public bool UpdateEquipmentStateEvents(DataSet dsSave)
        {
            bool blReturn = true;

            try
            {
                IServerObjFactory serverFactory = CallRemotingService.GetRemoteObject();

                if (serverFactory != null)
                {
                    DataSet dsReturn = serverFactory.CreateIEquipmentStateEventsEngine().InsertEquipmentStateEvents(dsSave);
                    _errorMsg = FanHai.Hemera.Share.Common.ReturnMessageUtils.GetServerReturnMessage(dsReturn);
                    if (_errorMsg.Length > 0)
                    {
                        blReturn = false;
                        MessageService.ShowError(_errorMsg);
                    }
                }
            }
            catch (Exception ex)
            {
                blReturn = false;
                MessageService.ShowError(ex);
            }
            finally
            {
                CallRemotingService.UnregisterChannel();
            }

            #region Process Output Parameters

            return(blReturn);

            #endregion
        }