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

📄 mainform1.cs

📁 本系统为资产管理系统
💻 CS
📖 第 1 页 / 共 5 页
字号:
			//SqlConnection conn = new SqlConnection(s.getConnectionString);
			conn.Open();
			string Query = "select employeeNo as 员工号,employeeName as 员工姓名,address as 住址,workTelExt as 单位电话,homeTelNum as 家庭电话,empEmail as Email from employee";
			SqlCommand cmd = new SqlCommand(Query,conn);
			SqlDataAdapter da  = new SqlDataAdapter();
			da.SelectCommand = new SqlCommand(Query,conn);
			DataSet ds = new DataSet();
			da.Fill(ds,"employee");
			this.dataGrid1.DataSource = ds;
			//DataTable ss = ds.Tables["employee"];
			//this.dataGrid1.Focus();
			this.dataGrid1.DataMember = "employee";
			this.dataGrid1.AllowDrop = true;
			conn.Close();
			this.panel6.Focus();
		}

		private void linkLabel3_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
		{
			this.panel5.Visible = true;
			SqlConnection conn = new SqlConnection(s.getConnectionString);
			this.panel6.Controls.Clear();
			this.panel6.Focus();
			//this.panel4.Controls.Clear();
			listBoxAgent l = new listBoxAgent();
			this.panel6.Controls.Add(l);
			l.ButtonClickAg1 += new AssetManagement.listBoxAgent.ButtonClickHandlerAg(ButtonClickAg1);
			l.ButtonClickAg2 += new AssetManagement.listBoxAgent.ButtonClickHandlerAg(ButtonClickAg2);
			l.ButtonClickAg3 += new AssetManagement.listBoxAgent.ButtonClickHandlerAg(ButtonClickAg3);

			//this.panel4.Controls.Add(l);
			//this.dataGrid1.Controls.Clear();
			//SqlConnection conn = new SqlConnection(s.getConnectionString);
			conn.Open();
			string Query = "select agentNo as 维护商编号,agentName as 名称,agentAddress as 地址,agentZipCode as 邮政编码,agentTelNo as 联系电话,agentFaxNo as 传真,agentEmail as Email,agentWebSite as 维护商网址 from agent";
			SqlCommand cmd = new SqlCommand(Query,conn);
			SqlDataAdapter da  = new SqlDataAdapter();
			da.SelectCommand = new SqlCommand(Query,conn);
			DataSet ds = new DataSet();
			da.Fill(ds,"agent");
		    
			this.dataGrid1.DataSource = ds;
			this.dataGrid1.DataMember = "agent";
			this.dataGrid1.Focus();
			this.dataGrid1.AllowDrop = true;
			conn.Close();
		}



		private void linkLabel1_MouseEnter(object sender, System.EventArgs e)
		{
			this.linkLabel1.LinkColor = System.Drawing.Color.CornflowerBlue;
			this.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.SystemDefault;
		}

		private void linkLabel1_MouseLeave(object sender, System.EventArgs e)
		{
		   this.linkLabel1.LinkColor = System.Drawing.Color.Black;
		  this.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;

		}

		private void linkLabel2_MouseEnter(object sender, System.EventArgs e)
		{
			this.linkLabel2.LinkColor = System.Drawing.Color.CornflowerBlue;
			this.linkLabel2.LinkBehavior = System.Windows.Forms.LinkBehavior.SystemDefault;
	
		}

		private void linkLabel2_MouseLeave(object sender, System.EventArgs e)
		{
			this.linkLabel2.LinkColor = System.Drawing.Color.Black;
			this.linkLabel2.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;

		}

		private void linkLabel3_MouseEnter(object sender, System.EventArgs e)
		{
			this.linkLabel3.LinkColor = System.Drawing.Color.CornflowerBlue;
			this.linkLabel3.LinkBehavior = System.Windows.Forms.LinkBehavior.SystemDefault;
	
		}

		private void linkLabel3_MouseLeave(object sender, System.EventArgs e)
		{
			this.linkLabel3.LinkColor = System.Drawing.Color.Black;
			this.linkLabel3.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;

		}

		private void tr(object sender, System.EventArgs e)
		{
			this.linkLabel4.LinkColor = System.Drawing.Color.CornflowerBlue;
			this.linkLabel4.LinkBehavior = System.Windows.Forms.LinkBehavior.SystemDefault;
	    }

		private void linkLabel4_MouseLeave(object sender, System.EventArgs e)
		{  
			this.linkLabel4.LinkColor = System.Drawing.Color.Black;
			this.linkLabel4.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;

		}

		private void linkLabel5_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
		{
			this.panel5.Visible = true;
			SqlConnection conn = new SqlConnection(s.getConnectionString);
			this.panel6.Controls.Clear();
			listBoxValuation lv = new listBoxValuation();
			this.panel6.Controls.Add(lv);
			lv.ButtonClickV1 += new AssetManagement.listBoxValuation.ButtonClickHandlerV(ButtonClickV1);
			lv.ButtonClickV2 += new AssetManagement.listBoxValuation.ButtonClickHandlerV(ButtonClickV2);
			lv.ButtonClickV3 += new AssetManagement.listBoxValuation.ButtonClickHandlerV(ButtonClickV3);
			this.panel6.Focus();
			conn.Open();
			string Query = "select valuationNo as 估价编号,assetNo as 资产编号,employeeNo as 记录者编号,valuationDate as 估价日期,valuationPrice as 估价价格 from valuation";
			SqlCommand cmd = new SqlCommand(Query,conn);
			SqlDataAdapter da = new SqlDataAdapter();
			da.SelectCommand = new SqlCommand(Query,conn);
            DataSet ds = new DataSet();
			da.Fill(ds,"valuation");
			this.dataGrid1.DataSource = ds;
			this.dataGrid1.DataMember = "valuation";
			conn.Close();

		}

		private void linkLabel5_MouseEnter(object sender, System.EventArgs e)
		{
			this.linkLabel5.LinkColor = System.Drawing.Color.CornflowerBlue;
			this.linkLabel5.LinkBehavior = System.Windows.Forms.LinkBehavior.SystemDefault;

		}

		private void linkLabel5_MouseLeave(object sender, System.EventArgs e)
		{
			this.linkLabel5.LinkColor = System.Drawing.Color.Black;
			this.linkLabel5.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;

		}

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

		private void linkLabel4_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
		{
			this.panel5.Visible = true;
			SqlConnection conn = new SqlConnection(s.getConnectionString);
		    this.panel6.Controls.Clear();
			listBoxMaintenance lm = new listBoxMaintenance();
			this.panel6.Controls.Add(lm);
			lm.ButtonClickM1 += new AssetManagement.listBoxMaintenance.ButtonClickHandlerM(ButtonClickM1);
			lm.ButtonClickM2 += new AssetManagement.listBoxMaintenance.ButtonClickHandlerM(ButtonClickM2);
			lm.ButtonClickM3 += new AssetManagement.listBoxMaintenance.ButtonClickHandlerM(ButtonClickM3);
			conn.Open();
			string Query = "select maintenanceNo as 维护编号,assetNo as 资产编号,agentNo as 维护商编号,employeeNo as 记录者编号,maintenanceDate as 维护日期,maintenanceDescription as 维护备注,maintenanceCost as 维护费用 from maintenance";
			SqlCommand cmd = new SqlCommand(Query,conn);
			SqlDataAdapter da = new SqlDataAdapter();
			da.SelectCommand = new SqlCommand(Query,conn);
			DataSet ds = new DataSet();
			da.Fill(ds,"maintenance");
			this.dataGrid1.DataSource = ds;
			this.dataGrid1.DataMember = "maintenance";
			this.panel6.Focus();
			conn.Close();
		}
		private void ButtonClick()
		{
			this.panel5.Visible = true;
			SqlConnection conn = new SqlConnection(s.getConnectionString);
			conn.Open();
			string Query =  "select employeeNo as 员工号,employeeName as 员工姓名,address as 住址,workTelExt as 单位电话,homeTelNum as 家庭电话,empEmail as Email from employee where employeeNo like 'A%'";
			SqlCommand cmd = new SqlCommand(Query,conn);
			SqlDataAdapter da  = new SqlDataAdapter();
			da.SelectCommand = new SqlCommand(Query,conn);
			DataSet ds = new DataSet();
			da.Fill(ds,"manager");
			this.dataGrid1.DataSource = ds;
			this.dataGrid1.DataMember = "manager";
			this.panel6.Focus();
			this.dataGrid1.AllowDrop = true;
			conn.Close();
		}
		private void ButtonClick1()
		{
			this.panel5.Visible = true;
			SqlConnection conn = new SqlConnection(s.getConnectionString);

			conn.Open();
			string Query =  "select employeeNo as 员工号,employeeName as 员工姓名,address as 住址,workTelExt as 单位电话,homeTelNum as 家庭电话,empEmail as Email from employee where employeeNo like 'B%'";
			SqlCommand cmd = new SqlCommand(Query,conn);
			SqlDataAdapter da  = new SqlDataAdapter();
			da.SelectCommand = new SqlCommand(Query,conn);
			DataSet ds = new DataSet();
			da.Fill(ds,"ec");
			this.dataGrid1.DataSource = ds;
			this.dataGrid1.DataMember = "ec";
			this.dataGrid1.Focus();
			this.dataGrid1.AllowDrop  = true;
			conn.Close();

		}
		private void ButtonClick2()
		{
			this.panel5.Visible = true;
			SqlConnection conn = new SqlConnection(s.getConnectionString);

			conn.Open();
			string Query =  "select employeeNo as 员工号,employeeName as 员工姓名,address as 住址,workTelExt as 单位电话,homeTelNum as 家庭电话,empEmail as Email from employee where employeeNo like 'C%'";
			SqlCommand cmd = new SqlCommand(Query,conn);
			SqlDataAdapter da  = new SqlDataAdapter();
			da.SelectCommand = new SqlCommand(Query,conn);
			DataSet ds = new DataSet();
			da.Fill(ds,"maintenancer");
			this.dataGrid1.DataSource = ds;
			this.dataGrid1.DataMember = "maintenancer";
			this.panel6.Focus();
			this.dataGrid1.AllowDrop  =true;
			conn.Close();

		}
		private void ButtonClickA()
		{
			this.panel5.Visible = true;
			SqlConnection conn = new SqlConnection(s.getConnectionString);

			conn.Open();
			string Query =  "select assetNo as 资产编号,employeeNo as 所属员工编号,assetDescription as 资产备注,serialNo as 序列号,dateAcquired as 购进日期,purchasePrice as 购入价格,currentValue as 当前价值,dateSold as 卖出日期,nextMaintenanceDate as 下次维护时间 from asset where statusNo = 6";
			SqlCommand cmd = new SqlCommand(Query,conn);
			SqlDataAdapter da  = new SqlDataAdapter();
			da.SelectCommand = new SqlCommand(Query,conn);
			DataSet ds = new DataSet();
			da.Fill(ds,"status4");
			this.dataGrid1.DataSource = ds;
			this.dataGrid1.DataMember = "status4";
			this.panel6.Focus();
			//this.dataGrid1.Focus();
			this.dataGrid1.AllowDrop  = true;
			conn.Close();
		}
		private void ButtonClickA1()
		{
			this.panel5.Visible = true;
			SqlConnection conn = new SqlConnection(s.getConnectionString);

			conn.Open();
			string Query =  "select assetNo as 资产编号,employeeNo as 所属员工编号,assetDescription as 资产备注,serialNo as 序列号,dateAcquired as 购进日期,purchasePrice as 购入价格,currentValue as 当前价值,dateSold as 卖出日期,nextMaintenanceDate as 下次维护时间 from asset where exists ( select * from Maintenance where assetNo = asset.assetNo)";
			SqlCommand cmd = new SqlCommand(Query,conn);
			SqlDataAdapter da  = new SqlDataAdapter();
			da.SelectCommand = new SqlCommand(Query,conn);
			DataSet ds = new DataSet();
			da.Fill(ds,"dasds");
			this.dataGrid1.DataSource = ds;
			this.dataGrid1.DataMember = "dasds";
			this.dataGrid1.Focus();
			this.dataGrid1.AllowDrop  = true;
			conn.Close();
		}
		private void ButtonClickA2()
		{
			this.panel5.Visible = true;
			SqlConnection conn = new SqlConnection(s.getConnectionString);

			conn.Open();
			string Query =  "select assetNo as 资产编号,employeeNo as 所属员工编号,assetDescription as 资产备注,serialNo as 序列号,dateAcquired as 购进日期,purchasePrice as 购入价格,currentValue as 当前价值,dateSold as 卖出日期,nextMaintenanceDate as 下次维护时间 from asset where statusNo = 1";
			SqlCommand cmd = new SqlCommand(Query,conn);
			SqlDataAdapter da  = new SqlDataAdapter();
			da.SelectCommand = new SqlCommand(Query,conn);
			DataSet ds = new DataSet();
			da.Fill(ds,"status1");
			this.dataGrid1.DataSource = ds;
			this.dataGrid1.DataMember = "status1";
			this.panel6.Focus();
			this.dataGrid1.AllowDrop  = true;
			conn.Close();
		}
		private void ButtonClickA3()
		{
			this.panel5.Visible = true;
			SqlConnection conn = new SqlConnection(s.getConnectionString);

			conn.Open();
			string Query =  "select assetNo as 资产编号,employeeNo as 所属员工编号,assetDescription as 资产备注,serialNo as 序列号,dateAcquired as 购进日期,purchasePrice as 购入价格,currentValue as 当前价值,dateSold as 卖出日期,nextMaintenanceDate as 下次维护时间 from asset where statusNo = 5";
			SqlCommand cmd = new SqlCommand(Query,conn);
			SqlDataAdapter da  = new SqlDataAdapter();
			da.SelectCommand = new SqlCommand(Query,conn);
			DataSet ds = new DataSet();
			da.Fill(ds,"status5");
			this.dataGrid1.DataSource = ds;
			this.dataGrid1.DataMember = "status5";
			this.dataGrid1.Focus();
			this.dataGrid1.AllowDrop = true;
			conn.Close();
		}
		private void ButtonClickA4()
		{
			this.panel5.Visible = true;
			SqlConnection conn = new SqlConnection(s.getConnectionString);

			conn.Open();

⌨️ 快捷键说明

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