コード例 #1
0
ファイル: MessageController.cs プロジェクト: hhy5277/JustSay
        public ActionResult Create(string ToID, string content, string toName)
        {
            IMemberBusiness iMember = new MemberBusiness(new JustSayEntities());

            if (HotConfig.IsControlMessage == 1 && iMember.IsLimitPost(User.Identity.Name.ToInt()))
            {
                ViewData["Validate"] = true;
            }
            else
            {
                ModelState.Remove("_mvcCaptchaText");
            }
            if (ModelState.IsValid)
            {
                Message message = new Message();
                Member  member  = MemberBusiness.GetUserInfo();
                message.ToID     = ToID.UidDescrypt();
                message.FromID   = member.ID;
                message.FromName = member.ShowName;
                message.Content  = content;
                message.ToName   = toName;
                iMessage.Add(message);
                return(Content("发送成功"));
            }
            return(Content("发送频繁60s以后再来"));
        }