📄 modify.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 Modify : System.Web.UI.Page
{
protected void Page_LoadComplete(object sender, EventArgs e)
{
(Master.FindControl("lblTitle") as Label).Text = "信息修改";
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (Request.Params["id"] != null || Request.Params["id"].Trim() != "")
{
string id = Request.Params["id"];
ShowInfo(int.Parse(id));
}
}
}
private void ShowInfo(string HotelID)
{
Maticsoft.BLL.Hotel bll=new Maticsoft.BLL.Hotel();
Maticsoft.Model.Hotel model=bll.GetModel(HotelID);
this.lblHotelID.Text=model.HotelID;
this.txtHotelName.Text=model.HotelName;
this.txtHotelEN.Text=model.HotelEN;
this.txtSpellCode.Text=model.SpellCode;
this.txtBusinessID.Text=model.BusinessID;
this.txtRegionID.Text=model.RegionID;
this.txtHotelType.Text=model.HotelType;
this.txtHotelStars.Text=model.HotelStars;
this.txtRating.Text=model.Rating;
this.txtIntroduction.Text=model.Introduction;
this.txtPicture.Text=model.Picture;
this.txtUserRating.Text=model.UserRating;
this.txtEMap.Text=model.EMap;
this.txtVenderID.Text=model.VenderID;
}
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.Update(model);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -