Ejemplo n.º 1
0
        public SendEventResponse SendEvent(SendEventData data)
        {
            var dataDto = DataConverter.GetSendEventRequestDtoData(data);
            var request = new SendEventRequestDto
            {
                Data  = dataDto,
                Token = GetAccessTokenDto()
            };
            var responseDto = DtoService.SendEvent(request);
            var response    = CreateResponse <SendEventResponse>(responseDto);

            response.InternalData = DataConverter.GetsSendEventResponseDtoData(responseDto.Data);
            return(response);
        }
Ejemplo n.º 2
0
        internal SendEventResponse SendEventWrapper(SendEventBase sendEventBase)
        {
            if (sendEventBase == null)
            {
                throw new ArgumentNullException("sendEventBase");
            }
            if (sendEventBase.Ignore)
            {
                return(ResponseHelper.GetClientErrorResponse <SendEventResponse>("Событие проигнорировано"));
            }

            PrepareDataHelper.PrepareEvent(sendEventBase);

            if (sendEventBase.IsServerTime == false)
            {
                SetServerTime(sendEventBase);
            }

            var data = new SendEventData()
            {
                Category        = sendEventBase.EventCategory,
                ComponentId     = sendEventBase.ComponentControl.Info.Id,
                Count           = sendEventBase.Count,
                Importance      = sendEventBase.Importance,
                JoinInterval    = sendEventBase.JoinInterval,
                JoinKey         = sendEventBase.JoinKey,
                Message         = sendEventBase.Message,
                StartDate       = sendEventBase.StartDate,
                TypeCode        = sendEventBase.TypeCode,
                TypeDisplayName = sendEventBase.TypeDisplayName,
                TypeSystemName  = sendEventBase.TypeSystemName,
                Version         = sendEventBase.Version
            };

            data.Properties.CopyFrom(sendEventBase.Properties);

            return(ApiService.SendEvent(data));
        }
Ejemplo n.º 3
0
 public SendEventResponse SendEvent(SendEventData data)
 {
     return(Execute("SendEvent", () => ApiServiceInternal.SendEvent(data)));
 }
Ejemplo n.º 4
0
 public SendEventResponse SendEvent(SendEventData data)
 {
     return(GetResponse <SendEventResponse>());
 }