📄 modify.aspx.cs
字号:
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.TourismProOrderH
{
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.TourismProOrderH bll=new Maticsoft.BLL.TourismProOrderH();
Maticsoft.Model.TourismProOrderH model=bll.GetModel(OrderNo);
this.lblOrderNo.Text=model.OrderNo;
this.txtLinesProID.Text=model.LinesProID;
this.txtCustomerID.Text=model.CustomerID;
this.txtManAmount.Text=model.ManAmount.ToString();
this.txtChildren.Text=model.Children.ToString();
this.txtReceivable.Text=model.Receivable.ToString();
this.txtPayMoney.Text=model.PayMoney.ToString();
this.txtBalance.Text=model.Balance.ToString();
this.txtOrderType.Text=model.OrderType;
this.txtOrderStates.Text=model.OrderStates.ToString();
this.txtConfirmUserID.Text=model.ConfirmUserID;
this.txtConfirmDate.Text=model.ConfirmDate.ToString();
this.txtAccountConfirmUserID.Text=model.AccountConfirmUserID;
this.txtAccountConfirmDate.Text=model.AccountConfirmDate.ToString();
this.txtPlanConfirmUserID.Text=model.PlanConfirmUserID;
this.txtPlanConfirmDate.Text=model.PlanConfirmDate.ToString();
this.txtSingleRoomAmount.Text=model.SingleRoomAmount.ToString();
this.txtSumAddPrice.Text=model.SumAddPrice.ToString();
this.txtRoomAmount.Text=model.RoomAmount.ToString();
this.txtLinkMan.Text=model.LinkMan;
this.txtPhone1.Text=model.Phone1;
this.txtPhone2.Text=model.Phone2;
this.txtAddress.Text=model.Address;
this.txtPostcode.Text=model.Postcode;
this.txtRemark.Text=model.Remark;
}
protected void btnAdd_Click(object sender, EventArgs e)
{
string strErr="";
if(this.txtLinesProID.Text =="")
{
strErr+="LinesProID不能为空!\\n";
}
if(this.txtCustomerID.Text =="")
{
strErr+="CustomerID不能为空!\\n";
}
if(!PageValidate.IsNumber(txtManAmount.Text))
{
strErr+="ManAmount不是数字!\\n";
}
if(!PageValidate.IsNumber(txtChildren.Text))
{
strErr+="Children不是数字!\\n";
}
if(!PageValidate.IsDecimal(txtReceivable.Text))
{
strErr+="Receivable不是数字!\\n";
}
if(!PageValidate.IsDecimal(txtPayMoney.Text))
{
strErr+="PayMoney不是数字!\\n";
}
if(!PageValidate.IsDecimal(txtBalance.Text))
{
strErr+="Balance不是数字!\\n";
}
if(this.txtOrderType.Text =="")
{
strErr+="OrderType不能为空!\\n";
}
if(!PageValidate.IsNumber(txtOrderStates.Text))
{
strErr+="OrderStates不是数字!\\n";
}
if(this.txtConfirmUserID.Text =="")
{
strErr+="ConfirmUserID不能为空!\\n";
}
if(!PageValidate.IsDateTime(txtConfirmDate.Text))
{
strErr+="ConfirmDate不是时间格式!\\n";
}
if(this.txtAccountConfirmUserID.Text =="")
{
strErr+="AccountConfirmUserID不能为空!\\n";
}
if(!PageValidate.IsDateTime(txtAccountConfirmDate.Text))
{
strErr+="AccountConfirmDate不是时间格式!\\n";
}
if(this.txtPlanConfirmUserID.Text =="")
{
strErr+="PlanConfirmUserID不能为空!\\n";
}
if(!PageValidate.IsDateTime(txtPlanConfirmDate.Text))
{
strErr+="PlanConfirmDate不是时间格式!\\n";
}
if(!PageValidate.IsNumber(txtSingleRoomAmount.Text))
{
strErr+="SingleRoomAmount不是数字!\\n";
}
if(!PageValidate.IsDecimal(txtSumAddPrice.Text))
{
strErr+="SumAddPrice不是数字!\\n";
}
if(!PageValidate.IsNumber(txtRoomAmount.Text))
{
strErr+="RoomAmount不是数字!\\n";
}
if(this.txtLinkMan.Text =="")
{
strErr+="LinkMan不能为空!\\n";
}
if(this.txtPhone1.Text =="")
{
strErr+="Phone1不能为空!\\n";
}
if(this.txtPhone2.Text =="")
{
strErr+="Phone2不能为空!\\n";
}
if(this.txtAddress.Text =="")
{
strErr+="Address不能为空!\\n";
}
if(this.txtPostcode.Text =="")
{
strErr+="Postcode不能为空!\\n";
}
if(this.txtRemark.Text =="")
{
strErr+="Remark不能为空!\\n";
}
if(strErr!="")
{
MessageBox.Show(this,strErr);
return;
}
string LinesProID=this.txtLinesProID.Text;
string CustomerID=this.txtCustomerID.Text;
int ManAmount=int.Parse(this.txtManAmount.Text);
int Children=int.Parse(this.txtChildren.Text);
decimal Receivable=decimal.Parse(this.txtReceivable.Text);
decimal PayMoney=decimal.Parse(this.txtPayMoney.Text);
decimal Balance=decimal.Parse(this.txtBalance.Text);
string OrderType=this.txtOrderType.Text;
int OrderStates=int.Parse(this.txtOrderStates.Text);
string ConfirmUserID=this.txtConfirmUserID.Text;
DateTime ConfirmDate=DateTime.Parse(this.txtConfirmDate.Text);
string AccountConfirmUserID=this.txtAccountConfirmUserID.Text;
DateTime AccountConfirmDate=DateTime.Parse(this.txtAccountConfirmDate.Text);
string PlanConfirmUserID=this.txtPlanConfirmUserID.Text;
DateTime PlanConfirmDate=DateTime.Parse(this.txtPlanConfirmDate.Text);
int SingleRoomAmount=int.Parse(this.txtSingleRoomAmount.Text);
decimal SumAddPrice=decimal.Parse(this.txtSumAddPrice.Text);
int RoomAmount=int.Parse(this.txtRoomAmount.Text);
string LinkMan=this.txtLinkMan.Text;
string Phone1=this.txtPhone1.Text;
string Phone2=this.txtPhone2.Text;
string Address=this.txtAddress.Text;
string Postcode=this.txtPostcode.Text;
string Remark=this.txtRemark.Text;
Maticsoft.Model.TourismProOrderH model=new Maticsoft.Model.TourismProOrderH();
model.LinesProID=LinesProID;
model.CustomerID=CustomerID;
model.ManAmount=ManAmount;
model.Children=Children;
model.Receivable=Receivable;
model.PayMoney=PayMoney;
model.Balance=Balance;
model.OrderType=OrderType;
model.OrderStates=OrderStates;
model.ConfirmUserID=ConfirmUserID;
model.ConfirmDate=ConfirmDate;
model.AccountConfirmUserID=AccountConfirmUserID;
model.AccountConfirmDate=AccountConfirmDate;
model.PlanConfirmUserID=PlanConfirmUserID;
model.PlanConfirmDate=PlanConfirmDate;
model.SingleRoomAmount=SingleRoomAmount;
model.SumAddPrice=SumAddPrice;
model.RoomAmount=RoomAmount;
model.LinkMan=LinkMan;
model.Phone1=Phone1;
model.Phone2=Phone2;
model.Address=Address;
model.Postcode=Postcode;
model.Remark=Remark;
Maticsoft.BLL.TourismProOrderH bll=new Maticsoft.BLL.TourismProOrderH();
bll.Update(model);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -