📄 selltable.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace 进销存管理系统
{
/// <summary>
/// SellTable 的摘要说明。
/// </summary>
public class SellTable : System.Windows.Forms.Form
{
private LinkDataBase link = new LinkDataBase();
private DataTable newTable;
public static string [] inputDataGridArray = new string [] {null,null,null,null};
public static string [] inputTextDataArray = new string [] {"",""}; //确定要赋的值为文本,故用空字符
private DateTime gridMouseDownTime;//记录事件,确定鼠标是双击表格还是选中一个单元
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.DataGrid dgrd_SellTable;
private System.Windows.Forms.ComboBox cmb_Oprater;
private System.Windows.Forms.TextBox txt_SellDate;
private System.Windows.Forms.TextBox txt_Maker;
private System.Windows.Forms.TextBox txt_Company;
private System.Windows.Forms.ToolBar toolBar1;
private System.Windows.Forms.ToolBarButton tbarBtnSave;
private System.Windows.Forms.ToolBarButton tbarBtnDelete;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.TextBox txt_TotalCount;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txt_NoTax;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txt_Tax;
private System.Windows.Forms.ToolBarButton tbarTrash;
private System.Windows.Forms.ComboBox cmb_ClientID;
private System.ComponentModel.IContainer components;
public SellTable()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
this.selectDataBase();
this.DataGridStateControl();
this.cmb_ClientID.Items.Add("");
}
/// <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.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SellTable));
this.dgrd_SellTable = new System.Windows.Forms.DataGrid();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.cmb_Oprater = new System.Windows.Forms.ComboBox();
this.cmb_ClientID = new System.Windows.Forms.ComboBox();
this.txt_SellDate = new System.Windows.Forms.TextBox();
this.txt_Maker = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.txt_Company = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.toolBar1 = new System.Windows.Forms.ToolBar();
this.tbarBtnSave = new System.Windows.Forms.ToolBarButton();
this.tbarBtnDelete = new System.Windows.Forms.ToolBarButton();
this.tbarTrash = new System.Windows.Forms.ToolBarButton();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.txt_TotalCount = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.txt_NoTax = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.txt_Tax = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.dgrd_SellTable)).BeginInit();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// dgrd_SellTable
//
this.dgrd_SellTable.AllowSorting = false;
this.dgrd_SellTable.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_SellTable.CaptionVisible = false;
this.dgrd_SellTable.DataMember = "";
this.dgrd_SellTable.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dgrd_SellTable.Location = new System.Drawing.Point(0, 104);
this.dgrd_SellTable.Name = "dgrd_SellTable";
this.dgrd_SellTable.Size = new System.Drawing.Size(720, 264);
this.dgrd_SellTable.TabIndex = 5;
this.dgrd_SellTable.DoubleClick += new System.EventHandler(this.dgrd_SellTable_DoubleClick);
this.dgrd_SellTable.CurrentCellChanged += new System.EventHandler(this.dgrd_SellTable_CurrentCellChanged);
this.dgrd_SellTable.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dgrd_SellTable_MouseDown);
//
// 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.cmb_Oprater);
this.groupBox1.Controls.Add(this.cmb_ClientID);
this.groupBox1.Controls.Add(this.txt_SellDate);
this.groupBox1.Controls.Add(this.txt_Maker);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.txt_Company);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.groupBox1.Location = new System.Drawing.Point(0, 22);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(720, 82);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
//
// cmb_Oprater
//
this.cmb_Oprater.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb_Oprater.Location = new System.Drawing.Point(525, 16);
this.cmb_Oprater.Name = "cmb_Oprater";
this.cmb_Oprater.Size = new System.Drawing.Size(120, 20);
this.cmb_Oprater.Sorted = true;
this.cmb_Oprater.TabIndex = 3;
//
// cmb_ClientID
//
this.cmb_ClientID.Location = new System.Drawing.Point(143, 51);
this.cmb_ClientID.MaxDropDownItems = 1;
this.cmb_ClientID.Name = "cmb_ClientID";
this.cmb_ClientID.Size = new System.Drawing.Size(128, 20);
this.cmb_ClientID.Sorted = true;
this.cmb_ClientID.TabIndex = 4;
this.cmb_ClientID.KeyUp += new System.Windows.Forms.KeyEventHandler(this.cmb_Client_KeyUp);
this.cmb_ClientID.DropDown += new System.EventHandler(this.cmb_Client_DropDown);
//
// txt_SellDate
//
this.txt_SellDate.Location = new System.Drawing.Point(143, 16);
this.txt_SellDate.Name = "txt_SellDate";
this.txt_SellDate.Size = new System.Drawing.Size(128, 21);
this.txt_SellDate.TabIndex = 1;
//
// txt_Maker
//
this.txt_Maker.Location = new System.Drawing.Point(346, 16);
this.txt_Maker.Name = "txt_Maker";
this.txt_Maker.Size = new System.Drawing.Size(100, 21);
this.txt_Maker.TabIndex = 2;
this.txt_Maker.Text = "sys";
//
// label4
//
this.label4.Location = new System.Drawing.Point(75, 55);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(62, 16);
this.label4.TabIndex = 19;
this.label4.Text = "客户编号:";
//
// txt_Company
//
this.txt_Company.Location = new System.Drawing.Point(293, 51);
this.txt_Company.Name = "txt_Company";
this.txt_Company.ReadOnly = true;
this.txt_Company.Size = new System.Drawing.Size(352, 21);
this.txt_Company.TabIndex = 9;
this.txt_Company.TabStop = false;
//
// label5
//
this.label5.Location = new System.Drawing.Point(293, 22);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(48, 16);
this.label5.TabIndex = 17;
this.label5.Text = "制单人:";
//
// label6
//
this.label6.Location = new System.Drawing.Point(471, 22);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(48, 16);
this.label6.TabIndex = 18;
this.label6.Text = "业务员:";
//
// label7
//
this.label7.Location = new System.Drawing.Point(75, 22);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(62, 16);
this.label7.TabIndex = 16;
this.label7.Text = "售货日期:";
//
// toolBar1
//
this.toolBar1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.tbarBtnSave,
this.tbarBtnDelete,
this.tbarTrash});
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 = 8;
this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
//
// tbarBtnSave
//
this.tbarBtnSave.ImageIndex = 0;
this.tbarBtnSave.Name = "tbarBtnSave";
this.tbarBtnSave.ToolTipText = "保存修改";
//
// tbarBtnDelete
//
this.tbarBtnDelete.ImageIndex = 1;
this.tbarBtnDelete.Name = "tbarBtnDelete";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -