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

📄 warrentinput.cs

📁 用vs2003和SQLServer2000开发的财务管理系统
💻 CS
📖 第 1 页 / 共 4 页
字号:
			this.dataGrid2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dataGrid2_MouseDown);
			this.dataGrid2.DoubleClick += new System.EventHandler(this.dataGrid2_DoubleClick);
			this.dataGrid2.CurrentCellChanged += new System.EventHandler(this.dataGrid2_CurrentCellChanged);
			// 
			// da1
			// 
			this.da1.DeleteCommand = this.sqlDeleteCommand1;
			this.da1.InsertCommand = this.sqlInsertCommand1;
			this.da1.SelectCommand = this.sqlSelectCommand1;
			this.da1.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("制单", "制单"),
																																																 new System.Data.Common.DataColumnMapping("借方合计", "借方合计"),
																																																 new System.Data.Common.DataColumnMapping("贷方合计", "贷方合计"),
																																																 new System.Data.Common.DataColumnMapping("过账状态", "过账状态"),
																																																 new System.Data.Common.DataColumnMapping("凭证状态", "凭证状态")})});
			this.da1.UpdateCommand = this.sqlUpdateCommand1;
			// 
			// sqlDeleteCommand1
			// 
			this.sqlDeleteCommand1.CommandText = @"DELETE FROM 凭证表 WHERE (凭证编号 = @Original_凭证编号) AND (会计期间 = @Original_会计期间 OR @Original_会计期间 IS NULL AND 会计期间 IS NULL) AND (借方合计 = @Original_借方合计 OR @Original_借方合计 IS NULL AND 借方合计 IS NULL) AND (凭证字号 = @Original_凭证字号 OR @Original_凭证字号 IS NULL AND 凭证字号 IS NULL) AND (凭证状态 = @Original_凭证状态 OR @Original_凭证状态 IS NULL AND 凭证状态 IS NULL) AND (制单 = @Original_制单 OR @Original_制单 IS NULL AND 制单 IS NULL) AND (日期 = @Original_日期 OR @Original_日期 IS NULL AND 日期 IS NULL) AND (贷方合计 = @Original_贷方合计 OR @Original_贷方合计 IS NULL AND 贷方合计 IS NULL) AND (过账状态 = @Original_过账状态 OR @Original_过账状态 IS NULL AND 过账状态 IS NULL) AND (附单据 = @Original_附单据 OR @Original_附单据 IS NULL AND 附单据 IS NULL)";
			this.sqlDeleteCommand1.Connection = this.sqlConnection1;
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_凭证编号", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "凭证编号", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_会计期间", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "会计期间", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_借方合计", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "借方合计", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_凭证字号", System.Data.SqlDbType.VarChar, 2, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "凭证字号", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_凭证状态", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "凭证状态", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_制单", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "制单", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_日期", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "日期", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_贷方合计", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "贷方合计", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_过账状态", System.Data.SqlDbType.VarChar, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "过账状态", System.Data.DataRowVersion.Original, null));
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_附单据", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "附单据", System.Data.DataRowVersion.Original, null));
			// 
			// sqlConnection1
			// 
			this.sqlConnection1.ConnectionString = "workstation id=localhost;packet size=4096;integrated security=SSPI;initial catalo" +
				"g=caiwubook;persist security info=False";
			// 
			// sqlInsertCommand1
			// 
			this.sqlInsertCommand1.CommandText = "INSERT INTO 凭证表(凭证编号, 会计期间, 凭证字号, 日期, 附单据, 制单, 借方合计, 贷方合计, 过账状态, 凭证状态) VALUES (@凭" +
				"证编号, @会计期间, @凭证字号, @日期, @附单据, @制单, @借方合计, @贷方合计, @过账状态, @凭证状态); SELECT 凭证编号, 会计期" +
				"间, 凭证字号, 日期, 附单据, 制单, 借方合计, 贷方合计, 过账状态, 凭证状态 FROM 凭证表 WHERE (凭证编号 = @凭证编号) ORDER" +
				" BY 凭证编号";
			this.sqlInsertCommand1.Connection = this.sqlConnection1;
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@凭证编号", System.Data.SqlDbType.VarChar, 10, "凭证编号"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@会计期间", System.Data.SqlDbType.Int, 4, "会计期间"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@凭证字号", System.Data.SqlDbType.VarChar, 2, "凭证字号"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@日期", System.Data.SqlDbType.DateTime, 8, "日期"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@附单据", System.Data.SqlDbType.Int, 4, "附单据"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@制单", System.Data.SqlDbType.VarChar, 20, "制单"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@借方合计", System.Data.SqlDbType.Money, 8, "借方合计"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@贷方合计", System.Data.SqlDbType.Money, 8, "贷方合计"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@过账状态", System.Data.SqlDbType.VarChar, 4, "过账状态"));
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@凭证状态", System.Data.SqlDbType.VarChar, 10, "凭证状态"));
			// 
			// sqlSelectCommand1
			// 
			this.sqlSelectCommand1.CommandText = "SELECT 凭证编号, 会计期间, 凭证字号, 日期, 附单据, 制单, 借方合计, 贷方合计, 过账状态, 凭证状态 FROM 凭证表 WHERE (凭证编号" +
				" LIKE @Param4) AND (会计期间 LIKE @Param5) AND (日期 LIKE @Param6) ORDER BY 凭证编号";
			this.sqlSelectCommand1.Connection = this.sqlConnection1;
			this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Param4", System.Data.SqlDbType.VarChar, 10, "凭证编号"));
			this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Param5", System.Data.SqlDbType.VarChar, 10, "会计期间"));
			this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Param6", System.Data.SqlDbType.DateTime, 8, "日期"));
			// 
			// sqlUpdateCommand1
			// 
			this.sqlUpdateCommand1.CommandText = @"UPDATE 凭证表 SET 凭证编号 = @凭证编号, 会计期间 = @会计期间, 凭证字号 = @凭证字号, 日期 = @日期, 附单据 = @附单据, 制单 = @制单, 借方合计 = @借方合计, 贷方合计 = @贷方合计, 过账状态 = @过账状态, 凭证状态 = @凭证状态 WHERE (凭证编号 = @Original_凭证编号) AND (会计期间 = @Original_会计期间 OR @Original_会计期间 IS NULL AND 会计期间 IS NULL) AND (借方合计 = @Original_借方合计 OR @Original_借方合计 IS NULL AND 借方合计 IS NULL) AND (凭证字号 = @Original_凭证字号 OR @Original_凭证字号 IS NULL AND 凭证字号 IS NULL) AND (凭证状态 = @Original_凭证状态 OR @Original_凭证状态 IS NULL AND 凭证状态 IS NULL) AND (制单 = @Original_制单 OR @Original_制单 IS NULL AND 制单 IS NULL) AND (日期 = @Original_日期 OR @Original_日期 IS NULL AND 日期 IS NULL) AND (贷方合计 = @Original_贷方合计 OR @Original_贷方合计 IS NULL AND 贷方合计 IS NULL) AND (过账状态 = @Original_过账状态 OR @Original_过账状态 IS NULL AND 过账状态 IS NULL) AND (附单据 = @Original_附单据 OR @Original_附单据 IS NULL AND 附单据 IS NULL); SELECT 凭证编号, 会计期间, 凭证字号, 日期, 附单据, 制单, 借方合计, 贷方合计, 过账状态, 凭证状态 FROM 凭证表 WHERE (凭证编号 = @凭证编号) ORDER BY 凭证编号";
			this.sqlUpdateCommand1.Connection = this.sqlConnection1;
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@凭证编号", System.Data.SqlDbType.VarChar, 10, "凭证编号"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@会计期间", System.Data.SqlDbType.Int, 4, "会计期间"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@凭证字号", System.Data.SqlDbType.VarChar, 2, "凭证字号"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@日期", System.Data.SqlDbType.DateTime, 8, "日期"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@附单据", System.Data.SqlDbType.Int, 4, "附单据"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@制单", System.Data.SqlDbType.VarChar, 20, "制单"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@借方合计", System.Data.SqlDbType.Money, 8, "借方合计"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@贷方合计", System.Data.SqlDbType.Money, 8, "贷方合计"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@过账状态", System.Data.SqlDbType.VarChar, 4, "过账状态"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@凭证状态", System.Data.SqlDbType.VarChar, 10, "凭证状态"));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_凭证编号", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "凭证编号", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_会计期间", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "会计期间", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_借方合计", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "借方合计", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_凭证字号", System.Data.SqlDbType.VarChar, 2, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "凭证字号", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_凭证状态", System.Data.SqlDbType.VarChar, 10, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "凭证状态", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_制单", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "制单", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_日期", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "日期", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_贷方合计", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "贷方合计", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_过账状态", System.Data.SqlDbType.VarChar, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "过账状态", System.Data.DataRowVersion.Original, null));
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_附单据", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "附单据", System.Data.DataRowVersion.Original, null));
			// 
			// da2
			// 
			this.da2.SelectCommand = this.sqlSelectCommand2;
			this.da2.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("借方", "借方"),
																																																 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 b.科目名称, a.编号, a.凭证编号, a.摘要, a.科目代码, a.借方, a.贷方, a.数量, a.单价, a.结算方式, a.结算号," +
				" a.结算日期 FROM 分录表 a INNER JOIN 科目表 b ON a.科目代码 = b.科目代码 WHERE (a.凭证编号 = @Param2)";
			this.sqlSelectCommand2.Connection = this.sqlConnection1;
			this.sqlSelectCommand2.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Param2", System.Data.SqlDbType.VarChar, 10, "凭证编号"));
			// 
			// label12
			// 
			this.label12.Location = new System.Drawing.Point(280, 242);
			this.label12.Name = "label12";
			this.label12.Size = new System.Drawing.Size(184, 14);
			this.label12.TabIndex = 33;
			this.label12.Text = "双击新行前的导航栏选择明细";
			// 
			// WarrentInput
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(736, 525);
			this.Controls.Add(this.label12);
			this.Controls.Add(this.dataGrid2);
			this.Controls.Add(this.dataGrid1);
			this.Controls.Add(this.groupBox1);
			this.Controls.Add(this.toolBar1);
			this.Controls.Add(this.groupBox2);
			this.Name = "WarrentInput";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			this.Text = "【会计凭证输入】";
			this.Load += new System.EventHandler(this.WarrentInput_Load);
			this.groupBox1.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.dataSet11)).EndInit();
			this.groupBox2.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.dataGrid2)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		//-------------创建窗体时,读入全部数据------------
		private void WarrentInput_Load(object sender, System.EventArgs e)
		{
			da1.SelectCommand.Parameters[0].Value="%%";//设置参数
			da1.SelectCommand.Parameters[1].SqlDbType=System.Data.SqlDbType.VarChar;
			da1.SelectCommand.Parameters[2].SqlDbType=System.Data.SqlDbType.VarChar;
			da1.SelectCommand.Parameters[1].Value="%%";
			da1.SelectCommand.Parameters[2].Value="%%";
			da1.Fill(dataSet11.凭证表);            			
			DataGridStateControl();//设置分录表表格
			//最初显示时,分录表显示第一个凭证记录的明细信息
			da2.SelectCommand.Parameters[0].Value=txt4.Text.Trim();
			newTable.Clear();
			da2.Fill(newTable);
			dataGrid2.ReadOnly=true;

			//创建窗体时处于浏览状态,不允许双击分录表添加记录
			this.enableDoubleClick=false;
			//绑定数据导航控制
			cmOrders=(CurrencyManager) BindingContext[dataSet11,"凭证表"];				
		}

		//----------设置明细表格各列的属性----------
		private void DataGridStateControl()
		{
			newTable = new DataTable();
			newTable.Columns.Add("科目代码",typeof(string));
			newTable.Columns.Add("科目名称",typeof(string));
			newTable.Columns.Add("借方",typeof(decimal));
			newTable.Columns.Add("贷方",typeof(decimal));
			newTable.Columns.Add("摘要",typeof(string));
			
			this.dataGrid2.DataSource = newTable;
			newTable.Rows.Add(newTable.NewRow()); //向表中添加一行

			DataGridTableStyle ts = new DataGridTableStyle();
			DataGridTextBoxColumn aColumnTextColumn;
			ts.AllowSorting = false;
			ts.AlternatingBackColor = Color.LightGray;
			ts.MappingName = newTable.TableName;
			int numCols = newTable.Columns.Count;
			for (int i = 0;i< numCols;i++)
			{
				aColumnTextColumn = new DataGridTextBoxColumn();
				if( i==0 || i==1 )//表中允许编辑【借方】,【贷方】和【备注】三个字段
				{
					aColumnTextColumn.ReadOnly=true;
				}
				if (  i == 1 )//当鼠标单击第1列时,允许响应
				{
					aColumnTextColumn.TextBox.MouseDown += new MouseEventHandler(TextBoxMouseDownHandler);
				}
				if(i==1)
				{
					aColumnTextColumn.Width=100;//设置科目名称宽度
				}
				
				if ( i == 4 )
				{
					aColumnTextColumn.Width = 160;//设置宽度
				}
				aColumnTextColumn.MappingName = newTable.Columns[i].ColumnName;
				aColumnTextColumn.HeaderText = newTable.Columns[i].ColumnName;
				aColumnTextColumn.NullText = "";
				aColumnTextColumn.Format = "N"; //设置为数字格式显示
				ts.GridColumnStyles.Add(aColumnTextColumn);
			}
			dataGrid2.TableStyles.Add(ts);
		}

		

		//------------根据输入信息来检索数据-------------
		private void btnSearch_Click(object sender, System.EventArgs e)
		{
			da1.SelectCommand.Parameters[0].Value="%%";
			da1.SelectCommand.Parameters[1].Value="%%";
			da1.SelectCommand.Parameters[2].Value="%%";
			//根据用户在文本框中的输入来设置SQL查询的参数
			if(txt1.Text.Trim()!="")
			{
				da1.SelectCommand.Parameters[0].Value="%"+txt1.Text.Trim()+"%";
			}
			if(txt2.Text.Trim()!="")
				
			{
				da1.SelectCommand.Parameters[1].Value="%"+txt2.Text.Trim()+"%";
			}
			if(txt3.Text.Trim()!="")
				
			{
				da1.SelectCommand.Parameters[2].Value="%"+txt3.Text.Trim()+"%";
			}
			//清空数据表,并根据新设置的查询参数重新填充
			dataSet11.凭证表.Clear();
			da1.Fill(dataSet11);
			//显示分录数据
			da2.SelectCommand.Parameters[0].Value=txt4.Text.Trim();
			newTable.Clear();
			da2.Fill(newTable);
			dataGrid2.ReadOnly=true;		
		}

		
		//---------根据指针指向的凭证表数据显示其分录表数据---------
		private void dataGrid1_CurrentCellChanged(object sender, System.EventArgs e)
		{
			da2.SelectCommand.Parameters[0].Value=txt4.Text.Trim();
			newTable.Clear();
			da2.Fill(newTable);
			dataGrid2.ReadOnly=true;
		}


		//----------双击分录表表格,添加新的分录记录----------
		private void dataGrid2_DoubleClick(object sender, System.EventArgs e)
		{
			if(this.enableDoubleClick==true)
			{
				this.doubleClicked();
			}
		}

		//--------------确定鼠标在表格中的点击模式--------------
		private void dataGrid2_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
		{
			//获取当前点击鼠标时的时间
			DataGrid myGrid   = (DataGrid)sender;
			System.Windows.Forms.DataGrid.HitTestInfo myHitTest;
			
			myHitTest = dataGrid2.HitTest(e.X,e.Y);

⌨️ 快捷键说明

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