Пример #1
0
        private void genTable(Table table, OpRes res, ParamGrandPrix param, 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;
            }

            int i = 0, k = 0;

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

            List <ResultChampionItem> qresult =
                (List <ResultChampionItem>)user.getQueryResult(param, QueryType.queryTypeGrandPrix);

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

                m_content[0] = item.m_time;
                m_content[1] = item.m_playerId.ToString();
                m_content[2] = item.m_nickName;
                m_content[3] = item.m_bestScore.ToString();

                for (k = 0; k < s_head.Length; k++)
                {
                    td = new TableCell();
                    tr.Cells.Add(td);
                    td.Text = m_content[k];
                }
            }
        }
    private OpRes queryWeekChampion(GMUser user)
    {
        List <Dictionary <string, object> > dataList = DBMgr.getInstance().executeQuery(TableName.MATCH_GRAND_PRIX_WEEK_CHAMPION,
                                                                                        user.getDbServerID(), DbName.DB_GAME, null, 0, 0, null, "matchTime", false);

        if (dataList == null)
        {
            return(OpRes.opres_success);
        }

        for (int i = 0; i < dataList.Count; i++)
        {
            ResultChampionItem info = new ResultChampionItem();
            info.m_time      = Convert.ToDateTime(dataList[i]["matchTime"]).ToLocalTime().ToShortDateString();
            info.m_playerId  = Convert.ToInt32(dataList[i]["playerId"]);
            info.m_nickName  = Convert.ToString(dataList[i]["nickName"]);
            info.m_bestScore = Convert.ToInt32(dataList[i]["bestScore"]);
            m_result1.Add(info);
        }

        return(OpRes.opres_success);
    }