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

📄 querybynewdata.cs

📁 为湖北省教委、湖北省就业指导中心订做的学历查询系统
💻 CS
📖 第 1 页 / 共 2 页
字号:
			// 学历类型
			// 
			this.学历类型.Text = "学历类型";
			// 
			// 学制
			// 
			this.学制.Text = "学制";
			// 
			// 院校名称
			// 
			this.院校名称.Text = "院校名称";
			// 
			// 专业名称
			// 
			this.专业名称.Text = "专业名称";
			this.专业名称.Width = 80;
			// 
			// 毕结业结论
			// 
			this.毕结业结论.Text = "毕结业结论";
			// 
			// 入学时间
			// 
			this.入学时间.Text = "入学时间";
			// 
			// 毕业时间
			// 
			this.毕业时间.Text = "毕业时间";
			// 
			// 证书编号
			// 
			this.证书编号.Text = "证书编号";
			// 
			// 录入人员
			// 
			this.录入人员.Text = "录入人员";
			// 
			// 录入时间
			// 
			this.录入时间.Text = "录入时间";
			// 
			// 审核结果
			// 
			this.审核结果.Text = "审核结果";
			// 
			// QueryByNewData
			// 
			this.Controls.Add(this.lv);
			this.Controls.Add(this.groupBox3);
			this.Name = "QueryByNewData";
			this.Size = new System.Drawing.Size(600, 450);
			this.Load += new System.EventHandler(this.QueryByNewData_Load);
			this.groupBox3.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion



		private void QueryByNewData_Load(object sender, System.EventArgs e)
		{
			
			this.txtNewname.Focus( );
			db.InitConnectionPool(@"Provider=vfpoledb.1;Data Source=VerifyStore\" , 1);
		}

		private void lv_DoubleClick(object sender, System.EventArgs e)
		{
			btnYN_2 = true;

			ListViewItem ltemp = lv.SelectedItems[0];
			string xm = lv.SelectedItems[0].SubItems[1].Text;
			string xb = lv.SelectedItems[0].SubItems[2].Text;
			string csrq = lv.SelectedItems[0].SubItems[3].Text;
			string pycc = lv.SelectedItems[0].SubItems[4].Text;
			string xxxs = lv.SelectedItems[0].SubItems[5].Text;
			string xz = lv.SelectedItems[0].SubItems[6].Text;
			string yxmc = lv.SelectedItems[0].SubItems[7].Text;
			string zymc = lv.SelectedItems[0].SubItems[8].Text;
			string bjyjl = lv.SelectedItems[0].SubItems[9].Text;
			string rxrq = lv.SelectedItems[0].SubItems[10].Text;
			string byrq = lv.SelectedItems[0].SubItems[11].Text;
			string zsbh = lv.SelectedItems[0].SubItems[12].Text;
			string shjg = lv.SelectedItems[0].SubItems[15].Text;

			DialogResult k = DetailForm.ShowForm(xm,xb,csrq,pycc,xxxs,xz,yxmc,zymc,bjyjl,rxrq,byrq,zsbh,shjg,OldOrNew( lv.Tag.ToString( )));
			if( k == DialogResult.OK )
			{
				lv.SelectedItems[0].SubItems[1].Text = DetailForm.Namem;
				lv.SelectedItems[0].SubItems[2].Text = DetailForm.Sex;
				lv.SelectedItems[0].SubItems[3].Text = DetailForm.Birthday;
				lv.SelectedItems[0].SubItems[4].Text = DetailForm.Classo;
				lv.SelectedItems[0].SubItems[5].Text = DetailForm.Diploma;
				lv.SelectedItems[0].SubItems[6].Text = DetailForm.Xz;
				lv.SelectedItems[0].SubItems[7].Text = DetailForm.Yxmc;
				lv.SelectedItems[0].SubItems[8].Text = DetailForm.Zymc;
				lv.SelectedItems[0].SubItems[9].Text = DetailForm.Byjl;
				lv.SelectedItems[0].SubItems[10].Text = DetailForm.Rxrq;
				lv.SelectedItems[0].SubItems[11].Text = DetailForm.Byrq;
				lv.SelectedItems[0].SubItems[12].Text = DetailForm.Zsbh;
				lv.SelectedItems[0].SubItems[15].Text = DetailForm.Shjg;
			}
			else if( k == DialogResult.No)
			{
				lv.Items.Remove( ltemp);
			}
			else
			{

			}
		}

		/// <summary>
		/// 判断是旧库还是新库
		/// </summary>
		/// <param name="condition">条件</param>
		/// <returns>true就是新库</returns>
		private bool OldOrNew( string condition )
		{
			if( condition == "OldQuery" || condition == "OldInput" )
				return true;
			else
				return false;
		}

		private void txtNewdiplomaid_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if( !(( 48 <= e.KeyChar &&  e.KeyChar <=57 )|| e.KeyChar == 8 ))
			{
				e.Handled = true;
			}
			if ( e.KeyChar == 13 )
			{
				pictureBox1_Click( sender, e );
			}
		}

		private void txtTime_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if( !(( 48 <= e.KeyChar &&  e.KeyChar <=57 )|| e.KeyChar == 8 ))
			{
				e.Handled = true;
			}
		}

		private void button3_Click(object sender, System.EventArgs e)
		{
			if ( lv.SelectedItems.Count == 0 )
			{
				MessageBox.Show( "请先选择要删除的数据!","错误提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
				return;
			}
			string Top = "您现在要删除"+ lv.SelectedItems.Count.ToString( ) +"条数据,请确认操作!";
			if( MessageBox.Show( Top,"删除数据确认提示",MessageBoxButtons.YesNo,MessageBoxIcon.Warning) == DialogResult.Yes )
			{
				ArrayList tempList = new ArrayList( );
				for ( int i = 0 ; i < lv.SelectedItems.Count ; i++ )
				{
					ListViewItem ltemp = lv.SelectedItems[i];
					tempList.Add( ltemp );
				}
				for ( int j = 0 ; j < tempList.Count ; j++ )
				{
					ListViewItem tp = (ListViewItem)tempList[j];
					string xm = tp.SubItems[1].Text;
					string zsbh = tp.SubItems[12].Text;
					string delstr = "DELETE FROM education WHERE zsbh='" + zsbh + "' AND xm='" + xm + "'";
					db.ExecuteCommandNonQuery( delstr );
					lv.Items.Remove( tp );
				}
				MessageBox.Show("删除数据成功!","详细信息操作提示信息",MessageBoxButtons.OK ,MessageBoxIcon.Information );
			}
		}

		private void pictureBox1_Click(object sender, System.EventArgs e)
		{
			txtNewname.Text = txtNewname.Text.Trim();

			if  (( txtNewname.Text.Length == 0) &&( cbNewclass.Text.Trim( ) == "请选择或输入新项") 
				&& (cbNewdiploma.Text.Trim( ) == "请选择或输入新项") && (txtNewdiplomaid.Text.Trim( ).Length == 0) &&( txtNewschool.Text.Trim( ).Length == 0)
				&&( txtNewspecialty.Text.Trim( ).Length == 0) && (txtManager.Text.Trim( ).Length == 0) && (txtTime.Text.Trim( ).Length == 0))
			{
				MessageBox.Show( "请至少填入一项进行查询","查询错误提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
				this.Focus( );
			}
			else
			{
				lv.Items.Clear( );
				string queryString = "SELECT * FROM education WHERE ";
				if ( txtNewname.Text.Trim( ).Length != 0 )
				{
					queryString += "xm='" + txtNewname.Text.Trim( ) + "' AND ";
				}
				if ( txtNewdiplomaid.Text.Trim( ).Length != 0  )
				{
					queryString += "zsbh='" + txtNewdiplomaid.Text.Trim( ) + "' AND ";
				}
				if ( cbNewclass.Text.Trim( ) != "请选择或输入新项" )
				{
					queryString += "pycc='" + cbNewclass.Text.Trim( ) + "' AND ";
				}
				if ( cbNewdiploma.Text.Trim( ) != "请选择或输入新项" )
				{
					queryString += "xxxs='" + cbNewdiploma.Text.Trim( ) + "' AND ";
				}
				if ( txtNewschool.Text.Trim( ).Length != 0 )
				{
					queryString += "yxmc='" + txtNewschool.Text.Trim( ) + "' AND ";
				}
				if ( txtNewspecialty.Text.Trim( ).Length != 0 )
				{
					queryString += "zymc='" + txtNewspecialty.Text.Trim( ) + "' AND ";
				}
				if ( txtManager.Text.Trim( ).Length != 0 )
				{
					queryString += "manager='" + txtManager.Text.Trim( ) + "' AND ";
				}
				if( txtTime.Text.Trim( ).Length != 0 )
				{
					queryString += "czrq='" + txtTime.Text.Trim( ) + "' AND ";
				}
				queryString = queryString.Substring(0,queryString.Length - 5);
				db.InitConnectionPool(@"Provider=vfpoledb.1;Data Source=VerifyStore\" , 1);
				DataSet ds = db.ExecuteCommand( queryString );
				if ( ds.Tables[0].Rows.Count == 0 )
				{
					MessageBox.Show( "没有找到数据项","提示窗口",MessageBoxButtons.OK,MessageBoxIcon.Warning);
					this.Focus( );
				}
				else
				{
					
					lv.Items.Clear( );
					lv.Tag = "New";
					for( int i = 0; i < ds.Tables[0].Rows.Count; i++ )
					{
						ListViewItem first = new ListViewItem( );
						if( i%2 == 0 )
						{
							first.BackColor = Color.LightSkyBlue;
						}
						first.Text = (i + 1).ToString( );
						first.SubItems.Add( ds.Tables[0].Rows[i]["xm"].ToString( ).Trim( ) );
						first.SubItems.Add( ds.Tables[0].Rows[i]["xb"].ToString( ).Trim( ) );
						first.SubItems.Add( ds.Tables[0].Rows[i]["csrq"].ToString( ).Trim( ) );
						first.SubItems.Add( ds.Tables[0].Rows[i]["pycc"].ToString( ).Trim( ) );
						first.SubItems.Add( ds.Tables[0].Rows[i]["xxxs"].ToString( ).Trim( ) );
						first.SubItems.Add( ds.Tables[0].Rows[i]["xz"].ToString( ).Trim( ) );
						first.SubItems.Add( ds.Tables[0].Rows[i]["yxmc"].ToString( ).Trim( ) );
						first.SubItems.Add( ds.Tables[0].Rows[i]["zymc"].ToString( ).Trim( ) );
						first.SubItems.Add( ds.Tables[0].Rows[i]["bjyjl"].ToString( ).Trim( ) );
						first.SubItems.Add( ds.Tables[0].Rows[i]["rxrq"].ToString( ).Trim( ) );
						first.SubItems.Add( ds.Tables[0].Rows[i]["byrq"].ToString( ).Trim( ) );
						first.SubItems.Add( ds.Tables[0].Rows[i]["zsbh"].ToString( ).Trim( ) );
						first.SubItems.Add( ds.Tables[0].Rows[i]["manager"].ToString( ).Trim( ) );
						first.SubItems.Add( ds.Tables[0].Rows[i]["czrq"].ToString( ).Trim( ) );
						first.SubItems.Add( ds.Tables[0].Rows[i]["shjg"].ToString( ).Trim( ) );
						lv.Items.Add( first );
					}
					printList = lv;
				}
			}
		}

		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" );
		}

		private void label16_Click(object sender, System.EventArgs e)
		{
		
		}

		private void pictureBox2_MouseEnter(object sender, System.EventArgs e)
		{
			pictureBox2.Image = Image.FromFile( "img\\button-删除02.GIF" );
		}

		private void pictureBox2_MouseLeave(object sender, System.EventArgs e)
		{
			pictureBox2.Image = Image.FromFile( "img\\button-删除01.GIF" );
		}

		private void pictureBox2_Click(object sender, System.EventArgs e)
		{
			if ( lv.SelectedItems.Count == 0 )
			{
				MessageBox.Show( "请先选择要删除的数据!","错误提示",MessageBoxButtons.OK,MessageBoxIcon.Information);
				this.Focus( );
				return;
			}
			string Top = "您现在要删除"+ lv.SelectedItems.Count.ToString( ) +"条数据,请确认操作!";
			if( MessageBox.Show( Top,"删除数据确认提示",MessageBoxButtons.YesNo,MessageBoxIcon.Warning) == DialogResult.Yes )
			{
				ArrayList tempList = new ArrayList( );
				for ( int i = 0 ; i < lv.SelectedItems.Count ; i++ )
				{
					ListViewItem ltemp = lv.SelectedItems[i];
					tempList.Add( ltemp );
				}
				for ( int j = 0 ; j < tempList.Count ; j++ )
				{
					ListViewItem tp = (ListViewItem)tempList[j];
					string xm = tp.SubItems[1].Text;
					string zsbh = tp.SubItems[12].Text;
					string delstr = "DELETE FROM education WHERE zsbh='" + zsbh + "' AND xm='" + xm + "'";
					db.ExecuteCommandNonQuery( delstr );
					lv.Items.Remove( tp );
				}
				MessageBox.Show("删除数据成功!","详细信息操作提示信息",MessageBoxButtons.OK ,MessageBoxIcon.Information );
				this.Focus( );
			}
		}

		private void txtNewname_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if ( e.KeyChar == 13 )
			{
				pictureBox1_Click( sender, e );
			}
		}

		private void txtNewschool_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if ( e.KeyChar == 13 )
			{
				pictureBox1_Click( sender, e );
			}
		}

		private void cbNewdiploma_SelectedIndexChanged(object sender, System.EventArgs e)
		{
		
		}

		private void cbNewdiploma_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if ( e.KeyChar == 13 )
			{
				pictureBox1_Click( sender, e );
			}
		}

		private void txtManager_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if ( e.KeyChar == 13 )
			{
				pictureBox1_Click( sender, e );
			}
		}

		private void cbNewclass_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if ( e.KeyChar == 13 )
			{
				pictureBox1_Click( sender, e );
			}
		}

		private void txtNewspecialty_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			if ( e.KeyChar == 13 )
			{
				pictureBox1_Click( sender, e );
			}
		}

		private void txtTime_TextChanged(object sender, System.EventArgs e)
		{
		
		}

		private void lv_SelectedIndexChanged(object sender, System.EventArgs e)
		{
		
		}

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

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

		private void pictureBox3_Click(object sender, System.EventArgs e)
		{
			if( lv.Items.Count == 0 )
			{
				MessageBox.Show("你还没有进行查询,没有任何数据项,将不进行打印","错误提示",MessageBoxButtons.OK,MessageBoxIcon.Warning);
			}
			else
			{
				ReportForms rf = new ReportForms( );
				if ( rf.ShowDialog( ) == DialogResult.OK )
				{
					ReportFormsPrint rfp = new ReportFormsPrint( );
					rfp.ShowDialog( );
				}
			}
		}


	}
}

⌨️ 快捷键说明

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