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)); } }
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); }
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)); } }
private string GetSpreadGamer(HttpRequest req) { string json = ""; try { int pageIndex = Convert.ToInt32(req["pageIndex"] ?? "1"); int pageSize = Convert.ToInt32(req["pageSize"] ?? "20"); int UserID = Convert.ToInt32(req["byUserID"] ?? "20"); Dictionary <string, object> conditions = new Dictionary <string, object>(); conditions.Add("UserID", UserID); conditions.Add("startDate", req["startDate"]); conditions.Add("endDate", req["endDate"]); PagerSet pageSet = aidePlatformManagerFacade.GetSpreaderChildren(pageIndex, pageSize, conditions); DataTable dtGamers = pageSet.PageSet.Tables[1]; json = GetResponse(GetModuleName((int)ModuleType.AgentInfo), vw_GamerListInfo.Tablename, dtGamers, pageSize, pageSet.RecordCount); } catch (Exception ex) { json = JsonResultHelper.GetErrorJsonByArray(ex.Message); } return(json); }