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

📄 inputprint.cs

📁 为湖北省教委、湖北省就业指导中心订做的学历查询系统
💻 CS
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace WindowsApplication3
{
	/// <summary>
	/// InputPrint 的摘要说明。
	/// </summary>
	public class InputPrint : System.Windows.Forms.Form
	{
		public static string reportNum = "";
		public static string reportData = "";
        public static string reportKind = "";

		private System.Windows.Forms.Label stuLable;
		private System.Windows.Forms.TextBox textBox1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.RadioButton rab1;
		private System.Windows.Forms.RadioButton rab2;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.PictureBox pictureBox1;
		private System.Windows.Forms.DateTimePicker dateTimePicker1;
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		private System.ComponentModel.Container components = null;

		public InputPrint()
		{
			//
			// 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(InputPrint));
			this.stuLable = new System.Windows.Forms.Label();
			this.textBox1 = new System.Windows.Forms.TextBox();
			this.label2 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.rab2 = new System.Windows.Forms.RadioButton();
			this.rab1 = new System.Windows.Forms.RadioButton();
			this.label1 = new System.Windows.Forms.Label();
			this.pictureBox1 = new System.Windows.Forms.PictureBox();
			this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
			this.groupBox1.SuspendLayout();
			this.SuspendLayout();
			// 
			// stuLable
			// 
			this.stuLable.BackColor = System.Drawing.Color.Transparent;
			this.stuLable.Location = new System.Drawing.Point(16, 24);
			this.stuLable.Name = "stuLable";
			this.stuLable.Size = new System.Drawing.Size(168, 24);
			this.stuLable.TabIndex = 0;
			this.stuLable.Text = "学生情况";
			// 
			// textBox1
			// 
			this.textBox1.Location = new System.Drawing.Point(160, 96);
			this.textBox1.Name = "textBox1";
			this.textBox1.Size = new System.Drawing.Size(152, 21);
			this.textBox1.TabIndex = 1;
			this.textBox1.Text = "";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(40, 96);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(96, 23);
			this.label2.TabIndex = 3;
			this.label2.Text = "请输入报告编号";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(40, 136);
			this.label3.Name = "label3";
			this.label3.TabIndex = 4;
			this.label3.Text = "请输入报告日期";
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.rab2);
			this.groupBox1.Controls.Add(this.rab1);
			this.groupBox1.Location = new System.Drawing.Point(40, 216);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(360, 48);
			this.groupBox1.TabIndex = 6;
			this.groupBox1.TabStop = false;
			// 
			// rab2
			// 
			this.rab2.Location = new System.Drawing.Point(200, 16);
			this.rab2.Name = "rab2";
			this.rab2.TabIndex = 1;
			this.rab2.Text = "   查无此人";
			// 
			// rab1
			// 
			this.rab1.Location = new System.Drawing.Point(32, 16);
			this.rab1.Name = "rab1";
			this.rab1.TabIndex = 0;
			this.rab1.Text = "   存在此人";
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(40, 192);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(128, 23);
			this.label1.TabIndex = 7;
			this.label1.Text = "请选择打印报告的种类";
			// 
			// pictureBox1
			// 
			this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
			this.pictureBox1.Location = new System.Drawing.Point(320, 280);
			this.pictureBox1.Name = "pictureBox1";
			this.pictureBox1.Size = new System.Drawing.Size(72, 24);
			this.pictureBox1.TabIndex = 8;
			this.pictureBox1.TabStop = false;
			this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
			this.pictureBox1.MouseEnter += new System.EventHandler(this.pictureBox1_MouseEnter);
			this.pictureBox1.MouseLeave += new System.EventHandler(this.pictureBox1_MouseLeave);
			// 
			// dateTimePicker1
			// 
			this.dateTimePicker1.Location = new System.Drawing.Point(160, 136);
			this.dateTimePicker1.Name = "dateTimePicker1";
			this.dateTimePicker1.Size = new System.Drawing.Size(152, 21);
			this.dateTimePicker1.TabIndex = 9;
			// 
			// InputPrint
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.BackColor = System.Drawing.SystemColors.ControlLightLight;
			this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
			this.ClientSize = new System.Drawing.Size(448, 318);
			this.Controls.Add(this.dateTimePicker1);
			this.Controls.Add(this.pictureBox1);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.groupBox1);
			this.Controls.Add(this.label3);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.textBox1);
			this.Controls.Add(this.stuLable);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "InputPrint";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "打印设置";
			this.Load += new System.EventHandler(this.InputPrint_Load);
			this.groupBox1.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion
		
		
		
		
		private void InputPrint_Load(object sender, System.EventArgs e)
		{
			rab1.Checked = false;
			rab2.Checked = false;
			
			if(InputData.stuState == true)
			{
				stuLable.Text = "经查询,个人资料全部符合!";
				rab1.Checked = true;
			}
			else
			{
				stuLable.Text = "经查询,个人资料有修改部分!";
				rab2.Checked = true;
			}
		}

	

		private void pictureBox1_Click(object sender, System.EventArgs e)
		{
			textBox1.Text = textBox1.Text.Trim();
			//textBox2.Text = textBox2.Text.Trim();
//			if(textBox1.Text.Length == 0)//||(textBox2.Text.Length == 0))
//			{
//				MessageBox.Show("编号不能为空!");
//				return;
//			}
			if((rab1.Checked == false)&&(rab2.Checked == false))
			{
				MessageBox.Show("请选择要打印报告的种类!");
				return;
			}

			if(rab1.Checked == true)
			{
				reportKind = "yes";
			}
			if(rab2.Checked == true)
			{
				reportKind = "no";
			}
			reportNum = textBox1.Text;//设置编号
			reportData = dateTimePicker1.Value.ToShortDateString();//设置日期

			//////////////////////////////////字段长度处理
			if( (InputData.trans.name.Length < 4)&&(InputData.trans.name.Length == 1))
			{
				InputData.trans.name = "  "+InputData.trans.name+"    ";
			}
			if( (InputData.trans.name.Length < 4)&&(InputData.trans.name.Length == 2))
			{
				InputData.trans.name = "  "+InputData.trans.name+"  ";
			}
			if( (InputData.trans.name.Length < 4)&&(InputData.trans.name.Length == 3))
			{
				InputData.trans.name = "  "+InputData.trans.name;
			}

			if(InputData.trans.schName.Length<10)
			{
				if(InputData.trans.schName.Length == 9)
				{
                   InputData.trans.schName = "  "+InputData.trans.schName;
				}
				if(InputData.trans.schName.Length == 8)
				{
					InputData.trans.schName = "  "+InputData.trans.schName+"  ";
				}
				if(InputData.trans.schName.Length == 7)
				{
					InputData.trans.schName = "  "+InputData.trans.schName+"    ";
				}
				if(InputData.trans.schName.Length == 6)
				{
					InputData.trans.schName = "  "+InputData.trans.schName+"      ";
				}
				if(InputData.trans.schName.Length == 5)
				{
					InputData.trans.schName = "  "+InputData.trans.schName+"        ";
				}
				if(InputData.trans.schName.Length == 4)
				{
					InputData.trans.schName = "  "+InputData.trans.schName+"          ";
				}
				if(InputData.trans.schName.Length == 3)
				{
					InputData.trans.schName = "  "+InputData.trans.schName+"            ";
				}

			}
 
			if(InputData.trans.schCourse.Length < 8)
			{
				if(InputData.trans.schCourse.Length == 7)
				{
                   InputData.trans.schCourse = "  "+InputData.trans.schCourse ;
				}
				if(InputData.trans.schCourse.Length == 6)
				{
					InputData.trans.schCourse = "  "+InputData.trans.schCourse+"  ";
				}
				if(InputData.trans.schCourse.Length == 5)
				{
					InputData.trans.schCourse = "  "+InputData.trans.schCourse+"    ";
				}
				if(InputData.trans.schCourse.Length == 4)
				{
					InputData.trans.schCourse = "  "+InputData.trans.schCourse+"      ";
				}
				if(InputData.trans.schCourse.Length == 3)
				{
					InputData.trans.schCourse = "  "+InputData.trans.schCourse+"        ";
				}
				if(InputData.trans.schCourse.Length == 2)
				{
					InputData.trans.schCourse = "  "+InputData.trans.schCourse+"          ";
				}
			}
			
			if(InputData.trans.degreeKind.Length<8)
			{ 
				if(InputData.trans.degreeKind.Length == 7)
				{
                    InputData.trans.degreeKind = "  " + InputData.trans.degreeKind;
				}
				if(InputData.trans.degreeKind.Length == 6)
				{
					InputData.trans.degreeKind = "  " + InputData.trans.degreeKind+"  ";
				}
				if(InputData.trans.degreeKind.Length == 5)
				{
					InputData.trans.degreeKind = "  " + InputData.trans.degreeKind+"    ";
				}
				if(InputData.trans.degreeKind.Length == 4)
				{
					InputData.trans.degreeKind = "  " + InputData.trans.degreeKind+"      ";
				}
				if(InputData.trans.degreeKind.Length == 3)
				{
					InputData.trans.degreeKind = "  " + InputData.trans.degreeKind+"        ";
				}
				if(InputData.trans.degreeKind.Length == 2)
				{
					InputData.trans.degreeKind = "  " + InputData.trans.degreeKind+"          ";
				}
			}

			if(InputData.trans.degree.Length<9)
			{
				if(InputData.trans.degree.Length == 5)
				{
                   InputData.trans.degree = "  "+InputData.trans.degree + "      ";
				}
				if(InputData.trans.degree.Length == 6)
				{
					InputData.trans.degree = "  "+InputData.trans.degree + "    ";
				}
				if(InputData.trans.degree.Length == 4)
				{
					InputData.trans.degree =  "  "+InputData.trans.degree + "        ";
				}
				if(InputData.trans.degree.Length == 3)
				{
					InputData.trans.degree =  "  "+InputData.trans.degree + "          ";
				}
				if(InputData.trans.degree.Length == 2)
				{
					InputData.trans.degree =  "  "+InputData.trans.degree + "            ";
				}

			}

			/////////////////////////////////


			
			PreviewDialog view = new PreviewDialog();
			view.ShowDialog();

		}

		private void pictureBox1_MouseEnter(object sender, System.EventArgs e)
		{
		   pictureBox1.Image = Image.FromFile( "img\\button-打印报告02.GIF" );
		}

		private void pictureBox1_MouseLeave(object sender, System.EventArgs e)
		{
		   pictureBox1.Image = Image.FromFile( "img\\button-打印报告01.GIF" );
		}
	}
}

⌨️ 快捷键说明

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