using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class general_dormitory_query : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string sql = "SELECT [房间号], [姓名], [性别], [手机号], [身份证号], [班号], [入住时间] FROM [std_inf] where [姓名] like '%#姓名#%' and [性别] like '%#性别#%' and [房间号] like'%#房间号#%'";
        sql = sql.Replace("#姓名#", TextBox1.Text);
        sql = sql.Replace("#性别#", DropDownList1.SelectedValue);
        sql = sql.Replace("#房间号#", TextBox3.Text);
        SqlDataSource1.SelectCommand = sql;
        SqlDataSource1.Select(DataSourceSelectArguments.Empty);
    }
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Attributes.Add("onmouseover", "bk=this.style.backgroundColor;this.style.backgroundColor='gray';");
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=bk");
        }
    }
}
