📄 add.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.TourismProStock
{
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.txtLinesName.Text =="")
{
strErr+="LinesName不能为空!\\n";
}
if(!PageValidate.IsNumber(txtDays.Text))
{
strErr+="Days不是数字!\\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(this.txtReceiveCityID.Text =="")
{
strErr+="ReceiveCityID不能为空!\\n";
}
if(strErr!="")
{
MessageBox.Show(this,strErr);
return;
}
string LinesName=this.txtLinesName.Text;
int Days=int.Parse(this.txtDays.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;
string ReceiveCityID=this.txtReceiveCityID.Text;
Maticsoft.Model.TourismProStock model=new Maticsoft.Model.TourismProStock();
model.LinesName=LinesName;
model.Days=Days;
model.Traffic=Traffic;
model.ShopManPrice=ShopManPrice;
model.PeerManPrice=PeerManPrice;
model.InterManPrice=InterManPrice;
model.ShopChildrenPrice=ShopChildrenPrice;
model.PeerChildrenPrice=PeerChildrenPrice;
model.InterChildrenPrice=InterChildrenPrice;
model.SetAddres=SetAddres;
model.ReceiveCityID=ReceiveCityID;
Maticsoft.BLL.TourismProStock bll=new Maticsoft.BLL.TourismProStock();
bll.Add(model);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -