protected void Btn_Query_Click(object sender, EventArgs e) { string select_option = " and IllustratedDocName like '%" + TB_Query_DocName.Text + "%' and IllustratedDocNumber like '%" + TB_Query_DocNumber.Text + "%' and PCCNumber like '%" + TB_Query_PCCNumber.Text + "%'"; Sql_Query.SelectCommand += select_option; Gv_Query.DataBind(); }
protected void RBL_Query_SelectedIndexChanged(object sender, EventArgs e) { if (RBL_Query.SelectedValue == "0") { Sql_Query.SelectCommand = "SELECT * FROM [ConstructionElement]"; } else if (RBL_Query.SelectedValue == "1") { Sql_Query.SelectCommand = "SELECT * FROM [ConstructionElement] WHERE TheNewest = 1"; } Gv_Query.DataBind(); }
protected void Btn_Query_Click(object sender, EventArgs e) { if (RBL_Query.SelectedValue == "0") { Sql_Query.SelectCommand = "SELECT * FROM [ConstructionElement] WHERE "; } else if (RBL_Query.SelectedValue == "1") { Sql_Query.SelectCommand = "SELECT * FROM [ConstructionElement] WHERE TheNewest = 1 and "; } string select_option = "ElementName like '%" + TB_Query_Name.Text + "%' and Type like '%" + TB_Query_Type.Text + "%' and Remark like '%" + TB_Query_Remark.Text + "%'"; Sql_Query.SelectCommand += select_option; Gv_Query.DataBind(); }