Ejemplo n.º 1
0
        public JsonResult Send()
        {
            string username = Request["username"];
            User   receiver = UserView.GetUserByUsername(username);

            if (!Permission.LoginedNeed(Request, Response, Session) || receiver == null)
            {
                return(Json(false));
            }

            string title   = Request["title"];
            string content = Request["content"];

            User sender = (User)Session["user"];

            log.Info("uid:" + sender.uid + "发送消息至uid:" + receiver.uid);

            Message message = new Message
            {
                sender    = sender.uid,
                receiver  = receiver.uid,
                title     = title,
                content   = content,
                send_date = DateTime.Now,
                read      = false
            };

            return(Json(MessageView.SendMessage(message)));
        }