Beispiel #1
0
        public object GetMessageInfo([FromBody] JObject json)
        {
            try
            {
                string        res       = json.Value <string>("json");
                dynamic       dy        = JsonConvert.DeserializeObject <ExpandoObject>(res);
                string        userId    = dy.userid;
                string        messageId = dy.data.messageId;
                MessageEntity entity    = messagebll.GetEntity(messageId);

                //获取相关附件
                var    files  = new FileInfoBLL().GetFiles(messageId);
                string webUrl = new DataItemDetailBLL().GetItemValue("imgUrl");
                foreach (DataRow dr in files.Rows)
                {
                    dr["filepath"] = dr["filepath"].ToString().Replace("~/", webUrl + "/");
                }
                var result = new
                {
                    message = entity,
                    files   = files
                };
                return(new
                {
                    code = 0,
                    count = 1,
                    info = "获取数据成功",
                    data = result
                });
            }
            catch (Exception ex)
            {
                return(new { code = -1, count = 0, info = ex.Message });
            }
        }
Beispiel #2
0
        public ActionResult GetFormJson(string keyValue)
        {
            var data = messagebll.GetEntity(keyValue);

            return(ToJsonResult(data));
        }