public void del() { Model.Contribute contribute = new Model.Contribute(); contribute.id = s; BLL.ContributeBLL contributeBLL = new BLL.ContributeBLL(); if (contributeBLL.DelContribute(contribute)) { Response.Write("<script>alert('删除稿件成功');window.location.href='checktougao.aspx'</script>"); } }
protected void Button2_Click1(object sender, EventArgs e) { Model.Contribute contribute = new Model.Contribute(); contribute.id = s; BLL.ContributeBLL contributeBLL = new BLL.ContributeBLL(); if (contributeBLL.DelContribute(contribute)) { Response.Write("<script>alert('删除成功');window.location.href='contributes.aspx'</script>"); } }
protected void Button1_Click(object sender, EventArgs e) { Model.Contribute contribute = new Model.Contribute(); contribute.id = s; contribute.category = DropDownList1.SelectedItem.Text; contribute.title = Request["ttitle"].ToString(); contribute.author = Request["author"].ToString(); contribute.contents = this.txtEditorContents.Text; contribute.createTime = DateTime.Now.ToLocalTime().ToString(); BLL.ContributeBLL contributeBLL = new BLL.ContributeBLL(); contributeBLL.UpdateContribute(contribute); }
public void query(string id) { Model.Contribute contribute = new Model.Contribute(); contribute.id = id; BLL.ContributeBLL contributeBLL = new BLL.ContributeBLL(); if (contributeBLL.QueryContribute(contribute)) { this.ttitle.Value = contribute.title.ToString(); this.author.Value = contribute.author.ToString(); this.txtEditorContents.Text = contribute.contents; } else { Response.Write("<script>alert('查询失败')</script>"); } }
protected void Button1_Click(object sender, EventArgs e) { Model.Contribute contribute = new Model.Contribute(); BLL.ContributeBLL contributeBLL = new BLL.ContributeBLL(); if (this.DropDownList1.SelectedValue == "按标题") { contribute.title = Request["search"].ToString().Trim(); contributeBLL.SearchTitle(contribute); this.SqlDataSource1.SelectCommand = contribute.sql; } else if (this.DropDownList1.SelectedValue == "按类别") { contribute.category = Request["search"].ToString().Trim(); contributeBLL.SearchCategory(contribute); this.SqlDataSource1.SelectCommand = contribute.sql; } else if (this.DropDownList1.SelectedValue == "按投稿人") { contribute.username = Request["search"].ToString().Trim(); contributeBLL.SearchUsername(contribute); this.SqlDataSource1.SelectCommand = contribute.sql; } }