예제 #1
0
    private void BindDataForIsuse()
    {
        if (ddlLottery.Items.Count < 1)
        {
            return;
        }

        DataTable dt = new DAL.Tables.T_Isuses().Open("[ID], [Name]", "LotteryID = " +  Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue) + " and EndTime < GetDate() and isOpened = 1", "EndTime");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_InputOpenAffiche");

            return;
        }

        Shove.ControlExt.FillDropDownList(ddlIsuse, dt, "Name", "ID");

        if (ddlIsuse.Items.Count > 0)
        {
            btnOK.Enabled = true;
        }
        else
        {
            btnOK.Enabled = false;
        }

        BindData();
    }
예제 #2
0
    private void BindDataForIsuse()
    {
        if (ddlLottery.Items.Count < 1)
        {
            return;
        }

        DataTable dt = new DAL.Tables.T_Isuses().Open("[ID], [Name]", "LotteryID = " +  Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue) + " and EndTime < GetDate() and isnull(WinLotteryNumber,'') =''", "EndTime");

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

            return;
        }

        Shove.ControlExt.FillDropDownList(ddlIsuse, dt, "Name", "ID");

        if (ddlIsuse.Items.Count > 0)
        {
            btnGO.Enabled = true;
            tbWinNumber.Enabled = true;
        }
        else
        {
            btnGO.Enabled = false;
            tbWinNumber.Enabled = false;

            tbWinNumber.Text = "";
        }
    }
예제 #3
0
 private void BindData()
 {
     if (this.ddlLottery.Items.Count >= 1)
     {
         DataTable table = new Tables.T_Isuses().Open("", "LotteryID = " + Utility.FilteSqlInfusion(this.ddlLottery.SelectedValue) + " and EndTime > GetDate()", "EndTime");
         if (table == null)
         {
             PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName);
         }
         else
         {
             this.g.DataSource = table;
             this.g.DataBind();
             DataTable table2 = new Tables.T_Isuses().Open("top 1 [Name], StartTime, EndTime", "LotteryID = " + Utility.FilteSqlInfusion(this.ddlLottery.SelectedValue), "EndTime desc");
             if (table2 == null)
             {
                 PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName);
             }
             else if (table2.Rows.Count < 1)
             {
                 this.labLastIsuseTip.Text = "此彩种还没有添加过任何期号。";
             }
             else
             {
                 this.labLastIsuseTip.Text = "已添加的最后期号:" + table2.Rows[0]["Name"].ToString() + ",开始时间:" + _Convert.StrToDateTime(table2.Rows[0]["StartTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss") + ",截止时间:" + _Convert.StrToDateTime(table2.Rows[0]["EndTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss") + "。";
             }
         }
     }
 }
예제 #4
0
    private void BindDataForIsuse()
    {
        if (ddlLottery.Items.Count < 1)
        {
            return;
        }

        DataTable dt = null;

        string Condtion = "LotteryID = " + Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue);

        if (Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue) != "72" && Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue) != "73")
        {
            Condtion += " and EndTime < GetDate() and isOpened = 1";
        }

        dt = new DAL.Tables.T_Isuses().Open("[ID], [Name]", Condtion, "EndTime desc");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_WinList");

            return;
        }

        Shove.ControlExt.FillDropDownList(ddlIsuse, dt, "Name", "ID");

        if (ddlIsuse.Items.Count > 0)
        {
            BindData();
        }
    }
예제 #5
0
    private void BindData(int LotteryID)
    {
        DataTable dt = new DAL.Tables.T_Isuses().Open("top 1 *", "lotteryid=" + LotteryID.ToString() + " and getdate() between StartTime and EndTime", "");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.NoData, "数据库繁忙,请重试", this.GetType().FullName);

            return;
        }

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

        string IsuseName = dt.Rows[0]["Name"].ToString();

        int SystemEndAheadMinute = DataCache.LotteryEndAheadMinute[LotteryID];
        DateTime EndTime = Convert.ToDateTime(dt.Rows[0]["EndTime"]);
        DateTime SystemEndTime = EndTime.AddMinutes(SystemEndAheadMinute * -1);

        IsuseInfo = DataCache.Lotteries[LotteryID].ToString() + "合买方案</span><span class=\"fn\">第<strong>" + IsuseName + "</strong>期  截止时间:" + SystemEndTime.ToString("yyyy-MM-dd hh:mm:ss");

        if (LotteryID == 72 || LotteryID == 73)
        {
            IsuseInfo = "";
        }
    }
 protected void ddlIsuse_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.ddlLottery.Items.Count >= 1)
     {
         DataTable table = new Tables.T_Isuses().Open("WinLotteryNumber, isOpened", "[ID] = " + Utility.FilteSqlInfusion(this.ddlIsuse.SelectedValue), "");
         if ((table == null) || (table.Rows.Count < 1))
         {
             PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName);
         }
         else
         {
             bool flag = _Convert.StrToBool(table.Rows[0]["isOpened"].ToString(), true);
             string str = table.Rows[0]["WinLotteryNumber"].ToString();
             if (!flag)
             {
                 this.btnGO.Enabled = false;
                 PF.GoError(1, "此期还没有开奖,不能重构中奖描述。", base.GetType().BaseType.FullName);
             }
             else
             {
                 this.tbWinNumber.Text = str;
                 this.btnGO.Enabled = true;
             }
         }
     }
 }
예제 #7
0
 public string GetData(int LotteryID)
 {
     string key = "Home_Room_Export";
     DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key);
     cacheAsDataTable = null;
     StringBuilder builder = new StringBuilder();
     if (cacheAsDataTable == null)
     {
         cacheAsDataTable = new Tables.T_Isuses().Open("top 1000 Name, WinLotteryNumber, EndTime ", "LotteryID=" + LotteryID + " and IsOpened = 1 and IsNull(WinLotteryNumber,'')<>''", "EndTime Desc");
         if ((cacheAsDataTable == null) || (cacheAsDataTable.Rows.Count == 0))
         {
             PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName);
             return null;
         }
         cacheAsDataTable.Columns.Add("TempID", typeof(int));
         for (int i = 0; i < cacheAsDataTable.Rows.Count; i++)
         {
             cacheAsDataTable.Rows[i]["TempID"] = i + 1;
         }
         Shove._Web.Cache.SetCache(key, cacheAsDataTable, 0xe10);
     }
     builder.AppendLine("<table width=\"400\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"#DDDDDD\">");
     foreach (DataRow row in cacheAsDataTable.Rows)
     {
         builder.AppendLine("<tr >").AppendLine("<td  align=\"center\" bgcolor=\"#FFFFFF\" class=\"blue12\">").AppendLine(row["TempID"].ToString()).AppendLine("</td>").AppendLine("<td align=\"center\" bgcolor=\"#FFFFFF\"  class=\"blue12\">").AppendLine(row["Name"].ToString()).AppendLine("</td>").AppendLine("<td  align=\"center\" bgcolor=\"#FFFFFF\"  class=\"hui12\">").AppendLine(row["WinLotteryNumber"].ToString()).AppendLine("</td>").AppendLine("</tr>");
     }
     builder.AppendLine("</table>");
     return builder.ToString();
 }
예제 #8
0
    private void BindDataForIsuse()
    {
        if (ddlLottery.Items.Count < 1)
        {
            return;
        }

        DataTable dt = new DAL.Tables.T_Isuses().Open("[ID], [Name]", "LotteryID = " + Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue) + " and isOpened = 1", "EndTime desc");

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

            return;
        }

        Shove.ControlExt.FillDropDownList(ddlIsuse, dt, "Name", "ID");

        if (ddlIsuse.Items.Count > 0)
        {
            WinNumberOther.Visible = true;
            btnGO.Enabled = true;

            ddlIsuse_SelectedIndexChanged(ddlIsuse, new EventArgs());
        }
        else
        {
            WinNumberOther.Visible = true;
            btnGO.Enabled = false;
        }
    }
예제 #9
0
    private void BindDataForIsuse()
    {
        if (ddlLottery.Items.Count < 1)
        {
            return;
        }

        DataTable dt = new DAL.Tables.T_Isuses().Open("[ID], [Name]", "LotteryID = " + Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue) + " and isOpened = 0", "EndTime");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_OpenManual");

            return;
        }

        Shove.ControlExt.FillDropDownList(ddlIsuse, dt, "Name", "ID");

        if (ddlIsuse.Items.Count > 0)
        {
            ddlIsuse_SelectedIndexChanged(ddlIsuse, new System.EventArgs());

            if (ddlIsuse.SelectedValue == SLS.Lottery.ZCDC.sID)
            {
                Label1.Visible = false;
                tbWinLotteryNumber.Visible = false;
                lbTipLotteryNumber.Visible = false;
                tbWinLotteryNumber.Enabled = false;
                lbTipLotteryNumber.Visible = true;
                btnEnd.Enabled = true;
                tbOpenAffiche.Visible = false;
            }
            else
            {
                Label1.Visible = true;
                tbWinLotteryNumber.Visible = true;
                lbTipLotteryNumber.Visible = true;
                tbWinLotteryNumber.Enabled = true;
                lbTipLotteryNumber.Visible = true;
                btnEnd.Enabled = true;
                tbOpenAffiche.Visible = false;
            }
        }
        else
        {
            Label1.Visible = true;
            tbWinLotteryNumber.Visible = true;
            lbTipLotteryNumber.Visible = true;
            tbWinLotteryNumber.Enabled = false;
            lbTipLotteryNumber.Visible = false;
            btnEnd.Enabled = false;
            tbOpenAffiche.Visible = true;
        }
    }
예제 #10
0
 protected void ddlLottery_SelectedIndexChanged(object sender, EventArgs e)
 {
     DataTable dt = new Tables.T_Isuses().Open("ID,Name", "LotteryID=" + this.ddlLottery.SelectedValue + " and  getdate()>StartTime", "EndTime desc");
     if (dt == null)
     {
         PF.GoError(4, "数据库繁忙,请重试", "Admin_ChaseList");
     }
     else
     {
         ControlExt.FillDropDownList(this.ddlIsuses, dt, "Name", "ID");
     }
 }
예제 #11
0
    private void BindDataForIsuse()
    {
        DataTable dt = new DAL.Tables.T_Isuses().Open("[ID], [Name]", "LotteryID = " + Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue) + " and StartTime < GetDate() and IsOpened = 0", "EndTime");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_PrintOutput");

            return;
        }

        Shove.ControlExt.FillDropDownList(ddlIsuse, dt, "Name", "ID");

        g.Visible = (ddlIsuse.Items.Count > 0);
    }
예제 #12
0
    private void BindDataForIsuse()
    {
        if (ddlLottery.Items.Count < 1)
        {
            return;
        }

        DataTable dt = new DAL.Tables.T_Isuses().Open("", "StartTime < GetDate() and LotteryID = " + Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue), "EndTime desc");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_SchemeAtTop");

            return;
        }

        ddlIsuse.Items.Clear();

        Shove.ControlExt.FillDropDownList(ddlIsuse, dt, "Name", "ID");
    }
예제 #13
0
파일: Isuse.aspx.cs 프로젝트: ichari/ichari
    private void BindData()
    {
        if (ddlLottery.Items.Count < 1)
        {
            return;
        }

        DataTable dt = new DAL.Tables.T_Isuses().Open("", "LotteryID = " +  Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue) + " and EndTime > GetDate()", "EndTime");

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

            return;
        }

        g.DataSource = dt;
        g.DataBind();

        // 读最后一期期号,以提示用户该继续输入哪一期
        DataTable dtLastIsuse = new DAL.Tables.T_Isuses().Open("top 1 [Name], StartTime, EndTime", "LotteryID = " +  Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue), "EndTime desc");

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

            return;
        }

        if (dtLastIsuse.Rows.Count < 1)
        {
            labLastIsuseTip.Text = "此彩种还没有添加过任何期号。";
        }
        else
        {
            labLastIsuseTip.Text = "已添加的最后期号:" + dtLastIsuse.Rows[0]["Name"].ToString() + ",开始时间:" + Shove._Convert.StrToDateTime(dtLastIsuse.Rows[0]["StartTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss") + ",截止时间:" + Shove._Convert.StrToDateTime(dtLastIsuse.Rows[0]["EndTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss") + "。";
        }
    }
예제 #14
0
파일: Open.aspx.cs 프로젝트: ichari/ichari
    private void BindDataForIsuse()
    {
        if (ddlLottery.Items.Count < 1)
        {
            return;
        }

        string Code =  "and EndTime < GetDate()";

        DataTable dt = new DAL.Tables.T_Isuses().Open("[ID], [Name]", "LotteryID = " + Shove._Web.Utility.FilteSqlInfusion(ddlLottery.SelectedValue) + Code + " and isOpened = 0", "EndTime");

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

            return;
        }

        Shove.ControlExt.FillDropDownList(ddlIsuse, dt, "Name", "ID");

        if (ddlIsuse.Items.Count > 0)
        {
            WinNumberOther.Visible = true;
            btnGO_Step1.Enabled = true;
            btnGO_Step2.Enabled = false;
            btnGO_Step3.Enabled = false;
            tbWinNumber.Enabled = true;
        }
        else
        {
            WinNumberOther.Visible = true;
            btnGO_Step1.Enabled = false;
            btnGO_Step2.Enabled = false;
            btnGO_Step3.Enabled = false;
            tbWinNumber.Enabled = false;
        }
    }
예제 #15
0
    protected void btnGO_Click(object sender, System.EventArgs e)
    {
        tbWinNumber.Text = tbWinNumber.Text.Trim();

        if (!new SLS.Lottery()[int.Parse(ddlLottery.SelectedValue)].AnalyseWinNumber(tbWinNumber.Text))
        {
            Shove._Web.JavaScript.Alert(this.Page, "中奖号码格式不正确!");

            return;
        }

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

        T_Isuses.WinLotteryNumber.Value = tbWinNumber.Text;
        T_Isuses.IsOpened.Value = 1;

        if (T_Isuses.Update("[ID] = " +  Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue)) < 0)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().FullName);

            return;
        }

        Shove._Web.JavaScript.Alert(this.Page, "中奖号码填写成功。");

        BindDataForIsuse();
    }
 private void BindDataForIsuse()
 {
     if (this.ddlLottery.Items.Count >= 1)
     {
         DataTable dt = new Tables.T_Isuses().Open("[ID], [Name]", "LotteryID = " + Utility.FilteSqlInfusion(this.ddlLottery.SelectedValue) + " and EndTime < GetDate() and isnull(WinLotteryNumber,'')<>''", "EndTime");
         if (dt == null)
         {
             PF.GoError(4, "数据库繁忙,请重试", base.GetType().FullName);
         }
         else
         {
             ControlExt.FillDropDownList(this.ddlIsuse, dt, "Name", "ID");
             if (this.ddlIsuse.Items.Count > 0)
             {
                 this.btnOK.Enabled = true;
                 this.tbOpenAffiche.ReadOnly = false;
             }
             else
             {
                 this.btnOK.Enabled = false;
                 this.tbOpenAffiche.ReadOnly = true;
             }
             this.BindData();
         }
     }
 }
예제 #17
0
파일: Open.aspx.cs 프로젝트: ichari/ichari
    protected void ddlIsuse_SelectedIndexChanged(object sender, System.EventArgs e)
    {
        if (ddlLottery.Items.Count < 1)
        {
            return;
        }

        DataTable dt = new DAL.Tables.T_Isuses().Open("WinLotteryNumber, isOpened", "[ID] = " + Shove._Web.Utility.FilteSqlInfusion(ddlIsuse.SelectedValue), "");

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

            return;
        }

        bool isOpened = Shove._Convert.StrToBool(dt.Rows[0]["isOpened"].ToString(), true);
        string WinLotteryNumber = dt.Rows[0]["WinLotteryNumber"].ToString();

        if (isOpened)
        {
            btnGO_Step1.Enabled = false;
            btnGO_Step2.Enabled = false;
            btnGO_Step3.Enabled = false;
            tbWinNumber.Enabled = false;

            PF.GoError(ErrorNumber.Unknow, "此期已经开奖了,不能重复开奖。", this.GetType().BaseType.FullName);

            return;
        }

        WinNumberOther.Visible = true;
        btnGO_Step1.Enabled = true;
        btnGO_Step2.Enabled = false;
        btnGO_Step3.Enabled = false;
        tbWinNumber.Enabled = true;

        if (WinLotteryNumber != "")
        {
            tbWinNumber.Text = WinLotteryNumber;
        }
    }
예제 #18
0
파일: Gateway.cs 프로젝트: ichari/ichari
    public DataSet GetUnsuccessfulSchemes(long AgentID, DateTime TimeStamp, string Sign, int LotteryID, string IssueName)
    {
        new Log("Agent\\ElectronTicket").Write(String.Format("Method=GetUnsuccessfulSchemes\tAgentID={0}\tTimeStamp={1}\tSign={2}\tLotteryID={3}\tIssueName={4}", AgentID, TimeStamp, Sign, LotteryID, IssueName));

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

        if (Valid(ref ds, ref UseLotteryList, ref Balance, ref State, AgentID, TimeStamp, Sign, LotteryID, IssueName) < 0)
        {
            return ds;
        }

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

        DataTable dt = new DAL.Tables.T_Isuses().Open("[ID], StartTime, EndTime, State, isOpened", "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");
        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) || (IsuseState < 1))
        {
            BuildReturnDataSetForError(-5, "奖期未开启", ref ds);

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

            return ds;
        }

        BuildReturnDataSet(0, ref ds);

        DataTable dtSchemes = new DAL.Tables.T_ElectronTicketAgentSchemes().Open("SchemeNumber, State", "AgentID = " + AgentID.ToString() + " and IsuseID = " + IsuseID.ToString() + " and State <> 1", "[ID]");
        ds.Tables.Add(dtSchemes);

        return ds;
    }
예제 #19
0
    private void BindIsuses()
    {
        DataTable dt = new DAL.Tables.T_Isuses().Open("Name, EndTime, StartTime", "LotteryID=" + LotteryID.ToString() + " and isopened=0 and getdate() < EndTime", "");

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

            return;
        }

        dt.Columns.Add("value", typeof(System.String));

        foreach (DataRow dr in dt.Rows)
        {
            if (DateTime.Now.CompareTo(Shove._Convert.StrToDateTime(dr["StartTime"].ToString(), DateTime.Now.ToString())) < 0)
            {
                dr["value"] = dr["Name"];
            }
            else
            {
                dr["value"] = dr["Name"];
            }
        }

        Shove.ControlExt.FillDropDownList(ddlIsuses, dt, "value", "Name");
    }
예제 #20
0
 private void BindData()
 {
     DataTable table = new Tables.T_Isuses().Open("", "[ID]=" + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "");
     if ((table == null) || (table.Rows.Count < 1))
     {
         PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
     }
     else
     {
         this.tbIsuse.Text = table.Rows[0]["Name"].ToString();
         this.tbStartTime.Text = _Convert.StrToDateTime(table.Rows[0]["StartTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss");
         this.tbEndTime.Text = _Convert.StrToDateTime(table.Rows[0]["EndTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss");
         if (this.tbLotteryID.Text == "1")
         {
             table = new Tables.T_IsuseForSFC().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "[No]");
             if ((table == null) || (table.Rows.Count < 14))
             {
                 PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
                 return;
             }
             for (int i = 0; i < 14; i++)
             {
                 int num2 = i + 1;
                 TextBox box = (TextBox)this.FindControl("tbSFC" + num2.ToString());
                 int num3 = i + 1;
                 TextBox box2 = (TextBox)this.FindControl("tbSFC" + num3.ToString() + "_1");
                 int num4 = i + 1;
                 TextBox box3 = (TextBox)this.FindControl("tbSFC" + num4.ToString() + "_2");
                 box.Text = table.Rows[i]["HostTeam"].ToString();
                 box2.Text = table.Rows[i]["QuestTeam"].ToString();
                 box3.Text = table.Rows[i]["DateTime"].ToString();
             }
         }
         if (this.tbLotteryID.Text == "2")
         {
             table = new Tables.T_IsuseForJQC().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "[No]");
             if ((table == null) || (table.Rows.Count < 8))
             {
                 PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
                 return;
             }
             for (int j = 0; j < 8; j++)
             {
                 int num6 = j + 1;
                 TextBox box4 = (TextBox)this.FindControl("tbJQC" + num6.ToString());
                 int num7 = j + 1;
                 TextBox box5 = (TextBox)this.FindControl("tbJQC" + num7.ToString() + "_2");
                 box4.Text = table.Rows[j]["Team"].ToString();
                 box5.Text = table.Rows[j]["DateTime"].ToString();
             }
         }
         if (this.tbLotteryID.Text == "15")
         {
             table = new Tables.T_IsuseForLCBQC().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "[No]");
             if ((table == null) || (table.Rows.Count < 6))
             {
                 PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
                 return;
             }
             for (int k = 0; k < 6; k++)
             {
                 int num9 = k + 1;
                 TextBox box6 = (TextBox)this.FindControl("tbLCBQC" + num9.ToString());
                 int num10 = k + 1;
                 TextBox box7 = (TextBox)this.FindControl("tbLCBQC" + num10.ToString() + "_1");
                 int num11 = k + 1;
                 TextBox box8 = (TextBox)this.FindControl("tbLCBQC" + num11.ToString() + "_2");
                 box6.Text = table.Rows[k]["HostTeam"].ToString();
                 box7.Text = table.Rows[k]["QuestTeam"].ToString();
                 box8.Text = table.Rows[k]["DateTime"].ToString();
             }
         }
         if (this.tbLotteryID.Text == "19")
         {
             table = new Tables.T_IsuseForLCDC().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "[No]");
             if ((table == null) || (table.Rows.Count < 1))
             {
                 PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
                 return;
             }
             for (int m = 0; m < 1; m++)
             {
                 int num13 = m + 1;
                 TextBox box9 = (TextBox)this.FindControl("tbLCDC" + num13.ToString());
                 int num14 = m + 1;
                 TextBox box10 = (TextBox)this.FindControl("tbLCDC" + num14.ToString() + "_1");
                 int num15 = m + 1;
                 TextBox box11 = (TextBox)this.FindControl("tbLCDC" + num15.ToString() + "_2");
                 box9.Text = table.Rows[m]["HostTeam"].ToString();
                 box10.Text = table.Rows[m]["QuestTeam"].ToString();
                 box11.Text = table.Rows[m]["DateTime"].ToString();
             }
         }
         if (this.tbLotteryID.Text == "45")
         {
             table = new Tables.T_IsuseForZCDC().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "[No]");
             if ((table == null) || (table.Rows.Count < 1))
             {
                 PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
                 return;
             }
             this.DataListZCDC.DataSource = table.DefaultView;
             this.DataListZCDC.DataBind();
         }
         DataTable table2 = new Tables.T_TestNumber().Open("", "IsuseID = " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "");
         DataTable table3 = new Tables.T_TotalMoney().Open("", "IsuseID= " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "");
         if (table2 == null)
         {
             PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
         }
         else if (table3 == null)
         {
             PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
         }
         else
         {
             if (table2.Rows.Count > 0)
             {
                 this.tbTestNumber.Text = table2.Rows[0]["TestNumber"].ToString();
                 this.hidID.Value = table2.Rows[0]["ID"].ToString();
             }
             if (table3.Rows.Count > 0)
             {
                 this.tbMoney.Text = table3.Rows[0]["TotalMoney"].ToString();
                 this.moneyID.Value = table3.Rows[0]["ID"].ToString();
             }
         }
     }
 }
예제 #21
0
 protected void btnEdit_Click(object sender, EventArgs e)
 {
     string name = "";
     try
     {
         name = Utility.FilteSqlInfusion(this.tbIsuse.Text.Trim());
     }
     catch
     {
     }
     if (name == "")
     {
         JavaScript.Alert(this.Page, "期号不能为空!");
     }
     else
     {
         DataTable table = new Tables.T_Isuses().Open("[ID]", "[Name]='" + name + "' and LotteryID=" + Utility.FilteSqlInfusion(this.tbLotteryID.Text) + " and [ID] <> " + Utility.FilteSqlInfusion(this.tbIsuseID.Text), "");
         if (table == null)
         {
             PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
         }
         else if (table.Rows.Count > 0)
         {
             JavaScript.Alert(this.Page, "期号已经存在,请不要输入重名期号!");
         }
         else
         {
             object obj2 = PF.ValidLotteryTime(this.tbStartTime.Text);
             if (obj2 == null)
             {
                 JavaScript.Alert(this.Page, "开始时间格式输入错误!");
             }
             else
             {
                 DateTime startTime = (DateTime)obj2;
                 obj2 = PF.ValidLotteryTime(this.tbEndTime.Text);
                 if (obj2 == null)
                 {
                     JavaScript.Alert(this.Page, "截止时间格式输入错误!");
                 }
                 else
                 {
                     DateTime endTime = (DateTime)obj2;
                     if (endTime <= startTime)
                     {
                         JavaScript.Alert(this.Page, "截止时间应该在开始时间之后!");
                     }
                     else
                     {
                         string additionasXml = "";
                         if ((((((this.tbLotteryID.Text != "1") || (this.BuildAdditionasXmlForSFC(ref additionasXml) >= 0)) && ((this.tbLotteryID.Text != "2") || (this.BuildAdditionasXmlForJQC(ref additionasXml) >= 0))) && ((this.tbLotteryID.Text != "15") || (this.BuildAdditionasXmlForLCBQC(ref additionasXml) >= 0))) && ((this.tbLotteryID.Text != "19") || (this.BuildAdditionasXmlForLCDC(ref additionasXml) >= 0))) && ((this.tbLotteryID.Text != "45") || (this.BuildAdditionasXmlForZCDC(ref additionasXml) >= 0)))
                         {
                             long isuseID = long.Parse(this.tbIsuseID.Text);
                             int returnValue = -1;
                             string returnDescription = "";
                             if (Procedures.P_IsuseEdit(isuseID, name, startTime, endTime, additionasXml, ref returnValue, ref returnDescription) < 0)
                             {
                                 PF.GoError(4, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName);
                             }
                             else if (returnValue < 0)
                             {
                                 PF.GoError(1, returnDescription, this.Page.GetType().BaseType.FullName);
                             }
                             else
                             {
                                 if (this.tbTestNumber.Text.Trim() != "")
                                 {
                                     Tables.T_TestNumber number = new Tables.T_TestNumber
                                     {
                                         TestNumber = { Value = this.tbTestNumber.Text.Trim() },
                                         IsuseID = { Value = isuseID.ToString() }
                                     };
                                     if (_Convert.StrToLong(this.hidID.Value, 0L) > 0L)
                                     {
                                         number.Update("ID=" + this.hidID.Value);
                                     }
                                     else
                                     {
                                         number.Insert();
                                     }
                                 }
                                 if (this.tbMoney.Text.Trim() != "")
                                 {
                                     Tables.T_TotalMoney money = new Tables.T_TotalMoney
                                     {
                                         TotalMoney = { Value = this.tbMoney.Text.Trim() },
                                         IsuseID = { Value = this.tbIsuseID.Text }
                                     };
                                     if (_Convert.StrToLong(this.moneyID.Value, 0L) > 0L)
                                     {
                                         money.Update("ID=" + this.moneyID.Value);
                                     }
                                     else
                                     {
                                         money.Insert();
                                     }
                                 }
                                 Shove._Web.Cache.ClearCache("LotteryCalendar");
                                 Shove._Web.Cache.ClearCache(DataCache.IsusesInfo + this.tbLotteryID.Text.Trim());
                                 base.Response.Redirect("Isuse.aspx?LotteryID=" + this.tbLotteryID.Text, true);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
예제 #22
0
 private string Get3DZu3MissCount()
 {
     string key = "Home_Room_Buy_Get3DZu3MissCount";
     DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key);
     if (cacheAsDataTable == null)
     {
         cacheAsDataTable = new Tables.T_Isuses().Open("top 40 WinLotteryNumber", "LotteryID = 6 and WinLotteryNumber <> '' and IsOpened = 1", "EndTime desc");
         if (cacheAsDataTable == null)
         {
             new Log("System").Write(base.GetType().FullName + "数据库繁忙,请重试(Get3DZu3MissCount)");
             return "";
         }
         Shove._Web.Cache.SetCache(key, cacheAsDataTable, 60);
     }
     int num = 0;
     for (int i = 0; i < cacheAsDataTable.Rows.Count; i++)
     {
         if (this.FilterRepeated(cacheAsDataTable.Rows[i]["WinLotteryNumber"].ToString()).Length == 2)
         {
             break;
         }
         num++;
     }
     return num.ToString();
 }
예제 #23
0
 private void GetSZPL3Miss()
 {
     string key = "Home_Room_Buy_GetSZPL3Miss";
     this.lbMiss.Text = Shove._Web.Cache.GetCacheAsString(key, "");
     if (this.lbMiss.Text == "")
     {
         DataTable table = new Tables.T_Isuses().Open("top 100 EndTime,WinLotteryNumber", "LotteryID = 63 and GETDATE()>EndTime and ISNULL(WinLotteryNumber,'')<>'' and IsOpened=1", "EndTime desc");
         if (table == null)
         {
             new Log("System").Write(base.GetType().FullName + "数据库繁忙,请重试(GetSZPL3Miss)");
         }
         else
         {
             int[,] numArray = new int[3, 10];
             int num = 0;
             foreach (DataRow row in table.Select("", "EndTime asc"))
             {
                 string str2 = row["WinLotteryNumber"].ToString();
                 if (str2.Length == 3)
                 {
                     for (int i = 0; i < str2.Length; i++)
                     {
                         int num4 = _Convert.StrToInt(str2.Substring(i, 1), 0);
                         for (int j = 0; j < 10; j++)
                         {
                             if (j == num4)
                             {
                                 numArray[i, j] = 0;
                             }
                             else
                             {
                                 numArray[i, j]++;
                             }
                         }
                     }
                 }
             }
             foreach (DataRow row2 in table.Select("1=1", "EndTime desc"))
             {
                 if (this.FilterRepeated(row2["WinLotteryNumber"].ToString()).Length == 2)
                 {
                     break;
                 }
                 num++;
             }
             this.lbMiss.Text = this.GetSZPL3Miss(numArray) + "|" + num.ToString();
             Shove._Web.Cache.SetCache(key, this.lbMiss.Text, 600);
         }
     }
 }
예제 #24
0
파일: Gateway.cs 프로젝트: ichari/ichari
    private long GetIsuseID(int LotteryID, string IsuseName)
    {
        DataTable dt = new DAL.Tables.T_Isuses().Open("[ID]", "LotteryID = " + LotteryID.ToString() + "and [Name] = '" + Shove._Web.Utility.FilteSqlInfusion(IsuseName) + "'", "");

        if ((dt == null) || (dt.Rows.Count < 1))
        {
            return -1;
        }

        return Shove._Convert.StrToLong(dt.Rows[0]["ID"].ToString(), -1);
    }
예제 #25
0
 private void Get3DBaoDianMiss()
 {
     string key = "Home_Room_Buy_Get3DBaoDianMiss";
     this.lbMiss.Text = Shove._Web.Cache.GetCacheAsString(key, "");
     this.lbMiss.Text = "";
     if (this.lbMiss.Text == "")
     {
         DataTable table = new Tables.T_Isuses().Open("EndTime,WinLotteryNumber", "LotteryID = 6 and GETDATE()>EndTime and ISNULL(WinLotteryNumber,'')<>'' and IsOpened=1", "EndTime asc");
         if (table == null)
         {
             new Log("System").Write(base.GetType().FullName + "数据库繁忙,请重试(Get3DBaoDianMiss)");
         }
         else
         {
             int[] numArray = new int[0x1c];
             int[] numArray2 = new int[] {
                 0x3e8, 0x14d, 0xa7, 100, 0x43, 0x30, 0x24, 0x1c, 0x16, 0x12, 0x10, 14, 14, 13, 13, 14,
                 14, 0x10, 0x12, 0x16, 0x1c, 0x24, 0x30, 0x43, 100, 0xa7, 0x14d, 0x3e8
              };
             foreach (DataRow row in table.Rows)
             {
                 string str2 = row["WinLotteryNumber"].ToString();
                 int num = 0;
                 if (str2.Length == 3)
                 {
                     for (int k = 0; k < str2.Length; k++)
                     {
                         num += _Convert.StrToInt(str2.Substring(k, 1), 0);
                     }
                     for (int m = 0; m < numArray.Length; m++)
                     {
                         if (m == num)
                         {
                             numArray[m] = 0;
                         }
                         else
                         {
                             numArray[m]++;
                         }
                     }
                 }
             }
             double num4 = 0.0;
             double num5 = 0.0;
             for (int i = 0; i < 0x1c; i++)
             {
                 num5 = _Convert.StrToDouble(numArray[i].ToString(), 0.0);
                 if ((num5 / ((double)numArray2[i])) >= num4)
                 {
                     num4 = num5 / ((double)numArray2[i]);
                 }
             }
             StringBuilder builder = new StringBuilder();
             int num7 = numArray.Length / 14;
             for (int j = 0; j < num7; j++)
             {
                 builder.Append(" <table border=\"0\" cellpadding=\"0\" cellspacing=\"4\">").Append("<tr>").Append("<td class='blue' width='80px' align='center'>").Append("本期遗漏").Append("</td>");
                 for (int n = j * 14; n < ((j + 1) * 14); n++)
                 {
                     if ((_Convert.StrToDouble(numArray[n].ToString(), 0.0) / ((double)numArray2[n])) >= num4)
                     {
                         builder.Append("<td class='red12'>");
                     }
                     else
                     {
                         builder.Append("<td class='hui12'>");
                     }
                     builder.Append(numArray[n].ToString()).Append("</td>");
                 }
                 builder.Append("</tr>").Append("<tr>").Append("<td class='blue' width='80px' align='center'>").Append("理论遗漏").Append("</td>");
                 for (int num10 = j * 14; num10 < ((j + 1) * 14); num10++)
                 {
                     if ((_Convert.StrToDouble(numArray[num10].ToString(), 0.0) / ((double)numArray2[num10])) >= num4)
                     {
                         builder.Append("<td class='red12'>");
                     }
                     else
                     {
                         builder.Append("<td class='hui12'>");
                     }
                     builder.Append(numArray2[num10].ToString()).Append("</td>");
                 }
                 builder.Append("</tr>").Append("</table>-");
             }
             this.lbMiss.Text = builder.ToString();
             Shove._Web.Cache.SetCache(key, this.lbMiss.Text, 600);
         }
     }
 }
예제 #26
0
    // 接收奖期通知
    private void IsuseNotice(string TransMessage)
    {
        System.Xml.XmlDocument XmlDoc = new XmlDocument();

        try
        {
            XmlDoc.Load(new StringReader(TransMessage));
        }
        catch { }

        DAL.Tables.T_Isuses t_Isuses = new DAL.Tables.T_Isuses();

        string Body = TransMessage.Substring(TransMessage.IndexOf("<elements"), TransMessage.LastIndexOf("</elements>") - TransMessage.IndexOf("<elements")) + "</elements>";

        DataSet ds = new DataSet();

        ds.ReadXml(new StringReader(Body));

        if (ds == null)
        {
            return;
        }

        if (ds.Tables.Count == 0)
        {
            return;
        }

        DataTable dt = ds.Tables[0];

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

        string MessageID = "";

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            DataRow dr = dt.Rows[i];

            string LotteryName = dr["lotteryid"].ToString();
            int LotteryID = GetLotteryID(LotteryName);
            string IsuseName = GetIsusesNameToCaiyou(LotteryID.ToString(), dr["issue"].ToString());
            string Status = dr["status"].ToString();
            string StartTime = dr["starttime"].ToString();
            string EndTime = dr["endtime"].ToString();
            string WinNumber = "";

            if (Shove._Convert.StrToInt(Status, 0) > 1)
            {
                try
                {
                    WinNumber = GetWinNumber(LotteryID, dr["bonuscode"].ToString());
                }
                catch { }
            }

            if ((LotteryID < 0) || (String.IsNullOrEmpty(IsuseName)))
            {
                continue;
            }

            if (t_Isuses.GetCount("LotteryID = " + LotteryID.ToString() + " and [Name] = '" + Shove._Web.Utility.FilteSqlInfusion(IsuseName) + "' and year(StartTime) = YEAR(GETDATE())") < 1)
            {
                DateTime _StartTime = DateTime.Now;
                DateTime _EndTime = DateTime.Now;

                try
                {
                    _StartTime = DateTime.Parse(StartTime);
                    _EndTime = DateTime.Parse(EndTime);
                }
                catch
                {
                    continue;
                }

                long IsuseID = -1;
                string ReturnDescription = "";

                if (DAL.Procedures.P_IsuseAdd(LotteryID, IsuseName, _StartTime, _EndTime, "", ref IsuseID, ref ReturnDescription) < 0)
                {
                    continue;
                }

                if (IsuseID < 0)
                {
                    continue;
                }
            }

            DataTable dtIsuse = t_Isuses.Open("ID, State, WinLotteryNumber", "LotteryID = " + LotteryID.ToString() + " and [Name] = '" + Shove._Web.Utility.FilteSqlInfusion(IsuseName) + "' and year(StartTime) = YEAR(GETDATE())", "");

            if ((dtIsuse == null) || (dtIsuse.Rows.Count < 1))
            {
                continue;
            }

            if (Status == "1")
            {
                int ReturnValue = 0;
                string ReturnDescprtion = "";

                if (DAL.Procedures.P_ElectronTicketAgentSchemeQuash(Shove._Convert.StrToLong(dtIsuse.Rows[0]["ID"].ToString(), 0), ref ReturnValue, ref ReturnDescprtion) < 0)
                {
                    new Log("ElectronTicket\\ZCW").Write("电子票方案撤单错误_P_ElectronTicketAgentSchemeQuash");

                    continue;
                }
            }

            bool isHasUpdate = false;

            if (dtIsuse.Rows[0]["State"].ToString() != Status)
            {
                isHasUpdate = true;
            }

            if (isHasUpdate)
            {
                int ReturnValue = 0;
                string ReturnDescprtion = "";

                if (DAL.Procedures.P_IsuseUpdate(LotteryID, Shove._Web.Utility.FilteSqlInfusion(IsuseName), Shove._Convert.StrToShort(Status, 0), Shove._Convert.StrToDateTime(StartTime, DateTime.Now.ToString()), Shove._Convert.StrToDateTime(EndTime, DateTime.Now.ToString()), DateTime.Now, WinNumber, ref ReturnValue, ref ReturnDescprtion) < 0)
                {
                    new Log("ElectronTicket\\ZCW").Write("电子票撤销追号错误P_IsuseEdit。");
                }

                if (ReturnValue < 0)
                {
                    new Log("ElectronTicket\\ZCW").Write(ReturnDescprtion);
                }
            }

            if (!String.IsNullOrEmpty(WinNumber) && (dtIsuse.Rows[0]["WinLotteryNumber"].ToString() != WinNumber))
            {
                DataTable dtWinTypes = new DAL.Tables.T_WinTypes().Open("", "LotteryID =" + LotteryID.ToString(), "");

                double[] WinMoneyList = new double[dtWinTypes.Rows.Count * 2];

                for (int k = 0; k < dtWinTypes.Rows.Count; k++)
                {
                    if (Shove._Convert.StrToDouble(dtWinTypes.Rows[k]["DefaultMoney"].ToString(), 1) < 1)
                    {
                        MessageID = GetFromXPath(TransMessage, "message/header/messengerid");
                        ReNotice(MessageID, "13008");

                        return;
                    }

                    WinMoneyList[k * 2] = Shove._Convert.StrToDouble(dtWinTypes.Rows[k]["DefaultMoney"].ToString(), 1);
                    WinMoneyList[k * 2 + 1] = Shove._Convert.StrToDouble(dtWinTypes.Rows[k]["DefaultMoneyNoWithTax"].ToString(), 1);
                }

                #region 开奖第一步

                DataTable dtWin = null;

                dtWin = new DAL.Tables.T_Schemes().Open("LotteryNumber,PlayTypeID,Multiple,ID", "isOpened = 0 and IsuseID = " + dtIsuse.Rows[0]["ID"].ToString(), "[ID]");

                if (dtWin == null)
                {
                    return;
                }

                for (int y = 0; y < dtWin.Rows.Count; y++)
                {
                    string LotteryNumber = "";

                    try
                    {
                        LotteryNumber = dtWin.Rows[y]["LotteryNumber"].ToString();
                    }
                    catch
                    { }

                    string Description = "";
                    double WinMoneyNoWithTax = 0;

                    try
                    {

                        double WinMoney = new SLS.Lottery()[LotteryID].ComputeWin(LotteryNumber, WinNumber, ref Description, ref WinMoneyNoWithTax, int.Parse(dtWin.Rows[y]["PlayTypeID"].ToString()), WinMoneyList);

                        Shove.Database.MSSQL.ExecuteNonQuery("update T_Schemes set PreWinMoney = @p1, PreWinMoneyNoWithTax = @p2, EditWinMoney = @p3, EditWinMoneyNoWithTax = @p4, WinDescription = @p5 where [ID] = " + dtWin.Rows[y]["ID"].ToString(),
                            new Shove.Database.MSSQL.Parameter("p1", SqlDbType.Money, 0, ParameterDirection.Input, WinMoney * Shove._Convert.StrToInt(dtWin.Rows[y]["Multiple"].ToString(), 1)),
                            new Shove.Database.MSSQL.Parameter("p2", SqlDbType.Money, 0, ParameterDirection.Input, WinMoneyNoWithTax * Shove._Convert.StrToInt(dtWin.Rows[y]["Multiple"].ToString(), 1)),
                            new Shove.Database.MSSQL.Parameter("p3", SqlDbType.Money, 0, ParameterDirection.Input, WinMoney * Shove._Convert.StrToInt(dtWin.Rows[y]["Multiple"].ToString(), 1)),
                            new Shove.Database.MSSQL.Parameter("p4", SqlDbType.Money, 0, ParameterDirection.Input, WinMoneyNoWithTax * Shove._Convert.StrToInt(dtWin.Rows[y]["Multiple"].ToString(), 1)),
                            new Shove.Database.MSSQL.Parameter("p5", SqlDbType.VarChar, 0, ParameterDirection.Input, Description));
                    }
                    catch
                    {
                        continue;
                    }
                }

                #endregion

                #region 开奖第二步

                string OpenAffiche = new OpenAfficheTemplates()[LotteryID];

                int SchemeCount, QuashCount, WinCount, WinNoBuyCount;
                bool isEndOpen = false;

                int ReturnValue = 0;
                string ReturnDescription = "";

                while (!isEndOpen)
                {
                    SchemeCount = 0;
                    QuashCount = 0;
                    WinCount = 0;
                    WinNoBuyCount = 0;
                    //  总方案数,处理时撤单数,中奖数,中奖但未成功数

                    ReturnValue = 0;
                    ReturnDescription = "";
                    DataSet dsWin = null;

                    DAL.Procedures.P_Win(ref dsWin,
                         Shove._Convert.StrToLong(dtIsuse.Rows[0]["ID"].ToString(), 0),
                         WinNumber,
                         OpenAffiche,
                         1,
                         true,
                         ref SchemeCount, ref QuashCount, ref WinCount, ref WinNoBuyCount,
                         ref isEndOpen,
                         ref ReturnValue, ref ReturnDescription);
                }

                #endregion
            }

        }

        MessageID = GetFromXPath(TransMessage, "message/header/messengerid");
        ReNotice(MessageID, "13008");
    }
예제 #27
0
파일: Gateway.cs 프로젝트: ichari/ichari
    public DataSet GetIssues(long AgentID, DateTime TimeStamp, string Sign, int LotteryID, DateTime StartTime, DateTime EndTime)
    {
        new Log("Agent\\ElectronTicket").Write(String.Format("Method=GetIssues\tAgentID={0}\tTimeStamp={1}\tSign={2}\tLotteryID={3}\tStartTime={4}\tEndTime={5}", AgentID, TimeStamp, Sign, LotteryID, StartTime, EndTime));

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

        if (Valid(ref ds, ref UseLotteryList, ref Balance, ref State, AgentID, TimeStamp, Sign, LotteryID, StartTime, EndTime) < 0)
        {
            return ds;
        }

        if (LotteryID >= 0)
        {
            if (ValidLotteryID(ref ds, UseLotteryList, LotteryID) < 0)
            {
                return ds;
            }
        }
        else
        {
            if (UseLotteryList == "")
            {
                BuildReturnDataSetForError(-3, "彩种ID不存在或暂不支持", ref ds);

                new Log("Agent\\ElectronTicket").Write("彩种ID不存在或暂不支持");

                return ds;
            }
        }

        DataTable dt = null;

        if (LotteryID >= 0)
        {
            dt = new DAL.Tables.T_Isuses().Open("LotteryID, [Name] as IssueName, StartTime, EndTime, State as Status, WinLotteryNumber as BonusNumber", "LotteryID = " + LotteryID.ToString() + " and StartTime between '" + StartTime.ToString("yyyy-MM-dd HH:mm:ss") + "' and '" + EndTime.ToString("yyyy-MM-dd HH:mm:ss") + "'", "StartTime");
        }
        else
        {
            dt = new DAL.Tables.T_Isuses().Open("LotteryID, [Name] as IssueName, StartTime, EndTime, State as Status, WinLotteryNumber as BonusNumber", "LotteryID in (" + UseLotteryList + ") and StartTime between '" + StartTime.ToString("yyyy-MM-dd HH:mm:ss") + "' and '" + EndTime.ToString("yyyy-MM-dd HH:mm:ss") + "'", "StartTime");
        }

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

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

            return ds;
        }

        BuildReturnDataSet(0, ref ds);
        ds.Tables.Add(dt);

        return ds;
    }
예제 #28
0
파일: Gateway.cs 프로젝트: ichari/ichari
    public DataSet GetIssueInformation(long AgentID, DateTime TimeStamp, string Sign, int LotteryID, string IssueName)
    {
        new Log("Agent\\ElectronTicket").Write(String.Format("Method=GetIssueInformation\tAgentID={0}\tTimeStamp={1}\tSign={2}\tLotteryID={3}\tIssueName={4}", AgentID, TimeStamp, Sign, LotteryID, IssueName));

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

        if (Valid(ref ds, ref UseLotteryList, ref Balance, ref State, AgentID, TimeStamp, Sign, LotteryID, IssueName) < 0)
        {
            return ds;
        }

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

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

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

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

            return ds;
        }

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

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

            return ds;
        }

        BuildReturnDataSet(0, ref ds);
        ds.Tables.Add(dt);

        return ds;
    }
예제 #29
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;
    }
예제 #30
0
    private void GetSZPL3Miss()
    {
        string Key = "Home_Room_Buy_GetSZPL3Miss";

        lbMiss.Text = Shove._Web.Cache.GetCacheAsString(Key, "");

        if (lbMiss.Text == "")
        {
            DataTable dt = new DAL.Tables.T_Isuses().Open("top 100 EndTime,WinLotteryNumber", "LotteryID = 63 and GETDATE()>EndTime and ISNULL(WinLotteryNumber,'')<>'' and IsOpened=1", "EndTime desc");

            if (dt == null)
            {
                new Log("System").Write(this.GetType().FullName + "数据库繁忙,请重试(GetSZPL3Miss)");

                return;
            }

            int[,] SZPL3 = new int[3, 10];

            int Zu3MissCount = 0;
            string WinLotteryNumber;
            int WinNumber;

            DataRow[] drs = dt.Select("", "EndTime asc");

            foreach (DataRow dr in drs)
            {
                WinLotteryNumber = dr["WinLotteryNumber"].ToString();

                if (WinLotteryNumber.Length != 3)
                {
                    continue;
                }

                for (int i = 0; i < WinLotteryNumber.Length; i++)
                {
                    WinNumber = Shove._Convert.StrToInt(WinLotteryNumber.Substring(i, 1), 0);

                    for (int j = 0; j < 10; j++)
                    {
                        if (j == WinNumber)
                        {
                            SZPL3[i, j] = 0;
                        }
                        else
                        {
                            SZPL3[i, j]++;
                        }
                    }
                }
            }

            drs = dt.Select("1=1", "EndTime desc");

            foreach (DataRow dr in drs)
            {
                if (FilterRepeated(dr["WinLotteryNumber"].ToString()).Length == 2)
                {
                    break;
                }

                Zu3MissCount++;
            }

            lbMiss.Text = GetSZPL3Miss(SZPL3) + "|" + Zu3MissCount.ToString();

            Shove._Web.Cache.SetCache(Key, lbMiss.Text, 600);
        }
    }