温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:酒店管理系统(ExtJs)源码
当前文件:
MyHotelManager/HotelUI/Form/AddRoomType.aspx.cs,打开代码结构图
MyHotelManager/HotelUI/Form/AddRoomType.aspx.cs,打开代码结构图1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Collections; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
using HotelBLL; 12
using HotelModels; 13
14
public partial class Form_AddRoomType : System.Web.UI.Page 15
{ 16
protected void Page_Load(object sender, EventArgs e) 17
{ 18
if (!Page.IsPostBack) 19
{ 20
AddRoomType(); 21
} 22
} 23
24
25
/// <summary> 26
/// 添加房间类型 27
/// </summary> 28
private void AddRoomType() 29
{ 30
RoomTypeBLL rtBll = new RoomTypeBLL(); 31
RoomTypeBean rtb = new RoomTypeBean(); 32
//得到表单提交的值 33
rtb.TypeName = Request.Form["TypeName"]; 34
rtb.TypePrice = double.Parse(Request.Form["TypePrice"].ToString()); 35
rtb.IsTv = Request.Form["IsTv"]; 36
rtb.IsKongTiao = Request.Form["IsKongTiao"]; 37
rtb.Remark = Request.Form["remark"]; 38
string json; 39
//如果success为true,则表示服务器端处理成功 40
if (rtBll.AddRoomType(rtb)) 41
{ 42
json = @"{success: true}"; 43
} 44
else 45
{ 46
json = @"{success: false}"; 47
} 48
Response.Write(json); 49
} 50
} 51





}
}