private OpRes queryLevel(GMUser user)
    {
        List <Dictionary <string, object> > dataList = DBMgr.getInstance().executeQuery(TableName.CALF_ROPING_PASS_LOG,
                                                                                        user.getDbServerID(), DbName.DB_PUMP);

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

        for (int i = 0; i < dataList.Count; i++)
        {
            ResultCalfRopingLevelItem item = new ResultCalfRopingLevelItem();
            m_result3.Add(item);

            Dictionary <string, object> data = dataList[i];

            if (data.ContainsKey("passid"))
            {
                item.m_passId = Convert.ToInt32(data["passid"]);
            }
            if (data.ContainsKey("hitcount"))
            {
                item.m_hitCount = Convert.ToInt64(data["hitcount"]);
            }
            if (data.ContainsKey("allcount"))
            {
                item.allcount = Convert.ToInt64(data["allcount"]);
            }
        }

        return(OpRes.opres_success);
    }
Esempio n. 2
0
        private void genTable(Table table, OpRes res, ParamGameCalfRoping 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 <ResultCalfRopingLevelItem> qresult =
                (List <ResultCalfRopingLevelItem>)user.getQueryResult(param, QueryType.queryTypeGameCalfRoping);

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

                m_content[0] = item.m_passId.ToString();
                m_content[1] = item.m_hitCount.ToString();
                m_content[2] = item.allcount.ToString();
                m_content[3] = item.getHitRate();

                for (k = 0; k < s_head.Length; k++)
                {
                    td = new TableCell();
                    tr.Cells.Add(td);
                    td.Text = m_content[k];
                }
            }
        }
 private int sortLevel(ResultCalfRopingLevelItem p1, ResultCalfRopingLevelItem p2)
 {
     return(p1.m_passId - p2.m_passId);
 }