示例#1
0
    // 解析鳄鱼大亨json串信息
    public static InfoCrocodile parseInfoCrocodile(string exInfo)
    {
        InfoCrocodile info = null;

        try
        {
            Dictionary <string, object> dic = BaseJsonSerializer.deserialize <Dictionary <string, object> >(exInfo);
            info = new InfoCrocodile();
            if (dic.ContainsKey("betinfo"))
            {
                info.m_betInfo = BaseJsonSerializer.deserialize <List <BetInfoCrocodile> >(dic["betinfo"].ToString());
            }
            if (dic.ContainsKey("resulttype"))
            {
                info.m_resultType =
                    BaseJsonSerializer.deserialize <List <DbCrocodileResultType> >(dic["resulttype"].ToString());
            }
            if (dic.ContainsKey("resultList"))
            {
                info.m_resultList = BaseJsonSerializer.deserialize <List <DbCrocodileResultList> >(dic["resultList"].ToString());
            }
        }
        catch (System.Exception ex)
        {
        }
        return(info);
    }
示例#2
0
        // 下注表
        protected void genBetTable(Table table, InfoCrocodile info)
        {
            GMUser user = (GMUser)Session["user"];

            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];
            }

            long totalBet = 0, totalWin = 0;

            // 1-12个区域
            for (i = 1; i < 13; i++)
            {
                Crocodile_RateCFGData data = Crocodile_RateCFG.getInstance().getValue(i);

                BetInfoCrocodile item = info.getBetInfo(i);
                if (item != null)
                {
                    m_content[1] = item.rate.ToString();
                    m_content[2] = ItemHelp.showMoneyValue(item.bet_count).ToString();
                    totalBet    += item.bet_count;

                    m_content[3] = ItemHelp.showMoneyValue(item.award_count).ToString();
                    totalWin    += item.award_count;
                }
                else
                {
                    m_content[1] = m_content[2] = m_content[3] = "";
                }

                tr = new TableRow();
                table.Rows.Add(tr);
                for (int j = 0; j < s_head.Length; j++)
                {
                    TableCell td = new TableCell();
                    tr.Cells.Add(td);
                    if (j == 0)
                    {
                        addBetImg(td, data);
                    }
                    else
                    {
                        td.Text = m_content[j];
                    }
                }
            }

            addStatFoot(table, totalBet, totalWin);
        }
示例#3
0
 private void addResultImg(System.Web.UI.HtmlControls.HtmlGenericControl div, InfoCrocodile info)
 {
     foreach (var res in info.m_resultList)
     {
         Crocodile_RateCFGData data = Crocodile_RateCFG.getInstance().getValue(Convert.ToInt32(res.result_id) + 1);
         if (data != null)
         {
             addImg(div.Controls, data);
         }
     }
 }
示例#4
0
        private void fillResultInfo(InfoCrocodile info)
        {
            if (info == null)
            {
                return;
            }

            e_award_type_def type = info.getResultType();

            switch (type)
            {
            case e_award_type_def.e_type_normal:
            {
                addResultImg(divNormalResult, info);
            }
            break;

            case e_award_type_def.e_type_all_prizes:
            {
                tdAllPrizesResult.InnerText = info.getResultParam();
            }
            break;

            case e_award_type_def.e_type_spot_light:
            {
                addResultImg(divSpotLightResult, info);
            }
            break;

            case e_award_type_def.e_type_handsel:
            {
                string resultId = info.getHandSelResultId();
                if (string.IsNullOrEmpty(resultId))
                {
                    tdHandSelResult.InnerText = info.getResultParam() + "倍";
                }
                else
                {
                    Crocodile_RateCFGData data = Crocodile_RateCFG.getInstance().getValue(Convert.ToInt32(resultId) + 1);
                    addImg(tdHandSelResult.Controls, data);

                    Label L = new Label();
                    L.CssClass = "cHand";
                    L.Text     = info.getResultParam() + "倍";
                    tdHandSelResult.Controls.Add(L);
                }
            }
            break;
            }
        }
示例#5
0
        private void genInfoPanel(GameDetailInfo ginfo)
        {
            if (ginfo == null)
            {
                return;
            }

            MoneyItem     item = ginfo.m_item;
            InfoCrocodile info = (InfoCrocodile)ginfo.m_detailInfo;

            divHead.InnerText = item.m_genTime;
            // 玩家ID
            tdPlayerCrocodile.InnerText = "玩家ID:" + item.m_playerId.ToString();

            fillResultInfo(info);

            genBetTable(tableBet, info);
        }