Пример #1
0
        public PropellingMovementDto GetPropellingMovementDto(string serviceNumber, string group, string evn)
        {
            PropellingMovementDto propelling = null;
            var query = GetPropellingMovementDtos(serviceNumber, group);

            if (query != null)
            {
                propelling = query.FirstOrDefault(m => m.Environment == evn);
            }

            return(propelling);
        }
Пример #2
0
        /// <summary>
        /// 注册广播事件
        /// </summary>
        /// <param name="broadCastArgs"></param>
        private void RegisterMessageEvents(BroadCastEventArgs broadCastArgs)
        {
            if (broadCastArgs != null)
            {
                MessageRequest messageRequest = broadCastArgs.MessageRequest;

                IClientProxy clientProxy = Clients.All;      //Clients.Caller;

                //PropellingMovementDto propellingMovementDto = this.PropellingMovementService.GetPropellingMovementDto(SetupConfig.ServiceNumber
                //    , messageRequest.Group, SetupConfig.Enviroment);
                PropellingMovementDto propellingMovementDto = new PropellingMovementDto();
                //TODO:数据库获取
                if (propellingMovementDto != null)
                {
                    clientProxy.Invoke(messageRequest.Group, messageRequest.Message);
                }
                else
                {
                    throw new Exception("对应的服务广播组不存在");
                }
            }
        }