예제 #1
0
        protected 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;
            }

            int i = 0;

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

            ResultDragonGameModeEarning qresult
                = (ResultDragonGameModeEarning)user.getQueryResult(QueryType.queryTypeDragonGameModeEarning);

            for (i = 0; i < 3; i++)
            {
                ResultExpRateParam item = qresult.getParam(i);
                if (item == null)
                {
                    continue;
                }

                m_content[0] = ResultDragonGameModeEarning.s_mode[i];
                m_content[1] = item.m_totalIncome.ToString();
                m_content[2] = item.m_totalOutlay.ToString();
                m_content[3] = item.getDelta().ToString();
                m_content[4] = item.getFactExpRate().ToString();

                tr = new TableRow();
                table.Rows.Add(tr);
                for (int j = 0; j < s_head.Length; j++)
                {
                    td = new TableCell();
                    tr.Cells.Add(td);
                    td.Text = m_content[j];
                }
            }
        }
    public void addModeData(int mode, long income, long outlay)
    {
        ResultExpRateParam r = null;

        if (m_result.ContainsKey(mode))
        {
            r = m_result[mode];
        }
        else
        {
            r = new ResultExpRateParam();
            m_result.Add(mode, r);
        }

        r.m_totalIncome += income;
        r.m_totalOutlay += outlay;
    }
예제 #3
0
        // 期望盈利率表格
        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];
            }

            ParamGameCalfRoping param = new ParamGameCalfRoping();

            param.m_queryContent = ParamGameCalfRoping.QUERY_CONTROL_PARAM;

            OpRes res = user.doQuery(param, QueryType.queryTypeGameCalfRoping);
            List <ResultExpRateParam> qresult
                = (List <ResultExpRateParam>)user.getQueryResult(param, QueryType.queryTypeGameCalfRoping);

            for (i = 0; i < qresult.Count; i++)
            {
                ResultExpRateParam item = qresult[i];
                m_content[0] = item.m_expRate.ToString();
                m_content[1] = item.m_totalIncome.ToString();
                m_content[2] = item.m_totalOutlay.ToString();
                m_content[3] = item.getDelta().ToString();
                m_content[4] = item.getFactExpRate().ToString();

                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];
                }
            }
        }
    private OpRes queryParam(GMUser user)
    {
        List <Dictionary <string, object> > dataList = DBMgr.getInstance().executeQuery(TableName.CALF_ROPING_ROOM,
                                                                                        user.getDbServerID(), DbName.DB_GAME);

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

        for (int i = 0; i < dataList.Count; i++)
        {
            ResultExpRateParam info = new ResultExpRateParam();
            m_result.Add(info);

            if (dataList[i].ContainsKey("ExpectEarnRate"))
            {
                info.m_expRate = Convert.ToDouble(dataList[i]["ExpectEarnRate"]);
            }
            else
            {
                info.m_expRate = 0.05;
            }

            if (dataList[i].ContainsKey("lobby_income")) // 总收入
            {
                info.m_totalIncome = Convert.ToInt64(dataList[i]["lobby_income"]);
            }
            if (dataList[i].ContainsKey("lobby_outcome"))  // 总支出
            {
                info.m_totalOutlay = Convert.ToInt64(dataList[i]["lobby_outcome"]);
            }
        }

        return(OpRes.opres_success);
    }