modify.aspx.cs.svn-base
来自「走吧旅游网站前后台源代码」· SVN-BASE 代码 · 共 102 行
SVN-BASE
102 行
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.TourismProOrder
{
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.TourismProOrder bll=new Maticsoft.BLL.TourismProOrder();
Maticsoft.Model.TourismProOrder 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.txtPhone.Text=model.Phone;
this.txtEmail.Text=model.Email;
this.txtPricetype.Text=model.Pricetype;
this.txtPrice.Text=model.Price.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(this.txtPhone.Text =="")
{
strErr+="Phone不能为空!\\n";
}
if(this.txtEmail.Text =="")
{
strErr+="Email不能为空!\\n";
}
if(this.txtPricetype.Text =="")
{
strErr+="Pricetype不能为空!\\n";
}
if(!PageValidate.IsDecimal(txtPrice.Text))
{
strErr+="Price不是数字!\\n";
}
if(strErr!="")
{
MessageBox.Show(this,strErr);
return;
}
string DocumentsType=this.txtDocumentsType.Text;
string DocumentsCode=this.txtDocumentsCode.Text;
string Phone=this.txtPhone.Text;
string Email=this.txtEmail.Text;
string Pricetype=this.txtPricetype.Text;
decimal Price=decimal.Parse(this.txtPrice.Text);
Maticsoft.Model.TourismProOrder model=new Maticsoft.Model.TourismProOrder();
model.DocumentsType=DocumentsType;
model.DocumentsCode=DocumentsCode;
model.Phone=Phone;
model.Email=Email;
model.Pricetype=Pricetype;
model.Price=Price;
Maticsoft.BLL.TourismProOrder bll=new Maticsoft.BLL.TourismProOrder();
bll.Update(model);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?