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

📄 addroomtype.aspx.cs

📁 酒店管理系统 用C#开发 程序简单明了 应用系统
💻 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 BLL;
using Model;

public partial class AddRoomType : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            BindToAll();
        }
    }
    public void BindToAll()
    {
        int id = int.Parse(Request.QueryString["id"]);
        RoomTypeBLL room = new RoomTypeBLL();
        DataSet ds = room.selectwhereid(id);
        this.Label1.Text = ds.Tables[0].Rows[0]["TypeName"].ToString();
        this.TextBox2.Text = ds.Tables[0].Rows[0]["TypePrice"].ToString();
        this.TextBox4.Text = ds.Tables[0].Rows[0]["AddBedPrice"].ToString();
        string isadd = ds.Tables[0].Rows[0]["IsAddBed"].ToString();
        if (isadd == "是")
        {
            RadioButton1.Checked = true;
        }
        if (isadd == "否")
        {
            RadioButton2.Checked = true;
        }
        this.TextBox3.Text = ds.Tables[0].Rows[0]["Remark"].ToString();
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        RoomTypeEntity room = new RoomTypeEntity();
        room.TypeName = this.Label1.Text;
        room.TypePrice = this.TextBox2.Text;
        room.AddBedPrice = this.TextBox4.Text;
        string isadd = "";
        if (RadioButton1.Checked)
        {
            isadd = "是";
        }
        if (RadioButton2.Checked)
        {
            isadd = "否";
        }
        room.IsAddBed = isadd;
        room.Remark = this.TextBox3.Text;
        room.TypeID = int.Parse(Request.QueryString["id"]);
        RoomTypeBLL roombll = new RoomTypeBLL();
        int count = roombll.update(room);
        if (count != 0)
        {
            Server.Transfer("SelectRoomType.aspx");
        }
    }
}

⌨️ 快捷键说明

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