主题:求救
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace 进销存管理系统
{
/// <summary>
/// WareDataManage 的摘要说明。
/// </summary>
public class WareDataManage : System.Windows.Forms.Form
{
private bool blSellTableShow;
private DataSet ds = new DataSet();
private LinkDataBase link = new LinkDataBase();
private string sendTableName = "商品清单";
private string sendStrSQL = "SELECT 货号, 条码, 拼音编码, 品名, 单位, 进货价, 销售价1, 销售价2, 规格, 产地, 类别, 最低售价 FROM 商品清单";
private System.Windows.Forms.DataGrid dgrd_WareData;
private System.Windows.Forms.ToolBar toolBar1;
private System.Windows.Forms.ToolBarButton tbarBtnSave;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.ToolBarButton tbarBtnDelete;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txt_WareWord;
private System.Windows.Forms.Button btn_Search;
private System.ComponentModel.IContainer components;
public WareDataManage()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
//--------重载构造函数-----------
public WareDataManage(bool blShowToolBar)
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
this.ds = link.SelectDataBase(sendStrSQL,sendTableName);//创建数据库连接
//如果blToolBarShow为false,则表示该窗体由销售单和进货单生成,用于双击选择商品
this.DataGridStateControl(blShowToolBar);
this.dgrd_WareData.DataSource = ds.Tables[0];
this.toolBar1.Enabled = blShowToolBar;
}
/// <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.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(WareDataManage));
this.dgrd_WareData = new System.Windows.Forms.DataGrid();
this.toolBar1 = new System.Windows.Forms.ToolBar();
this.tbarBtnSave = new System.Windows.Forms.ToolBarButton();
this.tbarBtnDelete = new System.Windows.Forms.ToolBarButton();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.txt_WareWord = new System.Windows.Forms.TextBox();
this.btn_Search = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgrd_WareData)).BeginInit();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// dgrd_WareData
//
this.dgrd_WareData.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgrd_WareData.CaptionVisible = false;
this.dgrd_WareData.DataMember = "";
this.dgrd_WareData.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dgrd_WareData.Location = new System.Drawing.Point(0, 74);
this.dgrd_WareData.Name = "dgrd_WareData";
this.dgrd_WareData.Size = new System.Drawing.Size(720, 376);
this.dgrd_WareData.TabIndex = 3;
this.dgrd_WareData.DoubleClick += new System.EventHandler(this.dgrd_WareData_DoubleClick);
//
// toolBar1
//
this.toolBar1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.tbarBtnSave,
this.tbarBtnDelete});
this.toolBar1.DropDownArrows = true;
this.toolBar1.ImageList = this.imageList1;
this.toolBar1.Location = new System.Drawing.Point(0, 0);
this.toolBar1.Name = "toolBar1";
this.toolBar1.ShowToolTips = true;
this.toolBar1.Size = new System.Drawing.Size(720, 29);
this.toolBar1.TabIndex = 4;
this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
//
// tbarBtnSave
//
this.tbarBtnSave.ImageIndex = 0;
this.tbarBtnSave.ToolTipText = "保存修改";
//
// tbarBtnDelete
//
this.tbarBtnDelete.ImageIndex = 1;
this.tbarBtnDelete.ToolTipText = "删除数据";
//
// imageList1
//
this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.txt_WareWord);
this.groupBox1.Controls.Add(this.btn_Search);
this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.groupBox1.Location = new System.Drawing.Point(1, 22);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(718, 50);
this.groupBox1.TabIndex = 4;
this.groupBox1.TabStop = false;
//
// label1
//
this.label1.Location = new System.Drawing.Point(179, 22);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(64, 16);
this.label1.TabIndex = 5;
this.label1.Text = "商品拼音:";
//
// txt_WareWord
//
this.txt_WareWord.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txt_WareWord.Location = new System.Drawing.Point(267, 18);
this.txt_WareWord.Name = "txt_WareWord";
this.txt_WareWord.Size = new System.Drawing.Size(200, 21);
this.txt_WareWord.TabIndex = 1;
this.txt_WareWord.Text = "";
//
// btn_Search
//
this.btn_Search.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_Search.Location = new System.Drawing.Point(491, 17);
this.btn_Search.Name = "btn_Search";
this.btn_Search.Size = new System.Drawing.Size(48, 24);
this.btn_Search.TabIndex = 2;
this.btn_Search.Text = "查询";
this.btn_Search.Click += new System.EventHandler(this.btn_Search_Click);
//
// WareDataManage
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(720, 445);
this.Controls.Add(this.toolBar1);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.dgrd_WareData);
this.Name = "WareDataManage";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "【商品信息维护】";
((System.ComponentModel.ISupportInitialize)(this.dgrd_WareData)).EndInit();
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace 进销存管理系统
{
/// <summary>
/// WareDataManage 的摘要说明。
/// </summary>
public class WareDataManage : System.Windows.Forms.Form
{
private bool blSellTableShow;
private DataSet ds = new DataSet();
private LinkDataBase link = new LinkDataBase();
private string sendTableName = "商品清单";
private string sendStrSQL = "SELECT 货号, 条码, 拼音编码, 品名, 单位, 进货价, 销售价1, 销售价2, 规格, 产地, 类别, 最低售价 FROM 商品清单";
private System.Windows.Forms.DataGrid dgrd_WareData;
private System.Windows.Forms.ToolBar toolBar1;
private System.Windows.Forms.ToolBarButton tbarBtnSave;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.ToolBarButton tbarBtnDelete;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox txt_WareWord;
private System.Windows.Forms.Button btn_Search;
private System.ComponentModel.IContainer components;
public WareDataManage()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
//--------重载构造函数-----------
public WareDataManage(bool blShowToolBar)
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
this.ds = link.SelectDataBase(sendStrSQL,sendTableName);//创建数据库连接
//如果blToolBarShow为false,则表示该窗体由销售单和进货单生成,用于双击选择商品
this.DataGridStateControl(blShowToolBar);
this.dgrd_WareData.DataSource = ds.Tables[0];
this.toolBar1.Enabled = blShowToolBar;
}
/// <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.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(WareDataManage));
this.dgrd_WareData = new System.Windows.Forms.DataGrid();
this.toolBar1 = new System.Windows.Forms.ToolBar();
this.tbarBtnSave = new System.Windows.Forms.ToolBarButton();
this.tbarBtnDelete = new System.Windows.Forms.ToolBarButton();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.txt_WareWord = new System.Windows.Forms.TextBox();
this.btn_Search = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgrd_WareData)).BeginInit();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// dgrd_WareData
//
this.dgrd_WareData.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgrd_WareData.CaptionVisible = false;
this.dgrd_WareData.DataMember = "";
this.dgrd_WareData.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dgrd_WareData.Location = new System.Drawing.Point(0, 74);
this.dgrd_WareData.Name = "dgrd_WareData";
this.dgrd_WareData.Size = new System.Drawing.Size(720, 376);
this.dgrd_WareData.TabIndex = 3;
this.dgrd_WareData.DoubleClick += new System.EventHandler(this.dgrd_WareData_DoubleClick);
//
// toolBar1
//
this.toolBar1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.tbarBtnSave,
this.tbarBtnDelete});
this.toolBar1.DropDownArrows = true;
this.toolBar1.ImageList = this.imageList1;
this.toolBar1.Location = new System.Drawing.Point(0, 0);
this.toolBar1.Name = "toolBar1";
this.toolBar1.ShowToolTips = true;
this.toolBar1.Size = new System.Drawing.Size(720, 29);
this.toolBar1.TabIndex = 4;
this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
//
// tbarBtnSave
//
this.tbarBtnSave.ImageIndex = 0;
this.tbarBtnSave.ToolTipText = "保存修改";
//
// tbarBtnDelete
//
this.tbarBtnDelete.ImageIndex = 1;
this.tbarBtnDelete.ToolTipText = "删除数据";
//
// imageList1
//
this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.txt_WareWord);
this.groupBox1.Controls.Add(this.btn_Search);
this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.groupBox1.Location = new System.Drawing.Point(1, 22);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(718, 50);
this.groupBox1.TabIndex = 4;
this.groupBox1.TabStop = false;
//
// label1
//
this.label1.Location = new System.Drawing.Point(179, 22);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(64, 16);
this.label1.TabIndex = 5;
this.label1.Text = "商品拼音:";
//
// txt_WareWord
//
this.txt_WareWord.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txt_WareWord.Location = new System.Drawing.Point(267, 18);
this.txt_WareWord.Name = "txt_WareWord";
this.txt_WareWord.Size = new System.Drawing.Size(200, 21);
this.txt_WareWord.TabIndex = 1;
this.txt_WareWord.Text = "";
//
// btn_Search
//
this.btn_Search.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btn_Search.Location = new System.Drawing.Point(491, 17);
this.btn_Search.Name = "btn_Search";
this.btn_Search.Size = new System.Drawing.Size(48, 24);
this.btn_Search.TabIndex = 2;
this.btn_Search.Text = "查询";
this.btn_Search.Click += new System.EventHandler(this.btn_Search_Click);
//
// WareDataManage
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(720, 445);
this.Controls.Add(this.toolBar1);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.dgrd_WareData);
this.Name = "WareDataManage";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "【商品信息维护】";
((System.ComponentModel.ISupportInitialize)(this.dgrd_WareData)).EndInit();
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion