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

📄 logonbox.ascx.cs

📁 用vs2005写的一个生产任务管理系统。数据的统计和综合查询是主要功能
💻 CS
📖 第 1 页 / 共 2 页
字号:

	using System;
	using System.Data;
	using System.Drawing;
	using System.Web;
	using System.Web.UI.WebControls;
	using System.Web.UI.HtmlControls;
	using System.Web.Security;
    using RWSB.DatabaseOper;
	using System.Data.SqlClient;

namespace RWSB.web.Modul
{
	/// <summary>
	///		LogonBox 的摘要说明。
	/// </summary>
	public partial  class LogonBox : System.Web.UI.UserControl
	{
		protected System.Data.SqlClient.SqlCommand sqlCommand1;
		protected System.Data.SqlClient.SqlCommand sqlCommand2;
		protected System.Data.SqlClient.SqlCommand sqlSelectCommand1;
		protected System.Data.SqlClient.SqlCommand sqlInsertCommand1;
		protected System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
		protected System.Data.SqlClient.SqlCommand sqlDeleteCommand1;
		protected System.Data.SqlClient.SqlConnection sqlConnection1;
		protected System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1;
		protected System.Data.SqlClient.SqlCommand sqlCommand_FileDown;
		protected System.Data.SqlClient.SqlCommand sqlSelectCommand2;
		protected System.Data.SqlClient.SqlCommand sqlInsertCommand2;
		protected System.Data.SqlClient.SqlCommand sqlUpdateCommand2;
		protected System.Data.SqlClient.SqlCommand sqlDeleteCommand2;
		protected System.Data.SqlClient.SqlDataAdapter sqlDataAdapter2;
		protected System.Data.SqlClient.SqlCommand sqlCommand3;

		protected void Page_Load(object sender, System.EventArgs e)
		{
			// 在此处放置用户代码以初始化页面
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		///		设计器支持所需的方法 - 不要使用
		///		代码编辑器修改此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			this.sqlCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
			this.sqlCommand2 = new System.Data.SqlClient.SqlCommand();
			this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
			this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
			this.sqlCommand_FileDown = new System.Data.SqlClient.SqlCommand();
			// 
			// sqlCommand1
			// 
			this.sqlCommand1.CommandText = "SELECT PKID, User_Name, Password, (SELECT UserGrade FROM UserGrade WHERE pkid = u" +
				"ser_grade) AS UG, User_Grade FROM Users WHERE (User_Name = @User_Name) AND (Pass" +
				"word = @Password)";
			this.sqlCommand1.Connection = this.sqlConnection1;
			this.sqlCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@User_Name", System.Data.SqlDbType.VarChar, 50, "User_Name"));
			this.sqlCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Password", System.Data.SqlDbType.VarChar, 50, "Password"));
			// 
			// sqlConnection1
			// 
			this.sqlConnection1.ConnectionString = "workstation id=YRJ;packet size=4096;user id=sa;data source=127.0.0.1;persist secu" +
				"rity info=True;initial catalog=doughty_BBS;password=123";
			// 
			// sqlCommand2
			// 
			this.sqlCommand2.CommandText = "UPDATE Users SET Logon_Counter = Logon_Counter + 1, Last_Date = GETDATE() WHERE (" +
				"User_Name = @User_Name)";
			this.sqlCommand2.Connection = this.sqlConnection1;
			this.sqlCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@User_Name", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "User_Name", System.Data.DataRowVersion.Original, null));
			// 
			// sqlSelectCommand1
			// 
			this.sqlSelectCommand1.CommandText = "SELECT PKID, User_Name, Password, Name, sex, Email, QICQ, Address, HomePage, work" +
				"_Name, Phone, Birthday, Memos, Reg_Date, User_Grade, Last_Date, Logon_Counter FR" +
				"OM Users";
			this.sqlSelectCommand1.Connection = this.sqlConnection1;
			// 
			// sqlInsertCommand1
			// 
			this.sqlInsertCommand1.CommandText = @"INSERT INTO Users(User_Name, Password, Name, sex, Email, QICQ, Address, HomePage, work_Name, Phone, Birthday, Memos, Reg_Date, User_Grade, Last_Date, Logon_Counter) VALUES (@User_Name, @Password, @Name, @sex, @Email, @QICQ, @Address, @HomePage, @work_Name, @Phone, @Birthday, @Memos, @Reg_Date, @User_Grade, @Last_Date, @Logon_Counter); SELECT PKID, User_Name, Password, Name, sex, Email, QICQ, Address, HomePage, work_Name, Phone, Birthday, Memos, Reg_Date, User_Grade, Last_Date, Logon_Counter FROM Users WHERE (User_Name = @User_Name)";
			this.sqlInsertCommand1.Connection = this.sqlConnection1;
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@User_Name", System.Data.SqlDbType.VarChar, 50, "User_Name"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Password", System.Data.SqlDbType.VarChar, 50, "Password"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Name", System.Data.SqlDbType.VarChar, 50, "Name"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sex", System.Data.SqlDbType.Bit, 1, "sex"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Email", System.Data.SqlDbType.VarChar, 50, "Email"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@QICQ", System.Data.SqlDbType.VarChar, 50, "QICQ"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Address", System.Data.SqlDbType.VarChar, 50, "Address"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@HomePage", System.Data.SqlDbType.VarChar, 50, "HomePage"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@work_Name", System.Data.SqlDbType.VarChar, 50, "work_Name"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Phone", System.Data.SqlDbType.VarChar, 50, "Phone"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Birthday", System.Data.SqlDbType.DateTime, 8, "Birthday"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Memos", System.Data.SqlDbType.VarChar, 2147483647, "Memos"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Reg_Date", System.Data.SqlDbType.DateTime, 8, "Reg_Date"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@User_Grade", System.Data.SqlDbType.Int, 4, "User_Grade"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Last_Date", System.Data.SqlDbType.DateTime, 8, "Last_Date"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Logon_Counter", System.Data.SqlDbType.Int, 4, "Logon_Counter"));
			// 
			// sqlUpdateCommand1
			// 
			this.sqlUpdateCommand1.CommandText = "UPDATE Users SET User_Name = @User_Name, Password = @Password, Name = @Name, sex " +
				"= @sex, Email = @Email, QICQ = @QICQ, Address = @Address, HomePage = @HomePage, " +
				"work_Name = @work_Name, Phone = @Phone, Birthday = @Birthday, Memos = @Memos, Re" +
				"g_Date = @Reg_Date, User_Grade = @User_Grade, Last_Date = @Last_Date, Logon_Coun" +
				"ter = @Logon_Counter WHERE (User_Name = @Original_User_Name) AND (Address = @Ori" +
				"ginal_Address OR @Original_Address IS NULL AND Address IS NULL) AND (Birthday = " +
				"@Original_Birthday OR @Original_Birthday IS NULL AND Birthday IS NULL) AND (Emai" +
				"l = @Original_Email OR @Original_Email IS NULL AND Email IS NULL) AND (HomePage " +
				"= @Original_HomePage OR @Original_HomePage IS NULL AND HomePage IS NULL) AND (La" +
				"st_Date = @Original_Last_Date OR @Original_Last_Date IS NULL AND Last_Date IS NU" +
				"LL) AND (Logon_Counter = @Original_Logon_Counter OR @Original_Logon_Counter IS N" +
				"ULL AND Logon_Counter IS NULL) AND (Name = @Original_Name OR @Original_Name IS N" +
				"ULL AND Name IS NULL) AND (Password = @Original_Password OR @Original_Password I" +
				"S NULL AND Password IS NULL) AND (Phone = @Original_Phone OR @Original_Phone IS " +
				"NULL AND Phone IS NULL) AND (QICQ = @Original_QICQ OR @Original_QICQ IS NULL AND" +
				" QICQ IS NULL) AND (Reg_Date = @Original_Reg_Date OR @Original_Reg_Date IS NULL " +
				"AND Reg_Date IS NULL) AND (User_Grade = @Original_User_Grade OR @Original_User_G" +
				"rade IS NULL AND User_Grade IS NULL) AND (sex = @Original_sex OR @Original_sex I" +
				"S NULL AND sex IS NULL) AND (work_Name = @Original_work_Name OR @Original_work_N" +
				"ame IS NULL AND work_Name IS NULL); SELECT PKID, User_Name, Password, Name, sex," +
				" Email, QICQ, Address, HomePage, work_Name, Phone, Birthday, Memos, Reg_Date, Us" +
				"er_Grade, Last_Date, Logon_Counter FROM Users WHERE (User_Name = @User_Name)";
			this.sqlUpdateCommand1.Connection = this.sqlConnection1;
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@User_Name", System.Data.SqlDbType.VarChar, 50, "User_Name"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Password", System.Data.SqlDbType.VarChar, 50, "Password"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Name", System.Data.SqlDbType.VarChar, 50, "Name"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sex", System.Data.SqlDbType.Bit, 1, "sex"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Email", System.Data.SqlDbType.VarChar, 50, "Email"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@QICQ", System.Data.SqlDbType.VarChar, 50, "QICQ"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Address", System.Data.SqlDbType.VarChar, 50, "Address"));

⌨️ 快捷键说明

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