insertroomtype.aspx.cs

来自「酒店管理系统 用C#开发 程序简单明了 应用系统」· CS 代码 · 共 59 行

CS
59
字号
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 InsertRoomType : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            DIV1.Visible = false;
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        RoomTypeEntity room = new RoomTypeEntity();
        room.TypeName = this.TextBox1.Text;
        room.TypePrice = this.TextBox2.Text;
        room.AddBedPrice = this.TextBox3.Text;
        string isadd = "";
        if (RadioButton1.Checked)
        {
            isadd = "是";
        }
        if (RadioButton2.Checked)
        {
            isadd = "否";
        }
        room.IsAddBed = isadd;
        room.Remark = this.TextBox4.Text;
        RoomTypeBLL roombll = new RoomTypeBLL();
        int count = roombll.insert(room);
        if (count != 0)
        {
            DIV1.Visible = true;
            this.Label1.Text = "插入成功!";
            this.TextBox4.Text = "";
            this.TextBox3.Text = "";
            this.TextBox1.Text = "";
            this.TextBox2.Text = "";
            this.RadioButton1.Checked = false;
            this.RadioButton2.Checked = false;
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        DIV1.Visible = false;
    }
}

⌨️ 快捷键说明

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