Beispiel #1
0
        /// <summary>
        /// 获取篇文章内容
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string GetSingleArticle(HttpContext context)
        {
            var          source = bllJuactivity.GetJuActivity(Convert.ToInt32(context.Request["articleid"], 16));
            string       host   = string.Format("http://{0}", context.Request.Url.Authority);
            ArticleModel model  = new ArticleModel();

            model.ArticleTitle   = source.ActivityName;
            model.ArticleContent = source.ActivityDescription;

            #region 报名表单
            try
            {
                //加载报名表单
                if ((!string.IsNullOrEmpty(source.SignUpActivityID)) && (int.Parse(source.SignUpActivityID) > 0))
                {
                    //当前登录信息
                    ZentCloud.BLLJIMP.Model.UserInfo currUserInfo = new BLLJIMP.Model.UserInfo();
                    if (bll.IsLogin)
                    {
                        currUserInfo = DataLoadTool.GetCurrUserModel();
                    }

                    System.Text.StringBuilder sbAppend = new System.Text.StringBuilder();
                    sbAppend.AppendLine("<link type=\"text/css\" rel=\"stylesheet\" href=\"/css/buttons.css\"/>");
                    sbAppend.AppendLine(" <style type=\"text/css\">input[type='text'],textarea{height:30px;width:100%;border-radius: 2px;margin-top:5px;}</style>");
                    sbAppend.AppendLine("<script src=\"/Scripts/jquery.form.js\" type=\"text/javascript\"></script>");
                    sbAppend.AppendLine("<form id=\"formsignin\">");

                    var mapList = bllActivity.GetActivityFieldMappingList(source.SignUpActivityID);
                    foreach (var item in mapList)
                    {
                        if (item.FieldName.Equals("Name"))
                        {
                            sbAppend.AppendLine(string.Format("<input  placeholder=\"姓名\" name=\"Name\"  id=\"txtName\" type=\"text\" value=\"{0}\">", currUserInfo.TrueName));
                        }
                        else if (item.FieldName.Equals("Phone"))
                        {
                            sbAppend.AppendLine(string.Format("<input  placeholder=\"手机\" name=\"Phone\"  id=\"txtPhone\" type=\"text\" value=\"{0}\">", currUserInfo.Phone));
                        }
                        else
                        {
                            if (item.IsMultiline.Equals(1))
                            {
                                sbAppend.AppendLine(string.Format("<textarea  placeholder=\"{0}\" name=\"{1}\" style=\"height:50px;\" ></textarea>", item.MappingName, "K" + item.ExFieldIndex.ToString()));
                            }
                            else
                            {
                                if (item.MappingName.Contains("公司"))
                                {
                                    sbAppend.AppendLine(string.Format("<input  placeholder=\"{0}\" name=\"{1}\" type=\"text\" value=\"{2}\">", item.MappingName, "K" + item.ExFieldIndex.ToString(), currUserInfo.Company));
                                }
                                else if (item.MappingName.Contains("职位") || item.MappingName.Contains("职务"))
                                {
                                    sbAppend.AppendLine(string.Format("<input  placeholder=\"{0}\" name=\"{1}\" type=\"text\" value=\"{2}\">", item.MappingName, "K" + item.ExFieldIndex.ToString(), currUserInfo.Postion));
                                }
                                else if (item.MappingName.Contains("邮箱") || item.MappingName.Contains("邮件") || item.MappingName.ToLower().Contains("email"))
                                {
                                    sbAppend.AppendLine(string.Format("<input  placeholder=\"{0}\" name=\"{1}\" type=\"text\" value=\"{2}\">", item.MappingName, "K" + item.ExFieldIndex.ToString(), currUserInfo.Email));
                                }
                                else
                                {
                                    sbAppend.AppendLine(string.Format("<input  placeholder=\"{0}\" name=\"{1}\" type=\"text\">", item.MappingName, "K" + item.ExFieldIndex.ToString()));
                                }
                            }
                        }
                    }

                    sbAppend.AppendLine("<span class=\"button button-rounded button-flat-action\" style=\"width:86%;margin-top:10px;\"  onclick=\"SumitData()\" >提交</span>");
                    sbAppend.AppendLine(string.Format("<input  type=\"hidden\" value=\"{0}\" name=\"ActivityID\">", source.SignUpActivityID));
                    BLLJIMP.Model.UserInfo userInfo = bll.Get <BLLJIMP.Model.UserInfo>(string.Format(" UserId='{0}'", source.UserID));
                    sbAppend.AppendLine(string.Format("<input id=\"loginName\" type=\"hidden\" value=\"{0}\" name=\"LoginName\" />", ZentCloud.Common.Base64Change.EncodeBase64ByUTF8(userInfo.UserID))); //外部登录名
                    sbAppend.AppendLine(string.Format("<input id=\"loginPwd\" type=\"hidden\" value=\"{0}\" name=\"LoginPwd\" />", ZentCloud.Common.DEncrypt.ZCEncrypt(userInfo.Password)));              //外部登录密码
                    sbAppend.AppendLine("</form>");
                    //
                    sbAppend.AppendLine("<script type=\"text/javascript\">");
                    sbAppend.AppendLine("function SumitData() {");
                    sbAppend.AppendLine("var Name = $(\"#txtName\").val();");
                    sbAppend.AppendLine("var Phone = $(\"#txtPhone\").val();");
                    sbAppend.AppendLine("if (Name == \"\" || (Phone == \"\")) {alert(\"请输入姓名、手机号码\");return false; }");

                    sbAppend.AppendLine("$(\"#formsignin\").ajaxSubmit({");
                    sbAppend.AppendLine("url: \"/serv/ActivityApiJson.ashx\",");
                    sbAppend.AppendLine("type: \"post\",");
                    sbAppend.AppendLine("dataType: \"json\",");
                    sbAppend.AppendLine("success: function (resp) {");
                    sbAppend.AppendLine("if (resp.Status == 0) {//清空");
                    sbAppend.AppendLine(" $('input:text').val(\"\");");
                    sbAppend.AppendLine("$('textarea').val(\"\");");
                    sbAppend.AppendLine("alert(\"提交成功!\");");
                    sbAppend.AppendLine("return;");
                    sbAppend.AppendLine("}");
                    sbAppend.AppendLine("else if (resp.Status == 1) {alert(\"重复提交!\");}");
                    sbAppend.AppendLine(" else {alert(resp.Msg);}");
                    sbAppend.AppendLine("}});return false;  };");
                    sbAppend.AppendLine("</script>");


                    model.ArticleContent += sbAppend.ToString();
                }
            }
            catch (Exception)
            {
            }
            //加载报名表单
            #endregion

            model.ArticleThumbnails = bll.GetImgUrl(source.ThumbnailsPath);
            //model.ArticleUrl = string.Format("{0}/{1}/details.chtml", host, source.JuActivityIDHex);
            return(Common.JSONHelper.ObjectToJson(model));
        }
Beispiel #2
0
        /// <summary>
        /// 手动添加报名数据
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string AddActivityData(HttpContext context)
        {
            //接收到的实体
            BLLJIMP.Model.ActivityDataInfo reqModel = bllActivity.ConvertRequestToModel <BLLJIMP.Model.ActivityDataInfo>(new BLLJIMP.Model.ActivityDataInfo());

            string activityId           = context.Request["ActivityID"];
            var    newActivityUId       = 1001;
            var    lastActivityDataInfo = bllActivity.Get <ActivityDataInfo>(string.Format("ActivityID='{0}' order by UID DESC", activityId));

            if (lastActivityDataInfo != null)
            {
                newActivityUId = lastActivityDataInfo.UID + 1;
            }
            reqModel.ActivityID   = activityId;
            reqModel.UID          = newActivityUId;
            reqModel.InsertDate   = DateTime.Now;
            reqModel.WebsiteOwner = bllActivity.WebsiteOwner;

            #region OLD
            //BLLJIMP.Model.ActivityDataInfo Model = new ActivityDataInfo();
            //Model.UserId = context.Request["UserId"];
            //Model.ActivityID = ActivityID;
            //Model.UID = NewActivityUID;
            //Model.InsertDate = DateTime.Now;
            //Model.Name = GetPostParm("Name");
            //Model.Phone = GetPostParm("Phone");
            //Model.K1 = GetPostParm("K1");
            //Model.K2 = GetPostParm("K2");
            //Model.K3 = GetPostParm("K3");
            //Model.K4 = GetPostParm("K4");
            //Model.K5 = GetPostParm("K5");
            //Model.K6 = GetPostParm("K6");
            //Model.K7 = GetPostParm("K7");
            //Model.K8 = GetPostParm("K8");
            //Model.K9 = GetPostParm("K9");
            //Model.K10 = GetPostParm("K10");
            //Model.K11 = GetPostParm("K11");
            //Model.K12 = GetPostParm("K12");
            //Model.K13 = GetPostParm("K13");
            //Model.K14 = GetPostParm("K14");
            //Model.K15 = GetPostParm("K15");
            //Model.K16 = GetPostParm("K16");
            //Model.K17 = GetPostParm("K17");
            //Model.K18 = GetPostParm("K18");
            //Model.K19 = GetPostParm("K19");
            //Model.K20 = GetPostParm("K20");

            //Model.K21 = GetPostParm("K21");
            //Model.K22 = GetPostParm("K22");
            //Model.K23 = GetPostParm("K23");
            //Model.K24 = GetPostParm("K24");
            //Model.K25 = GetPostParm("K25");
            //Model.K26 = GetPostParm("K26");
            //Model.K27 = GetPostParm("K27");
            //Model.K28 = GetPostParm("K28");
            //Model.K29 = GetPostParm("K29");
            //Model.K30 = GetPostParm("K30");

            //Model.K31 = GetPostParm("K31");
            //Model.K32 = GetPostParm("K32");
            //Model.K33 = GetPostParm("K33");
            //Model.K34 = GetPostParm("K34");
            //Model.K35 = GetPostParm("K35");
            //Model.K36 = GetPostParm("K36");
            //Model.K37 = GetPostParm("K37");
            //Model.K38 = GetPostParm("K38");
            //Model.K39 = GetPostParm("K39");
            //Model.K40 = GetPostParm("K40");

            //Model.K41 = GetPostParm("K41");
            //Model.K42 = GetPostParm("K42");
            //Model.K43 = GetPostParm("K43");
            //Model.K44 = GetPostParm("K44");
            //Model.K45 = GetPostParm("K45");
            //Model.K46 = GetPostParm("K46");
            //Model.K47 = GetPostParm("K47");
            //Model.K48 = GetPostParm("K48");
            //Model.K49 = GetPostParm("K49");
            //Model.K50 = GetPostParm("K50");

            //Model.K51 = GetPostParm("K51");
            //Model.K52 = GetPostParm("K52");
            //Model.K53 = GetPostParm("K53");
            //Model.K54 = GetPostParm("K54");
            //Model.K55 = GetPostParm("K55");
            //Model.K56 = GetPostParm("K56");
            //Model.K57 = GetPostParm("K57");
            //Model.K58 = GetPostParm("K58");
            //Model.K59 = GetPostParm("K59");
            //Model.K60 = GetPostParm("K60");
            #endregion

            UserInfo userInfo = bllUser.GetUserInfo(reqModel.UserId);
            if (!string.IsNullOrEmpty(reqModel.UserId))
            {
                if (userInfo == null)
                {
                    resp.Msg = "用户不存在,请检查";
                    return(Common.JSONHelper.ObjectToJson(resp));
                }
                else
                {
                    #region 自动补充信息
                    reqModel.WeixinOpenID = userInfo.WXOpenId;
                    reqModel.UserId       = userInfo.UserID;
                    if (!string.IsNullOrEmpty(userInfo.TrueName))
                    {
                        reqModel.Name = userInfo.TrueName;
                    }
                    if (!string.IsNullOrEmpty(userInfo.Phone))
                    {
                        reqModel.Phone = userInfo.Phone;
                    }
                    var  fieldMappingList = bllActivity.GetActivityFieldMappingList(reqModel.ActivityID);
                    Type type             = reqModel.GetType();
                    if (!string.IsNullOrEmpty(userInfo.Company))
                    {
                        if (fieldMappingList.Where(p => p.MappingName.Contains("公司")).Count() > 0)
                        {
                            PropertyInfo propertyInfo = type.GetProperty("K" + fieldMappingList.Where(p => p.MappingName.Contains("公司")).First().ExFieldIndex.ToString());

                            propertyInfo.SetValue(reqModel, userInfo.Company, null);
                        }
                    }
                    if (!string.IsNullOrEmpty(userInfo.Postion))
                    {
                        if (fieldMappingList.Where(p => p.MappingName.Contains("职位")).Count() > 0)
                        {
                            PropertyInfo propertyInfo = type.GetProperty("K" + fieldMappingList.Where(p => p.MappingName.Contains("职位")).First().ExFieldIndex.ToString());

                            propertyInfo.SetValue(reqModel, userInfo.Postion, null);
                        }
                    }
                    if (!string.IsNullOrEmpty(userInfo.Email))
                    {
                        if (fieldMappingList.Where(p => p.MappingName.Contains("邮箱")).Count() > 0)
                        {
                            PropertyInfo propertyInfo = type.GetProperty("K" + fieldMappingList.Where(p => p.MappingName.Contains("邮箱")).First().ExFieldIndex.ToString());

                            propertyInfo.SetValue(reqModel, userInfo.Email, null);
                        }
                    }



                    #endregion
                }
            }
            if (string.IsNullOrEmpty(reqModel.Name))
            {
                resp.Msg = "该用户没有填写姓名,请填写姓名";
                return(Common.JSONHelper.ObjectToJson(resp));
            }
            if (string.IsNullOrEmpty(reqModel.Phone))
            {
                resp.Msg = "该用户没有填写手机号,请填写手机号";
                return(Common.JSONHelper.ObjectToJson(resp));
            }
            if (bllActivity.Add(reqModel))
            {
                resp.Status = 1;
                #region 扣积分
                JuActivityInfo juActivityInfo = bllJuActivity.GetJuActivityByActivityID(activityId);
                if ((juActivityInfo != null) && (juActivityInfo.ActivityIntegral > 0))
                {
                    if (userInfo != null)
                    {
                        //userInfo.TotalScore -= juActivityInfo.ActivityIntegral;
                        if (bllUser.Update(userInfo, string.Format(" TotalScore-={0}", juActivityInfo.ActivityIntegral), string.Format(" AutoID={0}", userInfo.AutoID)) > 0)
                        {
                            ////积分记录
                            //BLLJIMP.Model.WBHScoreRecord record = new BLLJIMP.Model.WBHScoreRecord()
                            //{
                            //    InsertDate = DateTime.Now,
                            //    ScoreNum = "-" + juActivityInfo.ActivityIntegral.ToString(),
                            //    WebsiteOwner = bllUser.WebsiteOwner,
                            //    UserId = reqModel.UserId,
                            //    NameStr = "参加" + juActivityInfo.ActivityName,
                            //    Nums = "b55",
                            //    RecordType = "1",
                            //};
                            UserScoreDetailsInfo scoreRecord = new UserScoreDetailsInfo();
                            scoreRecord.AddTime      = DateTime.Now;
                            scoreRecord.Score        = juActivityInfo.ActivityIntegral;
                            scoreRecord.ScoreType    = "ActivityUse";
                            scoreRecord.UserID       = userInfo.UserID;
                            scoreRecord.AddNote      = "参加" + juActivityInfo.ActivityName + "使用" + juActivityInfo.ActivityIntegral + "积分";
                            scoreRecord.WebSiteOwner = userInfo.WebsiteOwner;
                            //bllUser.Add(record);
                            bllUser.Add(scoreRecord);
                        }
                        else
                        {
                            resp.Msg = "更新用户积分失败";
                            return(Common.JSONHelper.ObjectToJson(resp));
                        }
                    }
                }
                #endregion
            }
            else
            {
                resp.Msg = "添加失败";
                return(Common.JSONHelper.ObjectToJson(resp));
            }
            return(Common.JSONHelper.ObjectToJson(resp));
        }
Beispiel #3
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                ToLog("已经进入——ApplyActivity");

                var userInfo = bll.GetCurrentUserInfo();
                ToLog("userInfo:" + JsonConvert.SerializeObject(userInfo));

                string activityId = bll.GetDistributionOffLineApplyActivityID();
                ToLog("activityId:" + activityId);

                ActivityDataInfo model = bllActivity.GetActivityDataInfo(activityId, bll.GetCurrUserID());

                bool isEnroll = model != null;               //是否报过名

                int                       apply_status  = 0; //0未申请  1待审核 2已通过 4001已拒绝 4002 微转发通过
                string                    remarks       = string.Empty;
                List <SignField>          signfieldList = new List <SignField>();
                List <ActivityDataRecord> applyRecord   = new List <ActivityDataRecord>();
                var                       fieldList     = bllActivity.GetActivityFieldMappingList(activityId).Where(p => p.IsHideInSubmitPage != "1");
                //检查当前是否已经是分销员
                if (!string.IsNullOrWhiteSpace(userInfo.DistributionOffLinePreUserId))
                {
                    apply_status = 2;
                }
                else
                {
                    if (isEnroll)
                    {
                        //判断是待审核还是审核不通过
                        if (model.Status == 4001)
                        {
                            apply_status = 4001;
                            remarks      = model.Remarks;
                        }
                        //else if (model.Status==0&&(!string.IsNullOrEmpty(model.SpreadUserID)))//微转发待审核
                        //{
                        //    apply_status = 4002;
                        //    remarks = string.Format("您已报名过 {0}分享的活动 {1},系统正在审核中,审核通过可以直接成为平台会员",model.K59,model.K60);
                        //}
                        //else if (model.Status == 4003)//微转发审核通过
                        //{
                        //    apply_status = 4003;
                        //    remarks = string.Format("您已报名过 {0}分享的活动 {1},可以直接成为平台会员", model.K59, model.K60);
                        //}
                        else
                        {
                            apply_status = 1;
                        }

                        Type type = model.GetType();
                        //数据记录
                        foreach (var item in fieldList)
                        {
                            ActivityDataRecord record = new ActivityDataRecord();
                            record.field = item.FieldName;
                            record.value = type.GetProperty(item.FieldName).GetValue(model, null).ToString();
                            applyRecord.Add(record);
                        }

                        //分销推荐id加上
                        applyRecord.Add(new ActivityDataRecord()
                        {
                            field = "DistributionOffLineRecommendCode",
                            value = model.DistributionOffLineRecommendCode,
                        });
                    }
                    else
                    {
                        apply_status = 0;
                    }
                    //如果未报过名,把活动字段信息返回

                    foreach (var item in fieldList)
                    {
                        SignField signModel = new SignField();
                        signModel.key    = item.MappingName;
                        signModel.value  = item.FieldName;
                        signModel.isnull = item.FieldIsNull;
                        signfieldList.Add(signModel);
                    }


                    //分销推荐id加上
                    signfieldList.Add(new SignField()
                    {
                        key    = "推荐码",
                        value  = "DistributionOffLineRecommendCode",
                        isnull = 0
                    });
                }

                apiResp.result = new
                {
                    activity_id  = activityId,
                    is_enroll    = isEnroll,
                    signfield    = signfieldList,
                    apply_record = applyRecord,
                    apply_status = apply_status,
                    remarks      = remarks
                };
                apiResp.status = true;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
            }
            catch (Exception ex)
            {
                ToLog("活动状态异常:" + ex.Message);
                throw ex;
            }
        }
Beispiel #4
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                string activityId = context.Request["activity_id"];
                int    pageIndex  = !string.IsNullOrEmpty(context.Request["pageindex"]) ? int.Parse(context.Request["pageindex"]) : 1;
                int    pageSize   = !string.IsNullOrEmpty(context.Request["pagesize"]) ? int.Parse(context.Request["pagesize"]) : 10;
                string keyWord    = context.Request["keyword"];
                if (string.IsNullOrEmpty(activityId))
                {
                    resp.errcode = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                    resp.errmsg  = "activity_id 为必填项,请检查";
                    context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                    return;
                }
                JuActivityInfo juActivity = bllJuActivity.GetJuActivity(int.Parse(activityId), false);
                if (juActivity == null)
                {
                    resp.errmsg  = "不存在该条活动";
                    resp.errcode = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                    context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                    return;
                }

                System.Text.StringBuilder sbWhere = new System.Text.StringBuilder(string.Format(" WebSiteOwner='{0}' AND isDelete=0 AND ActivityID='{1}' ", bllActivity.WebsiteOwner, juActivity.SignUpActivityID));

                if (!string.IsNullOrEmpty(keyWord))
                {
                    sbWhere.AppendFormat(" AND Name like '%{0}%' ", keyWord);
                }

                int totalCount = bllActivity.GetCount <ActivityDataInfo>(sbWhere.ToString());

                var dataList = bllActivity.GetLit <ActivityDataInfo>(pageSize, pageIndex, sbWhere.ToString());

                List <ActivityFieldMappingInfo> fieldMapList = bllActivity.GetActivityFieldMappingList(juActivity.SignUpActivityID);

                resp.isSuccess = true;

                List <dynamic> list      = new List <dynamic>();
                List <dynamic> maplist   = new List <dynamic>();
                var            fieldlist = bllActivity.GetActivityFieldMappingList(juActivity.SignUpActivityID);
                foreach (var item in fieldlist)
                {
                    maplist.Add(new
                    {
                        key   = item.MappingName,
                        value = item.FieldName
                    });
                }

                for (int i = 0; i < dataList.Count; i++)
                {
                    list.Add(new
                    {
                        name        = dataList[i].Name,
                        phone       = dataList[i].Phone,
                        insert_time = bllActivity.GetTimeStamp(dataList[i].InsertDate),
                        k1          = dataList[i].K1,
                        k2          = dataList[i].K2,
                        k3          = dataList[i].K3,
                        k4          = dataList[i].K4,
                        k5          = dataList[i].K5,
                        k6          = dataList[i].K6,
                        k7          = dataList[i].K7,
                        k8          = dataList[i].K8,
                        k9          = dataList[i].K9,
                        k10         = dataList[i].K10,

                        k11 = dataList[i].K11,
                        k12 = dataList[i].K12,
                        k13 = dataList[i].K13,
                        k14 = dataList[i].K14,
                        k15 = dataList[i].K15,
                        k16 = dataList[i].K16,
                        k17 = dataList[i].K17,
                        k18 = dataList[i].K18,
                        k19 = dataList[i].K19,
                        k20 = dataList[i].K20,

                        k21 = dataList[i].K21,
                        k22 = dataList[i].K22,
                        k23 = dataList[i].K23,
                        k24 = dataList[i].K24,
                        k25 = dataList[i].K25,
                        k26 = dataList[i].K26,
                        k27 = dataList[i].K27,
                        k28 = dataList[i].K28,
                        k29 = dataList[i].K29,
                        k30 = dataList[i].K30,

                        k31 = dataList[i].K31,
                        k32 = dataList[i].K32,
                        k33 = dataList[i].K33,
                        k34 = dataList[i].K34,
                        k35 = dataList[i].K35,
                        k36 = dataList[i].K36,
                        k37 = dataList[i].K37,
                        k38 = dataList[i].K38,
                        k39 = dataList[i].K39,
                        k40 = dataList[i].K40,

                        k41 = dataList[i].K41,
                        k42 = dataList[i].K42,
                        k43 = dataList[i].K43,
                        k44 = dataList[i].K44,
                        k45 = dataList[i].K45,
                        k46 = dataList[i].K46,
                        k47 = dataList[i].K47,
                        k48 = dataList[i].K48,
                        k49 = dataList[i].K49,
                        k50 = dataList[i].K50,

                        k51 = dataList[i].K51,
                        k52 = dataList[i].K52,
                        k53 = dataList[i].K53,
                        k54 = dataList[i].K54,
                        k55 = dataList[i].K55,
                        k56 = dataList[i].K56,
                        k57 = dataList[i].K57,
                        k58 = dataList[i].K58,
                        k59 = dataList[i].K59,
                        k60 = dataList[i].K60,
                    });
                }


                var data = new {
                    totalcount = totalCount,
                    list       = list,
                };

                resp.returnObj = new
                {
                    data    = data,
                    maplist = maplist
                };
            }
            catch (Exception ex)
            {
                resp.errcode = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
                resp.errmsg  = ex.Message;
            }
            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
        }