コード例 #1
0
        public void ProcessRequest(HttpContext context)
        {
            string activityId   = context.Request["activity_id"];
            string activityUids = context.Request["activity_uids"];

            if (string.IsNullOrEmpty(activityId))
            {
                resp.errmsg  = "activity_id 为必填项,请检查";
                resp.errcode = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
                return;
            }
            if (string.IsNullOrEmpty(activityUids))
            {
                resp.errmsg  = "activityUid 为必填项,请检查";
                resp.errcode = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                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;
            }
            if (bllActivity.Delete(new ActivityDataInfo(), string.Format(" WebsiteOwner='{0}' AND isDelete=0 AND ActivityID='{1}' AND UID in ({2})", bllJuActivity.WebsiteOwner, juActivity.SignUpActivityID, activityUids)) == activityUids.Split(',').Length)
            {
                bllJuActivity.UpSignUpTotalCount(juActivity.JuActivityID);//更新 报名人数
                resp.isSuccess = true;
                resp.errmsg    = "ok";
            }
            else
            {
                resp.errmsg  = "删除报名数据出错";
                resp.errcode = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
            }
            context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(resp));
        }
コード例 #2
0
ファイル: ActivityData.ashx.cs プロジェクト: uvbs/mmp
        /// <summary>
        /// 是否通过报名
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string ActivityDataByIsPass(HttpContext context)
        {
            string activityId = context.Request["ActivityID"];
            string uId        = context.Request["UID"];
            string remarks    = context.Request["Remarks"];
            int    status     = int.Parse(context.Request["Status"]);

            string[]         ids   = uId.Split(',');
            ActivityDataInfo model = new ActivityDataInfo();

            foreach (var item in ids)
            {
                model         = bllActivity.GetActivityDataInfo(activityId, int.Parse(item));
                model.Status  = status;
                model.Remarks = remarks;
                UserInfo commendUserInfo = bllUser.GetUserInfoByAutoID(int.Parse(model.DistributionOffLineRecommendCode));
                if (commendUserInfo == null)
                {
                    continue;
                }
                #region 审核通过
                if (status == 1001)//审核通过
                {
                    UserInfo userInfo = bllUser.GetUserInfo(model.UserId);
                    userInfo.TrueName = model.Name;
                    if (string.IsNullOrEmpty(model.SpreadUserID))//不是微转发的才分配上级用户
                    {
                        userInfo.DistributionOffLinePreUserId = commendUserInfo.UserID;
                    }
                    else//微转发直接成为分销员
                    {
                        commendUserInfo = bllUser.GetUserInfo(model.SpreadUserID);
                        userInfo.DistributionOffLinePreUserId = commendUserInfo.UserID;
                    }
                    if (bllUser.Update(userInfo))
                    {
                        //申请通过向申请人和上级提醒通过申请

                        //申请人
                        //bllWeixin.SendTemplateMessageNotifyComm(userInfo.WXOpenId, "财富伙伴申请结果", "恭喜您已经通过审核!", string.Format("http://{0}/App/Distribution/m/index.aspx", context.Request.UserHostName));
                        if (string.IsNullOrEmpty(model.SpreadUserID))//不是微转发的才分配上级用户
                        {
                            //上级
                            bllWeixin.SendTemplateMessageNotifyComm(commendUserInfo, string.Format("恭喜您的会员“{0}”申请财富会员成功", model.Name), "请提醒他关注公众号并帮助他熟悉系统操作吧。", string.Format("http://{0}/App/Distribution/m/index.aspx", context.Request.Url.Host));
                        }
                    }

                    //if (!string.IsNullOrEmpty(model.SpreadUserID))//不是微转发的才分配上级用户
                    //{
                    //    model.Status = 4003;

                    //}
                }
                #endregion

                #region 审核不通过
                else if (status == 4001)
                {
                    UserInfo userInfo = bllUser.GetUserInfo(model.UserId);

                    //判断下,当他有下线的时候就不可以取消审核状态
                    if (bllDistributionOffLine.IsHaveLowerLevel(model.UserId))
                    {
                        continue;
                    }
                    else
                    {
                        userInfo.DistributionOffLinePreUserId = "";
                        bllUser.Update(userInfo);
                    }

                    //申请通过向申请人和上级提醒通过申请

                    //申请人
                    //bllWeixin.SendTemplateMessageNotifyComm(userInfo.WXOpenId, "财富伙伴申请结果", string.Format("审核未通过!\\{0}", remarks));

                    //上级

                    bllWeixin.SendTemplateMessageNotifyComm(commendUserInfo, string.Format("很抱歉您的会员“{0}”申请财富会员失败", model.Name), string.Format(" 原因:{0}\\n您可提醒他满足要求后重新申请。", remarks), string.Format("http://{0}/App/Distribution/m/index.aspx", context.Request.Url.Host));
                    if (!string.IsNullOrEmpty(model.SpreadUserID))
                    {
                        //微转发审核不通过,删除此记录
                        bllActivity.Delete(model, string.Format("ActivityID={0} And UID={1}", model.ActivityID, model.UID));
                    }
                }
                #endregion

                if (!bllActivity.Update(model))
                {
                    continue;
                }
            }
            resp.Status = 1;
            return(Common.JSONHelper.ObjectToJson(resp));
        }