コード例 #1
0
 /// <summary>
 /// 删除消息
 /// </summary>
 /// <param name="messageDTO"></param>
 /// <returns></returns>
 public bool DeleteMessage(MessageDTO messageDTO)
 {
     return messageService.DeleteMessage(Mapper.Map<MessageDTO, Message>(messageDTO));
 }
コード例 #2
0
 public JsonResult SendMessage(string incept, string title, string content)
 {
     MessageDTO message = new MessageDTO();
     message.ID = Guid.NewGuid().ToString();
     message.Title = title;
     message.Content = content.Replace("\n", "<br />");
     message.SendTime = DateTime.Now;
     message.FromUserName = Session["userName"].ToString();
     message.ToUserName = incept;
     message.IsRead = false;
     if (messageServiceImpl.SendMessage(message))
     {
         return Json(new { result = "success", content = "发送成功!" });
     }
     else
     {
         return Json(new { result = "error", content = "发送失败!" });
     }
 }
コード例 #3
0
 /// <summary>
 /// 发送消息
 /// </summary>
 /// <param name="messageDTO"></param>
 /// <returns></returns>
 public bool SendMessage(MessageDTO messageDTO)
 {
     return messageService.SendMessage(Mapper.Map<MessageDTO, Message>(messageDTO));
 }