示例#1
0
        /// <summary>
        /// 课程基本设置
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        private string EditOpenConfig(HttpContext context)
        {
            string Creater = context.Request["Creater"];

            if (string.IsNullOrWhiteSpace(Creater))
            {
                resp.Status = (int)APIErrCode.PrimaryKeyIncomplete;
                resp.Msg    = "创建人不能为空";
                return(Common.JSONHelper.ObjectToJson(resp));
            }
            if (bllUserExpand.ExistUserExpand(UserExpandType.UserOpenCreate, this.currentUserInfo.UserID))
            {
                bllUserExpand.UpdateUserExpand(UserExpandType.UserOpenCreate, this.currentUserInfo.UserID, Creater);
            }
            else
            {
                bllUserExpand.AddUserExpand(UserExpandType.UserOpenCreate, this.currentUserInfo.UserID, Creater);
            }

            string OpenClassNotice = context.Request["OpenClassNotice"];

            if (!string.IsNullOrWhiteSpace(OpenClassNotice))
            {
                BLLKeyValueData bllKeyValueData = new BLLKeyValueData();

                KeyVauleDataInfo value = new KeyVauleDataInfo();
                value.DataType     = "OpenClassNotice";
                value.DataKey      = "0";
                value.DataValue    = OpenClassNotice;
                value.Creater      = this.currentUserInfo.UserID;
                value.WebsiteOwner = bll.WebsiteOwner;
                value.CreateTime   = DateTime.Now;
                bllKeyValueData.PutDataValue(value);
            }

            resp.Status = 1;
            resp.Msg    = "修改完成";
            return(Common.JSONHelper.ObjectToJson(resp));
        }
示例#2
0
        private string EditRechargeConfig(HttpContext context)
        {
            string           recharge                  = context.Request["Recharge"];
            string           vipPrice                  = context.Request["VIPPrice"];
            string           sendNoticePrice           = context.Request["SendNoticePrice"];
            string           minScore                  = context.Request["MinScore"];
            string           minWithdrawCashScore      = context.Request["MinWithdrawCashScore"];
            string           vipPrice0                 = context.Request["VIPPrice0"];
            string           vipDatelong               = context.Request["VIPDatelong"];
            string           vipInterestID             = context.Request["VIPInterestID"];
            string           vipInterestDescription    = context.Request["VIPInterestDescription"];
            string           websiteOwner              = bllkeyValueData.WebsiteOwner;
            KeyVauleDataInfo rechargeKeyValue          = new KeyVauleDataInfo("Recharge", "100", recharge, websiteOwner, null, currentUserInfo.UserID);
            KeyVauleDataInfo sendNoticePriceValue      = new KeyVauleDataInfo("SendNoticePrice", "1", sendNoticePrice, websiteOwner, null, currentUserInfo.UserID);
            KeyVauleDataInfo minScoreValue             = new KeyVauleDataInfo("MinScore", "1", minScore, websiteOwner, null, currentUserInfo.UserID);
            KeyVauleDataInfo minWithdrawCashScoreValue = new KeyVauleDataInfo("MinWithdrawCashScore", "1", minWithdrawCashScore, websiteOwner, null, currentUserInfo.UserID);
            KeyVauleDataInfo VIPPriceKeyValue          = new KeyVauleDataInfo("VIPPrice", "1", vipPrice, websiteOwner, null, currentUserInfo.UserID);
            KeyVauleDataInfo VIPPrice0KeyValue         = new KeyVauleDataInfo("VIPPrice", "0", vipPrice0, websiteOwner, null, currentUserInfo.UserID);
            KeyVauleDataInfo VIPDatelongKeyValue       = new KeyVauleDataInfo("VIPDatelong", "1", vipDatelong, websiteOwner, null, currentUserInfo.UserID);
            KeyVauleDataInfo VIPInterestIDKeyValue     = new KeyVauleDataInfo("VIPInterestID", "1", vipInterestID, websiteOwner, null, currentUserInfo.UserID);
            JuActivityInfo   juAct    = new JuActivityInfo();
            BLLJuActivity    bllJuAct = new BLLJuActivity();

            if (!string.IsNullOrWhiteSpace(vipInterestID) && vipInterestID != "0")
            {
                juAct = bllJuAct.GetJuActivity(Convert.ToInt32(vipInterestID));
                juAct.ActivityDescription = vipInterestDescription;
                if (!bllJuAct.PutArticle(juAct))
                {
                    resp.Status = -1;
                    resp.Msg    = "提交VIP权益失败";
                    return(Common.JSONHelper.ObjectToJson(resp));
                }
            }
            else if (!string.IsNullOrWhiteSpace(vipInterestDescription))
            {
                vipInterestID = bllJuAct.GetGUID(TransacType.CommAdd);
                VIPInterestIDKeyValue.DataValue = vipInterestID;

                juAct.JuActivityID        = Convert.ToInt32(vipInterestID);
                juAct.ActivityName        = "VIP权益";
                juAct.ArticleType         = "ConfigContent";
                juAct.UserID              = currentUserInfo.UserID;
                juAct.WebsiteOwner        = websiteOwner;
                juAct.CreateDate          = DateTime.Now;
                juAct.ActivityDescription = vipInterestDescription;
                if (!bllJuAct.Add(juAct))
                {
                    resp.Status = -1;
                    resp.Msg    = "提交VIP权益失败";
                    return(Common.JSONHelper.ObjectToJson(resp));
                }
            }

            BLLTransaction tran = new BLLTransaction();

            if (bllkeyValueData.PutDataValue(rechargeKeyValue, tran) &&
                bllkeyValueData.PutDataValue(sendNoticePriceValue, tran) &&
                bllkeyValueData.PutDataValue(minScoreValue, tran) &&
                bllkeyValueData.PutDataValue(minWithdrawCashScoreValue, tran) &&
                bllkeyValueData.PutDataValue(VIPPriceKeyValue, tran) &&
                bllkeyValueData.PutDataValue(VIPPrice0KeyValue, tran) &&
                bllkeyValueData.PutDataValue(VIPDatelongKeyValue, tran) &&
                bllkeyValueData.PutDataValue(VIPInterestIDKeyValue, tran))
            {
                tran.Commit();
                resp.Status = 1;
                resp.Msg    = "提交成功";
            }
            else
            {
                tran.Rollback();
                resp.Status = -1;
                resp.Msg    = "提交失败";
            }
            return(Common.JSONHelper.ObjectToJson(resp));
        }