//添加入住信息 protected void Button1_Click(object sender, EventArgs e) { int gid = Convert.ToInt32(this.TextBox1.Text); int roomid = Convert.ToInt32(this.DropDownList2.SelectedValue); int day = Convert.ToInt32(this.TextBox9.Text); DateTime intime = Convert.ToDateTime(this.TextBox8.Text); DateTime outtime = Convert.ToDateTime(this.TextBox4.Text); double charge = Convert.ToInt32(this.TextBox6.Text); double actcharge = Convert.ToInt32(this.TextBox11.Text); BLL_Hotel.Add_Reserve(gid, roomid, intime, outtime, day, charge, actcharge); BLL_Hotel.Gai_roomstate(roomid, 1); ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('预定登记成功!');location.href='ReserveDetail.aspx?roomid=" + roomid + "'", true); }
//添加预约信息 protected void btnSubmit_Click(object sender, EventArgs e) { int gid = Convert.ToInt32(this.txtGid.Text); int roomid = Convert.ToInt32(this.ddlRoomName.SelectedValue); int day = Convert.ToInt32(this.txtDayNum.Text); DateTime intime = Convert.ToDateTime(this.txtInTime.Text); DateTime outtime = Convert.ToDateTime(this.txtOutTime.Text); double charge = Convert.ToInt32(this.txtCharge.Text); double actcharge = Convert.ToInt32(this.txtActCharge.Text); BLL_Hotel.Add_Reserve(gid, roomid, intime, outtime, day, charge, actcharge); //入住预定(预定信息表插入数据) BLL_Hotel.Gai_roomstate(roomid, 1); //修改房间状态 ScriptManager.RegisterClientScriptBlock(UpdatePanel1, this.GetType(), "click", "alert('预定登记成功!');location.href='ReserveDetail.aspx?roomid=" + roomid + "'", true); }