📄 add.aspx.cs.svn-base
字号:
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 LTP.Common;
namespace Maticsoft.Web.Hotel
{
public partial class Add : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Page_LoadComplete(object sender, EventArgs e)
{
(Master.FindControl("lblTitle") as Label).Text = "信息添加";
}
protected void btnAdd_Click(object sender, EventArgs e)
{
string strErr="";
if(this.txtHotelName.Text =="")
{
strErr+="HotelName不能为空!\\n";
}
if(this.txtHotelEN.Text =="")
{
strErr+="HotelEN不能为空!\\n";
}
if(this.txtSpellCode.Text =="")
{
strErr+="SpellCode不能为空!\\n";
}
if(this.txtBusinessID.Text =="")
{
strErr+="BusinessID不能为空!\\n";
}
if(this.txtRegionID.Text =="")
{
strErr+="RegionID不能为空!\\n";
}
if(this.txtHotelType.Text =="")
{
strErr+="HotelType不能为空!\\n";
}
if(this.txtHotelStars.Text =="")
{
strErr+="HotelStars不能为空!\\n";
}
if(this.txtRating.Text =="")
{
strErr+="Rating不能为空!\\n";
}
if(this.txtIntroduction.Text =="")
{
strErr+="Introduction不能为空!\\n";
}
if(this.txtPicture.Text =="")
{
strErr+="Picture不能为空!\\n";
}
if(this.txtUserRating.Text =="")
{
strErr+="UserRating不能为空!\\n";
}
if(this.txtEMap.Text =="")
{
strErr+="EMap不能为空!\\n";
}
if(this.txtVenderID.Text =="")
{
strErr+="VenderID不能为空!\\n";
}
if(strErr!="")
{
MessageBox.Show(this,strErr);
return;
}
string HotelName=this.txtHotelName.Text;
string HotelEN=this.txtHotelEN.Text;
string SpellCode=this.txtSpellCode.Text;
string BusinessID=this.txtBusinessID.Text;
string RegionID=this.txtRegionID.Text;
string HotelType=this.txtHotelType.Text;
string HotelStars=this.txtHotelStars.Text;
string Rating=this.txtRating.Text;
string Introduction=this.txtIntroduction.Text;
string Picture=this.txtPicture.Text;
string UserRating=this.txtUserRating.Text;
string EMap=this.txtEMap.Text;
string VenderID=this.txtVenderID.Text;
Maticsoft.Model.Hotel model=new Maticsoft.Model.Hotel();
model.HotelName=HotelName;
model.HotelEN=HotelEN;
model.SpellCode=SpellCode;
model.BusinessID=BusinessID;
model.RegionID=RegionID;
model.HotelType=HotelType;
model.HotelStars=HotelStars;
model.Rating=Rating;
model.Introduction=Introduction;
model.Picture=Picture;
model.UserRating=UserRating;
model.EMap=EMap;
model.VenderID=VenderID;
Maticsoft.BLL.Hotel bll=new Maticsoft.BLL.Hotel();
bll.Add(model);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -