示例#1
0
        /// <summary>
        /// 更新转账返利配置
        /// </summary>
        /// <param name="context"></param>
        private void UpdateTransferReturnConfig(HttpContext context)
        {
            //验证权限
            int             moduleID = 313;
            AdminPermission adminPer = new AdminPermission(userExt, moduleID);

            if (!adminPer.GetPermission((long)Permission.Edit))
            {
                ajv.msg = "非法操作,无操作权限";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            int    id      = GameRequest.GetFormInt("id", 0);
            string type    = GameRequest.GetFormString("ReturnType");
            string percent = GameRequest.GetFormString("ReturnPercent");

            //验证ID
            if (id == 0)
            {
                ajv.msg = "非法操作,无效的配置标识";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            //验证类型
            if (!Utils.Validate.IsPositiveInt(type))
            {
                ajv.msg = "输入的类型格式不正确";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }
            //验证数量
            if (!Utils.Validate.IsPositiveInt(percent))
            {
                ajv.msg = "输入的返利比例格式不正确";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            TransferReturnConfig model = new TransferReturnConfig();

            model.ConfigID      = id;
            model.ReturnType    = Convert.ToByte(type);
            model.ReturnPercent = Convert.ToInt32(percent);

            int result = FacadeManage.aideTreasureFacade.UpdateTransferReturnConfig(model);

            if (result > 0)
            {
                ajv.msg = "修改成功";
                ajv.SetValidDataValue(true);
            }
            else
            {
                ajv.msg = "修改失败";
            }
            context.Response.Write(ajv.SerializeToJson());
        }
示例#2
0
 /// <summary>
 /// 修改返利配置
 /// </summary>
 /// <param name="config"></param>
 /// <returns></returns>
 public int UpdateTransferReturnConfig(TransferReturnConfig config)
 {
     return(aideTreasureData.UpdateTransferReturnConfig(config));
 }