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

📄 form_xy.cs

📁 一个很简单的考试系统。实用性很强啊!数据库在里面
💻 CS
📖 第 1 页 / 共 5 页
字号:
			this.lbl_yzbm.Location = new System.Drawing.Point(296, 48);
			this.lbl_yzbm.Name = "lbl_yzbm";
			this.lbl_yzbm.Size = new System.Drawing.Size(56, 23);
			this.lbl_yzbm.TabIndex = 203;
			this.lbl_yzbm.Text = "邮政编码";
			// 
			// lbl_xm
			// 
			this.lbl_xm.Location = new System.Drawing.Point(296, 16);
			this.lbl_xm.Name = "lbl_xm";
			this.lbl_xm.Size = new System.Drawing.Size(48, 23);
			this.lbl_xm.TabIndex = 202;
			this.lbl_xm.Text = "姓名";
			// 
			// lbl_sfzh
			// 
			this.lbl_sfzh.Location = new System.Drawing.Point(40, 112);
			this.lbl_sfzh.Name = "lbl_sfzh";
			this.lbl_sfzh.Size = new System.Drawing.Size(56, 23);
			this.lbl_sfzh.TabIndex = 201;
			this.lbl_sfzh.Text = "身份证号";
			// 
			// lbl_lxdh
			// 
			this.lbl_lxdh.Location = new System.Drawing.Point(40, 80);
			this.lbl_lxdh.Name = "lbl_lxdh";
			this.lbl_lxdh.Size = new System.Drawing.Size(56, 23);
			this.lbl_lxdh.TabIndex = 200;
			this.lbl_lxdh.Text = "联系电话";
			// 
			// lbl_csny
			// 
			this.lbl_csny.Location = new System.Drawing.Point(40, 48);
			this.lbl_csny.Name = "lbl_csny";
			this.lbl_csny.Size = new System.Drawing.Size(56, 23);
			this.lbl_csny.TabIndex = 199;
			this.lbl_csny.Text = "出生年月";
			// 
			// lbl_xh
			// 
			this.lbl_xh.Location = new System.Drawing.Point(40, 16);
			this.lbl_xh.Name = "lbl_xh";
			this.lbl_xh.Size = new System.Drawing.Size(32, 23);
			this.lbl_xh.TabIndex = 198;
			this.lbl_xh.Text = "学号";
			// 
			// dtp_kbrq
			// 
			this.dtp_kbrq.Location = new System.Drawing.Point(104, 336);
			this.dtp_kbrq.Name = "dtp_kbrq";
			this.dtp_kbrq.Size = new System.Drawing.Size(160, 21);
			this.dtp_kbrq.TabIndex = 3;
			// 
			// dgd_xy
			// 
			this.dgd_xy.DataMember = "";
			this.dgd_xy.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dgd_xy.Location = new System.Drawing.Point(0, 0);
			this.dgd_xy.Name = "dgd_xy";
			this.dgd_xy.ReadOnly = true;
			this.dgd_xy.Size = new System.Drawing.Size(792, 280);
			this.dgd_xy.TabIndex = 1;
			this.dgd_xy.MouseUp += new System.Windows.Forms.MouseEventHandler(this.dgd_xy_MouseUp);
			// 
			// panel2
			// 
			this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
			this.panel2.Controls.Add(this.btn_xxxx);
			this.panel2.Controls.Add(this.btn_qx);
			this.panel2.Controls.Add(this.btn_qdtj);
			this.panel2.Controls.Add(this.btn_sc);
			this.panel2.Controls.Add(this.btn_tj);
			this.panel2.Controls.Add(this.btn_bj);
			this.panel2.Controls.Add(this.btn_mjl);
			this.panel2.Controls.Add(this.btn_hyjr);
			this.panel2.Controls.Add(this.btn_qyjl);
			this.panel2.Controls.Add(this.btn_sjl);
			this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
			this.panel2.Location = new System.Drawing.Point(0, 517);
			this.panel2.Name = "panel2";
			this.panel2.Size = new System.Drawing.Size(792, 56);
			this.panel2.TabIndex = 2;
			this.panel2.Paint += new System.Windows.Forms.PaintEventHandler(this.panel2_Paint);
			// 
			// btn_xxxx
			// 
			this.btn_xxxx.Location = new System.Drawing.Point(688, 16);
			this.btn_xxxx.Name = "btn_xxxx";
			this.btn_xxxx.Size = new System.Drawing.Size(64, 23);
			this.btn_xxxx.TabIndex = 240;
			this.btn_xxxx.Text = "详细信息";
			this.btn_xxxx.Click += new System.EventHandler(this.btn_xxxx_Click);
			// 
			// btn_qx
			// 
			this.btn_qx.Location = new System.Drawing.Point(616, 16);
			this.btn_qx.Name = "btn_qx";
			this.btn_qx.Size = new System.Drawing.Size(64, 23);
			this.btn_qx.TabIndex = 239;
			this.btn_qx.Text = "取消";
			this.btn_qx.Click += new System.EventHandler(this.btn_qx_Click);
			// 
			// btn_qdtj
			// 
			this.btn_qdtj.Location = new System.Drawing.Point(544, 16);
			this.btn_qdtj.Name = "btn_qdtj";
			this.btn_qdtj.Size = new System.Drawing.Size(64, 23);
			this.btn_qdtj.TabIndex = 238;
			this.btn_qdtj.Text = "确定提交";
			this.btn_qdtj.Click += new System.EventHandler(this.btn_qdtj_Click);
			// 
			// btn_sc
			// 
			this.btn_sc.Location = new System.Drawing.Point(472, 16);
			this.btn_sc.Name = "btn_sc";
			this.btn_sc.Size = new System.Drawing.Size(64, 23);
			this.btn_sc.TabIndex = 237;
			this.btn_sc.Text = "删除";
			this.btn_sc.Click += new System.EventHandler(this.btn_sc_Click);
			// 
			// btn_tj
			// 
			this.btn_tj.Location = new System.Drawing.Point(400, 16);
			this.btn_tj.Name = "btn_tj";
			this.btn_tj.Size = new System.Drawing.Size(64, 23);
			this.btn_tj.TabIndex = 236;
			this.btn_tj.Text = "添加";
			this.btn_tj.Click += new System.EventHandler(this.btn_tj_Click);
			// 
			// btn_bj
			// 
			this.btn_bj.Location = new System.Drawing.Point(328, 16);
			this.btn_bj.Name = "btn_bj";
			this.btn_bj.Size = new System.Drawing.Size(64, 23);
			this.btn_bj.TabIndex = 235;
			this.btn_bj.Text = "编辑";
			this.btn_bj.Click += new System.EventHandler(this.btn_bj_Click);
			// 
			// btn_mjl
			// 
			this.btn_mjl.Location = new System.Drawing.Point(256, 16);
			this.btn_mjl.Name = "btn_mjl";
			this.btn_mjl.Size = new System.Drawing.Size(64, 23);
			this.btn_mjl.TabIndex = 234;
			this.btn_mjl.Text = "末记录";
			this.btn_mjl.Click += new System.EventHandler(this.btn_mjl_Click);
			// 
			// btn_hyjr
			// 
			this.btn_hyjr.Location = new System.Drawing.Point(184, 16);
			this.btn_hyjr.Name = "btn_hyjr";
			this.btn_hyjr.Size = new System.Drawing.Size(64, 23);
			this.btn_hyjr.TabIndex = 233;
			this.btn_hyjr.Text = "后一记录";
			this.btn_hyjr.Click += new System.EventHandler(this.btn_hyjr_Click);
			// 
			// btn_qyjl
			// 
			this.btn_qyjl.Location = new System.Drawing.Point(112, 16);
			this.btn_qyjl.Name = "btn_qyjl";
			this.btn_qyjl.Size = new System.Drawing.Size(64, 23);
			this.btn_qyjl.TabIndex = 232;
			this.btn_qyjl.Text = "前一记录";
			this.btn_qyjl.Click += new System.EventHandler(this.btn_qyjl_Click);
			// 
			// btn_sjl
			// 
			this.btn_sjl.Location = new System.Drawing.Point(40, 16);
			this.btn_sjl.Name = "btn_sjl";
			this.btn_sjl.Size = new System.Drawing.Size(64, 23);
			this.btn_sjl.TabIndex = 231;
			this.btn_sjl.Text = "首记录";
			this.btn_sjl.Click += new System.EventHandler(this.btn_sjl_Click);
			// 
			// Form_xy
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(792, 573);
			this.Controls.Add(this.panel2);
			this.Controls.Add(this.dgd_xy);
			this.Controls.Add(this.pnl_xy1);
			this.Name = "Form_xy";
			this.Text = "学员资料维护";
			this.Load += new System.EventHandler(this.Form_xy_Load);
			this.pnl_xy1.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dgd_xy)).EndInit();
			this.panel2.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		private void panel2_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
		{
		
		}

		private void btn_xxxx_Click(object sender, System.EventArgs e)
		{
			if(btn_xxxx.Text == "详细信息")
			{
				dgd_xy.Visible = false;
				pnl_xy1.Dock = System.Windows.Forms.DockStyle.Fill;
				btn_xxxx.Text = "返回";
			}
			else
			{
				dgd_xy.Visible = true;
				pnl_xy1.Dock = System.Windows.Forms.DockStyle.None;
				btn_xxxx.Text = "详细信息";
			}
		}

		private void Form_xy_Load(object sender, System.EventArgs e)
		{
			this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
			this.ControlBox = false;
			
			dbAccess dba=new dbAccess();
			sqlcon=new System.Data.SqlClient.SqlConnection(dba.connStr);
			sqlcon.Open();
			dat=new DataSet();
			this.LianJie();
			this.DataBings_data();
			this.Combo_Add();
			this.ConEnbFalse();
			this.btn_qx.Enabled=false;
			this.btn_qdtj.Enabled=false;
			if(dat.Tables[this.table_name].Rows.Count==0)
			{
				this.btn_sjl.Enabled=false;
				this.btn_qyjl.Enabled=false;
				this.btn_mjl.Enabled=false;
				this.btn_hyjr.Enabled=false;
				this.btn_bj.Enabled=false;
				this.btn_sc.Enabled=false;
				this.btn_qdtj.Enabled=false;
				this.btn_qx.Enabled=false;
			}
		}
		private void LianJie()
		{
			dbAccess dab=new dbAccess();
			string select = "select student.stu_id as '学号',stu_name as '姓名',"
				+"sex_name as '性别',stu_birthday as '出生年月',stu_postcode as '邮政编码',"
				+"stu_homeaddress as '家庭地址',stu_tel as '联系电话',stu_hometel as '家庭电话',"
				+"stu_studytype as '学习方式',stu_identityNo as '身份证号',cla_name as '班级',"
				+"stu_registerdate as '报名日期',natp_name as '籍贯',nat_name as '民族',"
				+"polf_name as '政治面貌',mars_name as '婚姻状况',stu_company as '工作单位',"
				+"stu_address as '通讯地址',fie_name as '行业',stu_job as '职位',"
				+"stu_email as '电子邮件',tecp_name as '职业技术',Stu_diploma as '学历',tecp_name as '专业技术职务',"
				+"culd_name as '文化程度',Stu_languagedegree as '外语程度',stu_college as '毕业院校',"
				+"stu_tuitionfee as '学费',stu_materialfee as '教材费',stu_mortgagefee as '押金',stu_skillfullevel as '电脑能力',"
				+"stu_studydate as '开班日期',stu_lodgefee as '住宿费',stu_resume as '简历',stu_memo as '备注'"
				+" from student,sex,nation,technicalPosition,Maritalstatus,PoliticalFeature,"
				+"cultureDegree,nativePlace,field,class,classes"
				+" where nation.nat_code=student.nat_code and nativePlace.natp_code=student.natp_code"
				+" and Maritalstatus.mars_code=student.mars_code and PoliticalFeature.polf_code=student.polf_code"
				+" and cultureDegree.culd_code=student.culd_code and technicalPosition.tecp_code=student.tecp_code"
				+" and sex.sex_code=student.sex_code and field.fie_code=student.fie_code and class.cla_no=classes.cla_no"
				+" and classes.stu_id=student.stu_id";
			System.Data.SqlClient.SqlDataAdapter sqldat=new System.Data.SqlClient.SqlDataAdapter(select,dab.connStr);
			sqldat.Fill(dat,this.table_name);
			for(int i=0; i < this.dat.Tables[this.table_name].Rows.Count; i++)
			{
				if (int.Parse(this.dat.Tables[this.table_name].Rows[i]["学习方式"].ToString())==1)
					this.dat.Tables[this.table_name].Rows[i]["学习方式"]="全日制";
				else if (int.Parse(this.dat.Tables[this.table_name].Rows[i]["学习方式"].ToString())==2)
					this.dat.Tables[this.table_name].Rows[i]["学习方式"]="半脱产";
				else if (int.Parse(this.dat.Tables[this.table_name].Rows[i]["学习方式"].ToString())==3)
					this.dat.Tables[this.table_name].Rows[i]["学习方式"]="双休日";
				else if (int.Parse(this.dat.Tables[this.table_name].Rows[i]["学习方式"].ToString())==4)
					this.dat.Tables[this.table_name].Rows[i]["学习方式"]="其它";
			}
		}
		private void DataBings_data()
		{
			this.dgd_xy.DataBindings.Clear();
			this.txt_zyjs.DataBindings.Clear();
			this.txt_yj.DataBindings.Clear();
			this.txt_xh.DataBindings.Clear();
			this.txt_xm.DataBindings.Clear();
			this.cbb_xb.DataBindings.Clear();
			this.dtp_csny.DataBindings.Clear();
			this.txt_yzbm.DataBindings.Clear();
			this.txt_jtdz.DataBindings.Clear();
			this.txt_lxdh.DataBindings.Clear();
			this.txt_jtdh.DataBindings.Clear();
			this.cbb_xxfs.DataBindings.Clear();
			this.txt_sfzh.DataBindings.Clear();
			this.cbb_bj.DataBindings.Clear();
			this.dtp_bnrq.DataBindings.Clear();
			this.cbb_jg.DataBindings.Clear();
			this.cbb_mz.DataBindings.Clear();
			this.cbb_zzmm.DataBindings.Clear();
			this.cbb_hyzk.DataBindings.Clear();
			this.txt_gzdw.DataBindings.Clear();
			this.txt_txdz.DataBindings.Clear();
			this.cbb_hy.DataBindings.Clear();
			this.txt_zw.DataBindings.Clear();
			this.txt_dzyj.DataBindings.Clear();
			this.txt_xl.DataBindings.Clear();
			this.cbb_whcd.DataBindings.Clear();
			this.cbb_zyjszw.DataBindings.Clear();
			this.txt_wycd.DataBindings.Clear();
			this.txt_byyx.DataBindings.Clear();
			this.txt_xf.DataBindings.Clear();
			this.txt_jcf.DataBindings.Clear();
			this.txt_dnnl.DataBindings.Clear();
			this.dtp_kbrq.DataBindings.Clear();
			this.txt_zcf.DataBindings.Clear();
			this.txt_jl.DataBindings.Clear();
			this.txt_bz.DataBindings.Clear();
			this.dgd_xy.SetDataBinding(dat,this.table_name);
			this.txt_xh.DataBindings.Add("text",dat,table_name+".学号");
			this.txt_xm.DataBindings.Add("text",dat,table_name+".姓名");
			this.cbb_xb.DataBindings.Add("text",dat,table_name+".性别");
			this.dtp_csny.DataBindings.Add("Value",dat,table_name+".出生年月");
			this.txt_yzbm.DataBindings.Add("text",dat,table_name+".邮政编码");
			this.txt_jtdz.DataBindings.Add("text",dat,table_name+".家庭地址");
			this.txt_lxdh.DataBindings.Add("text",dat,table_name+".联系电话");
			this.txt_jtdh.DataBindings.Add("text",dat,table_name+".家庭电话");
			this.cbb_xxfs.DataBindings.Add("text",dat,table_name+".学习方式");
			this.txt_sfzh.DataBindings.Add("text",dat,table_name+".身份证号");
			this.cbb_bj.DataBindings.Add("text",dat,table_name+".班级");
			this.dtp_bnrq.DataBindings.Add("Value",dat,table_name+".报名日期");
			this.cbb_jg.DataBindings.Add("text",dat,table_name+".籍贯");
			this.cbb_mz.DataBindings.Add("text",dat,table_name+".民族");
			this.cbb_zzmm.DataBindings.Add("text",dat,table_name+".政治面貌");
			this.cbb_hyzk.DataBindings.Add("text",dat,table_name+".婚姻状况");
			this.txt_gzdw.DataBindings.Add("text",dat,table_name+".工作单位");
			this.txt_txdz.DataBindings.Add("text",dat,table_name+".通讯地址");
			this.cbb_hy.DataBindings.Add("text",dat,table_name+".行业");
			this.txt_zw.DataBindings.Add("text",dat,table_name+".职位");
			this.txt_dzyj.DataBindings.Add("text",dat,table_name+".电子邮件");
			this.txt_zyjs.DataBindings.Add("text",dat,table_name+".职业技术");
			this.txt_xl.DataBindings.Add("text",dat,table_name+".学历");
			this.txt_wycd.DataBindings.Add("text",dat,table_name+".外语程度");
			this.cbb_zyjszw.DataBindings.Add("text",dat,table_name+".专业技术职务");
			this.cbb_whcd.DataBindings.Add("text",dat,table_name+".文化程度");
			this.txt_byyx.DataBindings.Add("text",dat,table_name+".毕业院校");
			this.txt_xf.DataBindings.Add("text",dat,table_name+".学费");
			this.txt_jcf.DataBindings.Add("text",dat,table_name+".教材费");
			this.txt_yj.DataBindings.Add("text",dat,table_name+".押金");
			this.txt_dnnl.DataBindings.Add("text",dat,table_name+".电脑能力");
			this.dtp_kbrq.DataBindings.Add("Value",dat,table_name+".开班日期");

⌨️ 快捷键说明

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