Example #1
0
        public JsonResult SavaReply(string entity)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            ReplyEntity          model      = serializer.Deserialize <ReplyEntity>(entity);

            string replyID = "";

            replyID = OrdersBusiness.CreateReply(model.GUID, model.Content, CurrentUser.UserID, CurrentUser.AgentID, model.FromReplyID, model.FromReplyUserID, model.FromReplyAgentID);

            List <ReplyEntity> list = new List <ReplyEntity>();

            if (!string.IsNullOrEmpty(replyID))
            {
                model.ReplyID      = replyID;
                model.CreateTime   = DateTime.Now;
                model.CreateUser   = CurrentUser;
                model.CreateUserID = CurrentUser.UserID;
                model.AgentID      = CurrentUser.AgentID;
                if (!string.IsNullOrEmpty(model.FromReplyUserID) && !string.IsNullOrEmpty(model.FromReplyAgentID))
                {
                    model.FromReplyUser = OrganizationBusiness.GetUserByUserID(model.FromReplyUserID, model.FromReplyAgentID);
                }
                list.Add(model);
            }
            JsonDictionary.Add("items", list);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }