Esempio n. 1
0
        public JsonResult FamMsgSend(Guid receiveUserId, string fammsgcontent, string receiveUsername)
        {
            string statuscode = "200";
            string msg        = "";

            UCHome_Msg model = new UCHome_Msg();

            model.MsgID       = Guid.NewGuid();
            model.MsgDate     = DateTime.Now;
            model.MsgUserID   = userId;
            model.MsgUserName = userName;
            model.MsgContent  = HttpUtility.UrlDecode(fammsgcontent);
            var receiveIds   = receiveUserId.ToString();
            var receiveNames = HttpUtility.UrlDecode(receiveUsername);

            try
            {
                services.SendMsg(model, receiveIds, receiveNames);
            }
            catch (Exception ex)
            {
                statuscode = "500";
                msg        = ex.ToString();
            }


            JsonResult rlt = new JsonResult {
                Data = new { statuscode, msg }
            };

            return(Json(rlt, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public JsonResult MsgSend(UCHome_Msg model)
        {
            string statuscode = "200";
            string msg        = "";

            if (ModelState.IsValid)
            {
                model.MsgDate     = DateTime.Now;
                model.MsgUserID   = userId;
                model.MsgUserName = userName;
                var receiveIds   = Request["selectUserID"];
                var receiveNames = Request["selectUserName"];

                try
                {
                    services.SendMsg(model, receiveIds, receiveNames);
                }
                catch (Exception ex)
                {
                    statuscode = "500";
                    msg        = ex.ToString();
                }
            }

            JsonResult rlt = new JsonResult {
                Data = new { statuscode, msg }
            };

            return(Json(rlt, JsonRequestBehavior.AllowGet));
        }
Esempio n. 3
0
        public ActionResult MsgSend()
        {
            UCHome_Msg msg = new UCHome_Msg();

            msg.MsgID = Guid.NewGuid();
            return(PartialView(msg));
        }