Example #1
0
 public void AddChatToDatabase(Chat chat)
 {
     chat transposed = Mapper.Map<Chat, chat>(chat);
     db_mysql db = new db_mysql();
     db.chats.Add(transposed);
     db.SaveChanges();
 }
Example #2
0
        public void UpdateDatabase()
        {
            List<ChatMessage> temp_messages = new List<ChatMessage>(Messages);

            foreach (ChatMessage msg in temp_messages)
            {

                if (msg.StoredInDB == false)
                {
                    Core.Model.Chat chat = new Core.Model.Chat();
                    chat.ChatDate = msg.ChatDate;
                    chat.Message = msg.Message;
                    chat.Nick = msg.Nick;
                    chat.Room = msg.Room;
                    chat.IP = msg.IP;
                    _chatService.AddChatToDatabase(chat);
                    msg.StoredInDB = true;
                }

            }

            Messages = temp_messages;
        }
Example #3
0
 public void AddChatToDatabase(Chat chat)
 {
     _queryChats.AddChatToDatabase(chat);
 }