Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ActivityID       = bllDis.GetDistributionOffLineApplyActivityID();
            SysRecommendCode = bllUser.GetCurrWebSiteUserInfo().AutoID;

            slides = bllSlide.GetCurrWebsiteAllTypeList();
            WebsiteInfo model = bllWeisite.GetWebsiteInfo();

            if (model != null && !string.IsNullOrEmpty(model.WeiXinBindDomain))
            {
                strDomain = model.WeiXinBindDomain;
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            if (!string.IsNullOrEmpty(CurrentUserInfo.DistributionOffLinePreUserId))
            {
                apiResp.msg = "您已经是分销员";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                return;
            }
            string           activityId = bll.GetDistributionOffLineApplyActivityID();
            ActivityDataInfo model      = bllActivity.GetActivityDataInfo(activityId, CurrentUserInfo.UserID);

            if (model == null)
            {
                apiResp.msg = "您还未申请";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                return;
            }
            if (model.Status != 4003)//不是微转发审核通过的不给继续操作
            {
                apiResp.msg = "审核未通过";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                return;
            }
            UserInfo commendUserInfo = bllUser.GetUserInfoByAutoID(int.Parse(model.DistributionOffLineRecommendCode));

            if (commendUserInfo == null)
            {
                apiResp.msg = "推荐人不存在";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
                return;
            }

            CurrentUserInfo.DistributionOffLinePreUserId = commendUserInfo.UserID;
            CurrentUserInfo.TrueName = model.Name;
            if (bllUser.Update(CurrentUserInfo))
            {
                //申请通过向申请人和上级提醒通过申请
                bllWeixin.SendTemplateMessageNotifyComm(commendUserInfo, string.Format("恭喜您的会员“{0}”申请财富会员成功", model.Name), "请提醒他关注公众号并帮助他熟悉系统操作吧。", string.Format("http://{0}/App/Distribution/m/index.aspx", context.Request.Url.Host));

                apiResp.status = true;
                apiResp.msg    = "ok ";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
            }
            else
            {
                apiResp.msg = "操作失败";
                context.Response.Write(ZentCloud.Common.JSONHelper.ObjectToJson(apiResp));
            }
        }
Exemple #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;
            }
        }
Exemple #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request["moduleType"]))
            {
                moduleType = Request["moduleType"];
            }
            if (!string.IsNullOrEmpty(Request["moduleName"]))
            {
                moduleName = Request["moduleName"];
            }

            if (moduleType == "HouseRecommend")
            {
                tipMsg = "楼盘名称、省份、城市、地区";
            }
            if (moduleType == "CompanyBranchApply")
            {
                tipMsg = "城市、联系人、联系方式";
            }
            if (moduleType == "CompanyBranchRecommend")
            {
                tipMsg = "城市、联系人、联系方式";
            }
            if (moduleType == "HouseAppointment")
            {
                tipMsg = "楼盘名称、联系人、联系方式、备注";
            }
            if (moduleType == "HouseBuyerRecommend")
            {
                tipMsg = "楼盘名称、联系人、联系方式、备注";
            }

            statusList = bllDis.QueryProjectStatusList(moduleType);

            var statusModel = statusList.FirstOrDefault(p => p.StatusAction == "DistributionOffLineCommission");

            if (statusModel != null)
            {
                CommissionStatus = statusModel.OrderStatu;
            }
            var fieldList = bllDis.QueryProjectFieldMapList(moduleType);

            for (int i = 0; i < fieldList.Count; i++)
            {
                if (fieldList[i].IsShowInList == 0)
                {
                    continue;
                }
                Columns += "{ field: '" + fieldList[i].Field + "', title: '" + fieldList[i].MappingName + "', width: 10, align: 'left' }";
                if (i < fieldList.Count - 1)
                {
                    Columns += ",";
                }
            }
            ActivityID = bllDis.GetDistributionOffLineApplyActivityID();
            WebsiteInfo model = bllWeisite.GetWebsiteInfo();

            if (model != null && !string.IsNullOrEmpty(model.WeiXinBindDomain))
            {
                strDomain = model.WeiXinBindDomain;
            }
        }