您目前尚未登陆,请选择【登陆】或【注册
首页->行政办公->酒店管理系统(三层开发)源码>>WebSite_hotel/UserReception.aspx.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:酒店管理系统(三层开发)源码
当前文件:文件类型 ThreeLayerHotel/WebSite_hotel/UserReception.aspx.cs打开代码结构图
普通视图
		            
1using System; 2using System.Collections; 3using System.Configuration; 4using System.Data; 5using System.Linq; 6using System.Web; 7using System.Web.Security; 8using System.Web.UI; 9using System.Web.UI.HtmlControls; 10using System.Web.UI.WebControls; 11using System.Web.UI.WebControls.WebParts; 12using System.Xml.Linq; 13using BLL; 14using Entity; 15 16public partial class UserReception : System.Web.UI.Page 17{ 18 protected void Page_Load(object sender, EventArgs e) 19 { 20 if (!IsPostBack) 21 { 22 if (!IsPostBack) 23 { 24 if (Session["Name"] == null) 25 { 26 Response.Redirect("Index.aspx"); 27 } 28 } 29 MultiView4.ActiveViewIndex = 0; 30 Bind(); 31 } 32 } 33 34 /// <summary> 35 /// 查询所有 36 /// </summary> 37 void Bind() 38 { 39 DataTable dt = UserRoomBLL.GetReceptionTable(); 40 GridView1.DataSource = dt; 41 GridView1.DataBind(); 42 } 43 44 /// <summary> 45 /// 条件查询 46 /// </summary> 47 void Bind1() 48 { 49 if (ddl.Text == "用户ID") 50 { 51 DataTable dt = UserRoomBLL.GetUserReceptionByUserName(txtfilter.Text); 52 GridView2.DataSource = dt; 53 GridView2.DataBind(); 54 } 55 else 56 { 57 DataTable dt = UserRoomBLL.GetUserReceptionByName(txtfilter.Text); 58 GridView2.DataSource = dt; 59 GridView2.DataBind(); 60 } 61 } 62 63 void Do(int RoomID) 64 { 65 DataTable dt = UserRoomBLL.GetUserReceptionStateByRoomID(RoomID); 66 if (dt.Rows[0]["state"].ToString() == "已预订") 67 { 68 int flag = UserRoomBLL.UpdateUserReceptionStateByRoomID(RoomID); 69 if (flag == 1) 70 { 71 Session["flag"] = "成功的将用户“" + dt.Rows[0]["username"].ToString() + "”预订的房间“" + dt.Rows[0]["Number"] + "”修改为入住状态"; 72 if (MultiView4.ActiveViewIndex == 0) 73 Bind(); 74 else 75 Bind1(); 76 } 77 } 78 else 79 { 80 return; 81 } 82 } 83 84 protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) 85 { 86 int RoomID = Convert.ToInt32(GridView1.DataKeys[GridView1.SelectedIndex].Value); 87 Do(RoomID); 88 } 89 90 protected void GridView2_SelectedIndexChanged(object sender, EventArgs e) 91 { 92 int RoomID = Convert.ToInt32(GridView2.DataKeys[GridView2.SelectedIndex].Value); 93 Do(RoomID); 94 } 95 96 protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) 97 { 98 GridView1.PageIndex = e.NewPageIndex; 99 Bind(); 100 } 101 102 103 protected void GridView2_PageIndexChanging(object sender, GridViewPageEventArgs e) 104 { 105 GridView2.PageIndex = e.NewPageIndex; 106 Bind1(); 107 } 108 109 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) 110 { 111 if (e.Row.RowType == DataControlRowType.DataRow) 112 { 113 e.Row.Attributes.Add("onmouseover", "current=this.style.backgroundColor;this.style.backgroundColor='#6699ff'"); 114 e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=current"); 115 } 116 } 117 protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e) 118 { 119 if (e.Row.RowType == DataControlRowType.DataRow) 120 { 121 e.Row.Attributes.Add("onmouseover", "current=this.style.backgroundColor;this.style.backgroundColor='#6699ff'"); 122 e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=current"); 123 } 124 } 125 protected void LinkButton12_Click(object sender, EventArgs e) 126 { 127 MultiView4.ActiveViewIndex = 0; 128 Bind(); 129 } 130 protected void LinkButton11_Click(object sender, EventArgs e) 131 { 132 MultiView4.ActiveViewIndex = 1; 133 Bind1(); 134 } 135} 136
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:酒店管理系统(三层开发)源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号