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 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.º 3
0
        private string GetSpreaderIdList(HttpRequest req)
        {
            DataTable dt   = aidePlatformManagerFacade.GetSpreaderID(10);
            string    json = GetJsonByDataTable(dt);

            json = JsonResultHelper.GetSuccessJsonByArray(json);
            return(json);
        }
Exemplo n.º 4
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.º 5
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.º 6
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.º 7
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.º 8
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.º 9
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.º 10
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.º 11
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 + "}"));
        }