📄 customerform.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
namespace test007
{
/// <summary>
/// customerForm 的摘要说明。
/// </summary>
public class customerForm : System.Windows.Forms.Form
{
private CurrencyManager cmAmend;
private DataSet ds = new DataSet();
private LinkDataBase link = new LinkDataBase();
private string sendTableName = "customer";
private string sendStrSQL = "SELECT 客户编号, 客户名称, 客户简称, 企业法人,工商注册号, 客户地址, 邮政编码, 业务联系人, 电话, 传真, 电子邮件, 开户银行, 银行帐号 FROM customer";
protected System.Windows.Forms.ToolBar toolBar1;
protected System.Windows.Forms.GroupBox groupBox1;
protected System.Windows.Forms.Button button1;
protected System.Windows.Forms.Label label1;
protected System.Windows.Forms.TextBox textBox1;
protected System.Windows.Forms.Label label2;
protected System.Windows.Forms.TextBox textBox2;
protected System.Windows.Forms.DataGrid dataGrid1;
protected System.Windows.Forms.GroupBox groupBox2;
protected System.Windows.Forms.Label label3;
protected System.Windows.Forms.Label label4;
protected System.Windows.Forms.TextBox textBox3;
protected System.Windows.Forms.TextBox textBox4;
protected System.Windows.Forms.TextBox textBox5;
protected System.Windows.Forms.TextBox textBox6;
protected System.Windows.Forms.TextBox textBox7;
protected System.Windows.Forms.TextBox textBox8;
protected System.Windows.Forms.TextBox textBox9;
protected System.Windows.Forms.TextBox textBox10;
protected System.Windows.Forms.Label label5;
protected System.Windows.Forms.Label label6;
protected System.Windows.Forms.Label label7;
protected System.Windows.Forms.Label label8;
protected System.Windows.Forms.Label label9;
protected System.Windows.Forms.Label label10;
protected System.Windows.Forms.Label label11;
protected System.Windows.Forms.Label label12;
protected System.Windows.Forms.Label label13;
protected System.Windows.Forms.Label label14;
protected System.Windows.Forms.Label label15;
protected System.Windows.Forms.TextBox textBox11;
protected System.Windows.Forms.TextBox textBox12;
protected System.Windows.Forms.TextBox textBox13;
protected System.Windows.Forms.TextBox textBox14;
protected System.Windows.Forms.TextBox textBox15;
protected System.Windows.Forms.Label label16;
protected System.Windows.Forms.Label label17;
protected System.Windows.Forms.Label label18;
protected System.Windows.Forms.Label label19;
protected System.Windows.Forms.Label label20;
protected System.Windows.Forms.Label label21;
protected System.Windows.Forms.Label label22;
protected System.Windows.Forms.Label label23;
protected System.Windows.Forms.Label label24;
protected System.Windows.Forms.Label label25;
protected System.Windows.Forms.Label label26;
protected System.Windows.Forms.ToolBarButton toolBarButton1;
protected System.Windows.Forms.ToolBarButton toolBarButton2;
protected System.Windows.Forms.ToolBarButton toolBarButton3;
protected System.Windows.Forms.ToolBarButton toolBarButton4;
protected System.Windows.Forms.ToolBarButton toolBarButton5;
protected System.Windows.Forms.ToolBarButton toolBarButton6;
protected System.Windows.Forms.ToolBarButton toolBarButton8;
protected System.Windows.Forms.ToolBarButton toolBarButton9;
protected System.Windows.Forms.ToolBarButton toolBarButton11;
protected System.Windows.Forms.ImageList imageList1;
private System.ComponentModel.IContainer components;
public customerForm()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
this.ds = link.SelectDataBase(sendStrSQL,sendTableName);//创建数据库连接
dataGrid1.DataSource = ds.Tables[0];
DataGridStateControl();
DataBingingsFunction();
cmAmend =( CurrencyManager )BindingContext[ds.Tables[0]];
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(customerForm));
this.toolBar1 = new System.Windows.Forms.ToolBar();
this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton3 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton4 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton5 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton6 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton8 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton9 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton11 = new System.Windows.Forms.ToolBarButton();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label26 = new System.Windows.Forms.Label();
this.label25 = new System.Windows.Forms.Label();
this.label24 = new System.Windows.Forms.Label();
this.label23 = new System.Windows.Forms.Label();
this.label22 = new System.Windows.Forms.Label();
this.label21 = new System.Windows.Forms.Label();
this.label20 = new System.Windows.Forms.Label();
this.label19 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.label17 = new System.Windows.Forms.Label();
this.label16 = new System.Windows.Forms.Label();
this.textBox15 = new System.Windows.Forms.TextBox();
this.textBox14 = new System.Windows.Forms.TextBox();
this.textBox13 = new System.Windows.Forms.TextBox();
this.textBox12 = new System.Windows.Forms.TextBox();
this.textBox11 = new System.Windows.Forms.TextBox();
this.label15 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.textBox10 = new System.Windows.Forms.TextBox();
this.textBox9 = new System.Windows.Forms.TextBox();
this.textBox8 = new System.Windows.Forms.TextBox();
this.textBox7 = new System.Windows.Forms.TextBox();
this.textBox6 = new System.Windows.Forms.TextBox();
this.textBox5 = new System.Windows.Forms.TextBox();
this.textBox4 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// toolBar1
//
this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.toolBarButton1,
this.toolBarButton2,
this.toolBarButton3,
this.toolBarButton4,
this.toolBarButton5,
this.toolBarButton6,
this.toolBarButton8,
this.toolBarButton9,
this.toolBarButton11});
this.toolBar1.ButtonSize = new System.Drawing.Size(75, 35);
this.toolBar1.DropDownArrows = true;
this.toolBar1.ImageList = this.imageList1;
this.toolBar1.Name = "toolBar1";
this.toolBar1.ShowToolTips = true;
this.toolBar1.Size = new System.Drawing.Size(768, 38);
this.toolBar1.TabIndex = 0;
this.toolBar1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.toolBar1_ButtonClick);
//
// toolBarButton1
//
this.toolBarButton1.ImageIndex = 0;
this.toolBarButton1.Text = "首记录";
this.toolBarButton1.ToolTipText = "首记录";
//
// toolBarButton2
//
this.toolBarButton2.ImageIndex = 1;
this.toolBarButton2.Text = "上一个记录";
this.toolBarButton2.ToolTipText = "上一个记录";
//
// toolBarButton3
//
this.toolBarButton3.ImageIndex = 2;
this.toolBarButton3.Text = "下一个记录";
this.toolBarButton3.ToolTipText = "下一个记录";
//
// toolBarButton4
//
this.toolBarButton4.ImageIndex = 3;
this.toolBarButton4.Text = "末记录";
this.toolBarButton4.ToolTipText = "末记录";
//
// toolBarButton5
//
this.toolBarButton5.ImageIndex = 4;
this.toolBarButton5.Text = "新增记录";
this.toolBarButton5.ToolTipText = "新增记录";
//
// toolBarButton6
//
this.toolBarButton6.ImageIndex = 5;
this.toolBarButton6.Text = "提交记录";
this.toolBarButton6.ToolTipText = "提交记录";
//
// toolBarButton8
//
this.toolBarButton8.ImageIndex = 6;
this.toolBarButton8.Text = "保存修改";
this.toolBarButton8.ToolTipText = "保存修改";
//
// toolBarButton9
//
this.toolBarButton9.ImageIndex = 7;
this.toolBarButton9.Text = "删除记录";
this.toolBarButton9.ToolTipText = "删除记录";
//
// toolBarButton11
//
this.toolBarButton11.ImageIndex = 8;
this.toolBarButton11.Text = "退出";
this.toolBarButton11.ToolTipText = "退出";
//
// imageList1
//
this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
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.Controls.AddRange(new System.Windows.Forms.Control[] {
this.textBox2,
this.label2,
this.textBox1,
this.label1,
this.button1});
this.groupBox1.Location = new System.Drawing.Point(0, 40);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(768, 48);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(360, 16);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(112, 21);
this.textBox2.TabIndex = 4;
this.textBox2.Text = "";
//
// label2
//
this.label2.Location = new System.Drawing.Point(296, 24);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 16);
this.label2.TabIndex = 3;
this.label2.Text = "客户名称";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(160, 16);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(112, 21);
this.textBox1.TabIndex = 2;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -