📄 detailform.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using www.kcgx.com.Database;
namespace WindowsApplication3
{
/// <summary>
/// DetailForm 的摘要说明。
/// </summary>
public class DetailForm : System.Windows.Forms.Form
{
public static string RyearCheck ;
public static string ByearCheck ;
public static string GyearCheck ;
public static string printYN;
private System.Windows.Forms.GroupBox groupBox1;
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 label11;
private System.Windows.Forms.Label label12;
private bool IsOld;
private DBAgent db = new DBAgent( );
private System.Windows.Forms.TextBox txtName;
private System.Windows.Forms.TextBox txtSex;
private System.Windows.Forms.TextBox txtClass;
private System.Windows.Forms.TextBox txtDiploma;
private System.Windows.Forms.TextBox txtXz;
private System.Windows.Forms.TextBox txtSchool;
private System.Windows.Forms.TextBox txtConclusion;
private System.Windows.Forms.TextBox txtSpecialty;
private System.Windows.Forms.TextBox txtZsbh;
public static string Namem;
public static string Sex;
public static string Birthday;
public static string Classo;
public static string Diploma;
public static string Xz;
public static string Yxmc;
public static string Zymc;
public static string Byjl;
public static string Rxrq;
public static string Byrq;
public static string Zsbh;
public static string Shjg;
private System.Windows.Forms.Label scjgLable;
private System.Windows.Forms.TextBox scjgTxt;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.PictureBox pictureBox2;
private System.Windows.Forms.PictureBox pictureBox3;
private System.Windows.Forms.PictureBox pictureBox4;
private System.Windows.Forms.PictureBox pictureBox5;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.DateTimePicker dtCsrq;
private System.Windows.Forms.DateTimePicker dtRxrq;
private System.Windows.Forms.DateTimePicker dtByrq;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public DetailForm()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
public DetailForm(string name ,string sex,string birthday,string classOfedu,string diploma,string xz,string yxmc,string zymc,string byjl,string rxrq,string byrq,string zsbh,string shjl,bool isOld)
{
db.InitConnectionPool(@"Provider=vfpoledb.1;Data Source=VerifyStore\" , 1);
InitializeComponent();
txtName.Text = name;
txtSex.Text = sex;
if( birthday.Length == 0 )
{
dtCsrq.Visible = false;
ByearCheck = birthday.Trim();
textBox1.Visible = true;
textBox1.Text = "";
textBox1.Enabled = false;
}
else
{
dtCsrq.Value = DateTime.Parse(TimeChange.ChangeForm(birthday));
}
txtClass.Text = classOfedu;
txtDiploma.Text = diploma;
txtXz.Text = xz;
txtSchool.Text = yxmc;
txtSpecialty.Text = zymc;
txtConclusion.Text = byjl;
scjgTxt.Text = shjl;
printYN = scjgTxt.Text;//传递结论的参数
if( rxrq.Length == 0 )
{
dtRxrq.Visible = false;
RyearCheck = rxrq.Trim();
textBox2.Visible = true;
textBox2.Text = "";
textBox2.Enabled = false;
}
else
{
dtRxrq.Value = DateTime.Parse(TimeChange.ChangeForm(rxrq));
}
if( byrq.Length == 0 )
{
dtByrq.Visible = false;
GyearCheck = byrq.Trim();
textBox3.Visible = true;
textBox3.Text = "";
textBox3.Enabled = false;
}
else
{
dtByrq.Value = DateTime.Parse(TimeChange.ChangeForm(byrq));
}
txtZsbh.Text = zsbh;
IsOld = isOld;
JudgeOldDb( isOld );
}
public DetailForm(string name ,string sex,string birthday,string classOfedu,string diploma,string xz,string yxmc,string zymc,string byjl,string rxrq,string byrq,string zsbh,bool isOld)
{
db.InitConnectionPool(@"Provider=vfpoledb.1;Data Source=VerifyStore\" , 1);
InitializeComponent();
txtName.Text = name;
txtSex.Text = sex;
if( birthday.Length != 8 )
{
dtCsrq.Visible = false;
ByearCheck = birthday.Trim();
textBox1.Visible = true;
textBox1.Text = birthday ;
textBox1.Enabled = false;
}
else
{
dtCsrq.Value = DateTime.Parse(TimeChange.ChangeForm(birthday));
}
txtClass.Text = classOfedu;
txtDiploma.Text = diploma;
txtXz.Text = xz;
txtSchool.Text = yxmc;
txtSpecialty.Text = zymc;
txtConclusion.Text = byjl;
if( rxrq.Length == 0 )
{
dtRxrq.Visible = false;
RyearCheck = rxrq.Trim();
textBox2.Visible = true;
textBox2.Text = "";
textBox2.Enabled = false;
}
else
{
dtRxrq.Value = DateTime.Parse(TimeChange.ChangeForm(rxrq));
}
if( byrq.Length == 0 )
{
dtByrq.Visible = false;
GyearCheck = byrq.Trim();
textBox3.Visible = true;
textBox3.Text = "";
textBox3.Enabled = false;
}
else
{
dtByrq.Value = DateTime.Parse(TimeChange.ChangeForm(byrq));
}
txtZsbh.Text = zsbh;
IsOld = isOld;
JudgeOldDb( isOld );
}
private void JudgeOldDb( bool isOld)
{
if ( isOld )
{
txtName.Enabled = false;
txtSex.Enabled = false;
dtCsrq.Enabled = false;
txtClass.Enabled = false;
txtDiploma.Enabled = false;
txtXz.Enabled = false;
txtSchool.Enabled = false;
txtSpecialty.Enabled = false;
txtConclusion.Enabled = false;
dtRxrq.Enabled = false;
dtByrq.Enabled = false;
txtZsbh.Enabled = false;
//button1.Enabled = false;
//button2.Enabled = false;
}
}
/// <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(DetailForm));
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.dtByrq = new System.Windows.Forms.DateTimePicker();
this.dtRxrq = new System.Windows.Forms.DateTimePicker();
this.label10 = new System.Windows.Forms.Label();
this.dtCsrq = new System.Windows.Forms.DateTimePicker();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.scjgTxt = new System.Windows.Forms.TextBox();
this.scjgLable = new System.Windows.Forms.Label();
this.txtName = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.txtSex = new System.Windows.Forms.TextBox();
this.txtClass = new System.Windows.Forms.TextBox();
this.txtDiploma = new System.Windows.Forms.TextBox();
this.txtXz = new System.Windows.Forms.TextBox();
this.txtSchool = new System.Windows.Forms.TextBox();
this.txtConclusion = new System.Windows.Forms.TextBox();
this.txtSpecialty = new System.Windows.Forms.TextBox();
this.txtZsbh = new System.Windows.Forms.TextBox();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.pictureBox3 = new System.Windows.Forms.PictureBox();
this.pictureBox4 = new System.Windows.Forms.PictureBox();
this.pictureBox5 = new System.Windows.Forms.PictureBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.textBox3);
this.groupBox1.Controls.Add(this.textBox2);
this.groupBox1.Controls.Add(this.textBox1);
this.groupBox1.Controls.Add(this.dtByrq);
this.groupBox1.Controls.Add(this.dtRxrq);
this.groupBox1.Controls.Add(this.label10);
this.groupBox1.Controls.Add(this.dtCsrq);
this.groupBox1.Controls.Add(this.pictureBox1);
this.groupBox1.Controls.Add(this.scjgTxt);
this.groupBox1.Controls.Add(this.scjgLable);
this.groupBox1.Controls.Add(this.txtName);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.label8);
this.groupBox1.Controls.Add(this.label9);
this.groupBox1.Controls.Add(this.label11);
this.groupBox1.Controls.Add(this.label12);
this.groupBox1.Controls.Add(this.txtSex);
this.groupBox1.Controls.Add(this.txtClass);
this.groupBox1.Controls.Add(this.txtDiploma);
this.groupBox1.Controls.Add(this.txtXz);
this.groupBox1.Controls.Add(this.txtSchool);
this.groupBox1.Controls.Add(this.txtConclusion);
this.groupBox1.Controls.Add(this.txtSpecialty);
this.groupBox1.Controls.Add(this.txtZsbh);
this.groupBox1.Location = new System.Drawing.Point(8, 8);
this.groupBox1.Name = "groupBox1";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -