📄 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.TourismProH
{
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 LinesProID)
{
Maticsoft.BLL.TourismProH bll=new Maticsoft.BLL.TourismProH();
Maticsoft.Model.TourismProH model=bll.GetModel(LinesProID);
this.lblLinesProID.Text=model.LinesProID;
this.txtLinesID.Text=model.LinesID;
this.txtReceiveCityID.Text=model.ReceiveCityID;
this.txtLinesProName.Text=model.LinesProName;
this.txtLinesProType.Text=model.LinesProType;
this.txtLinesProGroup.Text=model.LinesProGroup;
this.txtTeamCode.Text=model.TeamCode;
this.txtDayAmount.Text=model.DayAmount.ToString();
this.txtOutTeamDate.Text=model.OutTeamDate;
this.txtOutTeamTime.Text=model.OutTeamTime;
this.txtReBackTeamDate.Text=model.ReBackTeamDate;
this.txtReBackTeamTime.Text=model.ReBackTeamTime;
this.txtOverDate.Text=model.OverDate;
this.txtSendTeamPlan.Text=model.SendTeamPlan;
this.txtReturnRules.Text=model.ReturnRules;
this.txtInsurance.Text=model.Insurance;
this.txtAmountMan.Text=model.AmountMan.ToString();
this.txtLeastAmountMan.Text=model.LeastAmountMan.ToString();
this.txtOutTraffic.Text=model.OutTraffic;
this.txtReBackTraffic.Text=model.ReBackTraffic;
this.txtEmergancyPhone.Text=model.EmergancyPhone;
this.txtSalesAuthority.Text=model.SalesAuthority;
this.txtRecUserID.Text=model.RecUserID;
this.txtRecDate.Text=model.RecDate.ToString();
this.txtState.Text=model.State.ToString();
this.txtOutCityID.Text=model.OutCityID;
this.txtInCityID.Text=model.InCityID;
this.txtTraffic.Text=model.Traffic;
this.txtShopManPrice.Text=model.ShopManPrice.ToString();
this.txtPeerManPrice.Text=model.PeerManPrice.ToString();
this.txtInterManPrice.Text=model.InterManPrice.ToString();
this.txtShopChildrenPrice.Text=model.ShopChildrenPrice.ToString();
this.txtPeerChildrenPrice.Text=model.PeerChildrenPrice.ToString();
this.txtInterChildrenPrice.Text=model.InterChildrenPrice.ToString();
this.txtSetAddres.Text=model.SetAddres;
}
protected void btnAdd_Click(object sender, EventArgs e)
{
string strErr="";
if(this.txtLinesID.Text =="")
{
strErr+="LinesID不能为空!\\n";
}
if(this.txtReceiveCityID.Text =="")
{
strErr+="ReceiveCityID不能为空!\\n";
}
if(this.txtLinesProName.Text =="")
{
strErr+="LinesProName不能为空!\\n";
}
if(this.txtLinesProType.Text =="")
{
strErr+="LinesProType不能为空!\\n";
}
if(this.txtLinesProGroup.Text =="")
{
strErr+="LinesProGroup不能为空!\\n";
}
if(this.txtTeamCode.Text =="")
{
strErr+="TeamCode不能为空!\\n";
}
if(!PageValidate.IsNumber(txtDayAmount.Text))
{
strErr+="DayAmount不是数字!\\n";
}
if(this.txtOutTeamDate.Text =="")
{
strErr+="OutTeamDate不能为空!\\n";
}
if(this.txtOutTeamTime.Text =="")
{
strErr+="OutTeamTime不能为空!\\n";
}
if(this.txtReBackTeamDate.Text =="")
{
strErr+="ReBackTeamDate不能为空!\\n";
}
if(this.txtReBackTeamTime.Text =="")
{
strErr+="ReBackTeamTime不能为空!\\n";
}
if(this.txtOverDate.Text =="")
{
strErr+="OverDate不能为空!\\n";
}
if(this.txtSendTeamPlan.Text =="")
{
strErr+="SendTeamPlan不能为空!\\n";
}
if(this.txtReturnRules.Text =="")
{
strErr+="ReturnRules不能为空!\\n";
}
if(this.txtInsurance.Text =="")
{
strErr+="Insurance不能为空!\\n";
}
if(!PageValidate.IsNumber(txtAmountMan.Text))
{
strErr+="AmountMan不是数字!\\n";
}
if(!PageValidate.IsNumber(txtLeastAmountMan.Text))
{
strErr+="LeastAmountMan不是数字!\\n";
}
if(this.txtOutTraffic.Text =="")
{
strErr+="OutTraffic不能为空!\\n";
}
if(this.txtReBackTraffic.Text =="")
{
strErr+="ReBackTraffic不能为空!\\n";
}
if(this.txtEmergancyPhone.Text =="")
{
strErr+="EmergancyPhone不能为空!\\n";
}
if(this.txtSalesAuthority.Text =="")
{
strErr+="SalesAuthority不能为空!\\n";
}
if(this.txtRecUserID.Text =="")
{
strErr+="RecUserID不能为空!\\n";
}
if(!PageValidate.IsDateTime(txtRecDate.Text))
{
strErr+="RecDate不是时间格式!\\n";
}
if(!PageValidate.IsNumber(txtState.Text))
{
strErr+="State不是数字!\\n";
}
if(this.txtOutCityID.Text =="")
{
strErr+="OutCityID不能为空!\\n";
}
if(this.txtInCityID.Text =="")
{
strErr+="InCityID不能为空!\\n";
}
if(this.txtTraffic.Text =="")
{
strErr+="Traffic不能为空!\\n";
}
if(!PageValidate.IsDecimal(txtShopManPrice.Text))
{
strErr+="ShopManPrice不是数字!\\n";
}
if(!PageValidate.IsDecimal(txtPeerManPrice.Text))
{
strErr+="PeerManPrice不是数字!\\n";
}
if(!PageValidate.IsDecimal(txtInterManPrice.Text))
{
strErr+="InterManPrice不是数字!\\n";
}
if(!PageValidate.IsDecimal(txtShopChildrenPrice.Text))
{
strErr+="ShopChildrenPrice不是数字!\\n";
}
if(!PageValidate.IsDecimal(txtPeerChildrenPrice.Text))
{
strErr+="PeerChildrenPrice不是数字!\\n";
}
if(!PageValidate.IsDecimal(txtInterChildrenPrice.Text))
{
strErr+="InterChildrenPrice不是数字!\\n";
}
if(this.txtSetAddres.Text =="")
{
strErr+="SetAddres不能为空!\\n";
}
if(strErr!="")
{
MessageBox.Show(this,strErr);
return;
}
string LinesID=this.txtLinesID.Text;
string ReceiveCityID=this.txtReceiveCityID.Text;
string LinesProName=this.txtLinesProName.Text;
string LinesProType=this.txtLinesProType.Text;
string LinesProGroup=this.txtLinesProGroup.Text;
string TeamCode=this.txtTeamCode.Text;
int DayAmount=int.Parse(this.txtDayAmount.Text);
string OutTeamDate=this.txtOutTeamDate.Text;
string OutTeamTime=this.txtOutTeamTime.Text;
string ReBackTeamDate=this.txtReBackTeamDate.Text;
string ReBackTeamTime=this.txtReBackTeamTime.Text;
string OverDate=this.txtOverDate.Text;
string SendTeamPlan=this.txtSendTeamPlan.Text;
string ReturnRules=this.txtReturnRules.Text;
string Insurance=this.txtInsurance.Text;
int AmountMan=int.Parse(this.txtAmountMan.Text);
int LeastAmountMan=int.Parse(this.txtLeastAmountMan.Text);
string OutTraffic=this.txtOutTraffic.Text;
string ReBackTraffic=this.txtReBackTraffic.Text;
string EmergancyPhone=this.txtEmergancyPhone.Text;
string SalesAuthority=this.txtSalesAuthority.Text;
string RecUserID=this.txtRecUserID.Text;
DateTime RecDate=DateTime.Parse(this.txtRecDate.Text);
int State=int.Parse(this.txtState.Text);
string OutCityID=this.txtOutCityID.Text;
string InCityID=this.txtInCityID.Text;
string Traffic=this.txtTraffic.Text;
decimal ShopManPrice=decimal.Parse(this.txtShopManPrice.Text);
decimal PeerManPrice=decimal.Parse(this.txtPeerManPrice.Text);
decimal InterManPrice=decimal.Parse(this.txtInterManPrice.Text);
decimal ShopChildrenPrice=decimal.Parse(this.txtShopChildrenPrice.Text);
decimal PeerChildrenPrice=decimal.Parse(this.txtPeerChildrenPrice.Text);
decimal InterChildrenPrice=decimal.Parse(this.txtInterChildrenPrice.Text);
string SetAddres=this.txtSetAddres.Text;
Maticsoft.Model.TourismProH model=new Maticsoft.Model.TourismProH();
model.LinesID=LinesID;
model.ReceiveCityID=ReceiveCityID;
model.LinesProName=LinesProName;
model.LinesProType=LinesProType;
model.LinesProGroup=LinesProGroup;
model.TeamCode=TeamCode;
model.DayAmount=DayAmount;
model.OutTeamDate=OutTeamDate;
model.OutTeamTime=OutTeamTime;
model.ReBackTeamDate=ReBackTeamDate;
model.ReBackTeamTime=ReBackTeamTime;
model.OverDate=OverDate;
model.SendTeamPlan=SendTeamPlan;
model.ReturnRules=ReturnRules;
model.Insurance=Insurance;
model.AmountMan=AmountMan;
model.LeastAmountMan=LeastAmountMan;
model.OutTraffic=OutTraffic;
model.ReBackTraffic=ReBackTraffic;
model.EmergancyPhone=EmergancyPhone;
model.SalesAuthority=SalesAuthority;
model.RecUserID=RecUserID;
model.RecDate=RecDate;
model.State=State;
model.OutCityID=OutCityID;
model.InCityID=InCityID;
model.Traffic=Traffic;
model.ShopManPrice=ShopManPrice;
model.PeerManPrice=PeerManPrice;
model.InterManPrice=InterManPrice;
model.ShopChildrenPrice=ShopChildrenPrice;
model.PeerChildrenPrice=PeerChildrenPrice;
model.InterChildrenPrice=InterChildrenPrice;
model.SetAddres=SetAddres;
Maticsoft.BLL.TourismProH bll=new Maticsoft.BLL.TourismProH();
bll.Update(model);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -