Пример #1
0
 private void cleanUserByChatMessages(UsersByChat userByChat)
 {
     foreach (Messages message in this.getServiceCore().Container.GetInstance <MessagesServices>().getMessagesFromChat(userByChat))
     {
         this.getServiceCore().Container.GetInstance <MessagesServices>().Delete(new Messages()
         {
             ID = message.ID
         });
     }
 }
Пример #2
0
        public IEnumerable <Messages> getMessagesFromChat(UsersByChat chat)
        {
            var cn = this._context.Database.Connection;

            var sql = @"SELECT ID,
                               UsersByChatID,
                               Message,
                               Type,
                               InsertedDate
                         FROM Messages
                        WHERE UsersByChatID = " + chat.ID;

            return(cn.Query <Messages>(sql));
        }
Пример #3
0
 private void userInteraction(UsersByChat userByChat)
 {
     userByChat.LastInteraction = DateTime.Now;
     userByChat.Connected       = true;
     ServiceCore.getInstance().Container.GetInstance <UsersByChatServices>().Update(userByChat);
 }
Пример #4
0
 public IEnumerable <Messages> getMessagesFromChat(UsersByChat chat)
 {
     return(this._repository.getMessagesFromChat(chat));
 }