www.pudn.com > flash-zhibo-yuanma.rar > admin_user.aspx.cs, change:2007-03-23,size:1914b


using System; 
using System.Collections; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Web; 
using System.Web.SessionState; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using System.Web.UI.HtmlControls; 
 
namespace admin 
{ 
	/// <summary> 
	/// admin_user 的摘要说明。 
	/// </summary> 
    public partial class admin_user : Sp.baseadmin 
	{ 
	    public string adminb="sp_admin"; 
		protected override void Page_Load(object sender, System.EventArgs e) 
        { 
            base.Page_Load(sender, e); 
			if (!Page.IsPostBack) 
            { 
			 
				BindSto(); 
				if (Request.QueryString["Cmd"]=="Del") 
				{ 
						dell(); 
				} 
			}// 在此处放置用户代码以初始化页面 
		} 
		void BindSto() 
		{ 
			 
			ReSto.DataSource=Sp.Base.ExecuteSql4Ds("SELECT * FROM "+adminb); 
			ReSto.DataBind(); 
			 
		 
		} 
		protected void Submit1_ServerClick(object sender, System.EventArgs e) 
		{ 
			string UserName,UserPass,Name; 
			UserName=Sp.Functions.Tosql(userid.Value); 
			UserPass=Sp.Functions.Encrypt(Sp.Functions.Tosql(userpass.Value),1); 
			Name=Sp.Functions.Tosql(name.Value); 
 
			string sql="INSERT INTO "+adminb+" (adminname,adminpass,username) VALUES ('"+UserName+"','"+UserPass+"','"+Name+"')"; 
			Sp.Base.ExecuteSql(sql); 
			Sp.Functions.JsAlerT("添加成功!"); 
			BindSto(); 
		} 
		void dell() 
		{ 
			string sql="DELETE FROM "+adminb+" where id='"+Request.QueryString["User"]+"'"; 
			Sp.Base.ExecuteSql(sql); 
			BindSto(); 
		} 
 
		#region Web 窗体设计器生成的代码 
		override protected void OnInit(EventArgs e) 
		{ 
			// 
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。 
			// 
			InitializeComponent(); 
			base.OnInit(e); 
		} 
		 
		/// <summary> 
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改 
		/// 此方法的内容。 
		/// </summary> 
		private void InitializeComponent() 
		{     
 
		} 
		#endregion 
	} 
}