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

📄 client.cs

📁 软件工程的课程作业
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace PSMS
{
	/// <summary>
	/// client 的摘要说明。
	/// </summary>
	public class client : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.Label label8;
		private System.Windows.Forms.Label label9;
		private System.Windows.Forms.Label label10;
		public System.Windows.Forms.TextBox ClientID;
		public System.Windows.Forms.TextBox ClientName;
		public System.Windows.Forms.TextBox MainDirector;
		public System.Windows.Forms.TextBox Location;
		public System.Windows.Forms.TextBox PostalCode;
		public System.Windows.Forms.TextBox WebSite;
		public System.Windows.Forms.TextBox ProductName;
		public System.Windows.Forms.TextBox Note;
		public System.Windows.Forms.Button csubmit;
		public System.Windows.Forms.Button creset;
		public System.Windows.Forms.TextBox Industry;
		public System.Windows.Forms.TextBox Area;
		private System.Windows.Forms.Label label11;
		private System.Windows.Forms.Label label12;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public client()
		{
			//
			// Windows 窗体设计器支持所必需的
			//
			InitializeComponent();

			//
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
			//
		}

		/// <summary>
		/// 清理所有正在使用的资源。
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows 窗体设计器生成的代码
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(client));
			this.label1 = new System.Windows.Forms.Label();
			this.ClientID = new System.Windows.Forms.TextBox();
			this.label2 = new System.Windows.Forms.Label();
			this.ClientName = new System.Windows.Forms.TextBox();
			this.label3 = new System.Windows.Forms.Label();
			this.label4 = new System.Windows.Forms.Label();
			this.MainDirector = new System.Windows.Forms.TextBox();
			this.label5 = new System.Windows.Forms.Label();
			this.label6 = new System.Windows.Forms.Label();
			this.Location = new System.Windows.Forms.TextBox();
			this.label7 = new System.Windows.Forms.Label();
			this.PostalCode = new System.Windows.Forms.TextBox();
			this.label8 = new System.Windows.Forms.Label();
			this.WebSite = new System.Windows.Forms.TextBox();
			this.label9 = new System.Windows.Forms.Label();
			this.ProductName = new System.Windows.Forms.TextBox();
			this.label10 = new System.Windows.Forms.Label();
			this.Note = new System.Windows.Forms.TextBox();
			this.csubmit = new System.Windows.Forms.Button();
			this.creset = new System.Windows.Forms.Button();
			this.Industry = new System.Windows.Forms.TextBox();
			this.Area = new System.Windows.Forms.TextBox();
			this.label11 = new System.Windows.Forms.Label();
			this.label12 = new System.Windows.Forms.Label();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(16, 16);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(56, 16);
			this.label1.TabIndex = 0;
			this.label1.Text = "ID:";
			// 
			// ClientID
			// 
			this.ClientID.Location = new System.Drawing.Point(112, 16);
			this.ClientID.Name = "ClientID";
			this.ClientID.TabIndex = 1;
			this.ClientID.Text = "";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(16, 56);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(72, 16);
			this.label2.TabIndex = 2;
			this.label2.Text = "客户名称:";
			// 
			// ClientName
			// 
			this.ClientName.Location = new System.Drawing.Point(112, 56);
			this.ClientName.Name = "ClientName";
			this.ClientName.Size = new System.Drawing.Size(64, 21);
			this.ClientName.TabIndex = 3;
			this.ClientName.Text = "";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(16, 96);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(80, 16);
			this.label3.TabIndex = 4;
			this.label3.Text = "所属行业:";
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(16, 136);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(72, 16);
			this.label4.TabIndex = 6;
			this.label4.Text = "主管单位:";
			// 
			// MainDirector
			// 
			this.MainDirector.Location = new System.Drawing.Point(112, 136);
			this.MainDirector.Name = "MainDirector";
			this.MainDirector.Size = new System.Drawing.Size(80, 21);
			this.MainDirector.TabIndex = 7;
			this.MainDirector.Text = "";
			// 
			// label5
			// 
			this.label5.Location = new System.Drawing.Point(16, 176);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(80, 16);
			this.label5.TabIndex = 8;
			this.label5.Text = "所在地区:";
			// 
			// label6
			// 
			this.label6.Location = new System.Drawing.Point(16, 208);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(56, 16);
			this.label6.TabIndex = 10;
			this.label6.Text = "地址:";
			// 
			// Location
			// 
			this.Location.Location = new System.Drawing.Point(112, 208);
			this.Location.Name = "Location";
			this.Location.Size = new System.Drawing.Size(120, 21);
			this.Location.TabIndex = 11;
			this.Location.Text = "";
			// 
			// label7
			// 
			this.label7.Location = new System.Drawing.Point(16, 248);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(56, 16);
			this.label7.TabIndex = 12;
			this.label7.Text = "邮编:";
			// 
			// PostalCode
			// 
			this.PostalCode.Location = new System.Drawing.Point(112, 248);
			this.PostalCode.Name = "PostalCode";
			this.PostalCode.Size = new System.Drawing.Size(88, 21);
			this.PostalCode.TabIndex = 13;
			this.PostalCode.Text = "";
			// 
			// label8
			// 
			this.label8.Location = new System.Drawing.Point(16, 288);
			this.label8.Name = "label8";
			this.label8.Size = new System.Drawing.Size(72, 23);
			this.label8.TabIndex = 14;
			this.label8.Text = "网站:";
			// 
			// WebSite
			// 
			this.WebSite.Location = new System.Drawing.Point(112, 288);
			this.WebSite.Name = "WebSite";
			this.WebSite.Size = new System.Drawing.Size(88, 21);
			this.WebSite.TabIndex = 15;
			this.WebSite.Text = "";
			// 
			// label9
			// 
			this.label9.Location = new System.Drawing.Point(16, 328);
			this.label9.Name = "label9";
			this.label9.Size = new System.Drawing.Size(80, 16);
			this.label9.TabIndex = 16;
			this.label9.Text = "适用产品:";
			// 
			// ProductName
			// 
			this.ProductName.Location = new System.Drawing.Point(112, 328);
			this.ProductName.Name = "ProductName";
			this.ProductName.Size = new System.Drawing.Size(120, 21);
			this.ProductName.TabIndex = 17;
			this.ProductName.Text = "";
			// 
			// label10
			// 
			this.label10.Location = new System.Drawing.Point(16, 368);
			this.label10.Name = "label10";
			this.label10.Size = new System.Drawing.Size(48, 16);
			this.label10.TabIndex = 18;
			this.label10.Text = "备注:";
			// 
			// Note
			// 
			this.Note.Location = new System.Drawing.Point(16, 392);
			this.Note.Multiline = true;
			this.Note.Name = "Note";
			this.Note.Size = new System.Drawing.Size(240, 56);
			this.Note.TabIndex = 19;
			this.Note.Text = "";
			// 
			// csubmit
			// 
			this.csubmit.Location = new System.Drawing.Point(48, 472);
			this.csubmit.Name = "csubmit";
			this.csubmit.TabIndex = 20;
			this.csubmit.Text = "确定";
			this.csubmit.Click += new System.EventHandler(this.csubmit_Click);
			// 
			// creset
			// 
			this.creset.Location = new System.Drawing.Point(160, 472);
			this.creset.Name = "creset";
			this.creset.TabIndex = 21;
			this.creset.Text = "重置";
			this.creset.Click += new System.EventHandler(this.creset_Click);
			// 
			// Industry
			// 
			this.Industry.Location = new System.Drawing.Point(112, 96);
			this.Industry.Name = "Industry";
			this.Industry.Size = new System.Drawing.Size(64, 21);
			this.Industry.TabIndex = 22;
			this.Industry.Text = "";
			// 
			// Area
			// 
			this.Area.Location = new System.Drawing.Point(112, 168);
			this.Area.Name = "Area";
			this.Area.TabIndex = 23;
			this.Area.Text = "";
			// 
			// label11
			// 
			this.label11.ForeColor = System.Drawing.Color.Red;
			this.label11.Location = new System.Drawing.Point(216, 16);
			this.label11.Name = "label11";
			this.label11.Size = new System.Drawing.Size(16, 16);
			this.label11.TabIndex = 24;
			this.label11.Text = "*";
			// 
			// label12
			// 
			this.label12.ForeColor = System.Drawing.Color.Red;
			this.label12.Location = new System.Drawing.Point(176, 56);
			this.label12.Name = "label12";
			this.label12.Size = new System.Drawing.Size(16, 16);
			this.label12.TabIndex = 24;
			this.label12.Text = "*";
			// 
			// client
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.Color.AliceBlue;
			this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
			this.ClientSize = new System.Drawing.Size(288, 510);
			this.Controls.Add(this.label11);
			this.Controls.Add(this.Area);
			this.Controls.Add(this.Industry);
			this.Controls.Add(this.creset);
			this.Controls.Add(this.csubmit);
			this.Controls.Add(this.Note);
			this.Controls.Add(this.ProductName);
			this.Controls.Add(this.WebSite);
			this.Controls.Add(this.PostalCode);
			this.Controls.Add(this.Location);
			this.Controls.Add(this.MainDirector);
			this.Controls.Add(this.ClientName);
			this.Controls.Add(this.ClientID);
			this.Controls.Add(this.label10);
			this.Controls.Add(this.label9);
			this.Controls.Add(this.label8);
			this.Controls.Add(this.label7);
			this.Controls.Add(this.label6);
			this.Controls.Add(this.label5);
			this.Controls.Add(this.label4);
			this.Controls.Add(this.label3);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.label12);
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.MaximizeBox = false;
			this.MaximumSize = new System.Drawing.Size(296, 544);
			this.MinimumSize = new System.Drawing.Size(296, 544);
			this.Name = "client";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "client 带*号栏为必填栏";
			this.ResumeLayout(false);

		}
		#endregion

		private void csubmit_Click(object sender, System.EventArgs e)
		{
			if(Note.Enabled == true && (ClientID.Text == "" || ClientName.Text == ""))
				MessageBox.Show("Please Input ClientID and ClientName!");
			else 
			{
				csubmit.BackColor = Color.GreenYellow;
				Close();
			}
		}

		private void creset_Click(object sender, System.EventArgs e)
		{
			ClientID.Clear();
			ClientName.Clear();
			Industry.Clear();
			MainDirector.Clear();
			Area.Clear();
			Location.Clear();
			PostalCode.Clear();
			WebSite.Clear();
			ProductName.Clear();
			Note.Clear();
		}			
	}
}

⌨️ 快捷键说明

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