private void BindData() { DataTable dt = new DAL.Tables.T_SingleRate().Open("", "StopSellTime > GetDate()", "[Day], MatchNumber"); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName); return; } g.DataSource = dt; g.DataBind(); }
private void BindData() { DataTable dt = new DAL.Tables.T_SingleRate().Open("", "ID=" + ID.ToString(), "[Day], MatchNumber"); if (dt == null) { PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", this.GetType().BaseType.FullName); return; } if (dt.Rows.Count < 1) { return; } lbMatchNumber.Text = dt.Rows[0]["MatchNumber"].ToString(); tbGame.Text = dt.Rows[0]["Game"].ToString(); tbStopSellTime.Text = Shove._Convert.StrToDateTime(dt.Rows[0]["StopSellTime"].ToString(), DateTime.Now.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); tbMainTeam.Text = dt.Rows[0]["MainTeam"].ToString(); tbGuestTeam.Text = dt.Rows[0]["GuestTeam"].ToString(); }
protected void btnEdit_Click(object sender, EventArgs e) { string Game = tbGame.Text.Trim(); if (Game == "") { Shove._Web.JavaScript.Alert(this.Page, "请输入联赛名称。"); return; } string MainTeam = tbMainTeam.Text.Trim(); if (MainTeam == "") { Shove._Web.JavaScript.Alert(this.Page, "请输入主队名称。"); return; } string GuestTeam = tbGuestTeam.Text.Trim(); if (Game == "") { Shove._Web.JavaScript.Alert(this.Page, "请输入客队名称。"); return; } DAL.Tables.T_SingleRate t_SingleRate = new DAL.Tables.T_SingleRate(); t_SingleRate.Game.Value = Game; t_SingleRate.MainTeam.Value = MainTeam; t_SingleRate.GuestTeam.Value = GuestTeam; t_SingleRate.StopSellTime.Value = tbStopSellTime.Text.Trim(); long Result = t_SingleRate.Update("ID=" + hID.Value); if (Result < 0) { Shove._Web.JavaScript.Alert(this.Page, "修改失败。"); return; } Shove._Web.JavaScript.Alert(this.Page, "修改成功", "Jczcdg.aspx"); }