/// <summary> /// 删除消息 /// </summary> /// <param name="messageDTO"></param> /// <returns></returns> public bool DeleteMessage(MessageDTO messageDTO) { return messageService.DeleteMessage(Mapper.Map<MessageDTO, Message>(messageDTO)); }
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 = "发送失败!" }); } }
/// <summary> /// 发送消息 /// </summary> /// <param name="messageDTO"></param> /// <returns></returns> public bool SendMessage(MessageDTO messageDTO) { return messageService.SendMessage(Mapper.Map<MessageDTO, Message>(messageDTO)); }