⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 modify.aspx.cs.svn-base

📁 走吧旅游网站前后台源代码
💻 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.TourismProStock
{
    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 LinesID)
{
	Maticsoft.BLL.TourismProStock bll=new Maticsoft.BLL.TourismProStock();
	Maticsoft.Model.TourismProStock model=bll.GetModel(LinesID);
	this.lblLinesID.Text=model.LinesID;
	this.txtLinesName.Text=model.LinesName;
	this.txtDays.Text=model.Days.ToString();
	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;
	this.txtReceiveCityID.Text=model.ReceiveCityID;

}
		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.Update(model);
		}

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -