Ejemplo n.º 1
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();
             }
         }
     }
 }
Ejemplo n.º 2
0
    private void BindData()
    {
        DataTable dt = new DAL.Tables.T_Isuses().Open("", "[ID]=" + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "");

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

            return;
        }

        tbIsuse.Text = dt.Rows[0]["Name"].ToString();
        tbStartTime.Text = Shove._Convert.StrToDateTime(dt.Rows[0]["StartTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss");
        tbEndTime.Text = Shove._Convert.StrToDateTime(dt.Rows[0]["EndTime"].ToString(), "0000-00-00 00:00:00").ToString("yyyy-MM-dd HH:mm:ss");

        if (tbLotteryID.Text == SLS.Lottery.SFC.sID || tbLotteryID.Text == SLS.Lottery.ZCSFC.sID || tbLotteryID.Text == SLS.Lottery.ZCRJC.sID)
        {
            dt = new DAL.Tables.T_IsuseForSFC().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "[No]");

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

                return;
            }

            if (dt.Rows.Count != 14)
            {
                return;
            }

            for (int i = 0; i < 14; i++)
            {
                TextBox tb = (TextBox)this.FindControl("tbSFC" + (i + 1).ToString());
                TextBox tb_1 = (TextBox)this.FindControl("tbSFC" + (i + 1).ToString() + "_1");
                TextBox tb_2 = (TextBox)this.FindControl("tbSFC" + (i + 1).ToString() + "_2");

                tb.Text = dt.Rows[i]["HostTeam"].ToString();
                tb_1.Text = dt.Rows[i]["QuestTeam"].ToString();
                tb_2.Text = dt.Rows[i]["DateTime"].ToString();
            }
        }

        if (tbLotteryID.Text == SLS.Lottery.JQC.sID)
        {
            dt = new DAL.Tables.T_IsuseForJQC().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "[No]");

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

                return;
            }

            for (int i = 0; i < 8; i++)
            {
                TextBox tb = (TextBox)this.FindControl("tbJQC" + (i + 1).ToString());
                TextBox tb_2 = (TextBox)this.FindControl("tbJQC" + (i + 1).ToString() + "_2");

                tb.Text = dt.Rows[i]["Team"].ToString();
                tb_2.Text = dt.Rows[i]["DateTime"].ToString();
            }
        }

        if (tbLotteryID.Text == SLS.Lottery.LCBQC.sID)
        {
            dt = new DAL.Tables.T_IsuseForLCBQC().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "[No]");

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

                return;
            }

            for (int i = 0; i < 6; i++)
            {
                TextBox tb = (TextBox)this.FindControl("tbLCBQC" + (i + 1).ToString());
                TextBox tb_1 = (TextBox)this.FindControl("tbLCBQC" + (i + 1).ToString() + "_1");
                TextBox tb_2 = (TextBox)this.FindControl("tbLCBQC" + (i + 1).ToString() + "_2");

                tb.Text = dt.Rows[i]["HostTeam"].ToString();
                tb_1.Text = dt.Rows[i]["QuestTeam"].ToString();
                tb_2.Text = dt.Rows[i]["DateTime"].ToString();
            }
        }

        if (tbLotteryID.Text == SLS.Lottery.LCDC.sID)
        {
            dt = new DAL.Tables.T_IsuseForLCDC().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "[No]");

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

                return;
            }

            for (int i = 0; i < 1; i++)
            {
                TextBox tb = (TextBox)this.FindControl("tbLCDC" + (i + 1).ToString());
                TextBox tb_1 = (TextBox)this.FindControl("tbLCDC" + (i + 1).ToString() + "_1");
                TextBox tb_2 = (TextBox)this.FindControl("tbLCDC" + (i + 1).ToString() + "_2");

                tb.Text = dt.Rows[i]["HostTeam"].ToString();
                tb_1.Text = dt.Rows[i]["QuestTeam"].ToString();
                tb_2.Text = dt.Rows[i]["DateTime"].ToString();
            }
        }     

        DataTable dtTestNumber = new DAL.Tables.T_TestNumber().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "");

        DataTable dtTotalMoney = new DAL.Tables.T_TotalMoney().Open("", "IsuseID= " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text) , "");


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

            return;
        }
        if (dtTotalMoney == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite,"数据库繁忙,请重试",this.Page.GetType().BaseType.FullName);
            return;
        }
        if (dtTestNumber.Rows.Count > 0)
        {
            tbTestNumber.Text = dtTestNumber.Rows[0]["TestNumber"].ToString();
            hidID.Value = dtTestNumber.Rows[0]["ID"].ToString();
        }
        if (dtTotalMoney.Rows.Count > 0)
        {
            tbMoney.Text = dtTotalMoney.Rows[0]["TotalMoney"].ToString();
            moneyID.Value = dtTotalMoney.Rows[0]["ID"].ToString();
        }
    }