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;
using hqgl.user;
public partial class general_dormitory_room : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Buffer =true;
        Response.ExpiresAbsolute =DateTime.Now.AddMinutes( - 1);
        Response.Expires = 0;
        Response.CacheControl = "no-cache";
        Response.AddHeader("Pragma", "No-Cache");


        userchuli uch = new userchuli();
        uch.user_yanzheng();
        string mm = Request.QueryString["mm"];

        if (string.IsNullOrEmpty(mm))
            SqlDataSource1.SelectCommand = "SELECT * FROM [room_view]";
        else if (mm == "em")
            SqlDataSource1.SelectCommand = "SELECT * FROM [room_view] where 空缺人数>0";
        else
            SqlDataSource1.SelectCommand = "SELECT * FROM [room_view] where 空缺人数<=0";
        SqlDataSource1.Select(DataSourceSelectArguments.Empty);
    }
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Attributes.Add("onclick", "rowclick(this);");
            e.Row.Attributes.Add("onmouseover", "bk=this.style.backgroundColor;this.style.backgroundColor='gray';");
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=bk");
        }
    }
}
