Пример #1
0
        public void ProcessRequest(HttpContext context)
        {
            string id = context.Request["id"];

            if (string.IsNullOrEmpty(id))
            {
                apiResp.msg  = "ids不能为空,请检查";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                bllDistributionOffLine.ContextResponse(context, apiResp);
                return;
            }
            BindBankCard model = bllDistributionOffLine.GetBindBankCard(int.Parse(id));

            if (bllDistributionOffLine.GetCurrUserID() != model.UserId)
            {
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.InadequatePermissions;
                apiResp.msg  = "无权操作";
                bllDistributionOffLine.ContextResponse(context, apiResp);
                return;
            }
            if (bllDistributionOffLine.Delete(model) > 0)
            {
                apiResp.msg    = "删除成功";
                apiResp.status = true;
            }
            else
            {
                apiResp.msg  = "删除出错";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.OperateFail;
            }
            bllDistributionOffLine.ContextResponse(context, apiResp);
        }
Пример #2
0
        public void ProcessRequest(HttpContext context)
        {
            string autoId = context.Request["id"];

            if (string.IsNullOrEmpty(autoId))
            {
                apiResp.msg  = "银行卡id为必填项,请检查";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                bllDistributionOffLine.ContextResponse(context, apiResp);
                return;
            }
            BindBankCard model = bllDistributionOffLine.GetBindBankCard(int.Parse(autoId));

            if (model.UserId != bllDistributionOffLine.GetCurrUserID())
            {
                apiResp.msg  = "无权操作";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.InadequatePermissions;
                bllDistributionOffLine.ContextResponse(context, apiResp);
                return;
            }
            if (model == null)
            {
                apiResp.msg  = "没有找到银行卡信息";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                bllDistributionOffLine.ContextResponse(context, apiResp);
                return;
            }
            apiResp.status = true;
            apiResp.result = new
            {
                id                      = model.AutoID,
                account_name            = model.AccountName,
                bank_account            = model.BankAccount,
                bank_name               = model.BankName,
                account_branch_name     = model.AccountBranchName,
                account_branch_province = model.AccountBranchProvince,
                account_branch_city     = model.AccountBranchCity,
                bank_code               = model.BankCode
            };
            bllDistributionOffLine.ContextResponse(context, apiResp);
        }
Пример #3
0
        public void ProcessRequest(HttpContext context)
        {
            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 projectId = context.Request["project_id"];

            if (string.IsNullOrEmpty(projectId))
            {
                apiResp.msg  = "project_id为必填项,请检查";
                apiResp.code = (int)BLLJIMP.Enums.APIErrCode.IsNotFound;
                bll.ContextResponse(context, apiResp);
                return;
            }
            int            totalCount = 0;
            var            logList    = bll.GetProJectLogList(pageSize, pageIndex, bll.GetCurrUserID(), projectId, bll.WebsiteOwner, out totalCount);
            List <dynamic> returnList = new List <dynamic>();

            foreach (var item in logList)
            {
                returnList.Add(new
                {
                    status              = item.Status,                       //状态
                    remark              = item.Remark,                       //备注
                    projectlog_time     = bll.GetTimeStamp(item.InsertDate), //时间
                    projectlog_time_str = item.InsertDate.ToString("yyyy-MM-dd HH:mm")
                });
            }
            apiResp.result = new
            {
                totalcount = totalCount,
                list       = returnList
            };
            apiResp.status = true;
            apiResp.msg    = "ok";
            bll.ContextResponse(context, apiResp);
        }
Пример #4
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;
            }
        }
Пример #5
0
        public void ProcessRequest(HttpContext context)
        {
            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"]) : 1;
            string keyWord                 = context.Request["keyword"];
            int    totalCount              = 0;
            List <BindBankCard> bankList   = bllDistributionOffLine.GetBindBankCardList(pageSize, pageIndex, keyWord, bllDistributionOffLine.GetCurrUserID(), out totalCount);
            List <dynamic>      returnList = new List <dynamic>();

            foreach (var item in bankList)
            {
                returnList.Add(new
                {
                    id           = item.AutoID,
                    account_name = item.AccountName,
                    bank_account = item.BankAccount,
                    bank_name    = item.BankName
                });
            }
            apiResp.result = new
            {
                list       = returnList,
                totalcount = totalCount
            };
            apiResp.status = true;
            bllDistributionOffLine.ContextResponse(context, apiResp);
        }