⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 roomdetaillist.ascx.cs

📁 本程序是一个宾馆管理系统
💻 CS
字号:
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 System.Data.SqlClient;
using SQLExe;

public partial class Context_RoomDetailList : System.Web.UI.UserControl
{
    private int RoomId;
    public int SetRoomId
    {
        set
        {
            this.RoomId = value;
        }
        get
        {
            return this.RoomId;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            SetDataBind();
           
        }
    }
    public void SetDataBind()
    {
        SqlConnection ST_myCon = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
        SqlCommand ST_mycommand = new SqlCommand();      
        ST_mycommand.Connection = ST_myCon;
        ST_mycommand.CommandText = "select ST_RoomId,ST_RPosition,ST_Name,ST_Area,ST_BedNum,ST_Price,ST_Status from RoomStatusView where ST_RoomId=" + this.RoomId + "";
        ST_myCon.Open();
        SqlDataReader dl = ST_mycommand.ExecuteReader();
        if (dl.Read())
        {
            this.lblRoomId.Text = dl["ST_RoomId"].ToString();
            this.lblPosition.Text = dl["ST_RPosition"].ToString();
            this.lblCategory.Text = dl["ST_Name"].ToString();
            this.lblArea.Text = dl["ST_Area"].ToString();
            this.lblBedNum.Text = dl["ST_BedNum"].ToString();
            this.lblPrice.Text = dl["ST_Price"].ToString();
            if (dl["ST_Status"].ToString() == "2")
            {
                this.lblIsNull.Text = "否";
                this.likReturn.Visible = false;//让退房失效
            }
            else if (dl["ST_Status"].ToString() == "1")
            {
                this.lblIsNull.Text = "是";
                this.likBook.Visible = false;///让订房失效
            }
        }
        dl.Close();
        ST_myCon.Close();

        }


    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        int RoomId=int.Parse(this.lblRoomId.Text);
        Response.Redirect("BookRoom.aspx?RoomId=" + RoomId);
    }
    protected void likReturn_Click(object sender, EventArgs e)
    {
        int RoomId = int.Parse(this.lblRoomId.Text);
        Response.Redirect("ReturnRoom.aspx?RoomId=" + RoomId);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -