Exemple #1
0
    public override void genTable(Table table, OpRes res, GMUser user)
    {
        TableRow tr = new TableRow();

        table.Rows.Add(tr);
        TableCell td = null;

        if (res != OpRes.opres_success)
        {
            td = new TableCell();
            tr.Cells.Add(td);
            td.Text = OpResMgr.getInstance().getResultString(res);
            return;
        }

        List <ResultGameHistoryItem> qresult =
            (List <ResultGameHistoryItem>)user.getQueryResult(QueryType.queryTypeGameHistory);

        int i = 0, j = 0;

        // 表头
        for (i = 0; i < s_head.Length; i++)
        {
            td = new TableCell();
            tr.Cells.Add(td);
            td.Text = s_head[i];
        }

        for (i = 0; i < qresult.Count; i++)
        {
            ResultGameHistoryCowstIem item = (ResultGameHistoryCowstIem)qresult[i];
            tr = new TableRow();
            if ((i & 1) == 0)
            {
                tr.CssClass = "alt";
            }
            table.Rows.Add(tr);

            m_content[0] = item.m_time;
            m_content[1] = StrName.s_gameName[item.m_gameId];
            m_content[2] = item.m_totalBound.ToString();
            m_content[3] = item.getBankerCard();
            m_content[4] = item.getEastCard();
            m_content[5] = item.getSouthCard();
            m_content[6] = item.getWestCard();
            m_content[7] = item.getNorthCard();

            for (j = 0; j < s_head.Length; j++)
            {
                td = new TableCell();
                tr.Cells.Add(td);
                td.Text = m_content[j];
            }
        }
    }
    // 填充牛牛数据
    void fillCows(ParamGameHistory param, GMUser user, List <Dictionary <string, object> > dataList)
    {
        for (int i = 0; i < dataList.Count; i++)
        {
            Dictionary <string, object> data = dataList[i];
            ResultGameHistoryCowstIem   tmp  = new ResultGameHistoryCowstIem();
            m_result.Add(tmp);

            tmp.m_time   = Convert.ToDateTime(data["genTime"]).ToLocalTime().ToString(ConstDef.DATE_TIME24);
            tmp.m_gameId = (int)GameId.cows;
            if (data.ContainsKey("gameIndex"))
            {
                tmp.m_totalBound = Convert.ToInt64(data["gameIndex"]);
            }

            GameDetail.detailInfoForCows(tmp.m_info, data);
        }
    }