📄 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.HotelOrder
{
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 OrderNo)
{
Maticsoft.BLL.HotelOrder bll=new Maticsoft.BLL.HotelOrder();
Maticsoft.Model.HotelOrder model=bll.GetModel(OrderNo);
this.lblOrderNo.Text=model.OrderNo;
this.txtHotelID.Text=model.HotelID;
this.txtIndate.Text=model.Indate;
this.txtOutdate.Text=model.Outdate;
this.txtPayMethods.Text=model.PayMethods;
this.txtRoomTrait.Text=model.RoomTrait;
this.txtLocalFloor.Text=model.LocalFloor;
this.txtBreakfastPrice1.Text=model.BreakfastPrice1.ToString();
this.txtBreakfastPrice2.Text=model.BreakfastPrice2.ToString();
this.txtAddBedPrice.Text=model.AddBedPrice.ToString();
this.txtAdvance.Text=model.Advance.ToString();
this.txtInManAmount.Text=model.InManAmount.ToString();
this.txtInPaper.Text=model.InPaper;
this.txtInManName.Text=model.InManName;
this.txtArriveEarlyDate.Text=model.ArriveEarlyDate;
this.txtArriveLateDate.Text=model.ArriveLateDate;
this.txtArriveMethods.Text=model.ArriveMethods;
this.txtLinkMan.Text=model.LinkMan;
this.txtConfirmedMethods.Text=model.ConfirmedMethods;
this.txtPhone1.Text=model.Phone1;
this.txtPhone2.Text=model.Phone2;
this.txtFax.Text=model.Fax;
this.txtEmail.Text=model.Email;
this.txtRemark.Text=model.Remark;
this.txtRoomType.Text=model.RoomType;
this.txtAveragePrice.Text=model.AveragePrice.ToString();
this.txtOrderState.Text=model.OrderState.ToString();
this.txtConfirmID.Text=model.ConfirmID;
this.txtConfimDate.Text=model.ConfimDate.ToString();
this.txtAccountConfirmID.Text=model.AccountConfirmID;
this.txtAccountConfirmDate.Text=model.AccountConfirmDate.ToString();
this.txtPlanConfirmID.Text=model.PlanConfirmID;
this.txtPlanConfirmDate.Text=model.PlanConfirmDate.ToString();
this.txtVenderID.Text=model.VenderID;
}
protected void btnAdd_Click(object sender, EventArgs e)
{
string strErr="";
if(this.txtHotelID.Text =="")
{
strErr+="HotelID不能为空!\\n";
}
if(this.txtIndate.Text =="")
{
strErr+="Indate不能为空!\\n";
}
if(this.txtOutdate.Text =="")
{
strErr+="Outdate不能为空!\\n";
}
if(this.txtPayMethods.Text =="")
{
strErr+="PayMethods不能为空!\\n";
}
if(this.txtRoomTrait.Text =="")
{
strErr+="RoomTrait不能为空!\\n";
}
if(this.txtLocalFloor.Text =="")
{
strErr+="LocalFloor不能为空!\\n";
}
if(!PageValidate.IsDecimal(txtBreakfastPrice1.Text))
{
strErr+="BreakfastPrice1不是数字!\\n";
}
if(!PageValidate.IsDecimal(txtBreakfastPrice2.Text))
{
strErr+="BreakfastPrice2不是数字!\\n";
}
if(!PageValidate.IsDecimal(txtAddBedPrice.Text))
{
strErr+="AddBedPrice不是数字!\\n";
}
if(!PageValidate.IsNumber(txtAdvance.Text))
{
strErr+="Advance不是数字!\\n";
}
if(!PageValidate.IsNumber(txtInManAmount.Text))
{
strErr+="InManAmount不是数字!\\n";
}
if(this.txtInPaper.Text =="")
{
strErr+="InPaper不能为空!\\n";
}
if(this.txtInManName.Text =="")
{
strErr+="InManName不能为空!\\n";
}
if(this.txtArriveEarlyDate.Text =="")
{
strErr+="ArriveEarlyDate不能为空!\\n";
}
if(this.txtArriveLateDate.Text =="")
{
strErr+="ArriveLateDate不能为空!\\n";
}
if(this.txtArriveMethods.Text =="")
{
strErr+="ArriveMethods不能为空!\\n";
}
if(this.txtLinkMan.Text =="")
{
strErr+="LinkMan不能为空!\\n";
}
if(this.txtConfirmedMethods.Text =="")
{
strErr+="ConfirmedMethods不能为空!\\n";
}
if(this.txtPhone1.Text =="")
{
strErr+="Phone1不能为空!\\n";
}
if(this.txtPhone2.Text =="")
{
strErr+="Phone2不能为空!\\n";
}
if(this.txtFax.Text =="")
{
strErr+="Fax不能为空!\\n";
}
if(this.txtEmail.Text =="")
{
strErr+="Email不能为空!\\n";
}
if(this.txtRemark.Text =="")
{
strErr+="Remark不能为空!\\n";
}
if(this.txtRoomType.Text =="")
{
strErr+="RoomType不能为空!\\n";
}
if(!PageValidate.IsDecimal(txtAveragePrice.Text))
{
strErr+="AveragePrice不是数字!\\n";
}
if(!PageValidate.IsNumber(txtOrderState.Text))
{
strErr+="OrderState不是数字!\\n";
}
if(this.txtConfirmID.Text =="")
{
strErr+="ConfirmID不能为空!\\n";
}
if(!PageValidate.IsDateTime(txtConfimDate.Text))
{
strErr+="ConfimDate不是时间格式!\\n";
}
if(this.txtAccountConfirmID.Text =="")
{
strErr+="AccountConfirmID不能为空!\\n";
}
if(!PageValidate.IsDateTime(txtAccountConfirmDate.Text))
{
strErr+="AccountConfirmDate不是时间格式!\\n";
}
if(this.txtPlanConfirmID.Text =="")
{
strErr+="PlanConfirmID不能为空!\\n";
}
if(!PageValidate.IsDateTime(txtPlanConfirmDate.Text))
{
strErr+="PlanConfirmDate不是时间格式!\\n";
}
if(this.txtVenderID.Text =="")
{
strErr+="VenderID不能为空!\\n";
}
if(strErr!="")
{
MessageBox.Show(this,strErr);
return;
}
string HotelID=this.txtHotelID.Text;
string Indate=this.txtIndate.Text;
string Outdate=this.txtOutdate.Text;
string PayMethods=this.txtPayMethods.Text;
string RoomTrait=this.txtRoomTrait.Text;
string LocalFloor=this.txtLocalFloor.Text;
decimal BreakfastPrice1=decimal.Parse(this.txtBreakfastPrice1.Text);
decimal BreakfastPrice2=decimal.Parse(this.txtBreakfastPrice2.Text);
decimal AddBedPrice=decimal.Parse(this.txtAddBedPrice.Text);
int Advance=int.Parse(this.txtAdvance.Text);
int InManAmount=int.Parse(this.txtInManAmount.Text);
string InPaper=this.txtInPaper.Text;
string InManName=this.txtInManName.Text;
string ArriveEarlyDate=this.txtArriveEarlyDate.Text;
string ArriveLateDate=this.txtArriveLateDate.Text;
string ArriveMethods=this.txtArriveMethods.Text;
string LinkMan=this.txtLinkMan.Text;
string ConfirmedMethods=this.txtConfirmedMethods.Text;
string Phone1=this.txtPhone1.Text;
string Phone2=this.txtPhone2.Text;
string Fax=this.txtFax.Text;
string Email=this.txtEmail.Text;
string Remark=this.txtRemark.Text;
string RoomType=this.txtRoomType.Text;
decimal AveragePrice=decimal.Parse(this.txtAveragePrice.Text);
int OrderState=int.Parse(this.txtOrderState.Text);
string ConfirmID=this.txtConfirmID.Text;
DateTime ConfimDate=DateTime.Parse(this.txtConfimDate.Text);
string AccountConfirmID=this.txtAccountConfirmID.Text;
DateTime AccountConfirmDate=DateTime.Parse(this.txtAccountConfirmDate.Text);
string PlanConfirmID=this.txtPlanConfirmID.Text;
DateTime PlanConfirmDate=DateTime.Parse(this.txtPlanConfirmDate.Text);
string VenderID=this.txtVenderID.Text;
Maticsoft.Model.HotelOrder model=new Maticsoft.Model.HotelOrder();
model.HotelID=HotelID;
model.Indate=Indate;
model.Outdate=Outdate;
model.PayMethods=PayMethods;
model.RoomTrait=RoomTrait;
model.LocalFloor=LocalFloor;
model.BreakfastPrice1=BreakfastPrice1;
model.BreakfastPrice2=BreakfastPrice2;
model.AddBedPrice=AddBedPrice;
model.Advance=Advance;
model.InManAmount=InManAmount;
model.InPaper=InPaper;
model.InManName=InManName;
model.ArriveEarlyDate=ArriveEarlyDate;
model.ArriveLateDate=ArriveLateDate;
model.ArriveMethods=ArriveMethods;
model.LinkMan=LinkMan;
model.ConfirmedMethods=ConfirmedMethods;
model.Phone1=Phone1;
model.Phone2=Phone2;
model.Fax=Fax;
model.Email=Email;
model.Remark=Remark;
model.RoomType=RoomType;
model.AveragePrice=AveragePrice;
model.OrderState=OrderState;
model.ConfirmID=ConfirmID;
model.ConfimDate=ConfimDate;
model.AccountConfirmID=AccountConfirmID;
model.AccountConfirmDate=AccountConfirmDate;
model.PlanConfirmID=PlanConfirmID;
model.PlanConfirmDate=PlanConfirmDate;
model.VenderID=VenderID;
Maticsoft.BLL.HotelOrder bll=new Maticsoft.BLL.HotelOrder();
bll.Update(model);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -