📄 product.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using Sale.DataLevel;
namespace Sale.UILevel
{
/// <summary>
/// Product 的摘要说明。
/// </summary>
public class Product : System.Windows.Forms.Form
{
private System.Windows.Forms.Button btnApply;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button btnLast;
private System.Windows.Forms.Button btnNext;
private System.Windows.Forms.Button btnPrevious;
private System.Windows.Forms.Button btnFirst;
private System.Windows.Forms.TextBox textName;
private System.Windows.Forms.TextBox textId;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox textRemark;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnAdd;
private System.Windows.Forms.Button btnDelete;
private System.Windows.Forms.Button btnModify;
private System.Windows.Forms.Button btnExit;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.TextBox textUnit;
private System.Windows.Forms.TextBox textSpecity;
private System.Windows.Forms.Label lblDatasetPosition;
private System.Data.SqlClient.SqlConnection sqlConnection1;
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 Sale.DataLevel.DataSetProduct objDataSetProduct;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Product()
{
//
// 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()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Product));
this.btnApply = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.lblDatasetPosition = new System.Windows.Forms.Label();
this.btnLast = new System.Windows.Forms.Button();
this.btnNext = new System.Windows.Forms.Button();
this.btnPrevious = new System.Windows.Forms.Button();
this.btnFirst = new System.Windows.Forms.Button();
this.textUnit = new System.Windows.Forms.TextBox();
this.objDataSetProduct = new Sale.DataLevel.DataSetProduct();
this.textSpecity = new System.Windows.Forms.TextBox();
this.textName = new System.Windows.Forms.TextBox();
this.textId = new System.Windows.Forms.TextBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.textRemark = new System.Windows.Forms.TextBox();
this.label5 = 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.btnAdd = new System.Windows.Forms.Button();
this.btnDelete = new System.Windows.Forms.Button();
this.btnModify = new System.Windows.Forms.Button();
this.btnExit = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
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.objDataSetProduct)).BeginInit();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// btnApply
//
this.btnApply.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnApply.Location = new System.Drawing.Point(72, 344);
this.btnApply.Name = "btnApply";
this.btnApply.Size = new System.Drawing.Size(72, 24);
this.btnApply.TabIndex = 29;
this.btnApply.Text = "应用";
this.btnApply.Click += new System.EventHandler(this.btnApply_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.lblDatasetPosition);
this.groupBox1.Controls.Add(this.btnLast);
this.groupBox1.Controls.Add(this.btnNext);
this.groupBox1.Controls.Add(this.btnPrevious);
this.groupBox1.Controls.Add(this.btnFirst);
this.groupBox1.Controls.Add(this.textUnit);
this.groupBox1.Controls.Add(this.textSpecity);
this.groupBox1.Controls.Add(this.textName);
this.groupBox1.Controls.Add(this.textId);
this.groupBox1.Controls.Add(this.groupBox2);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.groupBox1.Location = new System.Drawing.Point(24, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(480, 266);
this.groupBox1.TabIndex = 21;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "商品信息";
//
// lblDatasetPosition
//
this.lblDatasetPosition.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
this.lblDatasetPosition.ForeColor = System.Drawing.Color.White;
this.lblDatasetPosition.Location = new System.Drawing.Point(104, 24);
this.lblDatasetPosition.Name = "lblDatasetPosition";
this.lblDatasetPosition.Size = new System.Drawing.Size(64, 23);
this.lblDatasetPosition.TabIndex = 25;
this.lblDatasetPosition.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnLast
//
this.btnLast.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnLast.Image = ((System.Drawing.Image)(resources.GetObject("btnLast.Image")));
this.btnLast.Location = new System.Drawing.Point(224, 24);
this.btnLast.Name = "btnLast";
this.btnLast.Size = new System.Drawing.Size(40, 24);
this.btnLast.TabIndex = 23;
this.btnLast.Click += new System.EventHandler(this.btnLast_Click);
//
// btnNext
//
this.btnNext.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnNext.Image = ((System.Drawing.Image)(resources.GetObject("btnNext.Image")));
this.btnNext.Location = new System.Drawing.Point(176, 24);
this.btnNext.Name = "btnNext";
this.btnNext.Size = new System.Drawing.Size(40, 24);
this.btnNext.TabIndex = 22;
this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
//
// btnPrevious
//
this.btnPrevious.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnPrevious.Image = ((System.Drawing.Image)(resources.GetObject("btnPrevious.Image")));
this.btnPrevious.Location = new System.Drawing.Point(56, 24);
this.btnPrevious.Name = "btnPrevious";
this.btnPrevious.Size = new System.Drawing.Size(40, 24);
this.btnPrevious.TabIndex = 21;
this.btnPrevious.Click += new System.EventHandler(this.btnPrevious_Click);
//
// btnFirst
//
this.btnFirst.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnFirst.Image = ((System.Drawing.Image)(resources.GetObject("btnFirst.Image")));
this.btnFirst.Location = new System.Drawing.Point(8, 24);
this.btnFirst.Name = "btnFirst";
this.btnFirst.Size = new System.Drawing.Size(40, 24);
this.btnFirst.TabIndex = 20;
this.btnFirst.Click += new System.EventHandler(this.btnFirst_Click);
//
// textUnit
//
this.textUnit.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textUnit.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.objDataSetProduct, "Product.ProductUnit"));
this.textUnit.Location = new System.Drawing.Point(96, 208);
this.textUnit.Name = "textUnit";
this.textUnit.Size = new System.Drawing.Size(120, 23);
this.textUnit.TabIndex = 13;
this.textUnit.Text = "";
//
// objDataSetProduct
//
this.objDataSetProduct.DataSetName = "DataSetProduct";
this.objDataSetProduct.Locale = new System.Globalization.CultureInfo("zh-CN");
//
// textSpecity
//
this.textSpecity.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textSpecity.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.objDataSetProduct, "Product.ProductSort"));
this.textSpecity.Location = new System.Drawing.Point(96, 168);
this.textSpecity.Name = "textSpecity";
this.textSpecity.Size = new System.Drawing.Size(120, 23);
this.textSpecity.TabIndex = 12;
this.textSpecity.Text = "";
//
// textName
//
this.textName.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textName.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.objDataSetProduct, "Product.ProductName"));
this.textName.Location = new System.Drawing.Point(96, 120);
this.textName.Name = "textName";
this.textName.Size = new System.Drawing.Size(120, 23);
this.textName.TabIndex = 11;
this.textName.Text = "";
//
// textId
//
this.textId.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textId.Cursor = System.Windows.Forms.Cursors.Arrow;
this.textId.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.objDataSetProduct, "Product.ProductID"));
this.textId.Location = new System.Drawing.Point(96, 80);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -