// 期望盈利率表格 protected void genExpRateTable(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]; } // long totalIncome = 0; // long totalOutlay = 0; OpRes res = user.doQuery(null, QueryType.queryTypeDragonParam); List <ResultDragonParam> qresult = (List <ResultDragonParam>)user.getQueryResult(QueryType.queryTypeDragonParam); for (i = 0; i < qresult.Count; i++) { ResultDragonParam item = qresult[i]; m_content[0] = StrName.s_dragonRoomName[item.m_roomId - 1]; m_content[1] = item.m_expRate.ToString(); m_content[2] = item.m_totalIncome.ToString(); m_content[3] = item.m_totalOutlay.ToString(); m_content[4] = item.getDelta().ToString(); m_content[5] = item.getFactExpRate().ToString(); m_content[6] = item.m_doubleIncome.ToString(); m_content[7] = item.m_doubleOutcome.ToString(); m_content[8] = item.m_curPlayerCount.ToString(); m_content[9] = Tool.getCheckBoxHtml("roomList", item.m_roomId.ToString(), false); 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]; // if (j == 4) //{ // setColor(td, m_content[j]); // } } } // addStatFoot(table, totalIncome, totalOutlay); }
private OpRes query(GMUser user) { List <Dictionary <string, object> > dataList = DBMgr.getInstance().executeQuery(TableName.DRAGON_ROOM, user.getDbServerID(), DbName.DB_GAME); if (dataList == null) { return(OpRes.opres_success); } for (int i = 0; i < dataList.Count; i++) { ResultDragonParam info = new ResultDragonParam(); m_result.Add(info); info.m_roomId = Convert.ToInt32(dataList[i]["room_id"]); if (dataList[i].ContainsKey("expect_earn_rate")) { info.m_expRate = Convert.ToDouble(dataList[i]["expect_earn_rate"]); } else { info.m_expRate = 0.05; } if (dataList[i].ContainsKey("room_income")) // 总收入 { info.m_totalIncome = Convert.ToInt64(dataList[i]["room_income"]); } if (dataList[i].ContainsKey("room_outcome")) // 总支出 { info.m_totalOutlay = Convert.ToInt64(dataList[i]["room_outcome"]); } if (dataList[i].ContainsKey("double_income")) // 翻倍收入 { info.m_doubleIncome = Convert.ToInt64(dataList[i]["double_income"]); } if (dataList[i].ContainsKey("double_outcome")) // 翻倍支出 { info.m_doubleOutcome = Convert.ToInt64(dataList[i]["double_outcome"]); } if (dataList[i].ContainsKey("player_count")) { info.m_curPlayerCount = Convert.ToInt32(dataList[i]["player_count"]); } } return(OpRes.opres_success); }