Exemplo n.º 1
0
        public override string Index(HttpRequest req)
        {
            /************ 获取日志操作类型 **************/
            string dataType = req["dataType"];

            if (dataType == "operations")
            {
                DataTable dtOperations = aidePlatformManagerFacade.GetLogOperations();
                string    jsonstr      = GetJsonByDataTable(dtOperations);
                jsonstr = JsonResultHelper.GetSuccessJsonByArray(jsonstr);
                return(jsonstr);
            }
            /******************* end *****************/

            int pageIndex = Convert.ToInt32(req["pageIndex"] ?? "1");
            int pageSize  = Convert.ToInt32(req["pageSize"] ?? "20");

            PagerSet  pageSet = aidePlatformManagerFacade.GetSystemLog(pageIndex, pageSize, GetCondition(req));
            DataTable dtLogs  = pageSet.PageSet.Tables[1];

            string json = GetResponse(GetModuleName((int)ModuleType.SystemLog), "vw_Log", dtLogs, pageSize, pageSet.RecordCount);

            json = json.Replace("\n", "").Replace("\r", "");
            return(json);
        }
Exemplo n.º 2
0
        public string Save(HttpRequest req)
        {
            string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0"));

            try
            {
                Base_Users user = new Base_Users();
                user.UserID          = Convert.ToInt32(req["AdminID"] ?? "0");
                user.Username        = GameRequest.GetFormString("UserName");
                user.canHasSubAgent  = Convert.ToByte(req.Form["canHasSub"]);
                user.AgentLevelLimit = Convert.ToInt32(req.Form["AgentLevelLimit"]);
                user.RoleID          = Convert.ToInt32(req.Form["RoleID"]);
                user.GradeID         = Convert.ToInt32(req.Form["GradeID"]);
                user.Nullity         = byte.Parse(GameRequest.GetFormString("AgentStatus"));
                user.Percentage      = GameRequest.GetFormInt("Revenue", 0);

                Message msg = aidePlatformManagerFacade.ModifyUserInfo(user);
                if (msg.Success)
                {
                    LogHelper2.SaveSuccessLog("修改[" + req.Form["UserName"] + "]", userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module);
                    return(JsonResultHelper.GetSuccessJson("保存成功"));
                }
                else
                {
                    LogHelper2.SaveErrLog("修改[" + req.Form["UserName"] + "]", msg.Content, userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module);
                    return(JsonResultHelper.GetErrorJson(msg.Content));
                }
            }
            catch (Exception ex)
            {
                LogHelper2.SaveErrLog("修改[" + req.Form["UserName"] + "]", ex.Message, userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module);
                return(JsonResultHelper.GetErrorJson(ex.Message));
            }
        }
Exemplo n.º 3
0
        public string UpdateSpreaderID(HttpRequest req)
        {
            string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0"));

            try
            {
                int    UserID  = Convert.ToInt32(req["UserID"]);
                string oldCode = req["oldSpreaderID"];
                string newCode = req["SpreaderID"];
                int    r       = aidePlatformManagerFacade.UpdateSpreaderID(UserID, oldCode, newCode);
                if (r == -1)
                {
                    return(JsonResultHelper.GetErrorJson("邀请码不存在!"));
                }
                else if (r == -2)
                {
                    return(JsonResultHelper.GetErrorJson("邀请码已被占用!"));
                }
                LogHelper2.SaveSuccessLog("修改[" + req["UserName"] + "]", userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module);
                return(JsonResultHelper.GetSuccessJson("保存成功"));
            }
            catch (Exception ex)
            {
                LogHelper2.SaveErrLog("修改[" + req["UserName"] + "]邀请码", ex.Message, userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module);
                return(JsonResultHelper.GetErrorJson(ex.Message));
            }
        }
Exemplo n.º 4
0
        public string ajax(HttpRequest req)
        {
            if (!CheckUser())
            {
                return(JsonResultHelper.GetLoginErrorJson("登录已过期!"));
            }
            string type = req["type"];
            string json = "";

            switch (type)
            {
            case "Delete":
                json = Delete(req);
                break;

            case "New":
                json = New(req);
                break;

            case "Edit":
                json = Edit(req);
                break;

            case "Index":
                json = Index(req);
                break;

            default:
                return(JsonResultHelper.GetErrorJson("type参数不正确"));
            }
            return(json);
        }
Exemplo n.º 5
0
        public override string Index(HttpRequest req)
        {
            try
            {
                string subType = req["subType"];
                string json    = "";
                switch (subType)
                {
                case "byId":
                    int       UserID = Convert.ToInt32(req["UserID"]);
                    DataTable dtA    = aidePlatformManagerFacade.GetAgent(UserID);
                    json = GetJsonByDataTable(dtA);
                    json = JsonResultHelper.GetSuccessJsonByArray(json);
                    break;

                default:
                    int       pageIndex = Convert.ToInt32(req["pageIndex"] ?? "1");
                    int       pageSize  = Convert.ToInt32(req["pageSize"] ?? "20");
                    PagerSet  pageSet   = aidePlatformManagerFacade.GetSubAgentListEx(pageIndex, pageSize, GetConditionEx(req));
                    DataTable dtAgents  = pageSet.PageSet.Tables[1];
                    json = GetResponse(GetModuleName((int)ModuleType.SubAgents), View, dtAgents, pageSize, pageSet.RecordCount);
                    break;
                }

                return(json);
            }
            catch (Exception ex)
            {
                return(JsonResultHelper.GetErrorJsonByArray(ex.Message));
            }
        }
Exemplo n.º 6
0
        public override string Delete(HttpRequest req)
        {
            if (!IsAuthUserOperationPermission())
            {
                return(JsonResultHelper.GetErrorJson("对不起,您没有操作权限!"));
            }

            string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0"));
            string json   = "";
            string ids    = req["ids"];

            try
            {
                string msg = aidePlatformManagerFacade.DeleteRoleEx(ids);
                if (msg == "success")
                {
                    json = JsonResultHelper.GetSuccessJson("成功删除!");
                    LogHelper2.SaveSuccessLog("删除[" + ids + "]", userExt.UserID, (int)LogOperationEnum.DeleteRole, GameRequest.GetUserIP(), module);
                }
                else
                {
                    json = JsonResultHelper.GetErrorJson(msg + " 已存在关联用户,不能删除!");
                    LogHelper2.SaveErrLog("删除[" + ids + "]", msg, userExt.UserID, (int)LogOperationEnum.AddGamer, GameRequest.GetUserIP(), module);
                }
            }
            catch (Exception ex)
            {
                LogHelper2.SaveErrLog("删除[" + ids + "]", ex.Message, userExt.UserID, (int)LogOperationEnum.DeleteRole, GameRequest.GetUserIP(), module);
                json = JsonResultHelper.GetErrorJson(ex.Message);
            }
            return(json);
        }
Exemplo n.º 7
0
        private string GetSpreaderIdList(HttpRequest req)
        {
            DataTable dt   = aidePlatformManagerFacade.GetSpreaderID(10);
            string    json = GetJsonByDataTable(dt);

            json = JsonResultHelper.GetSuccessJsonByArray(json);
            return(json);
        }
Exemplo n.º 8
0
        private string GetReportBind(HttpRequest req)
        {
            DataTable dtRoomList = aidePlatformFacade.GetGameRoomList();
            string    json       = GetJsonByDataTable(dtRoomList);

            DataTable dtGameList = aidePlatformFacade.GetGameItemList();
            string    json1      = GetJsonByDataTable(dtGameList);

            return(JsonResultHelper.GetSuccessJsonByArray("{\"data\":{\"roomlist\":" + json + ",\"gamelist\":" + json1 + "}}"));
        }
Exemplo n.º 9
0
        private string bindData(HttpRequest req)
        {
            string    json = "";
            DataTable dtAR = aidePlatformManagerFacade.GetAgentRoles(-1);
            DataTable dtAG = aidePlatformManagerFacade.GetAgentGrades();

            json = "{\"AgentRoles\":" + GetJsonByDataTable(dtAR) + ",\"AgentGrades\":" + GetJsonByDataTable(dtAG) + "}";
            json = JsonResultHelper.GetSuccessJsonByArray(json);
            return(json);
        }
Exemplo n.º 10
0
        protected string GetResponse(string module, string view, DataTable dt, int pageSize, int totalCount)
        {
            string dataAppend = GetJsonByDataTable(dt);
            //string columnsAppend = GetColumnsAppendBy(view);

            string message = GetResultMessage(module, dataAppend, totalCount, pageSize);
            string json    = JsonResultHelper.GetSuccessJsonByArray(message);

            return(json);
        }
Exemplo n.º 11
0
        public override string New(HttpRequest req)
        {
            string json   = "";
            string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0"));


            try
            {
                Base_Users user = new Base_Users();
                user.Username = req.Form["UserName"];
                user.Password = Utility.MD5(req.Form["Password"]);
                bool oIsBand = (req.Form["IsBand"] == "on" ? true : false);
                byte IsBand  = Convert.ToByte(oIsBand);
                user.BandIP      = req.Form["BandIP"];
                user.RoleID      = Convert.ToInt32(string.IsNullOrEmpty(req.Form["RoleID"]) ? "0" : req.Form["RoleID"]);
                user.LastLoginIP = Utility.UserIP;
                string sNullity = req.Form["Nullity"];
                user.Nullity = Convert.ToByte(sNullity == "on" ? 1 : 0);
                if (string.IsNullOrEmpty(user.Username))
                {
                    json = JsonResultHelper.GetSuccessJson("用户名不能为空");
                }
                else
                {
                    Base_Users getuser = aidePlatformManagerFacade.GetUserByAccounts(user.Username);
                    if (getuser != null)
                    {
                        json = JsonResultHelper.GetSuccessJson("用户名已经存在!");
                        LogHelper2.SaveErrLog("新增账号[" + req.Form["UserName"] + "]", "保存失败!用户名已经存在!", userExt.UserID, (int)LogOperationEnum.AddAdmin, GameRequest.GetUserIP(), module);
                    }
                    else
                    {
                        int id = aidePlatformManagerFacade.AddUser(user);
                        if (id == -1)
                        {
                            json = JsonResultHelper.GetSuccessJson("保存失败!");
                        }
                        else
                        {
                            json = JsonResultHelper.GetSuccessJson("保存成功!");
                        }

                        LogHelper2.SaveSuccessLog("新增账号[" + req.Form["UserName"] + "]", userExt.UserID, (int)LogOperationEnum.AddAdmin, GameRequest.GetUserIP(), module);
                    }
                }
            }
            catch (Exception ex)
            {
                json = JsonResultHelper.GetErrorJson(ex.Message);
                LogHelper2.SaveErrLog("新增账号[" + req.Form["UserName"] + "]", ex.Message, userExt.UserID, (int)LogOperationEnum.AddAdmin, GameRequest.GetUserIP(), module);
            }
            return(json);
        }
Exemplo n.º 12
0
        private string GetAddBindData(HttpRequest req)
        {
            string json       = "";
            int    AgentLevel = Convert.ToInt32(req["AgentLevel"]);

            AgentLevel = AgentLevel == 0 ? -1 : AgentLevel + 1;
            DataTable dtAR = aidePlatformManagerFacade.GetAgentRoles(AgentLevel);
            DataTable dtAG = aidePlatformManagerFacade.GetAgentGrades();

            json = "{\"AgentRoles\":" + GetJsonByDataTable(dtAR) + ",\"AgentGrades\":" + GetJsonByDataTable(dtAG) + "}";
            json = JsonResultHelper.GetSuccessJsonByArray(json);
            return(json);
        }
Exemplo n.º 13
0
        public override string New(HttpRequest req)
        {
            string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0"));

            try
            {
                string sword = req["SensitiveWord"];
                aidePlatformManagerFacade.AddSensitiveWordSet(sword);
                LogHelper2.SaveSuccessLog("新增敏感词【" + sword + "】", userExt.UserID, (int)LogOperationEnum.EditSensitiveWord, GameRequest.GetUserIP(), module);
                return(JsonResultHelper.GetSuccessJson("保存成功!"));
            }
            catch (Exception ex)
            {
                return(JsonResultHelper.GetErrorJson("保存失败:" + ex.Message));
            }
        }
Exemplo n.º 14
0
        public override string Delete(HttpRequest req)
        {
            string ids    = req["ids"];
            string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0"));

            try
            {
                aidePlatformManagerFacade.DeleteUser(ids);
                LogHelper2.SaveSuccessLog("删除[" + ids + "]", userExt.UserID, (int)LogOperationEnum.DeleteAdmin, GameRequest.GetUserIP(), module);
                return(JsonResultHelper.GetSuccessJson("删除成功!"));
            }
            catch (Exception ex)
            {
                LogHelper2.SaveErrLog("删除[" + ids + "]:", ex.Message, userExt.UserID, (int)LogOperationEnum.DeleteAdmin, GameRequest.GetUserIP(), module);
                return(JsonResultHelper.GetErrorJson(ex.Message));
            }
        }
Exemplo n.º 15
0
        public override string Index(HttpRequest req)
        {
            try
            {
                int       pageIndex = Convert.ToInt32(req["pageIndex"] ?? "1");
                int       pageSize  = Convert.ToInt32(req["pageSize"] ?? "20");
                PagerSet  pageSet   = aidePlatformManagerFacade.GetUserList(pageIndex, pageSize, GetCondition(req), "ORDER BY UserID DESC");
                DataTable dtUsers   = pageSet.PageSet.Tables[0];

                string json = GetResponse(GetModuleName((int)ModuleType.Admin), View, dtUsers, pageSize, pageSet.RecordCount);
                return(json);
            }
            catch (Exception ex)
            {
                return(JsonResultHelper.GetErrorJson(ex.Message));
            }
        }
Exemplo n.º 16
0
        private string getIndex(HttpRequest req)
        {
            string json = "";

            try
            {
                DataTable dt1   = aidePlatformManagerFacade.GetAgentSpreaderOptions();
                DataTable dt2   = aidePlatformManagerFacade.GetAgentRevenesSet();
                string    json1 = GetJsonByDataTableEx(dt1).Trim();
                string    json2 = GetJsonByDataTableEx(dt2).Trim();
                json = JsonResultHelper.GetSuccessJsonByArray("{\"SpreadOptionsSet\":" + json1 + ",\"AgentRevenesSet\":" + json2 + "}");
            }
            catch (Exception ex)
            {
                json = JsonResultHelper.GetErrorJson(ex.Message);
            }
            return(json);
        }
Exemplo n.º 17
0
        public override string Index(HttpRequest req)
        {
            try
            {
                string    keyword   = req["keyword"];
                int       pageIndex = Convert.ToInt32(req["pageIndex"] ?? "1");
                int       pageSize  = Convert.ToInt32(req["pageSize"] ?? "20");
                PagerSet  pageSet   = aidePlatformManagerFacade.GetSensitiveWordSet(keyword, pageIndex, pageSize);
                DataTable dt        = pageSet.PageSet.Tables[1];

                string json = GetResponse(GetModuleName((int)ModuleType.SensitiveWord), View, dt, pageSize, pageSet.RecordCount);
                return(json);
            }
            catch (Exception ex)
            {
                return(JsonResultHelper.GetErrorJson(ex.Message));
            }
        }
Exemplo n.º 18
0
        private string ChangePassword(HttpRequest req)
        {
            string UserName = req["UserName"];
            string module   = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0"));

            try
            {
                int UserID = Convert.ToInt32(req["UserID"]);
                aidePlatformManagerFacade.ResetUserPassword(UserID, Utility.MD5("123456"));
                LogHelper2.SaveSuccessLog("重置[" + UserName + "]密码", userExt.UserID, (int)LogOperationEnum.ChangeAdminPassword, GameRequest.GetUserIP(), module);
                return(JsonResultHelper.GetSuccessJson("保存成功!"));
            }
            catch (Exception ex)
            {
                LogHelper2.SaveErrLog("重置[" + UserName + "]密码", ex.Message, userExt.UserID, (int)LogOperationEnum.ChangeAdminPassword, GameRequest.GetUserIP(), module);
                return(JsonResultHelper.GetErrorJson("保存失败:" + ex.Message));
            }
        }
Exemplo n.º 19
0
        public static string Logout()
        {
            string json = "";

            AdminCookie.SesionUser userExt = AdminCookie.GetUserFromCookie();
            try
            {
                aidePlatformManagerFacade.UserLogout();
                LogHelper2.SaveSuccessLog("[" + userExt.Username + "]退出成功", userExt.UserID, (int)LogOperationEnum.Logout, GameRequest.GetUserIP(), "登录模块");
                json = JsonResultHelper.GetSuccessJson("退出成功");
            }
            catch (Exception ex)
            {
                LogHelper2.SaveErrLog("[" + userExt.Username + "]退出失败", "", userExt.UserID, (int)LogOperationEnum.Login, GameRequest.GetUserIP(), "登录模块");
                json = JsonResultHelper.GetErrorJson(ex.Message);
            }
            return(json);
        }
Exemplo n.º 20
0
        public override string New(HttpRequest req)
        {
            string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0"));

            try
            {
                string  ids      = req.Form["ids"];
                int     GiftGold = Convert.ToInt32(req.Form["GiftGold"] ?? "0");
                string  Reason   = req.Form["Reason"];
                string  LoginIP  = GameRequest.GetUserIP();
                bool    IsAgent  = Convert.ToBoolean(req["IsAgent"] ?? "false");
                Message msg      = null;
                if (IsAgent)
                {
                    msg = aideTreasureFacade.GrantTreasure_Agent(userExt.AgentID, ids, ids.Split(',').Length, GiftGold, userExt.AgentID, Reason, LoginIP);
                }
                else
                {
                    msg = aideTreasureFacade.GrantTreasure(ids, GiftGold, userExt.UserID, Reason, LoginIP);
                }

                string json = "";
                if (msg.Success)
                {
                    json = JsonResultHelper.GetSuccessJson("操作成功");
                    LogHelper2.SaveSuccessLog("赠送[" + ids + "]金币", userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module);
                }
                else
                {
                    if (msg.MessageID == -4)
                    {
                        msg.Content = "操作失败,可用金币不足!";
                    }
                    json = JsonResultHelper.GetErrorJson(msg.Content);
                    LogHelper2.SaveErrLog("赠送[" + ids + "]金币", msg.Content, userExt.UserID, (int)LogOperationEnum.AddGamer, GameRequest.GetUserIP(), module);
                }
                return(json);
            }
            catch (Exception ex)
            {
                LogHelper2.SaveSuccessLog(ex.Message, userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module);
                return(JsonResultHelper.GetErrorJson(ex.Message));
            }
        }
Exemplo n.º 21
0
        private string SetNullity(HttpRequest req, int nullity)
        {
            string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0"));
            string ids    = req["ids"];

            try
            {
                Dictionary <string, object> kvs = new Dictionary <string, object>();
                kvs.Add(Base_Users._Nullity, nullity);
                aidePlatformManagerFacade.UpdateUserBy("AND UserID IN (" + ids + ")", kvs);
                LogHelper2.SaveSuccessLog((nullity == 1 ? "冻结[" : "解冻") + ids + "]", userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module);
                return(JsonResultHelper.GetSuccessJson("修改成功"));
            }
            catch (Exception ex)
            {
                LogHelper2.SaveErrLog((nullity == 1 ? "冻结[" : "解冻") + ids + "]", ex.Message, userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module);
                return(JsonResultHelper.GetErrorJson(ex.Message));
            }
        }
Exemplo n.º 22
0
        private string GetAgentsTree(HttpRequest req)
        {
            bool      IsAgent = aidePlatformManagerFacade.IsAgent(userExt.UserID);
            DataTable dt      = aidePlatformManagerFacade.GetAgentsTree(userExt.AgentID, IsAgent);
            string    json    = "";

            if (IsAgent)
            {
                int ParentAgentID = aidePlatformManagerFacade.GetParentAgentID(userExt.UserID);
                json = GetAgentsJson(dt, ParentAgentID, 0);
            }
            else
            {
                json = GetAgentsJson(dt, 0, 1);
                string roleName = aidePlatformManagerFacade.GetRolenameByRoleID(userExt.RoleID);
                json = "[{\"id\":\"" + userExt.UserID + "\",\"title\":\"" + userExt.Username + "\",\"RoleID\":" + userExt.RoleID + ",\"RoleName\":\"(" + roleName + ")\",\"parentId\":\"-1\",\"AdminID\":" + userExt.UserID + ",\"type\":\"admin\",\"open\":true,\"level\":0,\"ag\":0,\"subtree\":" + json + "}]";
            }
            return(JsonResultHelper.GetSuccessJsonByArray("{\"tree\":" + json + "}"));
        }
Exemplo n.º 23
0
        private string GetStatInfo(HttpRequest req)
        {
            DataTable dtStatInfo = null;
            string    UserID     = req["UserID"];

            if (string.IsNullOrEmpty(UserID))
            {
                dtStatInfo = aideTreasureFacade.GetStatInfo_Admin().Tables[0];
            }
            else
            {
                dtStatInfo = aideTreasureFacade.GetStatInfo_Agent(Convert.ToInt32(req["UserID"])).Tables[0];
                string spreaderUrl = ConfigHelper.GetAppSetting("SpreaderURL");
                FillSpreaderURL(dtStatInfo, spreaderUrl);
            }
            string json = GetJsonByDataTable(dtStatInfo);

            return(JsonResultHelper.GetSuccessJsonByArray("{\"data\":{\"info\":" + json + "}}"));
        }
Exemplo n.º 24
0
        private string GetSubAgentListInfo(HttpRequest req)
        {
            string json = "";

            try
            {
                int       pageIndex   = Convert.ToInt32(req["pageIndex"] ?? "1");
                int       pageSize    = Convert.ToInt32(req["pageSize"] ?? "20");
                PagerSet  pageSet     = aidePlatformManagerFacade.GetSubAgentListInfo(pageIndex, pageSize, GetCondition_SubAgentList(req));
                DataTable dtSubagents = pageSet.PageSet.Tables[1];

                json = GetResponse(GetModuleName((int)ModuleType.AgentInfo), vw_SubAgentListInfo.Tablename, dtSubagents, pageSize, pageSet.RecordCount);
            }
            catch (Exception ex)
            {
                json = JsonResultHelper.GetErrorJsonByArray(ex.Message);
            }
            return(json);
        }
Exemplo n.º 25
0
        public override string Edit(HttpRequest req)
        {
            string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0"));

            try
            {
                string subType = req["subType"] ?? "";
                string json    = "";
                switch (subType.ToLower())
                {
                case "spreaderid":
                    json = UpdateSpreaderID(req);
                    break;

                case "ch_pwd":
                    json = ResetUserPassword(req);
                    break;

                case "ch_pwd2":
                    json = ChangeUserPassword(req);
                    break;

                case "dj":
                    json = SetNullity(req, 1);
                    break;

                case "jd":
                    json = SetNullity(req, 0);
                    break;

                default:
                    json = Save(req);
                    break;
                }
                return(json);
            }
            catch (Exception ex)
            {
                LogHelper2.SaveErrLog("修改[" + (req.Form["UserName"] ?? req["UserName"]) + "]", ex.Message, userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module);
                return(JsonResultHelper.GetErrorJson(ex.Message));
            }
        }
Exemplo n.º 26
0
        private string GetReport(HttpRequest req, string view, Func <int, int, Dictionary <string, object>, PagerSet> find, Func <HttpRequest, Dictionary <string, object> > GetCondition)
        {
            try
            {
                int      pageIndex = Convert.ToInt32(req["pageIndex"] ?? "1");
                int      pageSize  = Convert.ToInt32(req["pageSize"] ?? "20");
                PagerSet pageSet   = find(pageIndex, pageSize, GetCondition(req));
                if (pageSet.PageSet.Tables.Count == 0)
                {
                    return(JsonResultHelper.GetErrorJson("没有符合条件的数据"));
                }
                DataTable dt = pageSet.PageSet.Tables[1];

                string json = GetResponse(GetModuleName((int)ModuleType.AgentInfo), view, dt, pageSize, pageSet.RecordCount);
                return(json);
            }
            catch (Exception ex)
            {
                return(JsonResultHelper.GetErrorJsonByArray(ex.Message));
            }
        }
Exemplo n.º 27
0
        public override string Index(HttpRequest req)
        {
            string roleName = "";

            if (userExt.RoleID == 1)
            {
                roleName = "超级管理员";
            }
            else
            {
                roleName = aidePlatformManagerFacade.GetRolenameByRoleID(userExt.RoleID);
            }
            bool IsAgent                = aidePlatformManagerFacade.IsAgent(userExt.UserID);
            int  AgentLevel             = aidePlatformManagerFacade.GetAgentLevel(userExt.UserID);
            int  ParentAgentID          = aidePlatformManagerFacade.GetParentAgentID(userExt.UserID);
            SensitiveWordController swc = new SensitiveWordController();
            string json = swc.GetSensitiveWordSet();

            return(JsonResultHelper.GetSuccessJsonByArray("{\"LoginInfo\":{\"UserID\":\"" + userExt.UserID + "\",\"UserName\":\"" + userExt.Username + "\",\"RoleID\":\"" + userExt.RoleID + "\",\"AgentLevel\":" + AgentLevel + ",\"RoleName\":\""
                                                          + roleName + "\",\"IsAgent\":" + IsAgent.ToString().ToLower() + ",\"AgentID\":" + userExt.AgentID + ",\"ParentAgentID\":" + ParentAgentID + "},\"SenstWords\":" + json + "}"));
        }
Exemplo n.º 28
0
        private string ChangeRole(HttpRequest req)
        {
            int    UserID = Convert.ToInt32(req.Form["UserID"]);
            string RoleID = req.Form["RoleID"];
            Dictionary <string, object> kvs = new Dictionary <string, object>();

            kvs.Add(Base_Users._RoleID, RoleID);
            string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0"));

            try
            {
                aidePlatformManagerFacade.UpdateUserByID(UserID, kvs);
                LogHelper2.SaveSuccessLog("[" + req.Form["UserName"] + "]更换角色成[]", userExt.UserID, (int)LogOperationEnum.ChangeAdminRole, GameRequest.GetUserIP(), module);
                return(JsonResultHelper.GetSuccessJson("保存成功!"));
            }
            catch (Exception ex)
            {
                LogHelper2.SaveErrLog("[" + req.Form["UserName"] + "]更换角色成:", ex.Message, userExt.UserID, (int)LogOperationEnum.ChangeAdminRole, GameRequest.GetUserIP(), module);
                return(JsonResultHelper.GetErrorJson("保存失败!" + ex.Message));
            }
        }
Exemplo n.º 29
0
        public string ChangeUserPassword(HttpRequest req)
        {
            string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0"));

            try
            {
                int    UserID = Convert.ToInt32(req.Form["UserID"]);
                string oldpwd = req.Form["oldPwd"];
                string newpwd = req.Form["newPwd"];
                int    i      = aidePlatformManagerFacade.ModifyUserPassword(UserID, Utility.MD5(oldpwd), Utility.MD5(newpwd));
                if (i == -1)
                {
                    return(JsonResultHelper.GetErrorJson("原密码输入错误"));
                }
                return(JsonResultHelper.GetSuccessJson("修改成功!"));
            }
            catch (Exception ex)
            {
                LogHelper2.SaveErrLog("修改[" + req["UserName"] + "]密码", ex.Message, userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module);
                return(JsonResultHelper.GetErrorJson(ex.Message));
            }
        }
Exemplo n.º 30
0
        public override string New(HttpRequest req)
        {
            string json   = "";
            string module = GetModuleName(Convert.ToInt32(req["moduleType"] ?? "0"));

            try
            {
                string subType = req["subType"];
                string objson  = JsonUrlEncode(req.Form.ToString());
                switch (subType)
                {
                case "spreadoptionsset":
                    DataTable dt0 = JsonToDataTable(objson, new List <string>()
                    {
                        "RoleID", "GradeID", "Rate", "ARate", "BRate", "CRate"
                    });
                    aidePlatformManagerFacade.SaveSpreaderOptions(dt0);
                    json = JsonResultHelper.GetSuccessJson("保存成功!");
                    LogHelper2.SaveSuccessLog("修改了分享返利比例", userExt.UserID, (int)LogOperationEnum.SpreadOption, GameRequest.GetUserIP(), module);
                    break;

                case "agentrevenesset":
                    DataTable dt1 = JsonToDataTable(objson, new List <string>()
                    {
                        "UserID", "Percentage"
                    });
                    aidePlatformManagerFacade.SaveAgentRevenesSet(dt1);
                    json = JsonResultHelper.GetSuccessJson("保存成功!");
                    LogHelper2.SaveSuccessLog("修改了代理返利比例", userExt.UserID, (int)LogOperationEnum.EditAgent, GameRequest.GetUserIP(), module);
                    break;
                }
            }
            catch (Exception ex)
            {
                json = JsonResultHelper.GetErrorJson(ex.Message);
                LogHelper2.SaveErrLog("修改返利比例", ex.Message, userExt.UserID, (int)LogOperationEnum.AddRole, GameRequest.GetUserIP(), module);
            }
            return(json);
        }