?? selbuy.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>
/// 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 + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -