Exemple #1
0
 public void ss(string sousuo)
 {
     Model.News news = new Model.News();
     news.title = sousuo;
     BLL.NewsBLL newsBLL = new BLL.NewsBLL();
     if (newsBLL.SearchTitle(news))
     {
         this.SqlDataSource1.SelectCommand = news.sql;
     }
 }
Exemple #2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     Model.News  news    = new Model.News();
     BLL.NewsBLL newsBLL = new BLL.NewsBLL();
     if (this.DropDownList1.SelectedValue == "按标题")
     {
         news.title = Request["search"].ToString().Trim();
         newsBLL.SearchTitle(news);
         this.SqlDataSource1.SelectCommand = news.sql;
     }
     else if (this.DropDownList1.SelectedValue == "按类别")
     {
         news.category = Request["search"].ToString().Trim();
         newsBLL.SearchCategory(news);
         this.SqlDataSource1.SelectCommand = news.sql;
     }
 }