protected void tb_auto_Click(object sender, EventArgs e) { if (tbIsuse.Text.Trim() == "") { Shove._Web.JavaScript.Alert(this, "期号不能为空。"); return; } DataListZCDC.Visible = true; tableCompetitionNum.Visible = false; DataTable table = CatchIsues(); if (table.Rows.Count == 0) { DataListZCDC.Visible = false; tableCompetitionNum.Visible = true; Shove._Web.JavaScript.Alert(this, "自动添加失败请手动添加。"); return; } CompetitionNum.Text = table.Rows.Count.ToString(); UPlLeague(table); DataListZCDC.DataSource = table; DataListZCDC.DataBind(); btnAdd.Enabled = true; }
protected void btCompetitionNum_Click(object sender, EventArgs e) { if (CompetitionNum.Text.Trim() == "") { Shove._Web.JavaScript.Alert(this.Page, "请输入本期比赛的总场数!"); return; } int AddCompetitionNum = Shove._Convert.StrToInt(CompetitionNum.Text.Trim(), 0); if (AddCompetitionNum < 16) { Shove._Web.JavaScript.Alert(this.Page, "输入的本期比赛总场数输入有误!"); return; } DataListZCDC.Visible = true; tableCompetitionNum.Visible = false; DataTable dt = new DataTable(); DataColumn newDC; newDC = new DataColumn("ID", System.Type.GetType("System.Int32")); dt.Columns.Add(newDC); newDC = new DataColumn("League", System.Type.GetType("System.String")); dt.Columns.Add(newDC); newDC = new DataColumn("HostTeam", System.Type.GetType("System.String")); dt.Columns.Add(newDC); newDC = new DataColumn("QuestTeam", System.Type.GetType("System.String")); dt.Columns.Add(newDC); newDC = new DataColumn("loseBall", System.Type.GetType("System.String")); dt.Columns.Add(newDC); newDC = new DataColumn("Time", System.Type.GetType("System.String")); dt.Columns.Add(newDC); newDC = new DataColumn("color", System.Type.GetType("System.String")); dt.Columns.Add(newDC); for (int i = 0; i < AddCompetitionNum; i++) { DataRow dr = dt.NewRow(); dr[0] = i + 1; dt.Rows.Add(dr); } DataListZCDC.DataSource = dt.DefaultView; DataListZCDC.DataBind(); btnAdd.Enabled = true; }
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 == SZJS.Lottery.SFC.sID || tbLotteryID.Text == SZJS.Lottery.ZCSFC.sID || tbLotteryID.Text == SZJS.Lottery.ZCRJC.sID) { dt = new DAL.Tables.T_IsuseForSFC().Open("", "IsuseID = " + Shove._Web.Utility.FilteSqlInfusion(tbIsuseID.Text), "[No]"); if ((dt == null) || (dt.Rows.Count < 14)) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.Page.GetType().BaseType.FullName); 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 == SZJS.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 == SZJS.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 == SZJS.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(); } } if (tbLotteryID.Text == SZJS.Lottery.ZCDC.sID) { dt = new DAL.Tables.T_IsuseForZCDC().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; } DataListZCDC.DataSource = dt.DefaultView; DataListZCDC.DataBind(); } }