📄 form3.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
namespace sqlgood
{
/// <summary>
/// Form3 的摘要说明。
/// </summary>
public class Form3 : System.Windows.Forms.Form
{
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.Button button5;
private Form frmParent;
private DataGridTableStyle ts = new DataGridTableStyle();
private System.Windows.Forms.Label label1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox txtnm2;
private System.Windows.Forms.TextBox txtprice2;
private System.Windows.Forms.TextBox txtnum2;
private System.Windows.Forms.TextBox txtallnum2;
private System.Windows.Forms.TextBox txtacount2;
private System.Windows.Forms.TextBox txtid2;
private System.Windows.Forms.Button btnin;
private System.Windows.Forms.Button btncansle2;
private System.Windows.Forms.Button btnupdata;
static int inallmoney=0,inallnum=0;
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 sqlgood.DataSet1 dataSet11;
private System.Windows.Forms.Button btnprev;
private System.Windows.Forms.Button btnnext;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form3(Form frmin)
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
frmParent=frmin;
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.dataSet11 = new sqlgood.DataSet1();
this.button5 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btncansle2 = new System.Windows.Forms.Button();
this.btnin = new System.Windows.Forms.Button();
this.txtid2 = new System.Windows.Forms.TextBox();
this.txtacount2 = new System.Windows.Forms.TextBox();
this.txtallnum2 = new System.Windows.Forms.TextBox();
this.txtnum2 = new System.Windows.Forms.TextBox();
this.txtprice2 = new System.Windows.Forms.TextBox();
this.txtnm2 = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.btnupdata = new System.Windows.Forms.Button();
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();
this.btnprev = new System.Windows.Forms.Button();
this.btnnext = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.AlternatingBackColor = System.Drawing.Color.White;
this.dataGrid1.BackColor = System.Drawing.Color.White;
this.dataGrid1.BackgroundColor = System.Drawing.Color.Ivory;
this.dataGrid1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.dataGrid1.CaptionBackColor = System.Drawing.Color.DarkSlateBlue;
this.dataGrid1.CaptionForeColor = System.Drawing.Color.Lavender;
this.dataGrid1.CaptionText = "商品进货";
this.dataGrid1.DataMember = "";
this.dataGrid1.DataSource = this.dataSet11.good;
this.dataGrid1.Enabled = false;
this.dataGrid1.FlatMode = true;
this.dataGrid1.Font = new System.Drawing.Font("Tahoma", 8F);
this.dataGrid1.ForeColor = System.Drawing.Color.Black;
this.dataGrid1.GridLineColor = System.Drawing.Color.Wheat;
this.dataGrid1.HeaderBackColor = System.Drawing.Color.CadetBlue;
this.dataGrid1.HeaderFont = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold);
this.dataGrid1.HeaderForeColor = System.Drawing.Color.Black;
this.dataGrid1.LinkColor = System.Drawing.Color.DarkSlateBlue;
this.dataGrid1.Location = new System.Drawing.Point(16, 48);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.ParentRowsBackColor = System.Drawing.Color.Ivory;
this.dataGrid1.ParentRowsForeColor = System.Drawing.Color.Black;
this.dataGrid1.SelectionBackColor = System.Drawing.Color.Wheat;
this.dataGrid1.SelectionForeColor = System.Drawing.Color.DarkSlateBlue;
this.dataGrid1.Size = new System.Drawing.Size(344, 240);
this.dataGrid1.TabIndex = 0;
this.dataGrid1.Navigate += new System.Windows.Forms.NavigateEventHandler(this.dataGrid1_Navigate);
//
// dataSet11
//
this.dataSet11.DataSetName = "DataSet1";
this.dataSet11.Locale = new System.Globalization.CultureInfo("zh-CN");
//
// button5
//
this.button5.Location = new System.Drawing.Point(680, 304);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(56, 32);
this.button5.TabIndex = 6;
this.button5.Text = "关闭";
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.ForeColor = System.Drawing.Color.Blue;
this.label1.Location = new System.Drawing.Point(128, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(136, 23);
this.label1.TabIndex = 7;
this.label1.Text = "进 货 版 面";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.btncansle2);
this.groupBox1.Controls.Add(this.btnin);
this.groupBox1.Controls.Add(this.txtid2);
this.groupBox1.Controls.Add(this.txtacount2);
this.groupBox1.Controls.Add(this.txtallnum2);
this.groupBox1.Controls.Add(this.txtnum2);
this.groupBox1.Controls.Add(this.txtprice2);
this.groupBox1.Controls.Add(this.txtnm2);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.ForeColor = System.Drawing.Color.Blue;
this.groupBox1.Location = new System.Drawing.Point(472, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(200, 336);
this.groupBox1.TabIndex = 8;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "进货栏";
//
// btncansle2
//
this.btncansle2.Location = new System.Drawing.Point(112, 264);
this.btncansle2.Name = "btncansle2";
this.btncansle2.TabIndex = 14;
this.btncansle2.Text = "清空";
this.btncansle2.Click += new System.EventHandler(this.btncansle2_Click);
//
// btnin
//
this.btnin.Location = new System.Drawing.Point(16, 264);
this.btnin.Name = "btnin";
this.btnin.TabIndex = 13;
this.btnin.Text = "进货";
this.btnin.Click += new System.EventHandler(this.btnin_Click);
//
// txtid2
//
this.txtid2.Location = new System.Drawing.Point(80, 24);
this.txtid2.Name = "txtid2";
this.txtid2.TabIndex = 12;
this.txtid2.Text = "";
//
// txtacount2
//
this.txtacount2.Location = new System.Drawing.Point(96, 224);
this.txtacount2.Name = "txtacount2";
this.txtacount2.Size = new System.Drawing.Size(96, 21);
this.txtacount2.TabIndex = 11;
this.txtacount2.Text = "";
this.txtacount2.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// txtallnum2
//
this.txtallnum2.Location = new System.Drawing.Point(96, 184);
this.txtallnum2.Name = "txtallnum2";
this.txtallnum2.Size = new System.Drawing.Size(96, 21);
this.txtallnum2.TabIndex = 10;
this.txtallnum2.Text = "";
this.txtallnum2.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.txtallnum2.TextChanged += new System.EventHandler(this.txtallnum2_TextChanged);
//
// txtnum2
//
this.txtnum2.Location = new System.Drawing.Point(80, 144);
this.txtnum2.Name = "txtnum2";
this.txtnum2.TabIndex = 9;
this.txtnum2.Text = "";
//
// txtprice2
//
this.txtprice2.Location = new System.Drawing.Point(80, 104);
this.txtprice2.Name = "txtprice2";
this.txtprice2.TabIndex = 8;
this.txtprice2.Text = "";
//
// txtnm2
//
this.txtnm2.Location = new System.Drawing.Point(80, 64);
this.txtnm2.Name = "txtnm2";
this.txtnm2.TabIndex = 7;
this.txtnm2.Text = "";
//
// label7
//
this.label7.ForeColor = System.Drawing.Color.Blue;
this.label7.Location = new System.Drawing.Point(8, 224);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(88, 23);
this.label7.TabIndex = 5;
this.label7.Text = "进货总价格";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label6
//
this.label6.ForeColor = System.Drawing.Color.Blue;
this.label6.Location = new System.Drawing.Point(8, 184);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(88, 23);
this.label6.TabIndex = 4;
this.label6.Text = "进货总数量";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label5
//
this.label5.Location = new System.Drawing.Point(8, 144);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(72, 23);
this.label5.TabIndex = 3;
this.label5.Text = "数量";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label4
//
this.label4.Location = new System.Drawing.Point(8, 104);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(72, 23);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -