private OpRes query(GMUser user) { List <Dictionary <string, object> > dataList = DBMgr.getInstance().executeQuery(TableName.COWS_ROOM, user.getDbServerID(), DbName.DB_GAME); if (dataList == null) { return(OpRes.opres_success); } for (int i = 0; i < dataList.Count; i++) { ResultParamCows info = new ResultParamCows(); info.m_roomId = Convert.ToInt32(dataList[i]["room_id"]); if (dataList[i].ContainsKey("ExpectEarnRate")) { info.m_expRate = Convert.ToDouble(dataList[i]["ExpectEarnRate"]); } 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("BankerAddGold")) // 上庄手续费 { info.m_serviceCharge = Convert.ToInt64(dataList[i]["BankerAddGold"]); } if (dataList[i].ContainsKey("BankerSubGold")) // 爆庄支出 { info.m_burstZhuang = Convert.ToInt64(dataList[i]["BankerSubGold"]); } if (dataList[i].ContainsKey("TotalRobotWinGold")) // 机器人收入 { info.m_robotIncome = Convert.ToInt64(dataList[i]["TotalRobotWinGold"]); } if (dataList[i].ContainsKey("TotalRobotLoseGold")) // 机器人支出 { info.m_robotOutlay = Convert.ToInt64(dataList[i]["TotalRobotLoseGold"]); } if (dataList[i].ContainsKey("player_count")) { info.m_curPlayerCount = Convert.ToInt32(dataList[i]["player_count"]); } m_result.Add(info.m_roomId, info); } return(OpRes.opres_success); }
// 期望盈利率表格 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]; } OpRes res = user.doQuery(null, QueryType.queryTypeQueryCowsParam); Dictionary <int, ResultParamCows> qresult = (Dictionary <int, ResultParamCows>)user.getQueryResult(QueryType.queryTypeQueryCowsParam); for (i = 1; i <= 1; i++) { m_content[0] = StrName.s_roomName[i - 1]; if (qresult.ContainsKey(i)) { ResultParamCows r = qresult[i]; m_content[1] = r.m_expRate.ToString(); m_content[2] = r.m_totalIncome.ToString(); m_content[3] = r.m_totalOutlay.ToString(); m_content[4] = r.getDelta().ToString(); m_content[5] = r.getFactExpRate(); m_content[6] = r.m_serviceCharge.ToString(); m_content[7] = r.m_burstZhuang.ToString(); m_content[8] = r.getTotalRate(); m_content[9] = r.m_robotIncome.ToString(); m_content[10] = r.m_robotOutlay.ToString(); m_content[11] = (r.m_robotIncome - r.m_robotOutlay).ToString(); m_content[12] = ItemHelp.getFactExpRate(r.m_robotIncome, r.m_robotOutlay); } else { m_content[1] = "0.05"; for (int m = 2; m < 13; m++) { m_content[m] = "0"; } } m_content[13] = Tool.getCheckBoxHtml("roomList", i.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]; } } }