📄 customermanageform.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data;
using SupDataBase;
namespace WindowsApplication1
{
/// <summary>
/// CustomerManageForm 的摘要说明。
/// </summary>
public class CustomerManageForm : System.Windows.Forms.Form
{
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.GroupBox groupBox1;
private System.Windows.Forms.DataGridTableStyle dataGridTableStyle1;
private System.Windows.Forms.DataGridTextBoxColumn m_NameColumn;
private System.Windows.Forms.DataGridTextBoxColumn m_ContactColumn;
private System.Windows.Forms.DataGridTextBoxColumn m_RemarkColumn;
private System.Windows.Forms.TextBox m_NameText;
private System.Windows.Forms.TextBox m_ContactText;
private System.Windows.Forms.TextBox m_RemarkText;
private SqlConnection m_Connection;
private SqlDataAdapter m_sqlDataAdapter;
private int previousRowNumber;
private ArrayList customerList;
private System.Windows.Forms.DataGrid m_CustomerDataGrid;
private System.Windows.Forms.Button m_AddButton;
private System.Windows.Forms.Button m_ModifyButton;
private System.Windows.Forms.Button m_DeleteButton;
private System.Windows.Forms.Button m_CancelButton;
private System.Windows.Forms.Button m_OKButton;
private System.Windows.Forms.TextBox m_IDText;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public CustomerManageForm()
{
//
// 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()
{
this.m_CustomerDataGrid = new System.Windows.Forms.DataGrid();
this.dataGridTableStyle1 = new System.Windows.Forms.DataGridTableStyle();
this.m_NameColumn = new System.Windows.Forms.DataGridTextBoxColumn();
this.m_ContactColumn = new System.Windows.Forms.DataGridTextBoxColumn();
this.m_RemarkColumn = new System.Windows.Forms.DataGridTextBoxColumn();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.m_NameText = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.m_ContactText = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.m_AddButton = new System.Windows.Forms.Button();
this.m_ModifyButton = new System.Windows.Forms.Button();
this.m_DeleteButton = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.m_RemarkText = new System.Windows.Forms.TextBox();
this.m_sqlDataAdapter = new System.Data.SqlClient.SqlDataAdapter();
this.m_CancelButton = new System.Windows.Forms.Button();
this.m_OKButton = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.m_CustomerDataGrid)).BeginInit();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// m_CustomerDataGrid
//
this.m_CustomerDataGrid.DataMember = "";
this.m_CustomerDataGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.m_CustomerDataGrid.Location = new System.Drawing.Point(0, 40);
this.m_CustomerDataGrid.Name = "m_CustomerDataGrid";
this.m_CustomerDataGrid.Size = new System.Drawing.Size(616, 160);
this.m_CustomerDataGrid.TabIndex = 0;
this.m_CustomerDataGrid.TableStyles.AddRange(new System.Windows.Forms.DataGridTableStyle[] {
this.dataGridTableStyle1});
//
// dataGridTableStyle1
//
this.dataGridTableStyle1.DataGrid = this.m_CustomerDataGrid;
this.dataGridTableStyle1.GridColumnStyles.AddRange(new System.Windows.Forms.DataGridColumnStyle[] {
this.m_NameColumn,
this.m_ContactColumn,
this.m_RemarkColumn});
this.dataGridTableStyle1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGridTableStyle1.MappingName = "";
//
// m_NameColumn
//
this.m_NameColumn.Alignment = System.Windows.Forms.HorizontalAlignment.Center;
this.m_NameColumn.Format = "";
this.m_NameColumn.FormatInfo = null;
this.m_NameColumn.HeaderText = "姓名";
this.m_NameColumn.MappingName = "name";
this.m_NameColumn.NullText = "";
this.m_NameColumn.ReadOnly = true;
this.m_NameColumn.Width = 75;
//
// m_ContactColumn
//
this.m_ContactColumn.Alignment = System.Windows.Forms.HorizontalAlignment.Center;
this.m_ContactColumn.Format = "";
this.m_ContactColumn.FormatInfo = null;
this.m_ContactColumn.HeaderText = "联系方式";
this.m_ContactColumn.MappingName = "contact";
this.m_ContactColumn.NullText = "";
this.m_ContactColumn.ReadOnly = true;
this.m_ContactColumn.Width = 75;
//
// m_RemarkColumn
//
this.m_RemarkColumn.Alignment = System.Windows.Forms.HorizontalAlignment.Center;
this.m_RemarkColumn.Format = "";
this.m_RemarkColumn.FormatInfo = null;
this.m_RemarkColumn.HeaderText = "备注";
this.m_RemarkColumn.MappingName = "remark";
this.m_RemarkColumn.NullText = "";
this.m_RemarkColumn.ReadOnly = true;
this.m_RemarkColumn.Width = 200;
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Top;
this.label1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.Location = new System.Drawing.Point(0, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(616, 24);
this.label1.TabIndex = 1;
this.label1.Text = "顾客列表:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.Location = new System.Drawing.Point(48, 24);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(48, 24);
this.label2.TabIndex = 2;
this.label2.Text = "姓名:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// m_NameText
//
this.m_NameText.Location = new System.Drawing.Point(104, 24);
this.m_NameText.Name = "m_NameText";
this.m_NameText.ReadOnly = true;
this.m_NameText.Size = new System.Drawing.Size(88, 21);
this.m_NameText.TabIndex = 0;
this.m_NameText.Text = "";
//
// label3
//
this.label3.Location = new System.Drawing.Point(240, 24);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(88, 24);
this.label3.TabIndex = 4;
this.label3.Text = "联系方式:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// m_ContactText
//
this.m_ContactText.Location = new System.Drawing.Point(320, 24);
this.m_ContactText.Name = "m_ContactText";
this.m_ContactText.ReadOnly = true;
this.m_ContactText.Size = new System.Drawing.Size(224, 21);
this.m_ContactText.TabIndex = 1;
this.m_ContactText.Text = "";
//
// label5
//
this.label5.AllowDrop = true;
this.label5.Location = new System.Drawing.Point(48, 56);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(48, 24);
this.label5.TabIndex = 8;
this.label5.Text = "备注:";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// m_AddButton
//
this.m_AddButton.Location = new System.Drawing.Point(40, 336);
this.m_AddButton.Name = "m_AddButton";
this.m_AddButton.Size = new System.Drawing.Size(80, 24);
this.m_AddButton.TabIndex = 1;
this.m_AddButton.Text = "添加";
this.m_AddButton.Click += new System.EventHandler(this.m_AddButton_Click);
//
// m_ModifyButton
//
this.m_ModifyButton.Location = new System.Drawing.Point(152, 336);
this.m_ModifyButton.Name = "m_ModifyButton";
this.m_ModifyButton.Size = new System.Drawing.Size(80, 24);
this.m_ModifyButton.TabIndex = 2;
this.m_ModifyButton.Text = "修改";
this.m_ModifyButton.Click += new System.EventHandler(this.m_ModifyButton_Click);
//
// m_DeleteButton
//
this.m_DeleteButton.Location = new System.Drawing.Point(264, 336);
this.m_DeleteButton.Name = "m_DeleteButton";
this.m_DeleteButton.Size = new System.Drawing.Size(80, 24);
this.m_DeleteButton.TabIndex = 3;
this.m_DeleteButton.Text = "删除";
this.m_DeleteButton.Click += new System.EventHandler(this.m_DeleteButton_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.m_RemarkText);
this.groupBox1.Controls.Add(this.m_ContactText);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.m_NameText);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Location = new System.Drawing.Point(0, 200);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(616, 128);
this.groupBox1.TabIndex = 18;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "顾客信息";
//
// m_RemarkText
//
this.m_RemarkText.Location = new System.Drawing.Point(104, 56);
this.m_RemarkText.Multiline = true;
this.m_RemarkText.Name = "m_RemarkText";
this.m_RemarkText.ReadOnly = true;
this.m_RemarkText.Size = new System.Drawing.Size(440, 64);
this.m_RemarkText.TabIndex = 2;
this.m_RemarkText.Text = "";
//
// m_CancelButton
//
this.m_CancelButton.Location = new System.Drawing.Point(488, 336);
this.m_CancelButton.Name = "m_CancelButton";
this.m_CancelButton.Size = new System.Drawing.Size(80, 24);
this.m_CancelButton.TabIndex = 5;
this.m_CancelButton.Text = "放弃";
this.m_CancelButton.Click += new System.EventHandler(this.m_CancelButton_Click);
//
// m_OKButton
//
this.m_OKButton.Location = new System.Drawing.Point(376, 336);
this.m_OKButton.Name = "m_OKButton";
this.m_OKButton.Size = new System.Drawing.Size(80, 24);
this.m_OKButton.TabIndex = 4;
this.m_OKButton.Text = "提交";
this.m_OKButton.Click += new System.EventHandler(this.m_OKButton_Click);
//
// CustomerManageForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(616, 366);
this.Controls.Add(this.m_CancelButton);
this.Controls.Add(this.m_OKButton);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.m_DeleteButton);
this.Controls.Add(this.m_ModifyButton);
this.Controls.Add(this.m_AddButton);
this.Controls.Add(this.label1);
this.Controls.Add(this.m_CustomerDataGrid);
this.Name = "CustomerManageForm";
this.Text = "顾客管理";
this.Load += new System.EventHandler(this.CustomerManageForm_Load);
((System.ComponentModel.ISupportInitialize)(this.m_CustomerDataGrid)).EndInit();
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void CustomerManageForm_Load(object sender, System.EventArgs e)
{
System.Data.DataTable dt = new System.Data.DataTable();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -