Beispiel #1
0
        public JsonResult AbleMatchConfig()
        {
            if (user != null)
            {
                AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                if (!adminPermission.GetPermission(4L))
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "没有权限",
                        Url = "/NoPower/Index"
                    }));
                }
            }
            string str = TypeUtil.ObjectToString(base.Request["cid"]);
            string sql = "Update MatchInfo Set Nullity = 0 WHERE MatchID in (" + str + ") and Nullity = 1";
            int    num = FacadeManage.aideGameMatchFacade.ExecuteSql(sql);

            if (num > 0)
            {
                return(Json(new
                {
                    IsOk = true,
                    Msg = "解冻成功"
                }));
            }
            return(Json(new
            {
                IsOk = false,
                Msg = "解冻失败,没有需要解冻的消息!"
            }));
        }
        public JsonResult ClearRecord()
        {
            if (user != null)
            {
                AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                if (!adminPermission.GetPermission(8L))
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "没有权限",
                        Url = "/NoPower/Index"
                    }));
                }
            }
            string sqlQuery = "WHERE InputDate <= '" + Fetch.GetEndTime(DateTime.Now.AddMonths(-1)) + "'";

            try
            {
                FacadeManage.aideRecordFacade.DeleteTaskRecord(sqlQuery);
                return(Json(new
                {
                    IsOk = true,
                    Msg = "清除成功"
                }));
            }
            catch
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "清除失败"
                }));
            }
        }
        public JsonResult DoActivityList()
        {
            string idList = TypeUtil.ObjectToString(base.Request["cid"]);

            if (user != null)
            {
                AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                if (!adminPermission.GetPermission(8L))
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "没有权限",
                        Url = "/NoPower/Index"
                    }));
                }
            }
            try
            {
                FacadeManage.aideNativeWebFacade.DeleteActivity(idList);
                return(Json(new
                {
                    IsOk = true,
                    Msg = "删除成功"
                }));
            }
            catch
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "删除失败"
                }));
            }
        }
Beispiel #4
0
 public JsonResult DoQuestionTypeInfo(RecordType entity)
 {
     if (user != null)
     {
         AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
         if (!adminPermission.GetPermission(4L))
         {
             return(Json(new
             {
                 IsOk = false,
                 Msg = "没有权限",
                 Url = "/NoPower/Index"
             }));
         }
     }
     if (entity == null || entity.ID <= 0 || entity.TypeName == "")
     {
         return(Json(new
         {
             IsOk = false,
             Msg = "没有提交数据"
         }));
     }
     entity.TabName = "GameIssueInfo";
     if (entity.TypeID == 1)
     {
         entity.TabName = "GameIssueInfo";
     }
     if (entity.TypeID == 2)
     {
         entity.TabName = "GameFeedbackInfo";
     }
     if (entity.TypeID == 3)
     {
         entity.TabName = "GameAccuseInfo";
     }
     entity.Memo = "RYNativeWebDB";
     if (FacadeManage.aideTreasureFacade.EditRecordType(entity) > 0)
     {
         return(Json(new
         {
             IsOk = true,
             Msg = "操作成功"
         }));
     }
     if (entity.Mode == "add")
     {
         return(Json(new
         {
             IsOk = false,
             Msg = "添加失败,请检查ID是否存在"
         }));
     }
     return(Json(new
     {
         IsOk = false,
         Msg = "操作失败"
     }));
 }
Beispiel #5
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());
        }
Beispiel #6
0
        protected void AuthUserOperationPermission(Permission permission)
        {
            AdminPermission adminPer = new AdminPermission(userExt, moduleID);

            if (!adminPer.GetPermission(( long )permission))
            {
                Redirect("/NotPower.html");
            }
        }
        public JsonResult DelConfigure()
        {
            if (user != null)
            {
                AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                if (!adminPermission.GetPermission(8L))
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "没有权限",
                        Url = "/NoPower/Index"
                    }));
                }
            }
            string @string = GameRequest.GetString("cid");

            string[]      array         = @string.Trim().Split(',');
            StringBuilder stringBuilder = new StringBuilder();

            string[] array2 = array;
            foreach (string text in array2)
            {
                int result = 0;
                if (int.TryParse(text, out result))
                {
                    stringBuilder.Append(text + ",");
                }
            }
            if (!string.IsNullOrEmpty(stringBuilder.ToString()))
            {
                try
                {
                    FacadeManage.aideAccountsFacade.DeleteConfigure(stringBuilder.ToString().TrimEnd(','));
                    return(Json(new
                    {
                        IsOk = true,
                        Msg = "删除成功"
                    }));
                }
                catch
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "删除失败"
                    }));
                }
            }
            return(Json(new
            {
                IsOk = false,
                Msg = "参数不正确"
            }));
        }
Beispiel #8
0
        public JsonResult DoBaseRolePermission()
        {
            if (user != null)
            {
                AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                if (!adminPermission.GetPermission(4L))
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "没有权限",
                        Url = "/NoPower/Index"
                    }));
                }
            }
            string value = TypeUtil.ObjectToString(base.Request["list"]);
            List <Base_RolePermission> list = null;

            if (!string.IsNullOrEmpty(value))
            {
                list = JsonConvert.DeserializeObject <List <Base_RolePermission> >(value);
            }
            if (list == null || list.Count < 1)
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "没有提交任何数据"
                }));
            }
            int roleID = TypeUtil.ObjectToInt(base.Request["RoleID"]);

            FacadeManage.aidePlatformManagerFacade.DeleteRolePermission(roleID);
            int num  = 0;
            int num2 = 0;

            foreach (Base_RolePermission item in list)
            {
                Message message = FacadeManage.aidePlatformManagerFacade.InsertRolePermission(item);
                if (message.Success)
                {
                    num2++;
                }
                else
                {
                    num++;
                }
            }
            return(Json(new
            {
                IsOk = true,
                Msg = "总共更新" + list.Count + "条,成功:" + num2 + "条,失败:" + num + "条"
            }));
        }
Beispiel #9
0
        public JsonResult DoMessage()
        {
            int    num  = TypeUtil.ObjectToInt(base.Request["param"]);
            string text = TypeUtil.ObjectToString(base.Request["body"]);

            if (num == 0 || text == "")
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "参数错误"
                }));
            }
            if (user != null)
            {
                AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                if (!adminPermission.GetPermission(4L))
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "没有权限",
                        Url = "/NoPower/Index"
                    }));
                }
            }
            GameFeedbackInfo gameFeedbackInfo = new GameFeedbackInfo();

            gameFeedbackInfo.RevertContent = text;
            gameFeedbackInfo.RevertUserID  = user.UserID;
            gameFeedbackInfo.RevertDate    = DateTime.Now;
            gameFeedbackInfo.Nullity       = 0;
            gameFeedbackInfo.IsProcessed   = 1;
            gameFeedbackInfo.FeedbackID    = num;
            Message message = FacadeManage.aideNativeWebFacade.RevertGameFeedback(gameFeedbackInfo);

            if (message.Success)
            {
                return(Json(new
                {
                    IsOk = true,
                    Msg = "回复成功"
                }));
            }
            return(Json(new
            {
                IsOk = false,
                Msg = "操作失败"
            }));
        }
        public ActionResult NewsInfo()
        {
            AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);

            if (!adminPermission.GetPermission(4L))
            {
                return(Redirect("/NoPower/Index"));
            }
            string a   = TypeUtil.ObjectToString(base.Request["cmd"]);
            int    num = TypeUtil.ObjectToInt(base.Request["param"]);

            if (a == "add")
            {
                base.ViewBag.Info = "新增";
            }
            else
            {
                base.ViewBag.Info = "更新";
            }
            base.ViewBag.ID       = num;
            base.ViewBag.ClassID  = "";
            base.ViewBag.Subject  = "";
            base.ViewBag.OnTop    = false;
            base.ViewBag.OnTopAll = false;
            base.ViewBag.IsElite  = false;
            base.ViewBag.IsHot    = false;
            base.ViewBag.IsLock   = false;
            base.ViewBag.LinkUrl  = "";
            base.ViewBag.IsLinks  = false;
            base.ViewBag.Body     = "";
            if (num > 0)
            {
                News newsInfo = FacadeManage.aideNativeWebFacade.GetNewsInfo(num);
                if (newsInfo != null)
                {
                    base.ViewBag.ClassID  = newsInfo.ClassID.ToString().Trim();
                    base.ViewBag.Subject  = newsInfo.Subject;
                    base.ViewBag.OnTop    = (newsInfo.OnTop == 1);
                    base.ViewBag.OnTopAll = (newsInfo.OnTopAll == 1);
                    base.ViewBag.IsElite  = (newsInfo.IsElite == 1);
                    base.ViewBag.IsHot    = (newsInfo.IsHot == 1);
                    base.ViewBag.IsLock   = (newsInfo.IsLock == 1);
                    base.ViewBag.LinkUrl  = ((newsInfo.LinkUrl == "") ? "http://" : newsInfo.LinkUrl);
                    base.ViewBag.IsLinks  = (newsInfo.IsLinks == 1);
                    base.ViewBag.Body     = newsInfo.Body;
                }
            }
            return(View());
        }
 public JsonResult DoSiteConfig(ConfigInfo config)
 {
     if (config == null)
     {
         return(Json(new
         {
             IsOk = false,
             Msg = "没有提交数据"
         }));
     }
     config.ConfigKey    = TypeUtil.ObjectToString(config.ConfigKey);
     config.ConfigName   = TypeUtil.ObjectToString(config.ConfigName);
     config.ConfigString = TypeUtil.ObjectToString(config.ConfigString);
     config.Field1       = TypeUtil.ObjectToString(config.Field1);
     config.Field2       = TypeUtil.ObjectToString(config.Field2);
     config.Field3       = TypeUtil.ObjectToString(config.Field3);
     config.Field4       = TypeUtil.ObjectToString(config.Field4);
     config.Field5       = TypeUtil.ObjectToString(config.Field5);
     config.Field6       = TypeUtil.ObjectToString(config.Field6);
     config.Field7       = TypeUtil.ObjectToString(config.Field7);
     config.Field8       = TypeUtil.ObjectToString(config.Field8);
     if (user != null)
     {
         AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
         if (!adminPermission.GetPermission(4L))
         {
             return(Json(new
             {
                 IsOk = false,
                 Msg = "没有权限",
                 Url = "/NoPower/Index"
             }));
         }
     }
     if (config.ConfigID > 0)
     {
         FacadeManage.aideNativeWebFacade.UpdateConfigInfo(config);
         return(Json(new
         {
             IsOk = true,
             Msg = "操作成功"
         }));
     }
     return(Json(new
     {
         IsOk = false,
         Msg = "操作失败"
     }));
 }
        public JsonResult DelPlayerControl()
        {
            if (user != null)
            {
                AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                if (!adminPermission.GetPermission(8L))
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "没有权限",
                        Url = "/NoPower/Index"
                    }));
                }
            }
            string value = TypeUtil.ObjectToString(base.Request["cid"]);

            try
            {
                Dictionary <string, object> dictionary = new Dictionary <string, object>();
                dictionary["dwIDs"]    = value;
                dictionary["Operator"] = user.Username;
                dictionary["ClientIP"] = GameRequest.GetUserIP();
                dictionary["strErr"]   = "";
                Message message = FacadeManage.aideAccountsFacade.ExcuteByProce("RYTreasureDB.dbo.P_DelPlayerControl", dictionary);
                if (!message.Success)
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = message.Content
                    }));
                }
                return(Json(new
                {
                    IsOk = true,
                    Msg = "删除成功"
                }));
            }
            catch
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "删除失败"
                }));
            }
        }
Beispiel #13
0
        public JsonResult DoBaseRoleList()
        {
            string text = TypeUtil.ObjectToString(base.Request["cid"]);

            if (user != null)
            {
                AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                if (!adminPermission.GetPermission(8L))
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "没有权限",
                        Url = "/NoPower/Index"
                    }));
                }
            }
            if (!string.IsNullOrEmpty(text))
            {
                string sqlQuery = "WHERE RoleID in (" + text + ")";
                try
                {
                    FacadeManage.aidePlatformManagerFacade.DeleteRole(sqlQuery);
                    return(Json(new
                    {
                        IsOk = true,
                        Msg = "删除成功"
                    }));
                }
                catch
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "删除失败"
                    }));
                }
            }
            return(Json(new
            {
                IsOk = false,
                Msg = "没有选择操作项"
            }));
        }
Beispiel #14
0
        public JsonResult DoReport()
        {
            int    num  = TypeUtil.ObjectToInt(base.Request["param"]);
            string text = TypeUtil.ObjectToString(base.Request["body"]);

            if (num == 0 || text == "")
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "参数错误"
                }));
            }
            if (user != null)
            {
                AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                if (!adminPermission.GetPermission(4L))
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "没有权限",
                        Url = "/NoPower/Index"
                    }));
                }
            }
            int num2 = FacadeManage.aideNativeWebFacade.UpdateReport(num, text, user.Username);

            if (num2 > 0)
            {
                return(Json(new
                {
                    IsOk = true,
                    Msg = "回复成功"
                }));
            }
            return(Json(new
            {
                IsOk = false,
                Msg = "操作失败"
            }));
        }
        public JsonResult DelTask()
        {
            string str = TypeUtil.ObjectToString(base.Request["cid"]);

            if (user != null)
            {
                AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                if (!adminPermission.GetPermission(8L))
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "没有权限",
                        Url = "/NoPower/Index"
                    }));
                }
            }
            string sqlQuery = "WHERE TaskID IN (" + str + ")";

            try
            {
                FacadeManage.aidePlatformFacade.DeleteTaskInfo(sqlQuery);
                return(Json(new
                {
                    IsOk = true,
                    Msg = "删除成功"
                }));
            }
            catch
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "删除失败"
                }));
            }
        }
        public JsonResult DoRulesList()
        {
            string str = TypeUtil.ObjectToString(base.Request["cid"]);

            if (user != null)
            {
                AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                if (!adminPermission.GetPermission(8L))
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "没有权限",
                        Url = "/NoPower/Index"
                    }));
                }
            }
            string sqlQuery = "WHERE KindID in (" + str + ")";

            try
            {
                FacadeManage.aideNativeWebFacade.DeleteGameRules(sqlQuery);
                return(Json(new
                {
                    IsOk = true,
                    Msg = "删除成功"
                }));
            }
            catch
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "删除失败"
                }));
            }
        }
Beispiel #17
0
        /// <summary>
        /// 获取游戏记录
        /// </summary>
        /// <param name="context"></param>
        private void GetUserGameRecord(HttpContext context)
        {
            //验证权限
            int             moduleID = 809;
            AdminPermission adminPer = new AdminPermission(userExt, moduleID);

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

            int drawID = GameRequest.GetQueryInt("drawID", 0);

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

            //获取数据
            DataSet ds = FacadeManage.aideTreasureFacade.GetRecordDrawScoreByDrawID(drawID);

            if (ds.Tables[0].Rows.Count > 0)
            {
                //复制表结构
                DataTable dt = ds.Tables[0].Clone();

                //修改表列数据类型
                dt.Columns["IsAndroid"].DataType = typeof(string);
                dt.Columns["Score"].DataType     = typeof(string);
                dt.Columns["Revenue"].DataType   = typeof(string);

                for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
                {
                    DataRow dw = dt.NewRow();
                    dw = ds.Tables[0].Rows[i];
                    dt.Rows.Add(dw.ItemArray);

                    //修改是否机器人数据项
                    if (Convert.ToInt32(dt.Rows[i]["IsAndroid"]) == 0)
                    {
                        dt.Rows[i]["IsAndroid"] = "否";
                    }
                    else
                    {
                        dt.Rows[i]["IsAndroid"] = "是";
                    }

                    //格式化输赢积分
                    dt.Rows[i]["Score"] = Convert.ToInt64(dt.Rows[i]["Score"]).ToString("N0");

                    //格式化税收
                    dt.Rows[i]["Revenue"] = Convert.ToInt32(dt.Rows[i]["Revenue"]).ToString("N0");
                }

                Game.Utils.Template            tm       = new Game.Utils.Template("/Template/UserGameRecord.html");
                Dictionary <string, DataTable> dicTable = new Dictionary <string, DataTable>();
                dicTable.Add("UserGameRecord", dt);
                tm.ForDataScoureList = dicTable;

                string html = tm.OutputHTML();
                ajv.AddDataItem("html", html);
            }

            //返回数据
            ajv.SetValidDataValue(true);
            context.Response.Write(ajv.SerializeToJson());
        }
 public JsonResult DoTaskInfo(TaskInfo entity)
 {
     if (entity != null)
     {
         if (entity.TaskType < 1)
         {
             return(Json(new
             {
                 IsOk = false,
                 Msg = "请选择任务类型"
             }));
         }
         if (entity.UserType < 1)
         {
             return(Json(new
             {
                 IsOk = false,
                 Msg = "请选择可领取任务玩家类型"
             }));
         }
         if (entity.KindID < 0)
         {
             return(Json(new
             {
                 IsOk = false,
                 Msg = "请选择任务所属游戏"
             }));
         }
         if (entity.Innings < 1)
         {
             return(Json(new
             {
                 IsOk = false,
                 Msg = "请输入比赛局数"
             }));
         }
         if (string.IsNullOrEmpty(entity.TaskDescription))
         {
             entity.TaskDescription = "";
         }
         bool flag;
         if (entity.TaskID > 0)
         {
             if (user != null)
             {
                 AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                 if (!adminPermission.GetPermission(4L))
                 {
                     return(Json(new
                     {
                         IsOk = false,
                         Msg = "没有权限",
                         Url = "/NoPower/Index"
                     }));
                 }
             }
             flag = FacadeManage.aidePlatformFacade.UpdateTaskInfo(entity);
         }
         else
         {
             if (user != null)
             {
                 AdminPermission adminPermission2 = new AdminPermission(user, user.MoudleID);
                 if (!adminPermission2.GetPermission(2L))
                 {
                     return(Json(new
                     {
                         IsOk = false,
                         Msg = "没有权限",
                         Url = "/NoPower/Index"
                     }));
                 }
             }
             entity.InputDate = DateTime.Now;
             flag             = FacadeManage.aidePlatformFacade.InsertTaskInfo(entity);
         }
         if (flag)
         {
             return(Json(new
             {
                 IsOk = true,
                 Msg = "保存任务信息成功"
             }));
         }
         return(Json(new
         {
             IsOk = false,
             Msg = "保存任务信息失败"
         }));
     }
     return(Json(new
     {
         IsOk = false,
         Msg = "没有提交数据"
     }));
 }
Beispiel #19
0
        public JsonResult DoBaseUserList()
        {
            string text = TypeUtil.ObjectToString(base.Request["cid"]);
            int    num  = TypeUtil.ObjectToInt(base.Request["type"]);

            if (!string.IsNullOrEmpty(text))
            {
                switch (num)
                {
                default:
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "请选择操作"
                    }));

                case 1:
                    if (user != null)
                    {
                        AdminPermission adminPermission2 = new AdminPermission(user, user.MoudleID);
                        if (!adminPermission2.GetPermission(4L))
                        {
                            return(Json(new
                            {
                                IsOk = false,
                                Msg = "没有权限",
                                Url = "/NoPower/Index"
                            }));
                        }
                    }
                    try
                    {
                        FacadeManage.aidePlatformManagerFacade.ModifyUserNullity(text, true);
                        return(Json(new
                        {
                            IsOk = true,
                            Msg = "冻结成功"
                        }));
                    }
                    catch
                    {
                        return(Json(new
                        {
                            IsOk = false,
                            Msg = "冻结失败"
                        }));
                    }

                case 2:
                    if (user != null)
                    {
                        AdminPermission adminPermission3 = new AdminPermission(user, user.MoudleID);
                        if (!adminPermission3.GetPermission(4L))
                        {
                            return(Json(new
                            {
                                IsOk = false,
                                Msg = "没有权限",
                                Url = "/NoPower/Index"
                            }));
                        }
                    }
                    try
                    {
                        FacadeManage.aidePlatformManagerFacade.ModifyUserNullity(text, false);
                        return(Json(new
                        {
                            IsOk = true,
                            Msg = "解冻成功"
                        }));
                    }
                    catch
                    {
                        return(Json(new
                        {
                            IsOk = false,
                            Msg = "解冻失败"
                        }));
                    }

                case 3:
                {
                    if (user != null)
                    {
                        AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                        if (!adminPermission.GetPermission(8L))
                        {
                            return(Json(new
                                {
                                    IsOk = false,
                                    Msg = "没有权限",
                                    Url = "/NoPower/Index"
                                }));
                        }
                    }
                    string userIDList = "WHERE UserID in (" + text + ")";
                    try
                    {
                        FacadeManage.aidePlatformManagerFacade.DeleteUser(userIDList);
                        return(Json(new
                            {
                                IsOk = true,
                                Msg = "删除成功"
                            }));
                    }
                    catch
                    {
                        return(Json(new
                            {
                                IsOk = false,
                                Msg = "删除失败"
                            }));
                    }
                }
                }
            }
            return(Json(new
            {
                IsOk = false,
                Msg = "没有选择操作项"
            }));

IL_0202:
            return(Json(new
            {
                IsOk = false,
                Msg = "没有进行任何操作"
            }));
        }
        public JsonResult DoRulesInfo(GameRulesInfo entity)
        {
            string a   = TypeUtil.ObjectToString(base.Request["OP"]);
            int    num = TypeUtil.ObjectToInt(base.Request["ID"]);

            if (entity == null)
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "没有数据"
                }));
            }
            if (string.IsNullOrEmpty(entity.ImgRuleUrl))
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "请选择一张PC网站效果图!"
                }));
            }
            if (string.IsNullOrEmpty(entity.HelpIntro))
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "请输入游戏介绍"
                }));
            }
            if (string.IsNullOrEmpty(entity.HelpRule))
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "请输入游戏规则介绍"
                }));
            }
            if (string.IsNullOrEmpty(entity.HelpGrade))
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "请输入游戏等级介绍"
                }));
            }
            Message message = new Message();

            if (a == "新增")
            {
                if (entity.KindID < 1)
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "请选择游戏"
                    }));
                }
                if (user != null)
                {
                    AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                    if (!adminPermission.GetPermission(2L))
                    {
                        return(Json(new
                        {
                            IsOk = false,
                            Msg = "没有权限",
                            Url = "/NoPower/Index"
                        }));
                    }
                }
                if (FacadeManage.aideNativeWebFacade.JudgeRulesIsExistence(entity.KindID))
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "该游戏规则已存在"
                    }));
                }
                message = FacadeManage.aideNativeWebFacade.InsertGameRules(entity);
            }
            else
            {
                if (user != null)
                {
                    AdminPermission adminPermission2 = new AdminPermission(user, user.MoudleID);
                    if (!adminPermission2.GetPermission(4L))
                    {
                        return(Json(new
                        {
                            IsOk = false,
                            Msg = "没有权限",
                            Url = "/NoPower/Index"
                        }));
                    }
                }
                if (FacadeManage.aideNativeWebFacade.JudgeRulesIsExistence(entity.KindID) && entity.KindID != num)
                {
                    return(Json(new
                    {
                        IsOk = false,
                        Msg = "该游戏规则已存在"
                    }));
                }
                message = FacadeManage.aideNativeWebFacade.UpdateGameRules(entity, num);
            }
            if (message.Success)
            {
                return(Json(new
                {
                    IsOk = true,
                    Msg = "操作成功"
                }));
            }
            return(Json(new
            {
                IsOk = false,
                Msg = message.Content
            }));
        }
        public JsonResult DoMobileNoticeInfo(News entity)
        {
            if (entity == null)
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "没有提交任何数据"
                }));
            }
            if (string.IsNullOrEmpty(entity.Body))
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "请输入新闻内容"
                }));
            }
            Message message = new Message();

            if (entity.NewsID < 1)
            {
                if (user != null)
                {
                    AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                    if (!adminPermission.GetPermission(2L))
                    {
                        return(Json(new
                        {
                            IsOk = false,
                            Msg = "没有权限",
                            Url = "/NoPower/Index"
                        }));
                    }
                }
                entity.UserID  = user.UserID;
                entity.IssueIP = Utility.UserIP;
                entity.ClassID = 3;
                message        = FacadeManage.aideNativeWebFacade.InsertNews(entity);
            }
            else
            {
                if (user != null)
                {
                    AdminPermission adminPermission2 = new AdminPermission(user, user.MoudleID);
                    if (!adminPermission2.GetPermission(4L))
                    {
                        return(Json(new
                        {
                            IsOk = false,
                            Msg = "没有权限",
                            Url = "/NoPower/Index"
                        }));
                    }
                }
                entity.NewsID       = entity.NewsID;
                entity.LastModifyIP = Utility.UserIP;
                entity.ClassID      = 3;
                message             = FacadeManage.aideNativeWebFacade.UpdateNews(entity);
            }
            if (message.Success)
            {
                return(Json(new
                {
                    IsOk = true,
                    Msg = "操作成功"
                }));
            }
            return(Json(new
            {
                IsOk = false,
                Msg = message.Content
            }));
        }
Beispiel #22
0
        public JsonResult DoBaseUserInfo(Base_Users entity)
        {
            if (entity == null)
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "没有提交数据"
                }));
            }
            if (string.IsNullOrEmpty(entity.Password))
            {
                entity.Password = entity.BandIP;
            }
            else
            {
                entity.Password = Utility.MD5(entity.Password);
            }
            Message message = new Message();

            if (entity.UserID > 0)
            {
                if (user != null)
                {
                    AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                    if (!adminPermission.GetPermission(4L))
                    {
                        return(Json(new
                        {
                            IsOk = false,
                            Msg = "没有权限",
                            Url = "/NoPower/Index"
                        }));
                    }
                }
                message = FacadeManage.aidePlatformManagerFacade.ModifyUserInfo(entity);
            }
            else
            {
                if (user != null)
                {
                    AdminPermission adminPermission2 = new AdminPermission(user, user.MoudleID);
                    if (!adminPermission2.GetPermission(2L))
                    {
                        return(Json(new
                        {
                            IsOk = false,
                            Msg = "没有权限",
                            Url = "/NoPower/Index"
                        }));
                    }
                }
                entity.LastLoginIP = Utility.UserIP;
                entity.IsBand      = 1;
                message            = FacadeManage.aidePlatformManagerFacade.Register(entity);
            }
            if (message.Success)
            {
                if (entity.UserID < 1)
                {
                    return(Json(new
                    {
                        IsOk = true,
                        Msg = "用户信息增加成功"
                    }));
                }
                return(Json(new
                {
                    IsOk = true,
                    Msg = "用户信息修改成功"
                }));
            }
            return(Json(new
            {
                IsOk = false,
                Msg = message.Content
            }));
        }
 public JsonResult DoActivityInfo(Activity entity)
 {
     if (entity == null)
     {
         return(Json(new
         {
             IsOk = false,
             Msg = "没有提交数据"
         }));
     }
     if (user != null)
     {
         AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
         if (!adminPermission.GetPermission(4L))
         {
             return(Json(new
             {
                 IsOk = false,
                 Msg = "没有权限",
                 Url = "/NoPower/Index"
             }));
         }
     }
     if (!string.IsNullOrEmpty(entity.ImageUrl))
     {
         if (entity.ActivityID >= 1)
         {
             try
             {
                 FacadeManage.aideNativeWebFacade.UpdateActivity(entity);
                 return(Json(new
                 {
                     IsOk = true,
                     Msg = "更新成功"
                 }));
             }
             catch
             {
                 return(Json(new
                 {
                     IsOk = false,
                     Msg = "更新失败"
                 }));
             }
         }
         try
         {
             FacadeManage.aideNativeWebFacade.AddActivity(entity);
             return(Json(new
             {
                 IsOk = true,
                 Msg = "新增成功"
             }));
         }
         catch
         {
             return(Json(new
             {
                 IsOk = false,
                 Msg = "新增失败"
             }));
         }
     }
     return(Json(new
     {
         IsOk = false,
         Msg = "请上传图片"
     }));
 }
Beispiel #24
0
        /// <summary>
        /// 更新等级配置
        /// </summary>
        private void UpdateLevelConfig(HttpContext context)
        {
            //验证权限
            int             moduleID = 408;
            AdminPermission adminPer = new AdminPermission(userExt, moduleID);

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

            int    levelID    = GameRequest.GetFormInt("id", 0);
            string experience = GameRequest.GetFormString("experience");
            string gold       = GameRequest.GetFormString("gold");
            string medal      = GameRequest.GetFormString("medal");
            string remark     = GameRequest.GetFormString("remark");

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

            //验证经验值
            if (!Utils.Validate.IsNumeric(experience))
            {
                ajv.msg = "请输入正确的经验值";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            //验证金币
            if (!Utils.Validate.IsNumeric(gold))
            {
                ajv.msg = "请输入正确的金币";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            //验证元宝
            if (!Utils.Validate.IsNumeric(medal))
            {
                ajv.msg = "请输入正确的元宝";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            //验证备注
            if (remark.Length > 64)
            {
                ajv.msg = "备注的最大长度不能超过64";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            GrowLevelConfig glc = new GrowLevelConfig();

            glc.LevelID     = levelID;
            glc.Experience  = Convert.ToInt32(experience);
            glc.RewardGold  = Convert.ToInt32(gold);
            glc.RewardMedal = Convert.ToInt32(medal);
            glc.LevelRemark = remark;

            int result = FacadeManage.aidePlatformFacade.UpdateGrowLevelConfig(glc);

            if (result > 0)
            {
                ajv.msg = "修改成功";
                ajv.SetValidDataValue(true);
            }
            else
            {
                ajv.msg = "修改失败";
            }
            context.Response.Write(ajv.SerializeToJson());
        }
Beispiel #25
0
        /// <summary>
        /// 清楚表数据
        /// </summary>
        /// <param name="context"></param>
        private void ClearTableData(HttpContext context)
        {
            //验证权限
            int             moduleID = 812;
            AdminPermission adminPer = new AdminPermission(userExt, moduleID);

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

            string time = GameRequest.GetString("time");
            int    id   = GameRequest.GetInt("id", 0);

            //验证ID
            if (id == 0)
            {
                ajv.msg = "非法操作,清除数据失败";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            //验证截止日期
            if (string.IsNullOrEmpty(time))
            {
                ajv.msg = "请选择要清除数据的截止时间";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }
            DateTime date;

            try
            {
                date = Convert.ToDateTime(time).AddDays(1);
            }
            catch
            {
                ajv.msg = "请输入正确的时间";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            //删除数据
            int result = 0;

            switch (id)
            {
            case 1:     //删除玩家进出记录表
                result = FacadeManage.aideTreasureFacade.DeleteRecordUserInoutByTime(date);
                break;

            case 2:     //删除游戏记录总局表
                result = FacadeManage.aideTreasureFacade.DeleteRecordDrawInfoByTime(date);
                break;

            case 3:     //删除游戏记录详情表
                result = FacadeManage.aideTreasureFacade.DeleteRecordDrawScoreByTime(date);
                break;

            case 4:     //删除银行操作记录表
                result = FacadeManage.aideTreasureFacade.DeleteRecordInsureByTime(date);
                break;

            default:
                break;
            }

            ajv.SetValidDataValue(true);
            ajv.msg = string.Format("操作成功,共删除了{0}条记录", result);
            context.Response.Write(ajv.SerializeToJson());
            return;
        }
Beispiel #26
0
        public JsonResult DoBaseRoleInfo(Base_Roles role)
        {
            if (role == null)
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "参数不嫩为空"
                }));
            }
            if (string.IsNullOrEmpty(role.RoleName))
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "角色名称不能为空"
                }));
            }
            Message message = new Message();

            if (role.RoleID > 0)
            {
                if (user != null)
                {
                    AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                    if (!adminPermission.GetPermission(4L))
                    {
                        return(Json(new
                        {
                            IsOk = false,
                            Msg = "没有权限",
                            Url = "/NoPower/Index"
                        }));
                    }
                }
                message = FacadeManage.aidePlatformManagerFacade.UpdateRole(role);
            }
            else
            {
                if (user != null)
                {
                    AdminPermission adminPermission2 = new AdminPermission(user, user.MoudleID);
                    if (!adminPermission2.GetPermission(2L))
                    {
                        return(Json(new
                        {
                            IsOk = false,
                            Msg = "没有权限",
                            Url = "/NoPower/Index"
                        }));
                    }
                }
                if (string.IsNullOrEmpty(role.Description))
                {
                    role.Description = "";
                }
                message = FacadeManage.aidePlatformManagerFacade.InsertRole(role);
            }
            if (message.Success)
            {
                if (role.RoleID > 0)
                {
                    return(Json(new
                    {
                        IsOk = true,
                        Msg = "角色信息修改成功"
                    }));
                }
                return(Json(new
                {
                    IsOk = true,
                    Msg = "角色信息增加成功"
                }));
            }
            return(Json(new
            {
                IsOk = false,
                Msg = message.Content
            }));
        }
Beispiel #27
0
        /// <summary>
        /// 更新奖品配置
        /// </summary>
        /// <param name="context"></param>
        private void UpdateLotteryItem(HttpContext context)
        {
            //验证权限
            int             moduleID = 312;
            AdminPermission adminPer = new AdminPermission(userExt, moduleID);

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

            int    itemIndex = GameRequest.GetFormInt("id", 0);
            string itemType  = GameRequest.GetFormString("ItemType");
            string itemQuota = GameRequest.GetFormString("ItemQuota");
            string itemRate  = GameRequest.GetFormString("ItemRate");

            //验证ID
            if (itemIndex == 0)
            {
                ajv.msg = "非法操作,无效的奖品索引";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            //验证类型
            if (!Utils.Validate.IsPositiveInt(itemType))
            {
                ajv.msg = "请输入正确的奖品类型";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }
            //验证数量
            if (!Utils.Validate.IsPositiveInt(itemQuota))
            {
                ajv.msg = "请输入正确的奖品数量";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }
            //验证中奖几率
            if (!Utils.Validate.IsPositiveInt(itemRate))
            {
                ajv.msg = "请输入正确的中奖几率";
                context.Response.Write(ajv.SerializeToJson());
                return;
            }

            LotteryItem model = new LotteryItem();

            model.ItemIndex = itemIndex;
            model.ItemType  = Convert.ToInt32(itemType);
            model.ItemQuota = Convert.ToInt32(itemQuota);
            model.ItemRate  = Convert.ToInt32(itemRate);
            int result = FacadeManage.aideTreasureFacade.UpdateLotteryItem(model);

            if (result > 0)
            {
                ajv.msg = "修改成功";
                ajv.SetValidDataValue(true);
            }
            else
            {
                ajv.msg = "修改失败";
            }
            context.Response.Write(ajv.SerializeToJson());
        }
Beispiel #28
0
        public JsonResult DoQuestionInfo(GameIssueInfo entity)
        {
            if (entity == null)
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "没有提交任何数据"
                }));
            }
            if (string.IsNullOrEmpty(entity.IssueTitle))
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "请输入问题标题"
                }));
            }
            if (string.IsNullOrEmpty(entity.IssueContent))
            {
                return(Json(new
                {
                    IsOk = false,
                    Msg = "请输入问题内容"
                }));
            }
            Message message = new Message();

            if (entity.IssueID < 1)
            {
                if (user != null)
                {
                    AdminPermission adminPermission = new AdminPermission(user, user.MoudleID);
                    if (!adminPermission.GetPermission(2L))
                    {
                        return(Json(new
                        {
                            IsOk = false,
                            Msg = "没有权限",
                            Url = "/NoPower/Index"
                        }));
                    }
                }
                message = (message = FacadeManage.aideNativeWebFacade.InsertGameIssue(entity));
            }
            else
            {
                if (user != null)
                {
                    AdminPermission adminPermission2 = new AdminPermission(user, user.MoudleID);
                    if (!adminPermission2.GetPermission(4L))
                    {
                        return(Json(new
                        {
                            IsOk = false,
                            Msg = "没有权限",
                            Url = "/NoPower/Index"
                        }));
                    }
                }
                message = FacadeManage.aideNativeWebFacade.UpdateGameIssue(entity);
            }
            if (message.Success)
            {
                return(Json(new
                {
                    IsOk = true,
                    Msg = "操作成功"
                }));
            }
            return(Json(new
            {
                IsOk = false,
                Msg = message.Content
            }));
        }
Beispiel #29
0
        /// <summary>
        /// 验证当前页面上的操作权限(有权限:true ; 无权限:false;)
        /// </summary>
        /// <param name="moduleID">需要验证的模块标识</param>
        /// <param name="privValue">需要验证的权限值</param>
        /// <returns></returns>
        protected bool AuthUserOperationPermission(int moduleID, long privValue)
        {
            AdminPermission adminPer = new AdminPermission(userExt, moduleID);

            return(adminPer.GetPermission(privValue));
        }