selbuy.cs
来自「物流行业的仓库库存管理系统DOTNET平台下的源码」· CS 代码 · 共 271 行 · 第 1/2 页
CS
271 行
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>
/// SelBuy 的摘要说明。
/// </summary>
public class SelBuy : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox textNum;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Data.SqlClient.SqlDataAdapter buyAdapter;
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 DataTable buyInfo=new DataTable();
private System.Windows.Forms.Button sel_button;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public SelBuy()
{
//
// 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.sel_button = new System.Windows.Forms.Button();
this.textNum = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.buyAdapter = 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.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.sel_button);
this.groupBox1.Controls.Add(this.textNum);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(16, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(472, 64);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "检索项";
//
// sel_button
//
this.sel_button.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.sel_button.Location = new System.Drawing.Point(296, 24);
this.sel_button.Name = "sel_button";
this.sel_button.Size = new System.Drawing.Size(72, 24);
this.sel_button.TabIndex = 2;
this.sel_button.Text = "检索";
this.sel_button.Click += new System.EventHandler(this.sel_button_Click);
//
// textNum
//
this.textNum.Location = new System.Drawing.Point(136, 24);
this.textNum.Name = "textNum";
this.textNum.Size = new System.Drawing.Size(96, 21);
this.textNum.TabIndex = 1;
this.textNum.Text = "";
//
// label1
//
this.label1.Location = new System.Drawing.Point(32, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(104, 24);
this.label1.TabIndex = 0;
this.label1.Text = "按设备号查询:";
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(24, 88);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.Size = new System.Drawing.Size(456, 224);
this.dataGrid1.TabIndex = 1;
//
// buyAdapter
//
this.buyAdapter.DeleteCommand = this.sqlDeleteCommand1;
this.buyAdapter.InsertCommand = this.sqlInsertCommand1;
this.buyAdapter.SelectCommand = this.sqlSelectCommand1;
this.buyAdapter.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
new System.Data.Common.DataTableMapping("Table", "buyTable", new System.Data.Common.DataColumnMapping[] {
new System.Data.Common.DataColumnMapping("设备号", "设备号"),
new System.Data.Common.DataColumnMapping("现有库存", "现有库存"),
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?