/// <summary> /// 初始化 /// </summary> protected void chushi() { //根据编号得到相应的记录 DataSet ds = bll.GetList(" id=" + Request.QueryString["id"]); if (ds.Tables[0].Rows.Count > 0) { txt_title.Text = ds.Tables[0].Rows[0]["title"].ToString(); Textarea1.Value = ds.Tables[0].Rows[0]["memo"].ToString(); } }
/// <summary> /// 绑定 /// </summary> private void bind() { string where = " 1=1 "; if (txt_title.Text != "") { where += " and title like '%" + txt_title.Text + "%' "; } GridView1.DataSource = bll.GetList(where + " order by id desc"); GridView1.DataBind(); }
//初始化 private void ShowInfo() { if (Request.QueryString["id"] != null) { SP.BLL.selection bll = new SP.BLL.selection(); //根据编号得到相应的记录 DataSet ds = bll.GetList(" id=" + Request.QueryString["id"]); if (ds.Tables[0].Rows.Count > 0) { DataRow sdr = ds.Tables[0].Rows[0]; lbltitle.Text = sdr["title"].ToString(); lblmemo.Text = sdr["memo"].ToString(); lblatime.Text = sdr["atime"].ToString(); } } }