public void binddata() { BLLhelp bllhelp = new BLLhelp(); DataSet ds = bllhelp.select(AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1), AspNetPager1.PageSize, "info"); GridView1.DataSource = ds; GridView1.DataBind(); }
public void bindInfo() { int cateid = Convert.ToInt32(Request.QueryString["cateid"]); BLLhelp bllhelp = new BLLhelp(); DataSet ds = bllhelp.ds_search(AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1), AspNetPager1.PageSize, "info", cateid); GridView1.DataSource = ds; GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Help help = new Help(); help.ID = Convert.ToInt32(Request.QueryString["id"]); BLLhelp bllhelp = new BLLhelp(); MySqlDataReader sdr = bllhelp.readinfo(help); if (sdr.Read()) { Label1.Text = sdr["_id"].ToString(); TextBox1.Text = sdr["_title"].ToString(); FCKeditor1.Value = sdr["_content"].ToString(); } sdr.Close(); } }
protected void Button1_Click(object sender, EventArgs e) { Help help = new Help(); help.Title = txt_title.Text; help.Content =FCKeditor1.Value; help.Cateid = Convert.ToInt32(dl_cate.SelectedValue); BLLhelp bllhelp = new BLLhelp(); int result = bllhelp.insert(help); if (result>0) { Common.MessageAlert.AlertLocation(Page, "alert('添加成功');location.href='helplist.aspx'"); } else { Common.MessageAlert.Alert(Page,"添加失败"); } }
protected void Button1_Click(object sender, EventArgs e) { Help help = new Help(); int id = Convert.ToInt32(Label1.Text); help.ID = id; help.Title = TextBox1.Text; help.Content = FCKeditor1.Value; BLLhelp bllhelp = new BLLhelp(); int result = bllhelp.update(help); if (result > 0) { Common.MessageAlert.AlertLocation(Page, "alert('更新成功');location.href='helplist.aspx'"); } else { Common.MessageAlert.Alert(Page, "更新失败"); } }
protected void Page_Load(object sender, EventArgs e) { int id = Convert.ToInt32(Request.QueryString["id"]); BLLHelpcate bllhelpcate = new BLLHelpcate(); DataSet ds = bllhelpcate.select(); Repeater1.DataSource = ds; Repeater1.DataBind(); int _id = Convert.ToInt32(Request.QueryString["_id"]); Help help = new Help(); help.ID = _id; BLLhelp bllhelp = new BLLhelp(); MySqlDataReader sdr = bllhelp.readinfo(help); if (sdr.Read()) { Label1.Text = sdr["_title"].ToString(); Label2.Text = sdr["_content"].ToString(); Page.Title = Label1.Text; } }
public void load() { string sql = "select top 9 * from news "; dt = DbHelperSQL.Query(sql).Tables[0]; if (Session["_username"] != null) { string aa = " 欢迎您光临秋哈购物网!!"; welcome.Text = Session["_username"].ToString() + aa.ToString()+" "; } string str = "select top 7 * from news order by _id desc "; DataSet ds = DB.dataSet(str); Repeater1.DataSource = ds.Tables[0]; Repeater1.DataBind(); int id = 2; BLLhelp bllhelp = new BLLhelp(); DataSet ds1 = bllhelp.cj_ds(id); Repeater2.DataSource = ds1; Repeater2.DataBind(); int id1 = 26; DataSet ds2 = bllhelp._selectAll(id1); Re_xs.DataSource = ds2; Re_xs.DataBind(); int id2 = 19; DataSet ds3 = bllhelp._selectAll(id2); Re_ps.DataSource = ds3; Re_ps.DataBind(); int id3 = 20; DataSet ds4 = bllhelp._selectAll(id3); Re_fw.DataSource = ds4; Re_fw.DataBind(); int id4 = 25; DataSet ds5 = bllhelp._selectAll(id4); Re_huiy.DataSource = ds5; Re_huiy.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { int id = Convert.ToInt32(Request.QueryString["id"]); BLLHelpcate bllhelpcate = new BLLHelpcate(); DataSet ds = bllhelpcate.select(); Repeater1.DataSource = ds; Repeater1.DataBind(); DataSet ds2 = bllhelpcate.select(id); Repeater3.DataSource = ds2; Repeater3.DataBind(); BLLhelp bllhelp = new BLLhelp(); DataSet ds1 = bllhelp.selectAll(id); Repeater2.DataSource = ds1; Repeater2.DataBind(); Model.Helpcate helpcate=new Model.Helpcate(); helpcate.ID=id; MySqlDataReader sdr = bllhelpcate.sqldatareader(helpcate); if (sdr.Read()) { Page.Title = sdr["_catename"].ToString(); } else { sdr.Close(); if (Label1.Text == "个人注册及信息管理") { Response.Write(Label1.Text); Page.Title = "个人注册及信息管理"; } } }
protected void Button4_Click(object sender, EventArgs e) { int id; for (int i = 0; i < GridView1.Rows.Count; i++) { CheckBox cb = (CheckBox)GridView1.Rows[i].FindControl("CheckBox1"); if (cb.Checked) { id = Convert.ToInt32(GridView1.DataKeys[i].Value); Help help = new Help(); help.ID = id; BLLhelp bllhelp = new BLLhelp(); int result = bllhelp.delete(help); if (result > 0) { Common.MessageAlert.AlertLocation(Page, "alert('批量删除成功');location.href='helplist.aspx'"); //Response.Write("<script>alert('批量删除成功');</script>"); } else { Common.MessageAlert.Alert(Page, "批量删除失败"); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BLLhelp bllhelp = new BLLhelp(); int result = bllhelp.resultCount(); if (result>0) { AspNetPager1.RecordCount = result; AspNetPager1.PageSize = 10; binddata(); } else { Button1.Visible = false; Button2.Visible = false; Button3.Visible = false; Button4.Visible = false; AspNetPager1.Visible = false; txt_search.Visible = false; } } }
protected void Button4_Click(object sender, EventArgs e) { int id; for (int i = 0; i < GridView1.Rows.Count; i++) { id = Convert.ToInt32(GridView1.DataKeys[i].Value); Help help = new Help(); help.ID = id; BLLhelp bllhelp = new BLLhelp(); int result=bllhelp.delete(help); if (result>0) { Common.MessageAlert.AlertLocation(Page, "alert('批量删除成功');location.href='helplist.aspx'"); } else { Common.MessageAlert.Alert(Page,"批量删除失败"); } } }
protected void Page_Load(object sender, EventArgs e) { AspNetPager1.PageSize = 5; if (!IsPostBack) { int cateid = Convert.ToInt32(Request.QueryString["cateid"]); Help help = new Help(); help.Cateid = cateid; BLLhelp bll = new BLLhelp(); int result = bll.searchResult(help); if (result>0) { AspNetPager1.RecordCount = result; bindInfo(); Label1.Visible = false; } else { Label1.Text = "对不起,没有相关信息"; Label1.Visible = true; AspNetPager1.Visible = false; Button2.Visible = false; Button3.Visible = false; Button4.Visible = false; } } }