modify.aspx.cs.svn-base
来自「走吧旅游网站前后台源代码」· SVN-BASE 代码 · 共 81 行
SVN-BASE
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.TourismProStockTrip
{
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 Date)
{
Maticsoft.BLL.TourismProStockTrip bll=new Maticsoft.BLL.TourismProStockTrip();
Maticsoft.Model.TourismProStockTrip model=bll.GetModel(Date);
this.lblLinesID.Text=model.LinesID;
this.lblDate.Text=model.Date;
this.txtTitle.Text=model.Title;
this.txtRemark.Text=model.Remark;
this.txtPicture.Text=model.Picture;
}
protected void btnAdd_Click(object sender, EventArgs e)
{
string strErr="";
if(this.txtTitle.Text =="")
{
strErr+="Title不能为空!\\n";
}
if(this.txtRemark.Text =="")
{
strErr+="Remark不能为空!\\n";
}
if(this.txtPicture.Text =="")
{
strErr+="Picture不能为空!\\n";
}
if(strErr!="")
{
MessageBox.Show(this,strErr);
return;
}
string Title=this.txtTitle.Text;
string Remark=this.txtRemark.Text;
string Picture=this.txtPicture.Text;
Maticsoft.Model.TourismProStockTrip model=new Maticsoft.Model.TourismProStockTrip();
model.Title=Title;
model.Remark=Remark;
model.Picture=Picture;
Maticsoft.BLL.TourismProStockTrip bll=new Maticsoft.BLL.TourismProStockTrip();
bll.Update(model);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?