📄 getpriceform.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Data.SqlClient; //加进数据库类链接
using System.Windows.Forms;
using SupDataBase;//命名空间修改
using System.Data;
namespace WindowsApplication1
{
/// <summary>
/// GetpriceForm 的摘要说明。
/// </summary>
public class GetpriceForm : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button button1;
private SqlConnection m_connection; //和数据库链接
private SqlDataAdapter m_sqlDataAdapter;//适配器
private System.Windows.Forms.TextBox m_GoodscodeText;
private System.Windows.Forms.TextBox m_GoodsnameText;
private System.Windows.Forms.TextBox m_PurchasepriceText;
private System.Windows.Forms.TextBox m_SalepriceText;
private System.Windows.Forms.TextBox m_RemarkText;
private System.Data.DataView m_dataview;
private System.Data.DataTable datatable;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
private System.Windows.Forms.DataGrid m_GoodListdataGrid;
private int pre_idx;
public GetpriceForm()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
m_connection=DBUtil.GetConnection();//获得数据库链接
m_sqlDataAdapter=new SqlDataAdapter();//初始化适配器
datatable = new System.Data.DataTable();
datatable.Columns.Add(new System.Data.DataColumn("商品ID"));
datatable.Columns.Add(new System.Data.DataColumn("商品条码"));
datatable.Columns.Add(new System.Data.DataColumn("商品名称"));
datatable.Columns.Add(new System.Data.DataColumn("进价"));
datatable.Columns.Add(new System.Data.DataColumn("售价"));
//datatable.Columns.Add(new System.Data.DataColumn("商品库存"));
datatable.Columns.Add(new System.Data.DataColumn("计量单位"));
datatable.Columns.Add(new System.Data.DataColumn("备注"));
m_dataview = new System.Data.DataView(datatable);
pre_idx = -1;
//
// 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.m_GoodListdataGrid = new System.Windows.Forms.DataGrid();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.m_RemarkText = new System.Windows.Forms.TextBox();
this.m_SalepriceText = new System.Windows.Forms.TextBox();
this.m_PurchasepriceText = new System.Windows.Forms.TextBox();
this.m_GoodscodeText = new System.Windows.Forms.TextBox();
this.m_GoodsnameText = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
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.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.m_GoodListdataGrid)).BeginInit();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.m_GoodListdataGrid);
this.groupBox1.Location = new System.Drawing.Point(8, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(704, 344);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "需定价商品";
//
// m_GoodListdataGrid
//
this.m_GoodListdataGrid.CaptionVisible = false;
this.m_GoodListdataGrid.DataMember = "";
this.m_GoodListdataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.m_GoodListdataGrid.Location = new System.Drawing.Point(16, 24);
this.m_GoodListdataGrid.Name = "m_GoodListdataGrid";
this.m_GoodListdataGrid.Size = new System.Drawing.Size(672, 304);
this.m_GoodListdataGrid.TabIndex = 0;
this.m_GoodListdataGrid.Navigate += new System.Windows.Forms.NavigateEventHandler(this.dataGrid1_Navigate);
this.m_GoodListdataGrid.CurrentCellChanged += new System.EventHandler(this.m_GoodListdataGrid_CurrentCellChanged);
//
// groupBox2
//
this.groupBox2.Controls.Add(this.m_RemarkText);
this.groupBox2.Controls.Add(this.m_SalepriceText);
this.groupBox2.Controls.Add(this.m_PurchasepriceText);
this.groupBox2.Controls.Add(this.m_GoodscodeText);
this.groupBox2.Controls.Add(this.m_GoodsnameText);
this.groupBox2.Controls.Add(this.button1);
this.groupBox2.Controls.Add(this.label6);
this.groupBox2.Controls.Add(this.label5);
this.groupBox2.Controls.Add(this.label3);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Location = new System.Drawing.Point(8, 360);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(704, 160);
this.groupBox2.TabIndex = 1;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "定价向导";
this.groupBox2.Enter += new System.EventHandler(this.groupBox2_Enter);
//
// m_RemarkText
//
this.m_RemarkText.Enabled = false;
this.m_RemarkText.Location = new System.Drawing.Point(112, 128);
this.m_RemarkText.Name = "m_RemarkText";
this.m_RemarkText.Size = new System.Drawing.Size(240, 21);
this.m_RemarkText.TabIndex = 12;
this.m_RemarkText.Text = "";
//
// m_SalepriceText
//
this.m_SalepriceText.Location = new System.Drawing.Point(112, 88);
this.m_SalepriceText.Name = "m_SalepriceText";
this.m_SalepriceText.Size = new System.Drawing.Size(112, 21);
this.m_SalepriceText.TabIndex = 11;
this.m_SalepriceText.Text = "";
this.m_SalepriceText.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.m_SalepriceText_KeyPress);
//
// m_PurchasepriceText
//
this.m_PurchasepriceText.Enabled = false;
this.m_PurchasepriceText.Location = new System.Drawing.Point(112, 56);
this.m_PurchasepriceText.Name = "m_PurchasepriceText";
this.m_PurchasepriceText.Size = new System.Drawing.Size(112, 21);
this.m_PurchasepriceText.TabIndex = 10;
this.m_PurchasepriceText.Text = "";
this.m_PurchasepriceText.TextChanged += new System.EventHandler(this.textBox4_TextChanged);
//
// m_GoodscodeText
//
this.m_GoodscodeText.Enabled = false;
this.m_GoodscodeText.Location = new System.Drawing.Point(112, 24);
this.m_GoodscodeText.Name = "m_GoodscodeText";
this.m_GoodscodeText.Size = new System.Drawing.Size(200, 21);
this.m_GoodscodeText.TabIndex = 9;
this.m_GoodscodeText.Text = "";
//
// m_GoodsnameText
//
this.m_GoodsnameText.Enabled = false;
this.m_GoodsnameText.Location = new System.Drawing.Point(408, 24);
this.m_GoodsnameText.Name = "m_GoodsnameText";
this.m_GoodsnameText.Size = new System.Drawing.Size(136, 21);
this.m_GoodsnameText.TabIndex = 7;
this.m_GoodsnameText.Text = "";
//
// button1
//
this.button1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.button1.Location = new System.Drawing.Point(408, 88);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(72, 24);
this.button1.TabIndex = 6;
this.button1.Text = "定价";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label6
//
this.label6.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label6.Location = new System.Drawing.Point(64, 136);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(40, 16);
this.label6.TabIndex = 5;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -