www.pudn.com > CRM.rar > Form2.cs


using System; 
using System.Drawing; 
using System.Collections; 
using System.ComponentModel; 
using System.Windows.Forms; 
 
namespace WindowsApplication1 
{ 
	///  
	/// Form2 的摘要说明。 
	///  
	public class Form2 : System.Windows.Forms.Form 
	{ 
		private System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1; 
		private System.Data.SqlClient.SqlCommand sqlSelectCommand1; 
		private System.Data.SqlClient.SqlCommand sqlInsertCommand1; 
		private System.Data.SqlClient.SqlCommand sqlUpdateCommand1; 
		private System.Data.SqlClient.SqlCommand sqlDeleteCommand1; 
		private System.Data.SqlClient.SqlConnection sqlConnection1; 
		///  
		/// 必需的设计器变量。 
		///  
		private System.ComponentModel.Container components = null; 
 
		public Form2() 
		{ 
			// 
			// Windows 窗体设计器支持所必需的 
			// 
			InitializeComponent(); 
 
			// 
			// TODO: 在 InitializeComponent 调用后添加任何构造函数代码 
			// 
		} 
 
		///  
		/// 清理所有正在使用的资源。 
		///  
		protected override void Dispose( bool disposing ) 
		{ 
			if( disposing ) 
			{ 
				if(components != null) 
				{ 
					components.Dispose(); 
				} 
			} 
			base.Dispose( disposing ); 
		} 
 
		#region Windows 窗体设计器生成的代码 
		///  
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改 
		/// 此方法的内容。 
		///  
		private void InitializeComponent() 
		{ 
			this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter(); 
			this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand(); 
			this.sqlConnection1 = new System.Data.SqlClient.SqlConnection(); 
			this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand(); 
			this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand(); 
			this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand(); 
			//  
			// sqlDataAdapter1 
			//  
			this.sqlDataAdapter1.DeleteCommand = this.sqlDeleteCommand1; 
			this.sqlDataAdapter1.InsertCommand = this.sqlInsertCommand1; 
			this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1; 
			this.sqlDataAdapter1.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] { 
																									  new System.Data.Common.DataTableMapping("Table", "distribution", new System.Data.Common.DataColumnMapping[] { 
																																																					  new System.Data.Common.DataColumnMapping("id", "id"), 
																																																					  new System.Data.Common.DataColumnMapping("sell_date", "sell_date"), 
																																																					  new System.Data.Common.DataColumnMapping("client", "client"), 
																																																					  new System.Data.Common.DataColumnMapping("bargain_number", "bargain_number"), 
																																																					  new System.Data.Common.DataColumnMapping("unit_price", "unit_price"), 
																																																					  new System.Data.Common.DataColumnMapping("quantity", "quantity"), 
																																																					  new System.Data.Common.DataColumnMapping("discount", "discount"), 
																																																					  new System.Data.Common.DataColumnMapping("sum_unm", "sum_unm")})}); 
			this.sqlDataAdapter1.UpdateCommand = this.sqlUpdateCommand1; 
			//  
			// sqlDeleteCommand1 
			//  
			this.sqlDeleteCommand1.CommandText = "[distributionDeleteCommand]"; 
			this.sqlDeleteCommand1.CommandType = System.Data.CommandType.StoredProcedure; 
			this.sqlDeleteCommand1.Connection = this.sqlConnection1; 
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); 
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_id", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "id", System.Data.DataRowVersion.Original, null)); 
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_bargain_number", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "bargain_number", System.Data.DataRowVersion.Original, null)); 
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_client", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "client", System.Data.DataRowVersion.Original, null)); 
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_discount", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(18)), ((System.Byte)(0)), "discount", System.Data.DataRowVersion.Original, null)); 
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_quantity", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(18)), ((System.Byte)(0)), "quantity", System.Data.DataRowVersion.Original, null)); 
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_sell_date", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "sell_date", System.Data.DataRowVersion.Original, null)); 
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_sum_unm", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "sum_unm", System.Data.DataRowVersion.Original, null)); 
			this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_unit_price", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "unit_price", System.Data.DataRowVersion.Original, null)); 
			//  
			// sqlConnection1 
			//  
			this.sqlConnection1.ConnectionString = "workstation id=LN;packet size=4096;user id=sa;data source=\".\";persist security in" + 
				"fo=False;initial catalog=CRM"; 
			//  
			// sqlInsertCommand1 
			//  
			this.sqlInsertCommand1.CommandText = "[distributionInsertCommand]"; 
			this.sqlInsertCommand1.CommandType = System.Data.CommandType.StoredProcedure; 
			this.sqlInsertCommand1.Connection = this.sqlConnection1; 
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); 
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sell_date", System.Data.SqlDbType.DateTime, 8, "sell_date")); 
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@client", System.Data.SqlDbType.VarChar, 50, "client")); 
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@bargain_number", System.Data.SqlDbType.VarChar, 50, "bargain_number")); 
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@unit_price", System.Data.SqlDbType.Money, 8, "unit_price")); 
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@quantity", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(18)), ((System.Byte)(0)), "quantity", System.Data.DataRowVersion.Current, null)); 
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@discount", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(18)), ((System.Byte)(0)), "discount", System.Data.DataRowVersion.Current, null)); 
			this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sum_unm", System.Data.SqlDbType.Money, 8, "sum_unm")); 
			//  
			// sqlSelectCommand1 
			//  
			this.sqlSelectCommand1.CommandText = "[distributionSelectCommand]"; 
			this.sqlSelectCommand1.CommandType = System.Data.CommandType.StoredProcedure; 
			this.sqlSelectCommand1.Connection = this.sqlConnection1; 
			this.sqlSelectCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); 
			//  
			// sqlUpdateCommand1 
			//  
			this.sqlUpdateCommand1.CommandText = "[distributionUpdateCommand]"; 
			this.sqlUpdateCommand1.CommandType = System.Data.CommandType.StoredProcedure; 
			this.sqlUpdateCommand1.Connection = this.sqlConnection1; 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, false, ((System.Byte)(0)), ((System.Byte)(0)), "", System.Data.DataRowVersion.Current, null)); 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sell_date", System.Data.SqlDbType.DateTime, 8, "sell_date")); 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@client", System.Data.SqlDbType.VarChar, 50, "client")); 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@bargain_number", System.Data.SqlDbType.VarChar, 50, "bargain_number")); 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@unit_price", System.Data.SqlDbType.Money, 8, "unit_price")); 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@quantity", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(18)), ((System.Byte)(0)), "quantity", System.Data.DataRowVersion.Current, null)); 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@discount", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(18)), ((System.Byte)(0)), "discount", System.Data.DataRowVersion.Current, null)); 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@sum_unm", System.Data.SqlDbType.Money, 8, "sum_unm")); 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_id", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "id", System.Data.DataRowVersion.Original, null)); 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_bargain_number", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "bargain_number", System.Data.DataRowVersion.Original, null)); 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_client", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "client", System.Data.DataRowVersion.Original, null)); 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_discount", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(18)), ((System.Byte)(0)), "discount", System.Data.DataRowVersion.Original, null)); 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_quantity", System.Data.SqlDbType.Decimal, 9, System.Data.ParameterDirection.Input, false, ((System.Byte)(18)), ((System.Byte)(0)), "quantity", System.Data.DataRowVersion.Original, null)); 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_sell_date", System.Data.SqlDbType.DateTime, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "sell_date", System.Data.DataRowVersion.Original, null)); 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_sum_unm", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "sum_unm", System.Data.DataRowVersion.Original, null)); 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_unit_price", System.Data.SqlDbType.Money, 8, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "unit_price", System.Data.DataRowVersion.Original, null)); 
			this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@id", System.Data.SqlDbType.Int, 4, "id")); 
			//  
			// Form2 
			//  
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); 
			this.ClientSize = new System.Drawing.Size(292, 266); 
			this.Name = "Form2"; 
			this.Text = "Form2"; 
			this.Load += new System.EventHandler(this.Form2_Load); 
 
		} 
		#endregion 
 
		private void Form2_Load(object sender, System.EventArgs e) 
		{ 
		 
		} 
 
		 
 
		 
	} 
}