protected void genTable(Table table) { GMUser user = (GMUser)Session["user"]; table.GridLines = GridLines.Both; TableRow tr = new TableRow(); table.Rows.Add(tr); int i = 0; for (; i < s_head.Length; i++) { TableCell td = new TableCell(); tr.Cells.Add(td); td.Text = s_head[i]; } QueryMgr mgr = user.getSys <QueryMgr>(SysType.sysTypeQuery); OpRes res = mgr.doQuery(null, QueryType.queryTypeFishStat, user); List <ResultFish> qresult = (List <ResultFish>)mgr.getQueryResult(QueryType.queryTypeFishStat); foreach (var data in qresult) { m_content[0] = data.m_fishId.ToString(); var fishInfo = FishCFG.getInstance().getValue(data.m_fishId); if (fishInfo != null) { m_content[1] = fishInfo.m_fishName; } else { m_content[1] = ""; } m_content[2] = data.m_hitCount.ToString(); m_content[3] = data.m_dieCount.ToString(); m_content[4] = data.getHit_Die(); m_content[5] = data.m_outlay.ToString(); m_content[6] = data.m_income.ToString(); m_content[7] = data.getOutlay_Income(); tr = new TableRow(); table.Rows.Add(tr); for (int j = 0; j < s_head.Length; j++) { TableCell td = new TableCell(); tr.Cells.Add(td); td.Text = m_content[j]; } } }
public void onQuery(GMUser user, Table table, int roomIndex, QueryType qtype) { TableRow tr = new TableRow(); table.Rows.Add(tr); int i = 0; for (; i < s_head.Length; i++) { TableCell td = new TableCell(); tr.Cells.Add(td); td.Text = s_head[i]; } OpRes res = user.doQuery(roomIndex, qtype /*QueryType.queryTypeFishStat*/); List <ResultFish> qresult = (List <ResultFish>)user.getQueryResult(qtype); foreach (var data in qresult) { m_content[0] = data.m_fishId.ToString(); FishCFGData fishInfo = null; if (qtype == QueryType.queryTypeFishStat) // 经典捕鱼 { fishInfo = FishCFG.getInstance().getValue(data.m_fishId); } else // 鳄鱼公园 { fishInfo = FishParkCFG.getInstance().getValue(data.m_fishId); } if (fishInfo != null) { m_content[1] = fishInfo.m_fishName; } else { m_content[1] = ""; } m_content[2] = data.m_hitCount.ToString(); m_content[3] = data.m_dieCount.ToString(); m_content[4] = data.getHit_Die(); m_content[5] = data.m_outlay.ToString(); m_content[6] = data.m_income.ToString(); m_content[7] = data.getOutlay_Income(); if (data.m_roomId > 0) { m_content[8] = StrName.s_fishRoomName[data.m_roomId - 1]; } else { m_content[8] = ""; } tr = new TableRow(); table.Rows.Add(tr); for (int j = 0; j < s_head.Length; j++) { TableCell td = new TableCell(); tr.Cells.Add(td); td.Text = m_content[j]; } } }