modify.aspx.cs.svn-base

来自「走吧旅游网站前后台源代码」· SVN-BASE 代码 · 共 87 行

SVN-BASE
87
字号
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.Group
{
    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 GroupID)
{
	Maticsoft.BLL.Group bll=new Maticsoft.BLL.Group();
	Maticsoft.Model.Group model=bll.GetModel(GroupID);
	this.lblGroupID.Text=model.GroupID;
	this.txtGroupName.Text=model.GroupName;
	this.txtGroupType.Text=model.GroupType;
	this.txtRecUserID.Text=model.RecUserID;
	this.txtRecDate.Text=model.RecDate.ToString();

}
		protected void btnAdd_Click(object sender, EventArgs e)
		{
			
	string strErr="";
	if(this.txtGroupName.Text =="")
	{
		strErr+="GroupName不能为空!\\n";	
	}
	if(this.txtGroupType.Text =="")
	{
		strErr+="GroupType不能为空!\\n";	
	}
	if(this.txtRecUserID.Text =="")
	{
		strErr+="RecUserID不能为空!\\n";	
	}
	if(!PageValidate.IsDateTime(txtRecDate.Text))
	{
		strErr+="RecDate不是时间格式!\\n";	
	}

	if(strErr!="")
	{
		MessageBox.Show(this,strErr);
		return;
	}
	string GroupName=this.txtGroupName.Text;
	string GroupType=this.txtGroupType.Text;
	string RecUserID=this.txtRecUserID.Text;
	DateTime RecDate=DateTime.Parse(this.txtRecDate.Text);


	Maticsoft.Model.Group model=new Maticsoft.Model.Group();
	model.GroupName=GroupName;
	model.GroupType=GroupType;
	model.RecUserID=RecUserID;
	model.RecDate=RecDate;
	Maticsoft.BLL.Group bll=new Maticsoft.BLL.Group();
	bll.Update(model);
		}

    }
}

⌨️ 快捷键说明

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