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

📄 frmproductinsee.cs

📁 制造业ERP系统搜集
💻 CS
📖 第 1 页 / 共 2 页
字号:
			// 
			// groupBox4
			// 
			this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
				| System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.groupBox4.Controls.Add(this.dataGrid1);
			this.groupBox4.Location = new System.Drawing.Point(0, 0);
			this.groupBox4.Name = "groupBox4";
			this.groupBox4.Size = new System.Drawing.Size(968, 224);
			this.groupBox4.TabIndex = 0;
			this.groupBox4.TabStop = false;
			this.groupBox4.Text = "入库单(父)表";
			// 
			// dataGrid1
			// 
			this.dataGrid1.DataMember = "";
			this.dataGrid1.DataSource = this.dataView1;
			this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dataGrid1.Location = new System.Drawing.Point(3, 17);
			this.dataGrid1.Name = "dataGrid1";
			this.dataGrid1.ReadOnly = true;
			this.dataGrid1.Size = new System.Drawing.Size(962, 204);
			this.dataGrid1.TabIndex = 1;
			// 
			// dataView1
			// 
			this.dataView1.Table = this.productInDS11.产成品入库单历史;
			// 
			// productInDS11
			// 
			this.productInDS11.DataSetName = "ProductInDS1";
			this.productInDS11.Locale = new System.Globalization.CultureInfo("en-US");
			// 
			// groupBox3
			// 
			this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.groupBox3.Controls.Add(this.dataGrid2);
			this.groupBox3.Location = new System.Drawing.Point(0, 264);
			this.groupBox3.Name = "groupBox3";
			this.groupBox3.Size = new System.Drawing.Size(968, 160);
			this.groupBox3.TabIndex = 2;
			this.groupBox3.TabStop = false;
			this.groupBox3.Text = "明细(子)表";
			// 
			// dataGrid2
			// 
			this.dataGrid2.DataMember = "";
			this.dataGrid2.DataSource = this.dataView2;
			this.dataGrid2.Dock = System.Windows.Forms.DockStyle.Fill;
			this.dataGrid2.HeaderForeColor = System.Drawing.SystemColors.ControlText;
			this.dataGrid2.Location = new System.Drawing.Point(3, 17);
			this.dataGrid2.Name = "dataGrid2";
			this.dataGrid2.ReadOnly = true;
			this.dataGrid2.Size = new System.Drawing.Size(962, 140);
			this.dataGrid2.TabIndex = 3;
			// 
			// dataView2
			// 
			this.dataView2.Table = this.productInDS11.view_产成品入库单明细历史;
			// 
			// sqlDataAdapter1
			// 
			this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1;
			this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
																									  new System.Data.Common.DataTableMapping("Table", "产成品入库单历史", new System.Data.Common.DataColumnMapping[] {
																																																				  new System.Data.Common.DataColumnMapping("编号", "编号"),
																																																				  new System.Data.Common.DataColumnMapping("入库日期", "入库日期"),
																																																				  new System.Data.Common.DataColumnMapping("部门号", "部门号"),
																																																				  new System.Data.Common.DataColumnMapping("入库员", "入库员"),
																																																				  new System.Data.Common.DataColumnMapping("制单人", "制单人"),
																																																				  new System.Data.Common.DataColumnMapping("票据", "票据")})});
			// 
			// sqlSelectCommand1
			// 
			this.sqlSelectCommand1.CommandText = "SELECT 编号, 入库日期, 部门号, 入库员, 制单人, 票据 FROM 产成品入库单历史";
			this.sqlSelectCommand1.Connection = this.sqlConnection1;
			// 
			// sqlConnection1
			// 
			this.sqlConnection1.ConnectionString = "workstation id=WINDOWSXP;packet size=4096;user id=sa;data source=\".\";persist secu" +
				"rity info=False;initial catalog=jxcbook";
			// 
			// sqlDataAdapter2
			// 
			this.sqlDataAdapter2.SelectCommand = this.sqlSelectCommand2;
			this.sqlDataAdapter2.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
																									  new System.Data.Common.DataTableMapping("Table", "view_产成品入库单明细历史", new System.Data.Common.DataColumnMapping[] {
																																																						 new System.Data.Common.DataColumnMapping("入库单号", "入库单号"),
																																																						 new System.Data.Common.DataColumnMapping("产成品编号", "产成品编号"),
																																																						 new System.Data.Common.DataColumnMapping("拼音编码", "拼音编码"),
																																																						 new System.Data.Common.DataColumnMapping("产成品名", "产成品名"),
																																																						 new System.Data.Common.DataColumnMapping("规格", "规格"),
																																																						 new System.Data.Common.DataColumnMapping("单位", "单位"),
																																																						 new System.Data.Common.DataColumnMapping("入库数量", "入库数量"),
																																																						 new System.Data.Common.DataColumnMapping("订单号", "订单号"),
																																																						 new System.Data.Common.DataColumnMapping("仓库", "仓库"),
																																																						 new System.Data.Common.DataColumnMapping("生产批号", "生产批号"),
																																																						 new System.Data.Common.DataColumnMapping("验收人", "验收人"),
																																																						 new System.Data.Common.DataColumnMapping("状态", "状态")})});
			// 
			// sqlSelectCommand2
			// 
			this.sqlSelectCommand2.CommandText = "SELECT 入库单号, 产成品编号, 拼音编码, 产成品名, 规格, 单位, 入库数量, 订单号, 仓库, 生产批号, 验收人, 状态 FROM view_产成" +
				"品入库单明细历史";
			this.sqlSelectCommand2.Connection = this.sqlConnection1;
			// 
			// FrmProductInSee
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(968, 430);
			this.Controls.Add(this.groupBox3);
			this.Controls.Add(this.groupBox2);
			this.Controls.Add(this.groupBox1);
			this.Name = "FrmProductInSee";
			this.Text = "产成品入库单明细查询";
			this.Load += new System.EventHandler(this.FrmProductInSee_Load);
			this.Closed += new System.EventHandler(this.FrmProductInSee_Closed);
			this.groupBox1.ResumeLayout(false);
			this.groupBox2.ResumeLayout(false);
			this.groupBox4.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.dataView1)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.productInDS11)).EndInit();
			this.groupBox3.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dataGrid2)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.dataView2)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void FrmProductInSee_Load(object sender, System.EventArgs e)
		{
			try
			{
				this.Cursor = Cursors.WaitCursor;
				//填充数据集
				sqlDataAdapter1.Fill(productInDS11);
				sqlDataAdapter2.Fill(productInDS11);
				//显示时,首先显示第一个产成品入库的明细
				dataView2.RowFilter="入库单号='"+dataGrid1[0,0].ToString().Trim()+"'";
				//明细数据根据选择的编号而变化
				dataGrid1.CurrentCellChanged+=new EventHandler(dataGrid1_CurrentCellChanged);
			}
			catch(Exception Err)
			{
				MessageBox.Show("查询数据集记录为空:"+Err.Message,"信息提示",
					MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
			finally
			{
				this.Cursor = Cursors.Default;
			}
		}

		//-------------显示入库单历史明细----------------
		private void dataGrid1_CurrentCellChanged(object sender, EventArgs e)
		{
			int i=dataGrid1.CurrentRowIndex;
			dataView2.RowFilter="入库单号='"+dataGrid1[i,0].ToString().Trim()+"'";
		}

		private void FrmProductInSee_Closed(object sender, System.EventArgs e)
		{
			if(this.sqlConnection1.State==ConnectionState.Open)
			{
				this.sqlConnection1.Close();
			}
		}

		private void button1_Click(object sender, System.EventArgs e)
		{
			try
			{
				this.Cursor = Cursors.WaitCursor;
				string filter="";
				if(textBox1.Text.Trim()!="")
				{
					filter+="部门号 like '"+textBox1.Text.Trim()+"%' AND ";
				}
				if(textBox3.Text.Trim()!="")
				{
					filter+="票据 like '"+textBox3.Text.Trim()+"%' AND ";
				}
				if(textBox4.Text.Trim()!="")
				{
					filter+="入库日期 like '"+textBox4.Text.Trim()+"%' AND ";
				}
				if(textBox5.Text.Trim()!="")
				{
					filter+="入库员 like '"+textBox5.Text.Trim()+"%' AND ";
				}
				int length=filter.Length;
				if(length>0)
				{
					filter=filter.Substring(0,length-5);
				}
				dataView1.RowFilter=filter;
				if(dataView1.Count>0)//有确定的进货数据再显示明细
				{				
					dataView2.RowFilter="入库单号='"+dataGrid1[0,0].ToString().Trim()+"'";
				}

			}
			catch(Exception Err)
			{
				MessageBox.Show("查询数据集记录操作失败:"+Err.Message,"信息提示",
					MessageBoxButtons.OK,MessageBoxIcon.Information);
			}
			finally
			{
				this.Cursor = Cursors.Default;
				this.sqlConnection1.Close();
			}
		}
		
	}
}

⌨️ 快捷键说明

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