Ejemplo n.º 1
0
 public PublicMessage(ConferenceMessage message)
 {
     TextMessage = message.TextMessage;
     FromId = message.FromId;
     Date = message.Date;
     IsNew = message.IsNew;
     MessageType = message.MessageType;
     File = message.File;
     FileID = message.FileID;
 }
Ejemplo n.º 2
0
        public async Task SendTextMessage(int dialogId, string message, string dialogType)
        {
            var connection = _connections.FirstOrDefault(x => x.ConnectionId == Context.ConnectionId);

            var baseMessage = new ConferenceMessage()
            {
                Date = DateTime.Now,
                IsNew = true,
                TextMessage = message,
                FromId = connection.Id
            };

            using (var uofw = _unitOfWorkFactory.CreateSystem())
            {
                var serv = (ISimpleMessageService)GetService<IBaseObjectCRUDService>(dialogType);

                var messageResult = await serv.CreateMessage(uofw, baseMessage, dialogId);

                var result = new JsonNetResult(messageResult.Message).ToString();

                await _sendTextMessage(messageResult.Targets, result, dialogType);
            }

        }