Beispiel #1
0
        public JsonResult AddMessage(Message message)
        {
            message.IsAdmin   = false;
            message.UpperLeve = 0;
            info.ResultType   = ResultInfo.BaseResultType.Error;
            if (Com.isTelephone(message.Mobile))
            {
                info.Msg = "电话号码格式不正确!";
            }
            if (string.IsNullOrEmpty(message.Nick))
            {
                info.Msg = "请填写昵称";
            }
            if (string.IsNullOrEmpty(message.MessageContent))
            {
                info.Msg = "请填写内容";
            }
            if (Session["VerifyCodeUsersLogin"] == null)
            {
                info.Msg = "服务器程序出错,请刷新页面重试!";
            }
            else
            {
                info = messageBll.AddMessage(message);
            }

            return(Json(info));
        }
Beispiel #2
0
        public void Send_Msg()
        {
            UserInfo user = IPublic.VerifyUser();

            if (user == null)
            {
                return;
            }
            MessageInfo message = new MessageInfo()
            {
                SendUserId   = HttpContext.Current.Request["UserId"],
                ReciveUserId = HttpContext.Current.Request["ReciveUserId"],
                Content      = HttpContext.Current.Request["Content"],
                SendTime     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
            };

            if (!messageBLL.AddMessage(message))
            {
                responseResult.ResponseDetails = "消息发送失败!";
                responseResult.ResponseStatus  = 0;
            }
            else
            {
                responseResult.ResponseData    = message;
                responseResult.ResponseDetails = "消息发送成功!";
                responseResult.ResponseStatus  = 1;
            }
            responseResult.ResponseWrite();
        }
Beispiel #3
0
        public IHttpActionResult AddMessage(MessageInfoModel model)
        {
            UserApi api     = new UserApi();
            var     userApi = api.GetUserInfoByToken();

            model.CreateUserID = Convert.ToInt32(userApi.Data.UserId);
            MessageBLL msg = new MessageBLL();
            var        get = msg.AddMessage(model);

            return(InspurJson <RetMessageInfo>(get));
        }
Beispiel #4
0
        public ActionResult SendMessage(OrganizationMessageModel model)
        {
            Person  fromPerson = Session["Person"] as Person;
            Message message    = new Message
            {
                Date        = DateTime.Now,
                FromID      = fromPerson.PersonID,
                ToID        = model.Organization.PersonID,
                MessageText = model.Message.MessageText
            };

            messageBLL.AddMessage(message);
            return(View());
        }