public void BindData() { this.GridView_mProject.DataSourceID = null; DataSet ds = new DataSet(); StringBuilder strWhere = new StringBuilder(); string value = DropDownList_misCheck.SelectedValue.ToString().Trim(); string value1 = DropDownList_mState.SelectedValue.ToString().Trim(); string value2 = DropDownList_mType.SelectedValue.ToString().Trim(); string value3 = DropDownList_Year.SelectedValue.ToString().Trim(); strWhere.AppendFormat("project_class like '%{0}%'", value); strWhere.AppendFormat("and project_state like '%{0}%'", value1); strWhere.AppendFormat("and project_type like '%{0}%'", value2); strWhere.AppendFormat("and project_year like '%{0}%'", value3); strWhere.AppendFormat("and project_writer like '%{0}%'", strid); if (txtmKeyword.Text.Trim() != "") { strWhere.AppendFormat("and(project_name like '%{0}%' or project_owner like '%{0}%' or project_positon like '%{0}%')", txtmKeyword.Text.Trim()); } ds = bllm.GetList(strWhere.ToString()); GridView_mProject.DataSource = ds; GridView_mProject.DataBind(); }
public void BindData() { this.GridView_Project.DataSourceID = null; DataSet ds = new DataSet(); StringBuilder strWhere = new StringBuilder(); string value = DropDownList_isCheck.SelectedValue.ToString().Trim(); string value1 = DropDownList_State.SelectedValue.ToString().Trim(); string value2 = DropDownList_Type.SelectedValue.ToString().Trim(); strWhere.AppendFormat("project_check like '%{0}%'", value); strWhere.AppendFormat("and project_state like '%{0}%'", value1); strWhere.AppendFormat("and project_type like '%{0}%'", value2); // if (txtKeyword.Text.Trim() != "") { // strWhere.AppendFormat("and(project_name like '%{0}%' or project_owner like '%{0}%' or project_positon like '%{0}%')", txtKeyword.Text.Trim()); } ds = bll.GetList(strWhere.ToString()); GridView_Project.DataSource = ds; GridView_Project.DataBind(); }
public void BindData() { this.GridView_Project.Visible = true; // Maticsoft.BLL.NewPort.projecttable bll = new Maticsoft.BLL.NewPort.projecttable(); Maticsoft.BLL.NewPort.Table_project bll = new Maticsoft.BLL.NewPort.Table_project(); this.GridView_Project.DataSourceID = null; DataSet ds = new DataSet(); StringBuilder strWhere = new StringBuilder(); strWhere.AppendFormat("("); strWhere.AppendFormat("project_year like '%{0}%' and ", DDL_Year1.SelectedValue.Trim()); if (cb_alltype.Checked == false) { if (cb_Ganhang.Checked) { strWhere.AppendFormat("project_type like '%{0}%' or ", "港航项目"); } if (cb_Jishuyun.Checked) { strWhere.AppendFormat("project_type like '%{0}%' or ", "集疏运项目"); } if (cb_Lingang.Checked) { strWhere.AppendFormat("project_type like '%{0}%' or ", "临港产业项目"); } strWhere.AppendFormat("project_type like '%{0}%' )and (", "visual2010"); } if (cb_allstate.Checked == false) { if (cb_New.Checked) { strWhere.AppendFormat("project_state like '%{0}%' or ", "新开工"); } if (cb_Goon.Checked) { strWhere.AppendFormat("project_state like '%{0}%' or ", "续建"); } strWhere.AppendFormat("project_state like '%{0}%' )and (", "visual2010"); } if (cb_allarea.Checked == false) { if (cb_Wuhan.Checked) { strWhere.AppendFormat("project_area like '%{0}%' or ", "武汉"); } if (cb_Ezhou.Checked) { strWhere.AppendFormat("project_area like '%{0}%' or ", "鄂州"); } if (cb_Huanggan.Checked) { strWhere.AppendFormat("project_area like '%{0}%' or ", "黄冈"); } if (cb_Xianning.Checked) { strWhere.AppendFormat("project_area like '%{0}%' or ", "咸宁"); } if (cb_Xinzhou.Checked) { strWhere.AppendFormat("project_area like '%{0}%' or ", "新洲"); } if (cb_Hannan.Checked) { strWhere.AppendFormat("project_area like '%{0}%' or ", "汉南"); } if (cb_HGQ.Checked) { strWhere.AppendFormat("project_area like '%{0}%' or ", "化工区"); } if (cb_XGT.Checked) { strWhere.AppendFormat("project_area like '%{0}%' or ", "新港投"); } if (cb_Wugan.Checked) { strWhere.AppendFormat("project_area like '%{0}%' or ", "武港"); } if (cb_Jiangxia.Checked) { strWhere.AppendFormat("project_area like '%{0}%' or ", "江夏"); } strWhere.AppendFormat("project_area like '%{0}%')", "visual2010"); } else { strWhere.AppendFormat("'visual2010' like '%{0}%')", "visual2010"); } ds = bll.GetList(strWhere.ToString()); GridView_Project.DataSource = ds; GridView_Project.DataBind(); }