Ejemplo n.º 1
0
 public static bool CreateMessage(Message message)
 {
     var at = DateTime.Now;
     message.SendDate = at;
     db.Messages.Add(message);
     db.SaveChanges();
     return true;
 }
Ejemplo n.º 2
0
 public ActionResult Send(Message messages)
 {
     messages.Type = MessageType.Type.好友消息.ToString();
     var isSuccess = MessagesService.CreateMessage(messages);
     
     if (isSuccess)
     {
         return RedirectToAction("Index");
     }
     return RedirectToAction("Index");
     //messages.Type = MessageType.Type.好友信息.ToString();
     //var isSuccess = MessagesService.CreateMessage(messages);
     //var result = new {IsSuccess = isSuccess};
     //return Json(result,JsonRequestBehavior.DenyGet);
 }