コード例 #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++)
        {
            ResultGameHistoryDicetIem item = (ResultGameHistoryDicetIem)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.getResult();

            for (j = 0; j < s_head.Length; j++)
            {
                td = new TableCell();
                tr.Cells.Add(td);
                td.Text = m_content[j];
            }
        }
    }
コード例 #2
0
    // 填充骰宝数据
    void fillDice(ParamGameHistory param, GMUser user, List <Dictionary <string, object> > dataList)
    {
        for (int i = 0; i < dataList.Count; i++)
        {
            Dictionary <string, object> data = dataList[i];
            ResultGameHistoryDicetIem   tmp  = new ResultGameHistoryDicetIem();
            m_result.Add(tmp);

            tmp.m_time       = Convert.ToDateTime(data["genTime"]).ToLocalTime().ToString(ConstDef.DATE_TIME24);
            tmp.m_gameId     = (int)GameId.dice;
            tmp.m_totalBound = Convert.ToInt64(data["gameIndex"]);
            tmp.m_dice1      = Convert.ToInt32(data["dice1"]);
            tmp.m_dice2      = Convert.ToInt32(data["dice2"]);
            tmp.m_dice3      = Convert.ToInt32(data["dice3"]);
        }
    }