📄 instorage.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
namespace WindowsApplication4
{
/// <summary>
/// InStorage 的摘要说明。
/// </summary>
public class InStorage : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label1;
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.Data.SqlClient.SqlDataAdapter InStgAdapter;
private System.Data.SqlClient.SqlConnection sqlConnection1;
private DataSet InStgset=new DataSet();
private DataTable InStgInfo= new DataTable();
private SqlConnection MyConn = new SqlConnection("server=.;Trusted_Connection=yes;user=sa;pwd=1;database=storage");
private CurrencyManager ISReport;
private SqlTransaction InStgTran;
private System.Windows.Forms.TextBox textMan;
private System.Windows.Forms.TextBox textCost;
private System.Windows.Forms.TextBox textAmount;
private System.Windows.Forms.TextBox textPho;
private System.Windows.Forms.TextBox textSupply;
private System.Windows.Forms.TextBox textDate;
private System.Windows.Forms.TextBox textNum2;
private System.Windows.Forms.Button cancel_button;
private System.Windows.Forms.Button send_button;
private System.Windows.Forms.Button add_button;
private System.Windows.Forms.DataGrid dataGrid1;
private string oldtxtAmount="";//重新编辑前的还库数量值
private bool change=false;
private System.Data.SqlClient.SqlCommand sqlSelectCommand1;
private System.Data.SqlClient.SqlCommand sqlInsertCommand1;
private System.Data.SqlClient.SqlCommand sqlUpdateCommand1;
private System.Data.SqlClient.SqlCommand sqlDeleteCommand1;//还库数量值状态更改标识
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public InStorage()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// 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.groupBox1 = new System.Windows.Forms.GroupBox();
this.textMan = new System.Windows.Forms.TextBox();
this.textCost = new System.Windows.Forms.TextBox();
this.textAmount = new System.Windows.Forms.TextBox();
this.textPho = new System.Windows.Forms.TextBox();
this.textSupply = new System.Windows.Forms.TextBox();
this.textDate = new System.Windows.Forms.TextBox();
this.textNum2 = 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.label1 = new System.Windows.Forms.Label();
this.add_button = new System.Windows.Forms.Button();
this.send_button = new System.Windows.Forms.Button();
this.cancel_button = new System.Windows.Forms.Button();
this.InStgAdapter = 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.dataGrid1 = new System.Windows.Forms.DataGrid();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.textMan);
this.groupBox1.Controls.Add(this.textCost);
this.groupBox1.Controls.Add(this.textAmount);
this.groupBox1.Controls.Add(this.textPho);
this.groupBox1.Controls.Add(this.textSupply);
this.groupBox1.Controls.Add(this.textDate);
this.groupBox1.Controls.Add(this.textNum2);
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.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.add_button);
this.groupBox1.Controls.Add(this.send_button);
this.groupBox1.Controls.Add(this.cancel_button);
this.groupBox1.Location = new System.Drawing.Point(24, 184);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(464, 144);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "入库登记信息";
//
// textMan
//
this.textMan.Location = new System.Drawing.Point(88, 112);
this.textMan.Name = "textMan";
this.textMan.Size = new System.Drawing.Size(248, 21);
this.textMan.TabIndex = 13;
this.textMan.Text = "";
//
// textCost
//
this.textCost.Location = new System.Drawing.Point(256, 80);
this.textCost.Name = "textCost";
this.textCost.Size = new System.Drawing.Size(80, 21);
this.textCost.TabIndex = 12;
this.textCost.Text = "";
//
// textAmount
//
this.textAmount.Location = new System.Drawing.Point(88, 80);
this.textAmount.Name = "textAmount";
this.textAmount.Size = new System.Drawing.Size(80, 21);
this.textAmount.TabIndex = 11;
this.textAmount.Text = "";
//
// textPho
//
this.textPho.Location = new System.Drawing.Point(256, 48);
this.textPho.Name = "textPho";
this.textPho.Size = new System.Drawing.Size(80, 21);
this.textPho.TabIndex = 10;
this.textPho.Text = "";
//
// textSupply
//
this.textSupply.Location = new System.Drawing.Point(88, 48);
this.textSupply.Name = "textSupply";
this.textSupply.Size = new System.Drawing.Size(80, 21);
this.textSupply.TabIndex = 9;
this.textSupply.Text = "";
//
// textDate
//
this.textDate.Location = new System.Drawing.Point(256, 16);
this.textDate.Name = "textDate";
this.textDate.Size = new System.Drawing.Size(80, 21);
this.textDate.TabIndex = 8;
this.textDate.Text = "";
//
// textNum2
//
this.textNum2.Location = new System.Drawing.Point(88, 16);
this.textNum2.Name = "textNum2";
this.textNum2.Size = new System.Drawing.Size(80, 21);
this.textNum2.TabIndex = 7;
this.textNum2.Text = "";
//
// label7
//
this.label7.Location = new System.Drawing.Point(24, 112);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(64, 24);
this.label7.TabIndex = 6;
this.label7.Text = "采购员";
//
// label6
//
this.label6.Location = new System.Drawing.Point(184, 80);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(88, 24);
this.label6.TabIndex = 5;
this.label6.Text = "价格:";
//
// label5
//
this.label5.Location = new System.Drawing.Point(24, 80);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(72, 24);
this.label5.TabIndex = 4;
this.label5.Text = "*数量:";
//
// label4
//
this.label4.Location = new System.Drawing.Point(176, 48);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(88, 24);
this.label4.TabIndex = 3;
this.label4.Text = "供应商电话:";
//
// label3
//
this.label3.Location = new System.Drawing.Point(24, 48);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(72, 24);
this.label3.TabIndex = 2;
this.label3.Text = "供应商:";
//
// label2
//
this.label2.Location = new System.Drawing.Point(184, 16);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(88, 24);
this.label2.TabIndex = 1;
this.label2.Text = "入库日期:";
//
// label1
//
this.label1.Location = new System.Drawing.Point(24, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(72, 24);
this.label1.TabIndex = 0;
this.label1.Text = "*设备号:";
//
// add_button
//
this.add_button.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.add_button.Location = new System.Drawing.Point(376, 16);
this.add_button.Name = "add_button";
this.add_button.Size = new System.Drawing.Size(72, 24);
this.add_button.TabIndex = 0;
this.add_button.Text = "新增";
this.add_button.Click += new System.EventHandler(this.add_button_Click);
//
// send_button
//
this.send_button.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.send_button.Location = new System.Drawing.Point(376, 56);
this.send_button.Name = "send_button";
this.send_button.Size = new System.Drawing.Size(72, 24);
this.send_button.TabIndex = 2;
this.send_button.Text = "提交";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -