示例#1
0
        public ActionResult AddMessage( string messageText )
        {
            if (messageText == "")
                return Json( new { result = "error" }, JsonRequestBehavior.AllowGet );

            var chatMessage = new ChatMessage();
            chatMessage.id = Guid.NewGuid();
            chatMessage.texted_at = DateTime.UtcNow;
            chatMessage.author_id = chatRepository.GetAuthorId( User.Identity.Name );
            chatMessage.is_deleted = false;
            chatMessage.text = messageText;

            chatRepository.Add( chatMessage );

            return Json( new { result = "ok", authorName = User.Identity.Name, text = messageText }, JsonRequestBehavior.AllowGet );
        }
示例#2
0
 public void Delete( ChatMessage chatMessage )
 {
     _db.ChatMessages.DeleteOnSubmit( chatMessage );
     Save();
 }
示例#3
0
 public void Add( ChatMessage chatMessage )
 {
     _db.ChatMessages.InsertOnSubmit( chatMessage );
     Save();
 }
示例#4
0
		private void detach_ChatMessages(ChatMessage entity)
		{
			this.SendPropertyChanging();
			entity.ChatUser = null;
		}
示例#5
0
 partial void DeleteChatMessage(ChatMessage instance);
示例#6
0
 partial void UpdateChatMessage(ChatMessage instance);
示例#7
0
 partial void InsertChatMessage(ChatMessage instance);