⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loning.aspx.cs

📁 主要功能: 1、 包括顾客信息、货品信息、定单信息的管理。 2、 按月统计销售业绩。 3、 报表设计。 4、 系统维护。
💻 CS
字号:
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;
using System.Data.OleDb;

namespace jd
{
	/// <summary>
	/// WebForm1 的摘要说明。
	/// </summary>
	public class WebForm1 : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.Label Label1;
		protected System.Web.UI.WebControls.Label Label2;
		protected System.Web.UI.WebControls.Image Image3;
		protected System.Web.UI.WebControls.Label Label4;
		protected System.Web.UI.WebControls.Label Label5;
		protected System.Web.UI.WebControls.HyperLink HyperLink10;
		protected System.Web.UI.WebControls.Label Label6;
		protected System.Web.UI.WebControls.HyperLink HyperLink2;
		protected System.Web.UI.WebControls.Image Image2;
		protected System.Web.UI.WebControls.Panel Panel2;
		protected System.Web.UI.WebControls.Label Label3;
		protected System.Web.UI.WebControls.Label Label11;
		protected System.Web.UI.WebControls.Label Label12;
		protected System.Web.UI.WebControls.Label Label13;
		protected System.Web.UI.WebControls.Label Label14;
		protected System.Web.UI.WebControls.Label Label15;
		protected System.Web.UI.WebControls.Label Label16;
		protected System.Web.UI.WebControls.Label Label17;
		protected System.Web.UI.WebControls.TextBox TextBox3;
		protected System.Web.UI.WebControls.TextBox TextBox4;
		protected System.Web.UI.WebControls.TextBox TextBox5;
		protected System.Web.UI.WebControls.TextBox TextBox6;
		protected System.Web.UI.WebControls.TextBox TextBox7;
		protected System.Web.UI.WebControls.TextBox TextBox8;
		protected System.Web.UI.WebControls.TextBox TextBox9;
		protected System.Web.UI.WebControls.Button Button4;
		protected System.Web.UI.WebControls.Button Button5;
		protected System.Web.UI.WebControls.Button Button6;
		protected System.Web.UI.WebControls.Label L1;
		protected System.Web.UI.WebControls.Image Image4;
		protected System.Web.UI.WebControls.Image Image1;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面

		}

		#region Web 窗体设计器生成的代码
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    
			this.Button4.Click += new System.EventHandler(this.Button4_Click);
			this.Button5.Click += new System.EventHandler(this.Button5_Click);
			this.Button6.Click += new System.EventHandler(this.Button6_Click);
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		private void Button5_Click(object sender, System.EventArgs e)//重置
		{
			this.TextBox3.Text="";
			this.TextBox4.Text="";
			this.TextBox5.Text="";
			this.TextBox6.Text="";
			this.TextBox7.Text="";
			this.TextBox8.Text="";
			this.TextBox9.Text="";
		}

		private void Button6_Click(object sender, System.EventArgs e)//返回selectd页
		{
			Response.Redirect("select.aspx");
		}

		private void Button4_Click(object sender, System.EventArgs e)
		{
			if(this.TextBox3.Text=="")
			{
				Response.Write("<script>window.alert('申请用户不能为空');</script>");
			}
			else if(this.TextBox4.Text=="")
			{
				Response.Write("<script>window.alert('设置密码不能为空');</script>");
			}
			else if(this.TextBox5.Text=="")
			{
				Response.Write("<script>window.alert('用户身份证不能为空');</script>");
			}
			else if(this.TextBox6.Text=="")
			{
				Response.Write("<script>window.alert('确认密码不能为空');</script>");
			}
			else if(this.TextBox7.Text=="")
			{
				Response.Write("<script>window.alert('联系电话不能为空');</script>");
			}
			else if(this.TextBox8.Text=="")
			{
				Response.Write("<script>window.alert('Email不能为空');</script>");
			}
			else if(this.TextBox4.Text!=this.TextBox6.Text)
			{
				Response.Write("<script>window.alert('输入的密码不一致');</script>");
			}
			else
			{
				bool ttt=true;
				this.L1.Text="会员";
				string connstr=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath(@".\databast.mdb");
				OleDbConnection conn=new OleDbConnection(connstr);
				conn.Open();
				OleDbCommand comm=new OleDbCommand();
				comm.Connection=conn;				
				string sql="select 用户名 from 用户管理表";
				OleDbDataAdapter adapter=new OleDbDataAdapter(sql,conn);
				DataSet dataset=new DataSet();
				adapter.Fill(dataset,"用户管理表");
				for(int i=0;i<dataset.Tables["用户管理表"].Rows.Count;i++)
				{
					if(this.TextBox3.Text==dataset.Tables["用户管理表"].Rows[i][0].ToString().Trim())
					{
						ttt=false;
						Response.Write("<script>window.alert('有重复的用户名!');</script>");
						this.TextBox3.Text="";
						break;
					}
				}
				if(ttt)
				{
					comm.CommandText="insert into 用户管理表(用户名,密码,权限,身份证,联系电话,Email,个人说明) values ('"+this.TextBox3.Text+"','"+this.TextBox4.Text+"','"+this.L1.Text+"','"+this.TextBox5.Text+"','"+this.TextBox7.Text+"','"+this.TextBox8.Text+"','"+this.TextBox9.Text+"')";
					comm.ExecuteNonQuery();
					conn.Close();
					Response.Write("<script>window.alert('注册成功');</script>");
				}
			}
		}
	}
}

⌨️ 快捷键说明

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