modify.aspx.cs

来自「走吧旅游网站前后台源代码」· CS 代码 · 共 81 行

CS
81
字号
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.AirlineOrderMan
{
    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 Name)
{
	Maticsoft.BLL.AirlineOrderMan bll=new Maticsoft.BLL.AirlineOrderMan();
	Maticsoft.Model.AirlineOrderMan model=bll.GetModel(Name);
	this.lblOrderNo.Text=model.OrderNo;
	this.lblName.Text=model.Name;
	this.txtDocumentsType.Text=model.DocumentsType;
	this.txtDocumentsCode.Text=model.DocumentsCode;
	this.txtBuyInsurance.Text=model.BuyInsurance.ToString();

}
		protected void btnAdd_Click(object sender, EventArgs e)
		{
			
	string strErr="";
	if(this.txtDocumentsType.Text =="")
	{
		strErr+="DocumentsType不能为空!\\n";	
	}
	if(this.txtDocumentsCode.Text =="")
	{
		strErr+="DocumentsCode不能为空!\\n";	
	}
	if(!PageValidate.IsNumber(txtBuyInsurance.Text))
	{
		strErr+="BuyInsurance不是数字!\\n";	
	}

	if(strErr!="")
	{
		MessageBox.Show(this,strErr);
		return;
	}
	string DocumentsType=this.txtDocumentsType.Text;
	string DocumentsCode=this.txtDocumentsCode.Text;
	int BuyInsurance=int.Parse(this.txtBuyInsurance.Text);


	Maticsoft.Model.AirlineOrderMan model=new Maticsoft.Model.AirlineOrderMan();
	model.DocumentsType=DocumentsType;
	model.DocumentsCode=DocumentsCode;
	model.BuyInsurance=BuyInsurance;
	Maticsoft.BLL.AirlineOrderMan bll=new Maticsoft.BLL.AirlineOrderMan();
	bll.Update(model);
		}

    }
}

⌨️ 快捷键说明

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