コード例 #1
0
 protected void ddlLotteries_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.ddlLotteries.SelectedValue == "0")
     {
         this.ddlPlayTypes.Items.Clear();
         this.ddlPlayTypes.Items.Add(new ListItem("选择玩法", "0"));
     }
     else
     {
         string key = "dtPlayTypes_" + this.ddlLotteries.SelectedValue;
         DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key);
         if (cacheAsDataTable == null)
         {
             cacheAsDataTable = new Tables.T_PlayTypes().Open("", "LotteryID in (" + ((base._Site.UseLotteryList == "") ? "-1" : base._Site.UseLotteryList) + ") and LotteryID = " + _Convert.StrToInt(this.ddlLotteries.SelectedValue, -1).ToString(), "[ID]");
             if ((cacheAsDataTable == null) || (cacheAsDataTable.Rows.Count < 1))
             {
                 PF.GoError(7, "数据库繁忙,请重试", base.GetType().FullName + "(-85)");
                 return;
             }
             Shove._Web.Cache.SetCache(key, cacheAsDataTable, 0x1770);
         }
         if (cacheAsDataTable == null)
         {
             PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName + "(-95)");
         }
         else
         {
             this.ddlPlayTypes.Items.Clear();
             foreach (DataRow row in cacheAsDataTable.Rows)
             {
                 this.ddlPlayTypes.Items.Add(new ListItem(row["Name"].ToString(), row["ID"].ToString()));
             }
         }
     }
 }
コード例 #2
0
ファイル: Project_List.aspx.cs プロジェクト: ichari/ichari
    private void BindPlay(int LotteryID)
    {
        string CacheKey = "Join_Project_List_dtVPlayTypes_" + LotteryID.ToString();
        DataTable dtPlayTypes = Shove._Web.Cache.GetCacheAsDataTable(CacheKey);

        if (dtPlayTypes == null)
        {
            dtPlayTypes = new DAL.Tables.T_PlayTypes().Open("ID, Name", "LotteryID =" + LotteryID.ToString() + " AND ID in " + GetLotteryPlayType(LotteryID), "ID");

            if (dtPlayTypes == null)
            {
                PF.GoError(ErrorNumber.NoData, "数据库繁忙,请重试", this.GetType().FullName);
                return;
            }
          //  Shove._Web.Cache.SetCache(CacheKey, dtPlayTypes, 6000);
        }

        PlayType = "";
        if (LotteryID == SLS.Lottery.CQSSC.ID)
            return;
        StringBuilder sb = new StringBuilder();

        for (int j = 0; j < dtPlayTypes.Rows.Count; j++)
        {
            sb.Append("<li mid=\""+dtPlayTypes.Rows[j]["ID"].ToString()+"\">"+dtPlayTypes.Rows[j]["Name"].ToString()+"</li>");
        }
        PlayType = sb.ToString().Replace("包点", "和值");
    }
コード例 #3
0
    /// <summary>
    /// 获得玩法
    /// </summary>
    /// <param name="_playTypeId">玩法ID</param>
    /// <returns>玩法Name</returns>
    protected string GetPlayType(object _playTypeId)
    {
        int playTypeId = Shove._Convert.StrToInt(_playTypeId.ToString(), 0);
        if (playTypeId < 1)
        {
            return "全部玩法";
        }
        else
        {
            DataTable dt = new DAL.Tables.T_PlayTypes().Open("Name", "id = " + playTypeId, "");
            return dt.Rows[0][0].ToString();
        }

    }
コード例 #4
0
ファイル: Gateway.cs プロジェクト: ichari/ichari
    public DataSet BettingWithin(long AgentID, DateTime TimeStamp, string Sign, int LotteryID, string IssueName, int PlayTypeID, string SchemeNumber, string LotteryNumber, double Amount, int Multiple, int Share, string InitiateName, string InitiateAlipayName, string InitiateAlipayID, string InitiateRealityName, string InitiateIDCard, string InitiateTelephone, string InitiateMobile, string InitiateEmail, double InitiateBonusScale, double InitiateBonusLimitLower, double InitiateBonusLimitUpper, string dtJoinDetailXml, string Op_Type)
    {
        new Log("Agent\\ElectronTicket").Write(String.Format("Method=BettingWithin\tAgentID={0}\tTimeStamp={1}\tSign={2}\tLotteryID={3}\tIssueName={4}\tPlayTypeID={5}\tSchemeNumber={6}\tAmount={7}\tMultiple={8}\tShare={9}\tOp_Type={10}", AgentID, TimeStamp, Sign, LotteryID, IssueName, PlayTypeID, SchemeNumber, Amount, Multiple, Share, Op_Type));

        DataSet ds = new DataSet();
        string UseLotteryList = "";
        double Balance = 0;
        short State = 0;

        if (Op_Type != "0001")
        {
            BuildReturnDataSetForError(-101, "不是有效的内部参数调用", ref ds);

            new Log("Agent\\ElectronTicket").Write("不是有效的内部参数调用");

            return ds;
        }

        DataTable dtJoinDetail = Shove._Convert.XMLToDataTable(dtJoinDetailXml);

        if (String.IsNullOrEmpty(SchemeNumber) || (Amount <= 0) || (Multiple < 1) || (Share < 1) || String.IsNullOrEmpty(InitiateName) || String.IsNullOrEmpty(InitiateAlipayName) || String.IsNullOrEmpty(InitiateAlipayID) ||
            String.IsNullOrEmpty(InitiateRealityName) || String.IsNullOrEmpty(InitiateIDCard) || String.IsNullOrEmpty(InitiateMobile) || (dtJoinDetail == null) || (dtJoinDetail.Rows.Count < 1))
        {
            BuildReturnDataSetForError(-22, "参数不符合规定或者未提供", ref ds);

            new Log("Agent\\ElectronTicket").Write("参数不符合规定或者未提供");

            return ds;
        }

        if (Valid(ref ds, ref UseLotteryList, ref Balance, ref State, AgentID, TimeStamp, Sign, LotteryID, IssueName, PlayTypeID, SchemeNumber, LotteryNumber, Amount, Multiple, Share, InitiateName, InitiateAlipayName, InitiateAlipayID, InitiateRealityName, InitiateIDCard, InitiateTelephone, InitiateMobile, InitiateEmail, InitiateBonusScale, InitiateBonusLimitLower, InitiateBonusLimitUpper, dtJoinDetailXml) < 0)
        {
            return ds;
        }

        if (State != 1)
        {
            BuildReturnDataSetForError(-1, "代理商ID错误", ref ds);

            new Log("Agent\\ElectronTicket").Write("代理商ID错误");

            return ds;
        }

        if (Balance <= 0)
        {
            BuildReturnDataSetForError(-7, "投注金额超限", ref ds);

            new Log("Agent\\ElectronTicket").Write("投注金额超限");

            return ds;
        }

        if (ValidLotteryID(ref ds, UseLotteryList, LotteryID) < 0)
        {
            return ds;
        }

        DataTable dt = new DAL.Tables.T_Isuses().Open("[ID], StartTime, EndTime, State", "LotteryID = " + LotteryID.ToString() + " and [Name] = '" + Shove._Web.Utility.FilteSqlInfusion(IssueName) + "'", "");

        if ((dt == null) || (dt.Rows.Count < 1))
        {
            BuildReturnDataSetForError(-4, "奖期不存在", ref ds);

            new Log("Agent\\ElectronTicket").Write("奖期不存在");

            return ds;
        }

        long IsuseID = Shove._Convert.StrToLong(dt.Rows[0]["ID"].ToString(), -1);
        DateTime StartTime = Shove._Convert.StrToDateTime(dt.Rows[0]["StartTime"].ToString(), "1980-1-1 0:0:0");
        DateTime EndTime = Shove._Convert.StrToDateTime(dt.Rows[0]["EndTime"].ToString(), "1980-1-1 0:0:0");
        short IsuseState = Shove._Convert.StrToShort(dt.Rows[0]["State"].ToString(), -1);

        if (IsuseID < 0)
        {
            BuildReturnDataSetForError(-4, "奖期不存在", ref ds);

            new Log("Agent\\ElectronTicket").Write("奖期不存在");

            return ds;
        }

        DateTime Now = DateTime.Now;

        if (Now < StartTime)
        {
            BuildReturnDataSetForError(-5, "奖期未开启", ref ds);

            new Log("Agent\\ElectronTicket").Write("奖期未开启");

            return ds;
        }

        if ((Now >= EndTime) || (IsuseState > 1))
        {
            BuildReturnDataSetForError(-6, "奖期已截止投注", ref ds);

            new Log("Agent\\ElectronTicket").Write("奖期已截止投注" + "|" + Now.ToString() + "|" + IsuseState);

            return ds;
        }

        DataTable dtPlayTypes = new DAL.Tables.T_PlayTypes().Open("Price, MaxMultiple", "LotteryID = " + LotteryID.ToString() + " and [ID] = " + PlayTypeID.ToString(), "");

        if (dtPlayTypes == null)
        {
            BuildReturnDataSetForError(-9999, "未知错误", ref ds);

            new Log("Agent\\ElectronTicket").Write("未知错误");

            return ds;
        }

        if (dtPlayTypes.Rows.Count < 1)
        {
            BuildReturnDataSetForError(-21, "玩法ID不存在", ref ds);

            new Log("Agent\\ElectronTicket").Write("玩法ID不存在");

            return ds;
        }

        double Price = Shove._Convert.StrToDouble(dtPlayTypes.Rows[0]["Price"].ToString(), 2);
        int MaxMultiple = Shove._Convert.StrToInt(dtPlayTypes.Rows[0]["MaxMultiple"].ToString(), 200);

        if ((PlayTypeID == 3903) || (PlayTypeID == 3904))
        {
            Price = 3;
        }

        if ((Multiple < 1) || (Multiple > MaxMultiple))
        {
            BuildReturnDataSetForError(-8, "倍数超限", ref ds);

            new Log("Agent\\ElectronTicket").Write("倍数超限");

            return ds;
        }

        if (new DAL.Tables.T_ElectronTicketAgentSchemes().GetCount("AgentID = " + AgentID.ToString() + " and SchemeNumber = '" + Shove._Web.Utility.FilteSqlInfusion(SchemeNumber) + "'") > 0)
        {
            BuildReturnDataSetForError(-15, "方案号重复", ref ds);

            new Log("Agent\\ElectronTicket").Write("方案号重复");

            return ds;
        }

        if ((InitiateBonusScale < 0) || (InitiateBonusScale > 1) || (InitiateBonusLimitLower < 0))
        {
            BuildReturnDataSetForError(-10, "佣金设置不符合要求", ref ds);

            new Log("Agent\\ElectronTicket").Write("佣金设置不符合要求");

            return ds;
        }

        int Num = 0;
        LotteryNumber = GetLotteryNumber(LotteryID, PlayTypeID, UnEncryptString(LotteryNumber), ref Num);

        if (Num == 0)
        {
            BuildReturnDataSetForError(-17, "投注号码格式错误", ref ds);

            new Log("Agent\\ElectronTicket").Write("投注号码格式错误");

            return ds;
        }

        if (Num * Multiple * Price != Amount)
        {
            BuildReturnDataSetForError(-9, "投注金额与票面金额不符", ref ds);

            new Log("Agent\\ElectronTicket").Write("投注金额与票面金额不符");

            return ds;
        }

        if ((Share > 1) && (dtJoinDetail.Rows.Count < 2))
        {
            BuildReturnDataSetForError(-11, "方案份数(金额)与购买明细份数(金额)不符合", ref ds);

            new Log("Agent\\ElectronTicket").Write("方案份数(金额)与购买明细份数(金额)不符合");

            return ds;
        }

        int DetailShareCount = 0;
        double DetailAmountCount = 0;
        string DetailXML = "<Details>";
        int i = 0;

        foreach (DataRow dr in dtJoinDetail.Rows)
        {
            string DetailName = "";
            string DetailAlipayName = "";
            string DetailRealityName = "";
            string DetailIDCard = "";
            string DetailTelephone = "";
            string DetailMobile = "";
            string DetailEmail = "";
            int DetailShare = -1;
            double DetailAmount = -1;

            try
            {
                DetailName = dr["Name"].ToString();
                DetailAlipayName = dr["AlipayName"].ToString();
                DetailRealityName = dr["RealityName"].ToString();
                DetailIDCard = dr["IDCard"].ToString();
                DetailTelephone = dr["Telephone"].ToString();
                DetailMobile = dr["Mobile"].ToString();
                DetailEmail = dr["Email"].ToString();
                DetailShare = Shove._Convert.StrToInt(dr["Share"].ToString(), -1);
                DetailAmount = Shove._Convert.StrToDouble(dr["Amount"].ToString(), -1);
            }
            catch
            {
                BuildReturnDataSetForError(-23, "购买明细格式错误", ref ds);

                new Log("Agent\\ElectronTicket").Write("购买明细格式错误");

                return ds;
            }

            if (String.IsNullOrEmpty(DetailName) || String.IsNullOrEmpty(DetailAlipayName) || String.IsNullOrEmpty(DetailRealityName) || String.IsNullOrEmpty(DetailIDCard) ||
                String.IsNullOrEmpty(DetailTelephone) || (DetailShare < 1) || (DetailAmount < 0))
            {
                BuildReturnDataSetForError(-23, "购买明细格式错误", ref ds);

                new Log("Agent\\ElectronTicket").Write("购买明细格式错误");

                return ds;
            }

            DetailShareCount += DetailShare;
            DetailAmountCount += DetailAmount;

            DetailXML += String.Format("<Detail No=\"{0}\" Name=\"{1}\" AlipayName=\"{2}\" RealityName=\"{3}\" IDCard=\"{4}\" Telephone=\"{5}\" Mobile=\"{6}\" Email=\"{7}\" Share=\"{8}\" Amount=\"{9}\" />", i++, DetailName, DetailAlipayName, DetailRealityName, DetailIDCard, DetailTelephone, DetailMobile, DetailEmail, DetailShare, DetailAmount);
        }

        DetailXML += "</Details>";

        if ((DetailShareCount != Share) || (DetailAmountCount != Amount))
        {
            BuildReturnDataSetForError(-11, "方案份数(金额)与购买明细份数(金额)不符合", ref ds);

            new Log("Agent\\ElectronTicket").Write("方案份数(金额)与购买明细份数(金额)不符合");

            return ds;
        }

        if (Balance < Amount)
        {
            BuildReturnDataSetForError(-7, "投注金额超限", ref ds);

            new Log("Agent\\ElectronTicket").Write("投注金额超限");

            return ds;
        }

        long SchemeID = 0;
        string ReturnDescription = "";

        if (DAL.Procedures.P_ElectronTicketAgentSchemeAdd(AgentID, SchemeNumber, LotteryID, PlayTypeID, IsuseID, LotteryNumber, Amount, Multiple, Share, InitiateName,
            InitiateAlipayName, InitiateAlipayID, InitiateRealityName, InitiateIDCard, InitiateTelephone, InitiateMobile, InitiateEmail,
            InitiateBonusScale, InitiateBonusLimitLower, InitiateBonusLimitUpper, DetailXML, ref SchemeID, ref ReturnDescription) < 0)
        {
            BuildReturnDataSetForError(-9999, "未知错误", ref ds);

            new Log("Agent\\ElectronTicket").Write("未知错误");

            return ds;
        }

        if (SchemeID < 0)
        {
            BuildReturnDataSetForError((int)SchemeID, ReturnDescription, ref ds);

            return ds;
        }

        BuildReturnDataSet(0, ref ds);
        ds.Tables.Add(new DataTable());

        return ds;
    }
コード例 #5
0
ファイル: Buy_SFC_DG.aspx.cs プロジェクト: ichari/ichari
    //生成HTML
    private void createHTML(DataTable dt, ref string strHTML, ref int jzCount, ref string strlgList)
    {
        //初始化
        jzCount = 0;
        strHTML = "";
        strlgList = "<ul id=\"lgList\">";

        DAL.Tables.T_PlayTypes play = new DAL.Tables.T_PlayTypes();

        System.Data.DataTable table = play.Open("SystemEndAheadMinute", "id=7303", "");

        if (table == null)
        {
            return;
        }

        double time = 0;

        if (table.Rows.Count > 0)
        {
            time = double.Parse(table.Rows[0]["SystemEndAheadMinute"].ToString());
        }

        if (dt.Rows != null && dt.Rows.Count > 0)
        {
            //变量
            StringBuilder sb = new StringBuilder(); //构造HTML
            int i = 0;                              //未截止的赛事计数器
            int m = 0;                              //赛事计数器
            DateTime startDate = DateTime.Now;      //开始时间(分组的开始时间)
            DateTime endDate = DateTime.Now;        //结束时间(分组的结束时间)
            DateTime date = DateTime.Now;           //赛事开始时间
            DateTime saleEndDate = DateTime.Now;      //销售截止时间
            string lineStyle = "";                  //行样式

            try
            {
                foreach (DataRow dr in dt.Rows)
                {
                    //获取开赛时间及停售时间
                    date = Shove._Convert.StrToDateTime(dr["StopSellTime"].ToString(), DateTime.Now.ToString());
                    saleEndDate = Shove._Convert.StrToDateTime(dr["StopSellTime"].ToString(), DateTime.Now.ToString());

                    //分组行的构造
                    if (m == 0)
                    {
                        if (string.Compare(date.ToString("HH:mm"), "12:00") >= 0)
                        {
                            startDate = Shove._Convert.StrToDateTime(date.ToString("yyyy-MM-dd") + " 12:00:00", DateTime.Now.ToString());
                            endDate = Shove._Convert.StrToDateTime(date.AddDays(1).ToString("yyyy-MM-dd") + " 12:00:00", DateTime.Now.ToString());
                        }
                        else
                        {
                            startDate = Shove._Convert.StrToDateTime(date.AddDays(-1).ToString("yyyy-MM-dd") + " 12:00:00", DateTime.Now.ToString());
                            endDate = Shove._Convert.StrToDateTime(date.ToString("yyyy-MM-dd") + " 12:00:00", DateTime.Now.ToString());
                        }

                        sb.AppendLine("<tr class=\"form_tr5\">")
                        .AppendLine("<td colspan=\"14\" height=\"24\"><a style=\"color: rgb(102, 0, 0); cursor: pointer;\" onclick=\"opendate('" + startDate.ToString("yyyy-MM-dd") + "')\"><span class=\"bold\">" + startDate.ToString("yyyy-MM-dd") + getWeekDayName(startDate.DayOfWeek) + "</span><span id=\"img_" + startDate.ToString("yyyy-MM-dd") + "\" alt=\"点击隐藏\" class=\"s_hidden\">点击隐藏 </span></td>")
                        .AppendLine("</tr><tbody id=\"d_" + startDate.ToString("yyyy-MM-dd") + "\">");
                    }
                    else if (date > endDate)
                    {
                        startDate = startDate.AddDays((date - endDate).Days + 1);
                        endDate = endDate.AddDays((date - endDate).Days + 1);

                        sb.AppendLine("</tbody><tr class=\"form_tr5\">")
                        .AppendLine("<td colspan=\"14\" height=\"24\"><a style=\"color: rgb(102, 0, 0); cursor: pointer;\" onclick=\"opendate('" + startDate.ToString("yyyy-MM-dd") + "')\"><span class=\"bold\">" + startDate.ToString("yyyy-MM-dd") + getWeekDayName(startDate.DayOfWeek) + "</span><span id=\"img_" + startDate.ToString("yyyy-MM-dd") + "\" alt=\"点击隐藏\" class=\"s_hidden\">点击隐藏 </span></td>")
                        .AppendLine("</tr><tbody id=\"d_" + startDate.ToString("yyyy-MM-dd") + "\">");
                    }

                    //开始构造赛事行
                    lineStyle = m % 2 == 0 ? "form_tr4" : "form_tr4_2";

                    sb.Append("<tr class='" + lineStyle + "' zid=\"" + dr["MatchID"].ToString() + "\" mid=\"" + dr["MatchID"].ToString() + "1\" pdate=\"" + saleEndDate.ToString("yyyy-MM-dd") + "\"  lg=\"" + dr["Game"].ToString() + "\" odds=" + dr["DifferMain1_5"].ToString() + "," + dr["DifferMain6_10"].ToString() + "," + dr["DifferMain11_15"].ToString() + "," + dr["DifferMain16_20"].ToString() + "," + dr["DifferMain21_25"].ToString() + "," + dr["DifferMain26"].ToString() + "," + dr["DifferGuest1_5"].ToString() + "," + dr["DifferGuest6_10"].ToString() + "," + dr["DifferGuest11_15"].ToString() + "," + dr["DifferGuest16_20"].ToString() + "," + dr["DifferGuest21_25"].ToString() + "," + dr["DifferGuest26"].ToString() + "\">")
                        .AppendLine("<td id=\"pltr_" + dr["MatchID"].ToString() + "1\" rowspan=\"2\"><input name=\"m" + dr["MatchID"].ToString() + "\" type=\"checkbox\" value=\"" + dr["MatchID"].ToString() + "\" checked=\"checked\"/>" + dr["MatchNumber"].ToString() + "</td>")
                        .Append("<td class=\"team1\" bgcolor=\"#FF0000\" rowspan=\"2\"><font color=\"#ffffff\">" + dr["Game"].ToString() + "</font></td>")
                        .AppendLine("<td rowspan=\"2\">" + saleEndDate.AddMinutes(time * -1).ToString("HH:mm") + "</td>")
                        .AppendLine("<td rowspan=\"2\">" + dr["GuestTeam"].ToString() + "</td>")
                        .AppendLine("<td rowspan=\"2\">" + dr["MainTeam"].ToString() + "</td>")
                        .AppendLine("<td>客胜</td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer; text-align:left\">&nbsp;<input type=\"checkbox\" value=\"1\" /><span>" + dr["DifferGuest1_5"].ToString() + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer; text-align:left\">&nbsp;<input type=\"checkbox\" value=\"3\" /><span>" + dr["DifferGuest6_10"].ToString() + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer; text-align:left\">&nbsp;<input type=\"checkbox\" value=\"5\" /><span>" + dr["DifferGuest11_15"].ToString() + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer; text-align:left\">&nbsp;<input type=\"checkbox\" value=\"7\" /><span>" + dr["DifferGuest16_20"].ToString() + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer; text-align:left\">&nbsp;<input type=\"checkbox\" value=\"9\" /><span>" + dr["DifferGuest21_25"].ToString() + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer; text-align:left\">&nbsp;<input type=\"checkbox\" value=\"11\" /><span>" + dr["DifferGuest26"].ToString() + "</span></td>")
                        .AppendLine("<td style=\"cursor:pointer\"><input type=\"checkbox\" name=\"ck" + dr["MatchID"].ToString() + "\" /></td>")
                        .AppendLine("</tr>")
                        .AppendLine("<tr class=\"form_tr4\" c=\"c\" id=\"pltr_" + dr["MatchID"].ToString() + "\" >")
                        .AppendLine("<td>主胜</td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer; text-align:left\">&nbsp;<input type=\"checkbox\" value=\"2\" /><span>" + dr["DifferMain1_5"].ToString() + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer; text-align:left\">&nbsp;<input type=\"checkbox\" value=\"4\" /><span>" + dr["DifferMain6_10"].ToString() + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer; text-align:left\">&nbsp;<input type=\"checkbox\" value=\"6\" /><span>" + dr["DifferMain11_15"].ToString() + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer; text-align:left\">&nbsp;<input type=\"checkbox\" value=\"8\" /><span>" + dr["DifferMain16_20"].ToString() + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer; text-align:left\">&nbsp;<input type=\"checkbox\" value=\"10\" /><span>" + dr["DifferMain21_25"].ToString() + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer; text-align:left\">&nbsp;<input type=\"checkbox\" value=\"12\" /><span>" + dr["DifferMain26"].ToString() + "</span></td>")
                        .AppendLine("<td style=\"cursor:pointer\"><input type=\"checkbox\" name=\"ck" + dr["MatchID"].ToString() + "\" /></td>")
                        .AppendLine("</tr>");

                    if (strlgList.IndexOf(dr["Game"].ToString()) < 0)
                    {
                        strlgList += "<li><input id=\"lg" + dr["Game"].ToString() + "\" m=\"" + dr["Game"].ToString() + "\" type=\"checkbox\" checked=\"checked\"><label for=\"lg" + dr["Game"].ToString() + "\">" + dr["Game"].ToString() + "</label></li>";
                    }

                    i++;
                    m++;

                }
            }
            catch (Exception ex)
            {
                new Log("TWZT").Write(this.GetType() + ex.Message);

                strHTML = "";
            }

            strlgList += "</ul>";
            sb.AppendLine("</tbody>");
            strHTML = sb.ToString();
        }
    }
コード例 #6
0
ファイル: Buy_ZJQS.aspx.cs プロジェクト: ichari/ichari
    //生成HTML
    private void createHTML(DataTable dt, ref string strHTML, ref int jzCount, ref string strlgList)
    {
        //初始化
        jzCount = 0;
        strHTML = "";
        strlgList = "<ul id=\"lgList\">";


        DAL.Tables.T_PlayTypes play = new DAL.Tables.T_PlayTypes();

        System.Data.DataTable table = play.Open("SystemEndAheadMinute", "id=7203", "");

        if (table == null)
        {
            return;
        }

        double time = 0;

        if (table.Rows.Count > 0)
        {
            time = double.Parse(table.Rows[0]["SystemEndAheadMinute"].ToString());
        }

        if (dt.Rows != null && dt.Rows.Count > 0)
        {
            //变量
            StringBuilder sb = new StringBuilder(); //构造HTML
            int i = 0;                              //未截止的赛事计数器
            int m = 0;                              //赛事计数器
            DateTime startDate = DateTime.Now;      //开始时间(分组的开始时间)
            DateTime endDate = DateTime.Now;        //结束时间(分组的结束时间)
            DateTime date = DateTime.Now;           //赛事开始时间
            DateTime saleEndDate = DateTime.Now;      //销售截止时间
            string lineStyle = "";                  //行样式
            string Day = "";
            string OldDay = "";

            try
            {
                foreach (DataRow dr in dt.Rows)
                {
                    //获取开赛时间及停售时间
                    date = Shove._Convert.StrToDateTime(dr["StopSellTime"].ToString(), DateTime.Now.ToString());
                    saleEndDate = Shove._Convert.StrToDateTime(dr["StopSellTime"].ToString(), DateTime.Now.ToString());
                    Day = dr["Day"].ToString();
                    
 					if (!OldDay.Equals(Day))
                    {
                        if (!string.IsNullOrEmpty(OldDay))
                        {
                            sb.Append("</tbody>");
                        }

                        sb.AppendLine("<tr class=\"form_tr5\">")
                        .AppendLine("<td colspan=\"16\" height=\"24\"><a style=\"color: rgb(102, 0, 0); cursor: pointer;\" onclick=\"opendate('" + Day.Insert(6, "-").Insert(4, "-") + "')\"><span class=\"bold\">" + Day.Insert(6, "-").Insert(4, "-") + getWeekDayName(Shove._Convert.StrToDateTime(Day.Insert(6, "-").Insert(4, "-"), DateTime.Now.ToString()).DayOfWeek) + "</span><span id=\"img_" + Day.Insert(6, "-").Insert(4, "-") + "\" alt=\"点击隐藏\" class=\"s_hidden\">点击隐藏 </span></td>")
                        .AppendLine("</tr><tbody id=\"d_" + Day.Insert(6, "-").Insert(4, "-") + "\">");
                    }

                    OldDay = Day;

                    //开始构造赛事行
                    lineStyle = m % 2 == 0 ? "form_tr4" : "form_tr4_2";

                    sb.Append("<tr class='" + lineStyle + "' zid=\"" + dr["MatchID"].ToString() + "\" mid=\"" + dr["MatchID"].ToString() + "\" pdate=\"" + OldDay.Insert(6, "-").Insert(4, "-") + "\" pname=\"" + (((int)startDate.DayOfWeek) == 0 ? 7 : ((int)startDate.DayOfWeek)).ToString() + dr["MatchNumber"].ToString().Substring(dr["MatchNumber"].ToString().Length - 3) + "\" lg=\"" + dr["Game"].ToString() + "\" odds=\"" + dr["in0"].ToString() + "," + dr["in1"].ToString() + "," + dr["in2"].ToString() + "," + dr["in3"].ToString() + "," + dr["in4"].ToString() + "," + dr["in5"].ToString() + "," + dr["in6"].ToString() + "," + dr["in7"].ToString() + "\">")
                        .AppendLine("<td><input name=\"m" + dr["MatchID"].ToString() + "\" type=\"checkbox\" value=\"" + dr["MatchID"].ToString() + "\" checked=\"checked\"/>" + dr["MatchNumber"].ToString() + "</td>")
                        .Append("<td class=\"team1\" bgcolor=\"" + dr["GameColor"].ToString() + "\"><font color=\"#ffffff\">" + dr["Game"].ToString() + "</font></td>")
                        .AppendLine("<td>" + saleEndDate.AddMinutes(time * -1).ToString("HH:mm") + "</td>")
                        .AppendLine("<td>" + dr["MainTeam"].ToString() + "</td>")
                        .AppendLine("<td>" + dr["GuestTeam"].ToString() + "</td>")
                        .AppendLine("<td>析 亚 欧</td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer\"><input type=\"checkbox\" value=\"0\" /><br /><span>" + Shove._Convert.StrToDouble(dr["in0"].ToString(), 0).ToString("F2") + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer\"><input type=\"checkbox\" value=\"1\" /><br /><span>" + Shove._Convert.StrToDouble(dr["in1"].ToString(), 0).ToString("F2") + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer\"><input type=\"checkbox\" value=\"2\" /><br /><span>" + Shove._Convert.StrToDouble(dr["in2"].ToString(), 0).ToString("F2") + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer\"><input type=\"checkbox\" value=\"3\" /><br /><span>" + Shove._Convert.StrToDouble(dr["in3"].ToString(), 0).ToString("F2") + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer\"><input type=\"checkbox\" value=\"4\" /><br /><span>" + Shove._Convert.StrToDouble(dr["in4"].ToString(), 0).ToString("F2") + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer\"><input type=\"checkbox\" value=\"5\" /><br /><span>" + Shove._Convert.StrToDouble(dr["in5"].ToString(), 0).ToString("F2") + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer\"><input type=\"checkbox\" value=\"6\" /><br /><span>" + Shove._Convert.StrToDouble(dr["in6"].ToString(), 0).ToString("F2") + "</span></td>")
                        .AppendLine("<td class=\"sp_bg\" style=\"cursor:pointer\"><input type=\"checkbox\" value=\"7\" /><br /><span>" + Shove._Convert.StrToDouble(dr["in7"].ToString(), 0).ToString("F2") + "</span></td>")
                        .AppendLine("<td style=\"cursor:pointer\"><input type=\"checkbox\" name=\"ck" + dr["MatchID"].ToString() + "\" /></td>")
                        .AppendLine("</tr>");



                    if (strlgList.IndexOf(dr["Game"].ToString()) < 0)
                    {
                        strlgList += "<li><input id=\"lg" + dr["Game"].ToString() + "\" m=\"" + dr["Game"].ToString() + "\" type=\"checkbox\" checked=\"checked\"><label for=\"lg" + dr["Game"].ToString() + "\">" + dr["Game"].ToString() + "</label></li>";
                    }

                    i++;
                    m++;

                }
            }
            catch (Exception ex)
            {
                new Log("TWZT").Write(this.GetType() + ex.Message);

                strHTML = "";
            }

            strlgList += "</ul>";
            sb.AppendLine("</tbody>");
            strHTML = sb.ToString();
            //noMatch.Value = i.ToString();

        }
    }
コード例 #7
0
ファイル: DataCache.cs プロジェクト: ichari/ichari
    static DataCache()
    {
        #region 银行

        DataTable dt = new DAL.Tables.T_Banks().Open("ID,Name", "", "");

        if (dt == null)
        {
            new Log("SNS").Write("PublicFunction 读取 T_Banks 出错");
        }

        if (dt != null)
        {
            foreach (DataRow dr in dt.Rows)
            {
                Banks[short.Parse(dr["ID"].ToString())] = dr["Name"].ToString();
            }
        }

        #endregion

        #region 城市

        dt = new DAL.Tables.T_Citys().Open("ID,Name", "", "");

        if (dt == null)
        {
            new Log("SNS").Write("PublicFunction 读取 T_Citys 出错");
        }

        if (dt != null)
        {
            foreach (DataRow dr in dt.Rows)
            {
                Citys[dr["Name"].ToString()] = int.Parse(dr["ID"].ToString());
            }
        }

        #endregion

        #region 安全问题

        SecurityQuestions[0] = "我婆婆或岳母的名字叫什么?";
        SecurityQuestions[1] = "我爸爸的出生地在哪里?";
        SecurityQuestions[2] = "我妈妈的出生地在哪里?";
        SecurityQuestions[3] = "我的小学校名是什么?";
        SecurityQuestions[4] = "我的中学校名是什么?";
        SecurityQuestions[5] = "我的一个好朋友的手机号码是什么?";
        SecurityQuestions[6] = "我的一个好朋友的爸爸名字是什么?";
        SecurityQuestions[7] = "自定义问题";

        #endregion

        #region 彩种玩法
        Lotteries[3] = "七星彩";
        Lotteries[5] = "双色球";
        Lotteries[6] = "福彩3D";
        Lotteries[28] = "重庆时时彩";
        Lotteries[29] = "时时乐";
        Lotteries[39] = "大乐透";
        Lotteries[58] = "东方6+1";
        Lotteries[59] = "15选5";
        Lotteries[13] = "七乐彩";
        Lotteries[9] = "22选5";
        Lotteries[14] = "29选7";
        Lotteries[63] = "排列3";
        Lotteries[64] = "排列5";
        Lotteries[19] = "篮彩";
        Lotteries[1] = "胜负彩";
        Lotteries[2] = "四场进球彩";
        Lotteries[15] = "六场半全场";
        Lotteries[61] = "江西时时彩";
        Lotteries[62] = "十一运夺金";
        Lotteries[65] = "31选7";
        Lotteries[41] = "浙江体彩6+1";
        Lotteries[70] = "11选5";   //江西11选5
        Lotteries[72] = "竞彩足彩";
        Lotteries[73] = "竞彩蓝彩";
        Lotteries[74] = "胜负彩";
        Lotteries[75] = "任九场";
        Lotteries[69] = "河南福彩22选5";
        Lotteries[68] = "快赢481";
        Lotteries[77] = "河南11选5";
        Lotteries[78] = "广东11选5";

        Dictionary<int, string> tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[301] = "单式";
        tempPlayTypes[302] = "复式";
        PlayTypes[3] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();
        tempPlayTypes[501] = "单式";
        tempPlayTypes[502] = "复式";
        tempPlayTypes[503] = "胆拖";

        PlayTypes[5] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[601] = "直选单式";
        tempPlayTypes[602] = "直选复式";
        tempPlayTypes[603] = "组选单式";
        tempPlayTypes[604] = "组6复式";
        tempPlayTypes[605] = "组3复式";
        tempPlayTypes[606] = "直选包点";
        tempPlayTypes[607] = "复选包点";

        PlayTypes[6] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[2801] = "单式";
        tempPlayTypes[2802] = "复式";
        tempPlayTypes[2803] = "组选";
        tempPlayTypes[2804] = "猜大小";
        tempPlayTypes[2805] = "五星通选单式";
        tempPlayTypes[2806] = "五星通选复式";
        tempPlayTypes[2807] = "二星组选单式";
        tempPlayTypes[2808] = "二星组选复式";
        tempPlayTypes[2809] = "二星组选分位";
        tempPlayTypes[2810] = "二星组选包点";
        tempPlayTypes[2811] = "二星组选包胆";
        tempPlayTypes[2812] = "三星包点";
        tempPlayTypes[2813] = "三星组3单式";
        tempPlayTypes[2814] = "三星组3复式";
        tempPlayTypes[2815] = "三星组6单式";
        tempPlayTypes[2816] = "三星组6复式";
        tempPlayTypes[2817] = "三星直选组合复式";
        tempPlayTypes[2818] = "三星组选包胆";
        tempPlayTypes[2819] = "三星组选包点";

        PlayTypes[61] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[2901] = "直选单式";
        tempPlayTypes[2902] = "直选复式";
        tempPlayTypes[2903] = "组选单式";
        tempPlayTypes[2904] = "组选6";
        tempPlayTypes[2905] = "组选3";
        tempPlayTypes[2906] = "直选";
        tempPlayTypes[2907] = "组选";
        tempPlayTypes[2908] = "前二单式";
        tempPlayTypes[2909] = "前二复式";
        tempPlayTypes[2910] = "后二单式";
        tempPlayTypes[2911] = "后二复式";
        tempPlayTypes[2912] = "前一单式";
        tempPlayTypes[2913] = "前一复式";
        tempPlayTypes[2914] = "后一单式";
        tempPlayTypes[2915] = "后一复式";

        PlayTypes[29] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[3901] = "单式";
        tempPlayTypes[3902] = "复式";
        tempPlayTypes[3903] = "追加单式";
        tempPlayTypes[3904] = "追加复式";
        tempPlayTypes[3905] = "12选2单式";
        tempPlayTypes[3906] = "12选2复式";

        PlayTypes[39] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[5801] = "单式";
        tempPlayTypes[5802] = "复式";

        PlayTypes[58] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[1301] = "单式";
        tempPlayTypes[1302] = "复式";

        PlayTypes[13] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[5901] = "单式";
        tempPlayTypes[5902] = "复式";

        PlayTypes[59] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[901] = "单式";
        tempPlayTypes[902] = "复式";

        PlayTypes[9] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[1401] = "单式";
        tempPlayTypes[1402] = "复式";

        PlayTypes[14] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[6301] = "排列3直选单式";
        tempPlayTypes[6302] = "排列3直选复式";
        tempPlayTypes[6303] = "排列3组选单式";
        tempPlayTypes[6304] = "排列3组选6复式";
        tempPlayTypes[6305] = "排列3组选3复式";
        tempPlayTypes[6306] = "排列3直选和值";
        tempPlayTypes[6307] = "排列3组选和值";

        PlayTypes[63] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[6401] = "排列5单式";
        tempPlayTypes[6402] = "排列5复式";

        PlayTypes[64] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[1901] = "单式";
        tempPlayTypes[1902] = "复式";

        PlayTypes[19] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[101] = "单式";
        tempPlayTypes[102] = "复式";
        tempPlayTypes[103] = "任九场单式";
        tempPlayTypes[104] = "任九场复式";

        PlayTypes[1] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[201] = "单式";
        tempPlayTypes[202] = "复式";

        PlayTypes[2] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[1501] = "单式";
        tempPlayTypes[1502] = "复式";

        PlayTypes[15] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[6201] = "任选一";
        tempPlayTypes[6202] = "任选二";
        tempPlayTypes[6203] = "任选三";
        tempPlayTypes[6204] = "任选四";
        tempPlayTypes[6205] = "任选五";
        tempPlayTypes[6206] = "任选六";
        tempPlayTypes[6207] = "任选七";
        tempPlayTypes[6208] = "任选八";
        tempPlayTypes[6209] = "前二直选";
        tempPlayTypes[6210] = "前三直选";
        tempPlayTypes[6211] = "前二组选";
        tempPlayTypes[6212] = "前三组选";

        PlayTypes[62] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[6501] = "单式";
        tempPlayTypes[3502] = "复式";

        PlayTypes[65] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[6501] = "单式";
        tempPlayTypes[3502] = "复式";

        PlayTypes[65] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[6101] = "单式";
        tempPlayTypes[6102] = "复式";
        tempPlayTypes[6103] = "组选";
        tempPlayTypes[6104] = "猜大小";
        tempPlayTypes[6105] = "五星通选单式";
        tempPlayTypes[6106] = "五星通选复式";
        tempPlayTypes[6107] = "二星组选单式";
        tempPlayTypes[6108] = "二星组选复式";
        tempPlayTypes[6109] = "二星组选分位";
        tempPlayTypes[6110] = "二星组选包点";
        tempPlayTypes[6111] = "二星组选包胆";
        tempPlayTypes[6112] = "二星直选包点";

        PlayTypes[61] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[7001] = "任选一";
        tempPlayTypes[7002] = "任选二";
        tempPlayTypes[7003] = "任选三";
        tempPlayTypes[7004] = "任选四";
        tempPlayTypes[7005] = "任选五";
        tempPlayTypes[7006] = "任选六";
        tempPlayTypes[7007] = "任选七";
        tempPlayTypes[7008] = "任选八";
        tempPlayTypes[7009] = "前二直选";
        tempPlayTypes[7010] = "前三直选";
        tempPlayTypes[7011] = "前二组选";
        tempPlayTypes[7012] = "前三组选";

        PlayTypes[70] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[4101] = "单式";
        tempPlayTypes[4102] = "复式";

        PlayTypes[41] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[7201] = "单式";
        tempPlayTypes[7202] = "复式";
        tempPlayTypes[7203] = "复式";
        tempPlayTypes[7204] = "复式";

        PlayTypes[72] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[7301] = "单式";
        tempPlayTypes[7302] = "复式";
        tempPlayTypes[7303] = "复式";
        tempPlayTypes[7304] = "复式";

        PlayTypes[73] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[7401] = "单式";
        tempPlayTypes[7402] = "复式";

        PlayTypes[74] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[7501] = "单式";
        tempPlayTypes[7502] = "复式";

        PlayTypes[75] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[6901] = "单式";
        tempPlayTypes[6902] = "复式";
        tempPlayTypes[6903] = "好运2";
        tempPlayTypes[6904] = "好运3";
        tempPlayTypes[6905] = "好运4";

        PlayTypes[69] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[6801] = "任选一";
        tempPlayTypes[6802] = "任选二";
        tempPlayTypes[6803] = "任选三";
        tempPlayTypes[6804] = "直选单式";
        tempPlayTypes[6805] = "直选复式";
        tempPlayTypes[6806] = "组选24单式";
        tempPlayTypes[6807] = "组选24复式";
        tempPlayTypes[6808] = "组选12单式";
        tempPlayTypes[6809] = "组选12复式";
        tempPlayTypes[6810] = "组选6单式";
        tempPlayTypes[6811] = "组选6复式";
        tempPlayTypes[6812] = "组选4单式";
        tempPlayTypes[6813] = "组选4复式";

        PlayTypes[68] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[7701] = "任选一";
        tempPlayTypes[7702] = "任选二";
        tempPlayTypes[7703] = "任选三";
        tempPlayTypes[7704] = "任选四";
        tempPlayTypes[7705] = "任选五";
        tempPlayTypes[7706] = "任选六";
        tempPlayTypes[7707] = "任选七";
        tempPlayTypes[7708] = "任选八";
        tempPlayTypes[7709] = "前二直选";
        tempPlayTypes[7710] = "前三直选";
        tempPlayTypes[7711] = "前二组选";
        tempPlayTypes[7712] = "前三组选";

        PlayTypes[77] = tempPlayTypes;

        tempPlayTypes = new Dictionary<int, string>();

        tempPlayTypes[7801] = "任选一";
        tempPlayTypes[7802] = "任选二";
        tempPlayTypes[7803] = "任选三";
        tempPlayTypes[7804] = "任选四";
        tempPlayTypes[7805] = "任选五";
        tempPlayTypes[7806] = "任选六";
        tempPlayTypes[7807] = "任选七";
        tempPlayTypes[7808] = "任选八";
        tempPlayTypes[7809] = "前二直选";
        tempPlayTypes[7810] = "前三直选";
        tempPlayTypes[7811] = "前二组选";
        tempPlayTypes[7812] = "前三组选";

        PlayTypes[78] = tempPlayTypes;
        #endregion

        #region
        LotterieBuyPage[3] = "Buy_QXC.aspx";
        LotterieBuyPage[5] = "Buy_SSQ.aspx";
        LotterieBuyPage[6] = "Buy_3D.aspx";
        LotterieBuyPage[28] = "Buy_CQSSC.aspx";
        LotterieBuyPage[29] = "Buy_SSL.aspx";
        LotterieBuyPage[39] = "Buy_CJDLT.aspx";
        LotterieBuyPage[58] = "Buy_DF6J1.aspx";
        LotterieBuyPage[59] = "Buy_15X5.aspx";
        LotterieBuyPage[13] = "Buy_QLC.aspx";
        LotterieBuyPage[9] = "Buy_22X5.aspx";
        LotterieBuyPage[14] = "Buy_31X7.aspx";
        LotterieBuyPage[63] = "Buy_PL3.aspx";
        LotterieBuyPage[64] = "Buy_PL5.aspx";
        LotterieBuyPage[19] = "Buy.aspx";
        LotterieBuyPage[1] = "Buy.aspx";
        LotterieBuyPage[2] = "Buy_JQC.aspx";
        LotterieBuyPage[15] = "Buy_LCBQC.aspx";
        LotterieBuyPage[61] = "Buy_SSC.aspx";
        LotterieBuyPage[62] = "Buy_SYYDJ.aspx";
        LotterieBuyPage[65] = "Buy_31X7.aspx";
        LotterieBuyPage[41] = "Buy_ZJTC6J1.aspx";
        LotterieBuyPage[70] = "Buy_JX11X5.aspx";   //江西11选5
        LotterieBuyPage[72] = "JCZC/Buy_SPF.aspx";
        LotterieBuyPage[73] = "JCLC/Buy_SF.aspx";
        LotterieBuyPage[74] = "Buy_SFC.aspx";
        LotterieBuyPage[75] = "Buy_SFC_9_D.aspx";
        LotterieBuyPage[69] = "Buy_HN22X5.aspx";
        LotterieBuyPage[68] = "Buy_KY481.aspx";
        LotterieBuyPage[77] = "Buy_HN11X5.aspx";
        LotterieBuyPage[78] = "Buy_GD11X5.aspx";
        #endregion

        #region 提前截止时间

        string strLottery = "";

        foreach (KeyValuePair<int, string> kvp in Lotteries)
        {
            strLottery += kvp.Key + ",";
        }

        strLottery = strLottery.Remove(strLottery.Length - 1, 1);

        DataTable dtPlayTypes = new DAL.Tables.T_PlayTypes().Open("LotteryID,SystemEndAheadMinute", "LotteryID in (" + strLottery + ")", "");

        foreach (DataRow dr in dtPlayTypes.Rows)
        {
            LotteryEndAheadMinute[int.Parse(dr["LotteryID"].ToString())] = int.Parse(dr["SystemEndAheadMinute"].ToString());
        }

        #endregion
    }
コード例 #8
0
    protected void ddlLotteries_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddlLotteries.SelectedValue == "-1")
        {
            ddlPlayTypes.Items.Clear();
            ddlPlayTypes.Items.Add(new ListItem("全部玩法", "-1"));

            return;
        }

        //玩法信息缓存 6000 秒
        string CacheKey = "dtPlayTypes_" + ddlLotteries.SelectedValue;
        DataTable dtPlayTypes = Shove._Web.Cache.GetCacheAsDataTable(CacheKey);

        if (dtPlayTypes == null)
        {
            dtPlayTypes = new DAL.Tables.T_PlayTypes().Open("", "LotteryID in (" + (_Site.UseLotteryList == "" ? "-1" : _Site.UseLotteryList) + ") and LotteryID = " + Shove._Convert.StrToInt(ddlLotteries.SelectedValue, -1).ToString(), "[ID]");

            if (dtPlayTypes == null || dtPlayTypes.Rows.Count < 1)
            {
                PF.GoError(ErrorNumber.NoData, "数据库繁忙,请重试", this.GetType().FullName + "(-85)");

                return;
            }

            Shove._Web.Cache.SetCache(CacheKey, dtPlayTypes, 6000);
        }

        if (dtPlayTypes == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName + "(-95)");

            return;
        }

        ddlPlayTypes.Items.Clear();
        ddlPlayTypes.Items.Add(new ListItem("全部玩法", "-1"));

        foreach (DataRow dr in dtPlayTypes.Rows)
        {
            ddlPlayTypes.Items.Add(new ListItem(dr["Name"].ToString(), dr["ID"].ToString()));
        }
    }
コード例 #9
0
ファイル: OpenInfoList.aspx.cs プロジェクト: ichari/ichari
    private void BindDataForPlayTypes(int LotteryID)
    {
        //玩法信息缓存 6000 秒
        string CacheKey = "dtPlayTypes_" + LotteryID.ToString();
        DataTable dtPlayTypes = Shove._Web.Cache.GetCacheAsDataTable(CacheKey);

        if (dtPlayTypes == null)
        {
            dtPlayTypes = new DAL.Tables.T_PlayTypes().Open("", "LotteryID in (" + (_Site.UseLotteryList == "" ? "-1" : _Site.UseLotteryList) + ") and LotteryID = " + LotteryID.ToString(), "[ID]");

            if (dtPlayTypes == null || dtPlayTypes.Rows.Count < 1)
            {
                PF.GoError(ErrorNumber.NoData, "数据库繁忙,请重试", this.GetType().FullName);

                return;
            }

            Shove._Web.Cache.SetCache(CacheKey, dtPlayTypes, 6000);
        }

        ddlPlayTypes.Items.Clear();
        ddlPlayTypes.Items.Add(new ListItem("全部玩法", "0"));

        foreach (DataRow dr in dtPlayTypes.Rows)
        {
            ListItem li = new ListItem(dr["Name"].ToString(), dr["ID"].ToString());

            ddlPlayTypes.Items.Add(li);
        }

        int PlayTypeID = Shove._Convert.StrToInt(Shove._Web.Utility.GetRequest("PlayTypeID"), 0);

        if (ddlPlayTypes.Items.Count > 0)
        {
            if (ddlPlayTypes.Items.FindByValue(PlayTypeID.ToString()) != null)
            {
                ddlPlayTypes.SelectedValue = PlayTypeID.ToString();
            }

            HidPlayType.Value = ddlPlayTypes.SelectedValue;

            BindDataForWinDetail(int.Parse(HidLotteryID.Value), int.Parse(HidIsuseID.Value));
        }
    }
コード例 #10
0
 private void BindDataForPlayTypes(int LotteryID)
 {
     string key = "dtPlayTypes_" + LotteryID.ToString();
     DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key);
     if (cacheAsDataTable == null)
     {
         cacheAsDataTable = new Tables.T_PlayTypes().Open("", "LotteryID in (" + ((base._Site.UseLotteryList == "") ? "-1" : base._Site.UseLotteryList) + ") and LotteryID = " + LotteryID.ToString(), "[ID]");
         if ((cacheAsDataTable == null) || (cacheAsDataTable.Rows.Count < 1))
         {
             PF.GoError(7, "数据库繁忙,请重试", base.GetType().FullName);
             return;
         }
         Shove._Web.Cache.SetCache(key, cacheAsDataTable, 0x1770);
     }
     this.ddlPlayTypes.Items.Clear();
     this.ddlPlayTypes.Items.Add(new ListItem("全部玩法", "0"));
     foreach (DataRow row in cacheAsDataTable.Rows)
     {
         ListItem item = new ListItem(row["Name"].ToString(), row["ID"].ToString());
         this.ddlPlayTypes.Items.Add(item);
     }
     int num = _Convert.StrToInt(Utility.GetRequest("PlayTypeID"), 0);
     if (this.ddlPlayTypes.Items.Count > 0)
     {
         if (this.ddlPlayTypes.Items.FindByValue(num.ToString()) != null)
         {
             this.ddlPlayTypes.SelectedValue = num.ToString();
         }
         this.HidPlayType.Value = this.ddlPlayTypes.SelectedValue;
         this.BindDataForWinDetail(int.Parse(this.HidLotteryID.Value), int.Parse(this.HidIsuseID.Value));
     }
 }
コード例 #11
0
 private void BindData()
 {
     DataTable table = new Views.V_SchemeSchedulesWithQuashed().Open("", "SiteID = " + base._Site.ID.ToString() + " and [id] = " + Shove._Web.Utility.FilteSqlInfusion(this.tbSchemeID.Text), "");
     if ((table == null) || (table.Rows.Count < 1))
     {
         PF.GoError(4, "数据库繁忙,请重试(-141)", base.GetType().BaseType.FullName);
     }
     else
     {
         DataTable table4;
         DataRow row = table.Rows[0];
         long num = _Convert.StrToLong(row["InitiateUserID"].ToString(), 0L);
         this.hfID.Value = num.ToString();
         this.LotteryName = row["LotteryName"].ToString();
         if (this.LotteryName == "江西时时彩")
         {
             this.LotteryName = this.LotteryName.Replace("江西", "");
         }
         this.Label3.Text = this.LotteryName + "<font class='red14'>" + row["IsuseName"].ToString() + "</font>期" + row["PlayTypeName"].ToString() + "认购方案";
         this.labTitle.Text = row["IsuseName"].ToString();
         this.labStartTime.Text = row["StartTime"].ToString();
         this.tbIsuseID.Text = row["IsuseID"].ToString();
         this.tbLotteryID.Text = row["LotteryID"].ToString();
         this.LotteryID = this.tbLotteryID.Text;
         this.PlayTypeID = _Convert.StrToInt(row["PlayTypeID"].ToString(), 0);
         this.labEndTime.Text = row["SystemEndTime"].ToString();
         if (_Convert.StrToInt(row["LotteryID"].ToString(), 0) == 0x2d)
         {
             string scheme = row["LotteryNumber"].ToString();
             string buyContent = "";
             string cnLocateWaysAndMultiples = "";
             Lottery lottery = new Lottery();
             if (lottery["45"].GetSchemeSplit(scheme, ref buyContent, ref cnLocateWaysAndMultiples))
             {
                 string str4 = buyContent.Split(new char[] { '|' })[0].ToString();
                 DataTable table2 = new Views.V_IsuseForZCDC().Open("DateTime", "[IsuseID]=" + this.tbIsuseID.Text + " and [No]=" + str4.Split(new char[] { '(' })[0], "");
                 if ((table2 == null) || (table2.Rows.Count == 0))
                 {
                     PF.GoError(4, "数据库繁忙,请重试(-184)", base.GetType().FullName);
                     return;
                 }
                 DataTable table3 = new Tables.T_PlayTypes().Open("SystemEndAheadMinute", "[ID] = " + row["PlayTypeID"], "");
                 this.labEndTime.Text = _Convert.StrToDateTime(table2.Rows[0][0].ToString(), DateTime.Now.ToString()).AddMinutes(_Convert.StrToDouble(table3.Rows[0][0].ToString(), 0.0)).ToString();
             }
         }
         this.labInitiateUser.Text = row["InitiateName"].ToString() + "&nbsp;&nbsp;【<A class=li3 href='../Web/Score.aspx?id=" + row["InitiateUserID"].ToString() + "&LotteryID=" + this.tbLotteryID.Text + "' target='_blank'>发起人历史战绩</A>】";
         short num2 = _Convert.StrToShort(row["QuashStatus"].ToString(), 0);
         Shove._Web.Cache.SetCache("All_QuashStatus" + this.SchemeID, num2, 0xe10);
         bool flag = _Convert.StrToBool(row["Buyed"].ToString(), false);
         int num3 = _Convert.StrToInt(row["Share"].ToString(), 0);
         int num4 = _Convert.StrToInt(row["BuyedShare"].ToString(), 0);
         double num5 = _Convert.StrToDouble(row["Money"].ToString(), 0.0);
         double num6 = _Convert.StrToDouble(row["AssureMoney"].ToString(), 0.0);
         double num7 = _Convert.StrToDouble(row["WinMoney"].ToString(), 0.0);
         short num8 = _Convert.StrToShort(row["SecrecyLevel"].ToString(), 0);
         bool flag2 = false;
         _Convert.StrToBool(row["isCanChat"].ToString(), false);
         if (num3 > 1)
         {
             this.trBonusScale.Visible = true;
             this.lbSchemeBonus.Text = ((_Convert.StrToDouble(row["SchemeBonusScale"].ToString(), 0.04) * 100.0)).ToString() + "%";
         }
         this.HidSchedule.Value = row["Schedule"].ToString();
         table4 = table4 = new Views.V_Isuses().Open("IsOpened, WinLotteryNumber,Code", "[id] = " + row["IsuseID"].ToString(), "");
         if (table4 == null)
         {
             PF.GoError(4, "数据库繁忙,请重试(-213)", base.GetType().FullName);
         }
         else if (table4.Rows.Count < 1)
         {
             PF.GoError(1, "系统错误(-220)", base.GetType().FullName);
         }
         else
         {
             flag2 = _Convert.StrToBool(table4.Rows[0]["IsOpened"].ToString(), true);
             this.lbWinNumber.Text = table4.Rows[0]["WinLotteryNumber"].ToString();
             this.ImageLogo.ImageUrl = "images/lottery/" + table4.Rows[0]["Code"].ToString().ToLower() + ".jpg";
             if (!base._Site.SiteOptions["Opt_FullSchemeCanQuash"].ToBoolean(false))
             {
                 this.btnQuashScheme.Visible = (((num2 == 0) && !flag) && ((num3 > num4) && (base._User != null))) && (num == base._User.ID);
             }
             else
             {
                 this.btnQuashScheme.Visible = (((num2 == 0) && !flag) && (base._User != null)) && (num == base._User.ID);
             }
             short num10 = _Convert.StrToShort(row["AtTopStatus"].ToString(), 0);
             bool flag4 = num10 != 0;
             if (num10 == 0)
             {
                 this.cbAtTopApplication.Visible = (((num2 == 0) && !flag) && ((num3 > num4) && (base._User != null))) && (num == base._User.ID);
                 this.cbAtTopApplication.Checked = flag4;
             }
             else
             {
                 this.labAtTop.Visible = true;
             }
             bool flag5 = false;
             bool flag6 = false;
             DateTime time5 = _Convert.StrToDateTime(this.labEndTime.Text, DateTime.Now.ToString());
             if (DateTime.Now >= time5)
             {
                 flag6 = true;
                 this.tbStop.Text = flag6.ToString();
             }
             if (num2 > 0)
             {
                 if (num2 == 2)
                 {
                     this.labState.Text = "已撤单(系统撤单)";
                 }
                 else
                 {
                     this.labState.Text = "已撤单";
                 }
             }
             else if (flag6)
             {
                 this.labState.Text = "已截止";
             }
             else if (flag)
             {
                 this.labState.Text = "<FONT color='red'>已成功</font>";
             }
             else if (num3 <= num4)
             {
                 this.labState.Text = "<FONT color='red'>已满员</font>";
             }
             else
             {
                 this.labState.Text = "<font color='red'>抢购中...</font>";
                 flag5 = true;
             }
             this.labMultiple.Text = row["Multiple"].ToString();
             if (((num8 == 1) && !flag6) && ((base._User == null) || (((base._User != null) && (num != base._User.ID)) && !base._User.isOwnedViewSchemeCompetence())))
             {
                 this.labLotteryNumber.Text = "投注内容已经被保密,将在本期投注截止后公开。";
             }
             else if (((num8 == 2) && !flag2) && ((base._User == null) || (((base._User != null) && (num != base._User.ID)) && !base._User.isOwnedViewSchemeCompetence())))
             {
                 this.labLotteryNumber.Text = "投注内容已经被保密,将在本期开奖后公开。";
             }
             else if ((num8 == 3) && ((base._User == null) || (((base._User != null) && (num != base._User.ID)) && !base._User.isOwnedViewSchemeCompetence())))
             {
                 this.labLotteryNumber.Text = "投注内容已经被保密。";
             }
             else
             {
                 int num11 = base._Site.SiteOptions["Opt_MaxShowLotteryNumberRows"].ToShort(0);
                 string str = "";
                 try
                 {
                     str = row["LotteryNumber"].ToString();
                 }
                 catch
                 {
                 }
                 if (_String.StringAt(str, '\n') < num11)
                 {
                     if (new Lottery.ZCDC().CheckPlayType(_Convert.StrToInt(row["PlayTypeID"].ToString(), -1)))
                     {
                         string vote = "";
                         DataTable table5 = PF.GetZCDCBuyContent(str, this.SchemeID, ref vote);
                         if (table5 == null)
                         {
                             PF.GoError(4, "数据访问错误(-358)", base.GetType().FullName);
                             return;
                         }
                         this.labMultiple.Text = vote;
                         this.rptScheme.DataSource = table5;
                         this.rptScheme.DataBind();
                         this.rptScheme.Visible = true;
                     }
                     else
                     {
                         this.labLotteryNumber.Text = _Convert.ToHtmlCode(str) + "&nbsp;";
                         if (flag2)
                         {
                             this.NumberDuiBi(this.labLotteryNumber.Text, this.lbWinNumber.Text, this.PlayTypeID);
                         }
                     }
                 }
                 else
                 {
                     this.linkDownloadScheme.Visible = true;
                     this.linkDownloadLotteryIdentifiers.Visible = (base._User == null) || ((base._User != null) && ((base._User.ID.ToString() == row["InitiateUserID"].ToString()) || base._User.Competences["Administrator"]));
                     this.linkDownloadLotteryIdentifiers.NavigateUrl = "../Web/DownLotteryIdentifiers.aspx?id=" + this.tbSchemeID.Text;
                     this.linkDownloadScheme.NavigateUrl = "../Web/DownloadSchemeFile.aspx?id=" + this.tbSchemeID.Text;
                 }
             }
             this.labSchemeNumber.Text = row["SchemeNumber"].ToString();
             this.labSchemeDateTime.Text = row["DateTime"].ToString();
             this.labSchemeMoney.Text = _Convert.StrToDouble(row["Money"].ToString(), 0.0).ToString("N");
             this.labSchemeTitle.Text = row["Title"].ToString() + "&nbsp;";
             this.labSchemeDescription.Text = row["Description"].ToString() + "&nbsp;";
             this.labSchemeADUrl.Text = Shove._Web.Utility.GetUrl() + "/Home/Room/Scheme.aspx?id=" + this.tbSchemeID.Text;
             object[] args = new object[] { this.labSchemeMoney.Text, num3, (num5 / ((double)num3)).ToString("N"), num4, ((num5 / ((double)num3)) * num4).ToString("N") };
             this.labSchemeDetail.Text = string.Format("此方案总金额 <FONT color='red'>{0}</font> 元,共 <FONT color='red'>{1}</font> 份,每份 <FONT color='red'>{2}</font> 元。<br />已认购 <FONT color='red'>{3}</font> 份(金额 <FONT color='red'>{4}</font> 元)", args) + (flag5 ? string.Format(",还有 <FONT color='red'>{0}</font> 份(金额 <FONT color='red'>{1}</font> 元)可以认购!", num3 - num4, ((num5 / ((double)num3)) * (num3 - num4)).ToString("N")) : "");
             if ((string.IsNullOrEmpty(row["LotteryNumber"].ToString()) && (((this.LotteryID == "1") || (this.LotteryID == "2")) || (this.LotteryID == "15"))) && (((num2 == 0) && !flag6) && !flag))
             {
                 this.labLotteryNumber.Text = "未上传";
                 if ((base._User != null) && (row["InitiateUserID"].ToString() == base._User.ID.ToString()))
                 {
                     this.lbUploadScheme.Visible = true;
                 }
             }
             if (flag)
             {
                 this.labLotteryCode.Text = "已出票,彩票标识:";
                 this.linkDownloadLotteryIdentifiers.Visible = true;
                 this.linkDownloadLotteryIdentifiers.NavigateUrl = "../Web/DownLotteryIdentifiers.aspx?id=" + this.tbSchemeID.Text;
             }
             else
             {
                 this.labLotteryCode.Text = "暂未出票";
                 this.linkDownloadLotteryIdentifiers.Visible = false;
             }
             this.labAssureMoney.Text = (num6 > 0.0) ? string.Format("发起人保底 <FONT color='red'>{0}</font> 份,<FONT color='red'>{1}</font> 元", Math.Round((double)(num6 / (num5 / ((double)num3))), 0).ToString(), num6.ToString("N")) : "未保底";
             if (num2 > 0)
             {
                 if (num2 == 2)
                 {
                     this.labWin.Text = "已撤单(系统撤单)";
                 }
                 else
                 {
                     this.labWin.Text = "已撤单";
                 }
             }
             else if (flag6)
             {
                 this.labWin.Text = string.Format("<FONT color='red'>{0}</font> 元", num7.ToString("N"));
                 string str7 = row["WinDescription"].ToString();
                 if (str7 != "")
                 {
                     this.labWin.Text = this.labWin.Text + "<br />" + str7;
                 }
                 else if (flag2)
                 {
                     this.labWin.Text = this.labWin.Text + "  未中奖";
                 }
                 else
                 {
                     this.labWin.Text = this.labWin.Text + "  <font color='red'>【注】</font>中奖结果在开奖后需要一段时间才能显示。";
                 }
             }
             else
             {
                 this.labWin.Text = "尚未截止";
             }
             if (flag2 && (((this.LotteryID == "1") || (this.LotteryID == "2")) || (this.LotteryID == "15")))
             {
                 this.labWin.Text = this.labWin.Text + "(命中<font color='red'>" + this.CompareLotteryNumberToWinNumber(row["LotteryNumber"].ToString(), row["WinLotteryNumber"].ToString()).ToString() + "</font>场)";
             }
             if (flag6)
             {
                 this.labCannotBuyTip.Text = "方案已截止,不能认购";
                 this.labCannotBuyTip.Visible = true;
                 this.pBuy.Visible = false;
                 this.btnOK.Enabled = false;
             }
             else if (num2 > 0)
             {
                 this.labCannotBuyTip.Text = "方案已撤单,不能认购";
                 this.labCannotBuyTip.Visible = true;
                 this.pBuy.Visible = false;
                 this.btnOK.Enabled = false;
             }
             else if (num4 >= num3)
             {
                 this.labCannotBuyTip.Text = "方案已满员,不能认购";
                 this.labCannotBuyTip.Visible = true;
                 this.pBuy.Visible = false;
                 this.btnOK.Enabled = false;
             }
             else
             {
                 this.labCannotBuyTip.Visible = false;
                 this.pBuy.Visible = true;
                 this.btnOK.Enabled = true;
             }
             this.labShare.Text = (num3 - num4).ToString();
             this.labShareMoney.Text = (num5 / ((double)num3)).ToString("N");
             this.BindDataForUserList();
             if (base._User != null)
             {
                 DataTable dt = new Views.V_BuyDetailsWithQuashedAll().Open("[id],[DateTime],[Money],Share,SchemeShare,BuyedShare,QuashStatus,Buyed,IsuseID,Code,Schedule,DetailMoney,isWhenInitiate, WinMoneyNoWIthTax", "SiteID = " + base._Site.ID.ToString() + " and SchemeID = " + Shove._Web.Utility.FilteSqlInfusion(this.tbSchemeID.Text) + " and [UserID] = " + base._User.ID.ToString(), "[id]");
                 if (dt == null)
                 {
                     PF.GoError(4, "数据库繁忙,请重试(-518)", base.GetType().FullName);
                 }
                 else
                 {
                     if (dt.Rows.Count == 0)
                     {
                         this.labMyBuy.Text = "此方案还没有我的认购记录。";
                         this.labMyBuy.Visible = true;
                         this.g.Visible = false;
                     }
                     else
                     {
                         this.labMyBuy.Visible = false;
                         this.g.Visible = true;
                         PF.DataGridBindData(this.g, dt);
                         if (flag2)
                         {
                             double num23 = 0.0;
                             for (int i = 0; i < dt.Rows.Count; i++)
                             {
                                 num23 += double.Parse(dt.Rows[i]["WinMoneyNoWIthTax"].ToString());
                             }
                             this.lbReward.Text = num23.ToString("N");
                         }
                     }
                     if (base._User.UserType < 2)
                     {
                         this.btnOK.Enabled = false;
                         this.btnQuashScheme.Enabled = false;
                     }
                 }
             }
         }
     }
 }
コード例 #12
0
 protected void g_ItemDataBound(object sender, DataGridItemEventArgs e)
 {
     if (((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) || (e.Item.ItemType == ListItemType.EditItem))
     {
         DataRowView dataItem = (DataRowView)e.Item.DataItem;
         DataRow row = dataItem.Row;
         e.Item.Cells[0].Text = _Convert.StrToDateTime(row["DateTime"].ToString(), DateTime.Now.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
         string key = "dtLotteriesUseLotteryList";
         DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key);
         if (cacheAsDataTable == null)
         {
             cacheAsDataTable = new Tables.T_Lotteries().Open("[ID], [Name], [Code]", "[ID] in(" + ((base._Site.UseLotteryList == "") ? "-1" : base._Site.UseLotteryList) + ")", "[ID]");
             if (cacheAsDataTable == null)
             {
                 PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName + "(-39)");
                 return;
             }
             Shove._Web.Cache.SetCache(key, cacheAsDataTable, 0x1770);
         }
         if (cacheAsDataTable == null)
         {
             PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName + "(-49)");
         }
         else
         {
             if (row["LotteryID"].ToString() == "-1")
             {
                 e.Item.Cells[2].Text = "全部彩种";
             }
             else
             {
                 e.Item.Cells[2].Text = cacheAsDataTable.Select("ID = " + row["LotteryID"].ToString())[0]["Name"].ToString();
             }
             key = "dtPlayTypes";
             DataTable table2 = Shove._Web.Cache.GetCacheAsDataTable(key);
             if (table2 == null)
             {
                 table2 = new Tables.T_PlayTypes().Open("", "LotteryID in (" + ((base._Site.UseLotteryList == "") ? "-1" : base._Site.UseLotteryList) + ")", "[ID]");
                 if ((table2 == null) || (table2.Rows.Count < 1))
                 {
                     PF.GoError(7, "数据库繁忙,请重试", base.GetType().FullName + "(-85)");
                     return;
                 }
                 Shove._Web.Cache.SetCache(key, table2, 0x1770);
             }
             if (table2 == null)
             {
                 PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName + "(-95)");
             }
             else
             {
                 if (row["PlayTypeID"].ToString() == "-1")
                 {
                     e.Item.Cells[3].Text = "全部玩法";
                 }
                 else
                 {
                     e.Item.Cells[3].Text = table2.Select("ID = " + row["PlayTypeID"].ToString())[0]["Name"].ToString();
                 }
                 e.Item.Cells[4].Text = _Convert.StrToDouble(row["MoneyStart"].ToString(), 0.0).ToString("N") + "&nbsp;至&nbsp;" + _Convert.StrToDouble(row["MoneyEnd"].ToString(), 0.0).ToString("N") + " 元";
                 e.Item.Cells[5].Text = (row["Type"].ToString() == "1") ? "用户定制" : "发起人指定";
             }
         }
     }
 }
コード例 #13
0
ファイル: LotteryTimeSet.aspx.cs プロジェクト: ichari/ichari
    protected void g_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
    {
        if (e.CommandName == "btnOK")
        {
            int ID = Shove._Convert.StrToInt(e.Item.Cells[5].Text, -1);
            int LotteryID = Shove._Convert.StrToInt(e.Item.Cells[6].Text, -1);

            int SystemEndAheadMinute = Shove._Convert.StrToInt(((TextBox)e.Item.Cells[2].FindControl("tbSystemEndAheadMinute")).Text, -1);
            int ChaseExecuteDeferMinute = Shove._Convert.StrToInt(((TextBox)e.Item.Cells[3].FindControl("tbChaseExecuteDeferMinute")).Text, -1);

            if (SystemEndAheadMinute < 2)
            {
                Shove._Web.JavaScript.Alert(this.Page, "提前截止分钟数最少必须 2 分钟,否则系统执行可能会因时间过短而不能及时处理,导致数据错误!");

                return;
            }

            string MaxChaseIsuse = e.Item.Cells[7].Text.Replace("&nbsp;", "").Trim();

            if (MaxChaseIsuse != "")
            {
                if (ChaseExecuteDeferMinute < 1)
                {
                    Shove._Web.JavaScript.Alert(this.Page, "追号任务自动执行必须在开始时间后最少 1 分钟!");

                    return;
                }
            }

            DAL.Tables.T_PlayTypes T_PlayTypes = new DAL.Tables.T_PlayTypes();

            T_PlayTypes.SystemEndAheadMinute.Value = SystemEndAheadMinute;

            if (T_PlayTypes.Update("[ID] = " + ID.ToString()) < 0)
            {
                PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_LotteryTimeSet");

                return;
            }

            if (MaxChaseIsuse != "")
            {
                if (MSSQL.ExecuteNonQuery("update T_Lotteries set ChaseExecuteDeferMinute = " + ChaseExecuteDeferMinute.ToString() + " where [ID] = " + LotteryID.ToString()) < 0)
                {
                    PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_LotteryTimeSet");

                    return;
                }
            }

            BindData();

            Shove._Web.JavaScript.Alert(this.Page, "保存成功。");

            return;
        }
    }
コード例 #14
0
    protected void g_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.EditItem)
        {
            DataRowView drv = (DataRowView)e.Item.DataItem;
            DataRow dr = drv.Row;

            //定制时间
            e.Item.Cells[0].Text = Shove._Convert.StrToDateTime(dr["DateTime"].ToString(), DateTime.Now.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
            //END

            //彩种
            string CacheKey = "dtLotteriesUseLotteryList";
            DataTable dtLotteries = Shove._Web.Cache.GetCacheAsDataTable(CacheKey);

            if (dtLotteries == null)
            {
                dtLotteries = new DAL.Tables.T_Lotteries().Open("[ID], [Name], [Code]", "[ID] in(" + (_Site.UseLotteryList == "" ? "-1" : _Site.UseLotteryList) + ")", "[ID]");

                if (dtLotteries == null)
                {
                    PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName + "(-39)");

                    return;
                }

                Shove._Web.Cache.SetCache(CacheKey, dtLotteries, 6000);
            }

            if (dtLotteries == null)
            {
                PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName + "(-49)");

                return;
            }

            if (dr["LotteryID"].ToString()=="-1")
            {
                e.Item.Cells[2].Text = "全部彩种";
            }
            else
            {
                e.Item.Cells[2].Text = dtLotteries.Select("ID = " + dr["LotteryID"].ToString())[0]["Name"].ToString();
            }
            //END

            //玩法
            //玩法信息缓存 6000 秒
            CacheKey = "dtPlayTypes";
            DataTable dtPlayTypes = Shove._Web.Cache.GetCacheAsDataTable(CacheKey);

            if (dtPlayTypes == null)
            {
                dtPlayTypes = new DAL.Tables.T_PlayTypes().Open("", "LotteryID in (" + (_Site.UseLotteryList == "" ? "-1" : _Site.UseLotteryList) + ")", "[ID]");

                if (dtPlayTypes == null || dtPlayTypes.Rows.Count < 1)
                {
                    PF.GoError(ErrorNumber.NoData, "数据库繁忙,请重试", this.GetType().FullName + "(-85)");

                    return;
                }

                Shove._Web.Cache.SetCache(CacheKey, dtPlayTypes, 6000);
            }

            if (dtPlayTypes == null)
            {
                PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName + "(-95)");

                return;
            }

            if (dr["PlayTypeID"].ToString() == "-1")
            {
                e.Item.Cells[3].Text = "全部玩法";
            }
            else
            {
                e.Item.Cells[3].Text = dtPlayTypes.Select("ID = " + dr["PlayTypeID"].ToString())[0]["Name"].ToString();
            }
            //END

            //认购金额
            e.Item.Cells[4].Text = Shove._Convert.StrToDouble(dr["MoneyStart"].ToString(), 0).ToString("N") + "&nbsp;至&nbsp;" + Shove._Convert.StrToDouble(dr["MoneyEnd"].ToString(), 0).ToString("N") + " 元";
            //END

            e.Item.Cells[5].Text = dr["Type"].ToString() == "1" ? "用户定制" : "发起人指定";
        }
    }
コード例 #15
0
ファイル: Buy_ZQBF.aspx.cs プロジェクト: ichari/ichari
    //生成HTML
    private void createHTML(DataTable dt, ref string strHTML, ref int jzCount, ref string strlgList)
    {
        //初始化
        jzCount = 0;
        strHTML = "";
        strlgList = "<ul id=\"lgList\">";

        DAL.Tables.T_PlayTypes play = new DAL.Tables.T_PlayTypes();

        System.Data.DataTable table = play.Open("SystemEndAheadMinute", "id=7202", "");

        if (table == null)
        {
            return;
        }

        double time = 0;

        if (table.Rows.Count > 0)
        {
            time = double.Parse(table.Rows[0]["SystemEndAheadMinute"].ToString());
        }

        if (dt.Rows != null && dt.Rows.Count > 0)
        {
            //变量
            StringBuilder sb = new StringBuilder(); //构造HTML
            int i = 0;                              //未截止的赛事计数器
            int m = 0;                              //赛事计数器
            DateTime startDate = DateTime.Now;      //开始时间(分组的开始时间)
            DateTime endDate = DateTime.Now;        //结束时间(分组的结束时间)
            DateTime date = DateTime.Now;           //赛事开始时间
            DateTime saleEndDate = DateTime.Now;      //销售截止时间
            string lineStyle = "";                  //行样式
            string Day = "";
            string OldDay = "";

            try
            {
                foreach (DataRow dr in dt.Rows)
                {
                    //获取开赛时间及停售时间
                    date = Shove._Convert.StrToDateTime(dr["StopSellTime"].ToString(), DateTime.Now.ToString());
                    saleEndDate = Shove._Convert.StrToDateTime(dr["StopSellTime"].ToString(), DateTime.Now.ToString());
                    Day = dr["Day"].ToString();

                    if (!OldDay.Equals(Day))
                    {
                        if (!string.IsNullOrEmpty(OldDay))
                        {
                            sb.Append("</tbody>");
                        }

                        sb.AppendLine("<tr class=\"form_tr5\">")
                        .AppendLine("<td colspan=\"16\" height=\"24\"><a style=\"color: rgb(102, 0, 0); cursor: pointer;\" onclick=\"opendate('" + Day.Insert(6, "-").Insert(4, "-") + "')\"><span class=\"bold\">" + Day.Insert(6, "-").Insert(4, "-") + getWeekDayName(Shove._Convert.StrToDateTime(Day.Insert(6, "-").Insert(4, "-"), DateTime.Now.ToString()).DayOfWeek) + "</span><span id=\"img_" + Day.Insert(6, "-").Insert(4, "-") + "\" alt=\"点击隐藏\" class=\"s_hidden\">点击隐藏 </span></td>")
                        .AppendLine("</tr><tbody id=\"d_" + Day.Insert(6, "-").Insert(4, "-") + "\">");
                    }

                    OldDay = Day;

                    //开始构造赛事行
                    lineStyle = m % 2 == 0 ? "form_tr4" : "form_tr4_2";

                    sb.Append("<tr class='" + lineStyle + "' zid=\"" + dr["MatchID"].ToString() + "\" mid=\"" + dr["MatchID"].ToString() + "\" pdate=\"" + OldDay.Insert(6, "-").Insert(4, "-") + "\" pname=\"" + (((int)startDate.DayOfWeek) == 0 ? 7 : ((int)startDate.DayOfWeek)).ToString() + dr["MatchNumber"].ToString().Substring(dr["MatchNumber"].ToString().Length - 3) + "\" lg=\"" + dr["Game"].ToString() + "\" odds=\"" + dr["Sother"].ToString() + "," + dr["S10"].ToString() + "," + dr["S20"].ToString() + "," + dr["S21"].ToString() + "," + dr["S30"].ToString() + "," + dr["S31"].ToString() + "," + dr["S32"].ToString() + "," + dr["S40"].ToString() + "," + dr["S41"].ToString() + "," + dr["S42"].ToString() + "," + dr["S50"].ToString() + "," + dr["S51"].ToString() + "," + dr["S52"].ToString() + "," + dr["Pother"].ToString() + "," + dr["P00"].ToString() + "," + dr["P11"].ToString() + "," + dr["P22"].ToString() + "," + dr["P33"].ToString() + "," + dr["Fother"].ToString() + "," + dr["F01"].ToString() + "," + dr["F02"].ToString() + "," + dr["F12"].ToString() + "," + dr["F03"].ToString() + "," + dr["F13"].ToString() + "," + dr["F23"].ToString() + "," + dr["F04"].ToString() + "," + dr["F14"].ToString() + "," + dr["F24"].ToString() + "," + dr["F05"].ToString() + "," + dr["F15"].ToString() + "," + dr["F25"].ToString() + "\">")
                         .AppendLine("<td><input name=\"m" + dr["MatchID"].ToString() + "\" type=\"checkbox\" value=\"" + dr["MatchID"].ToString() + "\" checked=\"checked\"/>" + dr["MatchNumber"].ToString() + "</td>")
                        .Append("<td class=\"team1\" bgcolor=\"" + dr["GameColor"].ToString() + "\"><font color=\"#FFFFFF\">" + dr["Game"].ToString() + "</font></td>")
                        .AppendLine("<td>" + saleEndDate.AddMinutes(time * -1).ToString("MM-dd HH:mm") + "</td>")
                        .AppendLine("<td>" + dr["MainTeam"].ToString() + "</td>")
                        .AppendLine("<td>" + dr["GuestTeam"].ToString() + "</td>")
                        .AppendLine("<td class=\"odds\">" + Shove._Convert.StrToDouble(dr["EuropeSSP"].ToString(), 0).ToString("F2") + "</td>")
                        .AppendLine("<td class=\"odds\">" + Shove._Convert.StrToDouble(dr["EuropePSP"].ToString(), 0).ToString("F2") + "</td>")
                        .AppendLine("<td class=\"odds\">" + Shove._Convert.StrToDouble(dr["EuropeFSP"].ToString(), 0).ToString("F2") + "</td>")
                        .AppendLine("<td>析 亚 欧</td>");

                    if (m == 0)
                    {
                        sb.Append("<td class=\"sp\"><a onclick=\"openclose(" + dr["MatchID"].ToString() + ")\"><img src=\"images/btn_sp.gif\" alt=\"隐藏选项\" id=\"img_" + dr["MatchID"].ToString() + "\" /></a></td>")
                            .Append("</tr>")
                            .Append("<tr id=\"pltr_" + dr["MatchID"].ToString() + "\">");
                    }
                    else
                    {
                        sb.Append("<td class=\"sp\"><a onclick=\"openclose(" + dr["MatchID"].ToString() + ")\"><img src=\"images/btn_spadd.gif\" alt=\"展开选项\" id=\"img_" + dr["MatchID"].ToString() + "\" /></a></td>")
                            .Append("</tr>")
                            .Append("<tr id=\"pltr_" + dr["MatchID"].ToString() + "\" style=\"display:none;\">");
                    }

                    sb.Append("<td colspan=\"11\">")
                    .Append("<div class=\"sp_box\">")
                    .Append("<table class=\"sp_table\" width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\">")
                    .Append("<tbody>")
                    .Append("<tr class=\"sp_3\">")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"3A\" /><strong>胜其它</strong><br /><span>" + Shove._Convert.StrToDouble(dr["Sother"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"10\" /><strong>1:0</strong><br /><span>" + Shove._Convert.StrToDouble(dr["S10"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"20\" /><strong>2:0</strong><br /><span>" + Shove._Convert.StrToDouble(dr["S20"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"21\" /><strong>2:1</strong><br /><span>" + Shove._Convert.StrToDouble(dr["S21"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"30\" /><strong>3:0</strong><br /><span>" + Shove._Convert.StrToDouble(dr["S30"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"31\" /><strong>3:1</strong><br /><span>" + Shove._Convert.StrToDouble(dr["S31"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"32\" /><strong>3:2</strong><br /><span>" + Shove._Convert.StrToDouble(dr["S32"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"40\" /><strong>4:0</strong><br /><span>" + Shove._Convert.StrToDouble(dr["S40"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"41\" /><strong>4:1</strong><br /><span>" + Shove._Convert.StrToDouble(dr["S41"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"42\" /><strong>4:2</strong><br /><span>" + Shove._Convert.StrToDouble(dr["S42"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"50\" /><strong>5:0</strong><br /><span>" + Shove._Convert.StrToDouble(dr["S50"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"51\" /><strong>5:1</strong><br /><span>" + Shove._Convert.StrToDouble(dr["S51"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"52\" /><strong>5:2</strong><br /><span>" + Shove._Convert.StrToDouble(dr["S52"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\"><input type=\"checkbox\" name=\"ck" + dr["MatchID"].ToString() + "\" />包</td></tr><tr class=\"sp_1\">")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"1A\" /><strong>平其它</strong><br /><span>" + Shove._Convert.StrToDouble(dr["Pother"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"00\" /><strong>0:0</strong><br /><span>" + Shove._Convert.StrToDouble(dr["P00"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"11\" /><strong>1:1</strong><br /><span>" + Shove._Convert.StrToDouble(dr["P11"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"22\" /><strong>2:2</strong><br /><span>" + Shove._Convert.StrToDouble(dr["P22"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"33\" /><strong>3:3</strong><br /><span>" + Shove._Convert.StrToDouble(dr["P33"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td colspan=\"8\">&nbsp;</td><td align=\"center\" style=\"cursor:pointer\"><input type=\"checkbox\" name=\"ck" + dr["MatchID"].ToString() + "\" />包</td>")
                    .Append("</tr>")
                    .Append("<tr class=\"sp_0\">")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"0A\" /><strong>负其它</strong><br /><span>" + Shove._Convert.StrToDouble(dr["Fother"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"01\" /><strong>0:1</strong><br /><span>" + Shove._Convert.StrToDouble(dr["F01"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"02\" /><strong>0:2</strong><br /><span>" + Shove._Convert.StrToDouble(dr["F02"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"12\" /><strong>1:2</strong><br /><span>" + Shove._Convert.StrToDouble(dr["F12"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"03\" /><strong>0:3</strong><br /><span>" + Shove._Convert.StrToDouble(dr["F03"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"13\" /><strong>1:3</strong><br /><span>" + Shove._Convert.StrToDouble(dr["F13"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"23\" /><strong>2:3</strong><br /><span>" + Shove._Convert.StrToDouble(dr["F23"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"04\" /><strong>0:4</strong><br /><span>" + Shove._Convert.StrToDouble(dr["F04"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"14\" /><strong>1:4</strong><br /><span>" + Shove._Convert.StrToDouble(dr["F14"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"24\" /><strong>2:4</strong><br /><span>" + Shove._Convert.StrToDouble(dr["F24"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"05\" /><strong>0:5</strong><br /><span>" + Shove._Convert.StrToDouble(dr["F05"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"15\" /><strong>1:5</strong><br /><span>" + Shove._Convert.StrToDouble(dr["F15"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\" ><input type=\"checkbox\" value=\"25\" /><strong>2:5</strong><br /><span>" + Shove._Convert.StrToDouble(dr["F25"].ToString(), 0).ToString("F2") + "</span></td>")
                    .Append("<td align=\"center\" style=\"cursor:pointer\"><input type=\"checkbox\" name=\"ck" + dr["MatchID"].ToString() + "\" />包</td>")
                    .Append("</tr>")
                    .Append("</tbody>")
                    .Append("</table>")
                    .Append("</div>")
                    .Append("</td>")
                    .Append("</tr>");

                    if (strlgList.IndexOf(dr["Game"].ToString()) < 0)
                    {
                        strlgList += "<li><input id=\"lg" + dr["Game"].ToString() + "\" m=\"" + dr["Game"].ToString() + "\" type=\"checkbox\" checked=\"checked\"><label for=\"lg" + dr["Game"].ToString() + "\">" + dr["Game"].ToString() + "</label></li>";
                    }

                    i++;
                    m++;
                }
            }
            catch (Exception ex)
            {
                new Log("TWZT").Write(this.GetType() + ex.Message);

                strHTML = "";
            }

            strlgList += "</ul>";
            sb.AppendLine("</tbody>");
            strHTML = sb.ToString();
            //noMatch.Value = i.ToString();

        }
    }
コード例 #16
0
 public DataSet BettingWithin(long AgentID, DateTime TimeStamp, string Sign, int LotteryID, string IssueName, int PlayTypeID, string SchemeNumber, string LotteryNumber, double Amount, int Multiple, int Share, string InitiateName, string InitiateAlipayName, string InitiateAlipayID, string InitiateRealityName, string InitiateIDCard, string InitiateTelephone, string InitiateMobile, string InitiateEmail, double InitiateBonusScale, double InitiateBonusLimitLower, double InitiateBonusLimitUpper, string dtJoinDetailXml, string Op_Type)
 {
     new Log(@"Agent\ElectronTicket").Write(string.Format("Method=BettingWithin\tAgentID={0}\tTimeStamp={1}\tSign={2}\tLotteryID={3}\tIssueName={4}\tPlayTypeID={5}\tSchemeNumber={6}\tAmount={7}\tMultiple={8}\tShare={9}\tOp_Type={10}", new object[] { AgentID, TimeStamp, Sign, LotteryID, IssueName, PlayTypeID, SchemeNumber, Amount, Multiple, Share, Op_Type }));
     DataSet ds = new DataSet();
     string useLotteryList = "";
     double balance = 0.0;
     short state = 0;
     if (Op_Type != "0001")
     {
         this.BuildReturnDataSetForError(-101, "不是有效的内部参数调用", ref ds);
         new Log(@"Agent\ElectronTicket").Write("不是有效的内部参数调用");
         return ds;
     }
     DataTable table = _Convert.XMLToDataTable(dtJoinDetailXml);
     if ((((string.IsNullOrEmpty(SchemeNumber) || (Amount <= 0.0)) || ((Multiple < 1) || (Share < 1))) || ((string.IsNullOrEmpty(InitiateName) || string.IsNullOrEmpty(InitiateAlipayName)) || (string.IsNullOrEmpty(InitiateAlipayID) || string.IsNullOrEmpty(InitiateRealityName)))) || ((string.IsNullOrEmpty(InitiateIDCard) || string.IsNullOrEmpty(InitiateMobile)) || ((table == null) || (table.Rows.Count < 1))))
     {
         this.BuildReturnDataSetForError(-22, "参数不符合规定或者未提供", ref ds);
         new Log(@"Agent\ElectronTicket").Write("参数不符合规定或者未提供");
         return ds;
     }
     if (this.Valid(ref ds, ref useLotteryList, ref balance, ref state, AgentID, TimeStamp, Sign, new object[] {
         LotteryID, IssueName, PlayTypeID, SchemeNumber, LotteryNumber, Amount, Multiple, Share, InitiateName, InitiateAlipayName, InitiateAlipayID, InitiateRealityName, InitiateIDCard, InitiateTelephone, InitiateMobile, InitiateEmail,
         InitiateBonusScale, InitiateBonusLimitLower, InitiateBonusLimitUpper, dtJoinDetailXml
      }) >= 0)
     {
         if (state != 1)
         {
             this.BuildReturnDataSetForError(-1, "代理商ID错误", ref ds);
             new Log(@"Agent\ElectronTicket").Write("代理商ID错误");
             return ds;
         }
         if (balance <= 0.0)
         {
             this.BuildReturnDataSetForError(-7, "投注金额超限", ref ds);
             new Log(@"Agent\ElectronTicket").Write("投注金额超限");
             return ds;
         }
         if (this.ValidLotteryID(ref ds, useLotteryList, LotteryID) < 0)
         {
             return ds;
         }
         DataTable table2 = new Tables.T_Isuses().Open("[ID], StartTime, EndTime, State", "LotteryID = " + LotteryID.ToString() + " and [Name] = '" + Utility.FilteSqlInfusion(IssueName) + "'", "");
         if ((table2 == null) || (table2.Rows.Count < 1))
         {
             this.BuildReturnDataSetForError(-4, "奖期不存在", ref ds);
             new Log(@"Agent\ElectronTicket").Write("奖期不存在");
             return ds;
         }
         long isuseID = _Convert.StrToLong(table2.Rows[0]["ID"].ToString(), -1L);
         DateTime time = _Convert.StrToDateTime(table2.Rows[0]["StartTime"].ToString(), "1980-1-1 0:0:0");
         DateTime time2 = _Convert.StrToDateTime(table2.Rows[0]["EndTime"].ToString(), "1980-1-1 0:0:0");
         short num4 = _Convert.StrToShort(table2.Rows[0]["State"].ToString(), -1);
         if (isuseID < 0L)
         {
             this.BuildReturnDataSetForError(-4, "奖期不存在", ref ds);
             new Log(@"Agent\ElectronTicket").Write("奖期不存在");
             return ds;
         }
         DateTime now = DateTime.Now;
         if (now < time)
         {
             this.BuildReturnDataSetForError(-5, "奖期未开启", ref ds);
             new Log(@"Agent\ElectronTicket").Write("奖期未开启");
             return ds;
         }
         if ((now >= time2) || (num4 > 1))
         {
             this.BuildReturnDataSetForError(-6, "奖期已截止投注", ref ds);
             new Log(@"Agent\ElectronTicket").Write(string.Concat(new object[] { "奖期已截止投注|", now.ToString(), "|", num4 }));
             return ds;
         }
         DataTable table3 = new Tables.T_PlayTypes().Open("Price, MaxMultiple", "LotteryID = " + LotteryID.ToString() + " and [ID] = " + PlayTypeID.ToString(), "");
         if (table3 == null)
         {
             this.BuildReturnDataSetForError(-9999, "未知错误", ref ds);
             new Log(@"Agent\ElectronTicket").Write("未知错误");
             return ds;
         }
         if (table3.Rows.Count < 1)
         {
             this.BuildReturnDataSetForError(-21, "玩法ID不存在", ref ds);
             new Log(@"Agent\ElectronTicket").Write("玩法ID不存在");
             return ds;
         }
         double num5 = _Convert.StrToDouble(table3.Rows[0]["Price"].ToString(), 2.0);
         int num6 = _Convert.StrToInt(table3.Rows[0]["MaxMultiple"].ToString(), 200);
         if ((PlayTypeID == 0xf3f) || (PlayTypeID == 0xf40))
         {
             num5 = 3.0;
         }
         if ((Multiple < 1) || (Multiple > num6))
         {
             this.BuildReturnDataSetForError(-8, "倍数超限", ref ds);
             new Log(@"Agent\ElectronTicket").Write("倍数超限");
             return ds;
         }
         if (new Tables.T_ElectronTicketAgentSchemes().GetCount("AgentID = " + AgentID.ToString() + " and SchemeNumber = '" + Utility.FilteSqlInfusion(SchemeNumber) + "'") > 0L)
         {
             this.BuildReturnDataSetForError(-15, "方案号重复", ref ds);
             new Log(@"Agent\ElectronTicket").Write("方案号重复");
             return ds;
         }
         if (((InitiateBonusScale < 0.0) || (InitiateBonusScale > 1.0)) || (InitiateBonusLimitLower < 0.0))
         {
             this.BuildReturnDataSetForError(-10, "佣金设置不符合要求", ref ds);
             new Log(@"Agent\ElectronTicket").Write("佣金设置不符合要求");
             return ds;
         }
         int num = 0;
         LotteryNumber = this.GetLotteryNumber(LotteryID, PlayTypeID, UnEncryptString(LotteryNumber), ref num);
         if (num == 0)
         {
             this.BuildReturnDataSetForError(-17, "投注号码格式错误", ref ds);
             new Log(@"Agent\ElectronTicket").Write("投注号码格式错误");
             return ds;
         }
         if (((num * Multiple) * num5) != Amount)
         {
             this.BuildReturnDataSetForError(-9, "投注金额与票面金额不符", ref ds);
             new Log(@"Agent\ElectronTicket").Write("投注金额与票面金额不符");
             return ds;
         }
         if ((Share > 1) && (table.Rows.Count < 2))
         {
             this.BuildReturnDataSetForError(-11, "方案份数(金额)与购买明细份数(金额)不符合", ref ds);
             new Log(@"Agent\ElectronTicket").Write("方案份数(金额)与购买明细份数(金额)不符合");
             return ds;
         }
         int num8 = 0;
         double num9 = 0.0;
         string detailXML = "<Details>";
         int num10 = 0;
         foreach (DataRow row in table.Rows)
         {
             string str3 = "";
             string str4 = "";
             string str5 = "";
             string str6 = "";
             string str7 = "";
             string str8 = "";
             string str9 = "";
             int num11 = -1;
             double num12 = -1.0;
             try
             {
                 str3 = row["Name"].ToString();
                 str4 = row["AlipayName"].ToString();
                 str5 = row["RealityName"].ToString();
                 str6 = row["IDCard"].ToString();
                 str7 = row["Telephone"].ToString();
                 str8 = row["Mobile"].ToString();
                 str9 = row["Email"].ToString();
                 num11 = _Convert.StrToInt(row["Share"].ToString(), -1);
                 num12 = _Convert.StrToDouble(row["Amount"].ToString(), -1.0);
             }
             catch
             {
                 this.BuildReturnDataSetForError(-23, "购买明细格式错误", ref ds);
                 new Log(@"Agent\ElectronTicket").Write("购买明细格式错误");
                 return ds;
             }
             if (((string.IsNullOrEmpty(str3) || string.IsNullOrEmpty(str4)) || (string.IsNullOrEmpty(str5) || string.IsNullOrEmpty(str6))) || ((string.IsNullOrEmpty(str7) || (num11 < 1)) || (num12 < 0.0)))
             {
                 this.BuildReturnDataSetForError(-23, "购买明细格式错误", ref ds);
                 new Log(@"Agent\ElectronTicket").Write("购买明细格式错误");
                 return ds;
             }
             num8 += num11;
             num9 += num12;
             detailXML = detailXML + string.Format("<Detail No=\"{0}\" Name=\"{1}\" AlipayName=\"{2}\" RealityName=\"{3}\" IDCard=\"{4}\" Telephone=\"{5}\" Mobile=\"{6}\" Email=\"{7}\" Share=\"{8}\" Amount=\"{9}\" />", new object[] { num10++, str3, str4, str5, str6, str7, str8, str9, num11, num12 });
         }
         detailXML = detailXML + "</Details>";
         if ((num8 != Share) || (num9 != Amount))
         {
             this.BuildReturnDataSetForError(-11, "方案份数(金额)与购买明细份数(金额)不符合", ref ds);
             new Log(@"Agent\ElectronTicket").Write("方案份数(金额)与购买明细份数(金额)不符合");
             return ds;
         }
         if (balance < Amount)
         {
             this.BuildReturnDataSetForError(-7, "投注金额超限", ref ds);
             new Log(@"Agent\ElectronTicket").Write("投注金额超限");
             return ds;
         }
         long schemeID = 0L;
         string returnDescription = "";
         if (Procedures.P_ElectronTicketAgentSchemeAdd(AgentID, SchemeNumber, LotteryID, PlayTypeID, isuseID, LotteryNumber, Amount, Multiple, Share, InitiateName, InitiateAlipayName, InitiateAlipayID, InitiateRealityName, InitiateIDCard, InitiateTelephone, InitiateMobile, InitiateEmail, InitiateBonusScale, InitiateBonusLimitLower, InitiateBonusLimitUpper, detailXML, ref schemeID, ref returnDescription) < 0)
         {
             this.BuildReturnDataSetForError(-9999, "未知错误", ref ds);
             new Log(@"Agent\ElectronTicket").Write("未知错误");
             return ds;
         }
         if (schemeID < 0L)
         {
             this.BuildReturnDataSetForError((int)schemeID, returnDescription, ref ds);
             return ds;
         }
         this.BuildReturnDataSet(0L, ref ds);
         ds.Tables.Add(new DataTable());
     }
     return ds;
 }
コード例 #17
0
ファイル: Client_DX.aspx.cs プロジェクト: ichari/ichari
    /// <summary>
    /// 得到截止时间
    /// </summary>
    /// <param name="date"></param>
    /// <param name="id"></param>
    /// <returns></returns>
    public static string GetStopSelltime(string date)
    {
        double time = 0;
        DAL.Tables.T_PlayTypes play = new DAL.Tables.T_PlayTypes();
        DataTable table = play.Open("SystemEndAheadMinute", "id=7302", "");

        if (table == null)
        {
            return date;
        }

        if (table.Rows.Count > 0)
        {
            time = double.Parse(table.Rows[0]["SystemEndAheadMinute"].ToString());
            date = Shove._Convert.StrToDateTime(date, DateTime.Now.ToString()).AddMinutes(-time).ToString("yy-MM-dd HH:mm");
        }

        return date;
    }
コード例 #18
0
ファイル: Scheme.aspx.cs プロジェクト: ichari/ichari
    public string GetScriptResTable(string val)
    {
        try
        {
            val = val.Trim();

            int Istart, Ilen;

            GetStrScope(val, "[", "]", out Istart, out Ilen);

            string matchlist = val.Substring(Istart + 1, Ilen - 1);

            string type = val.Split(';')[0];

            if (type.Substring(0, 2) != "72" && type.Substring(0, 2) != "73")
            {
                return val;
            }

            string Matchids = "";
            string MatchListDan = "";

            if (val.Split(';').Length == 4)
            {
                MatchListDan = matchlist.Split(']')[0];

                foreach (string match in MatchListDan.Split('|'))
                {
                    Matchids += match.Split('(')[0] + ",";
                }
            }

            foreach (string match in matchlist.Split('|'))
            {
                Matchids += match.Split('(')[0] + ",";
            }

            if (Matchids.EndsWith(","))
            {
                Matchids = Matchids.Substring(0, Matchids.Length - 1);
            }

            DataTable table = null;

            if (type.Substring(0, 2) == "72")
            {
                table = new DAL.Tables.T_Match().Open("StopSellingTime", "id in (" + Matchids + ")", " StopSellingTime ");
            }
            else
            {
                table = new DAL.Tables.T_MatchBasket().Open("StopSellingTime", "id in (" + Matchids + ")", " StopSellingTime");
            }

            if (table.Rows.Count < 1)
            {
                return "";
            }

            DataTable dtPlayType = new DAL.Tables.T_PlayTypes().Open("SystemEndAheadMinute", "ID=" + type.Substring(0, 4), "");

            if (dtPlayType == null)
            {
                return "";
            }

            if (dtPlayType.Rows.Count < 1)
            {
                return "";
            }

            return Shove._Convert.StrToDateTime(table.Rows[0]["StopSellingTime"].ToString(), DateTime.Now.AddDays(-1).ToString()).AddMinutes(Shove._Convert.StrToInt(dtPlayType.Rows[0]["SystemEndAheadMinute"].ToString(), 0) * -1).ToString();
        }
        catch {
            return "";
        }
    }