Form_Customer.cs
上传用户:chinapurv
上传日期:2014-03-12
资源大小:4870k
文件大小:23k
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- namespace 图书管理系统
- {
- /// <summary>
- /// Form_Customer 的摘要说明。
- /// </summary>
- public class Form_Customer : System.Windows.Forms.Form
- {
- private System.Windows.Forms.TextBox customeremail;
- private System.Windows.Forms.TextBox customersex;
- private System.Windows.Forms.TextBox customertelephone;
- private System.Windows.Forms.TextBox customeraddress;
- private System.Windows.Forms.TextBox customerinfo;
- private System.Windows.Forms.Label label5;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.TextBox customername;
- private System.Windows.Forms.TextBox customerID;
- private System.Windows.Forms.Label label7;
- private System.Windows.Forms.Label label8;
- private System.Windows.Forms.ComboBox comboBox2;
- private System.Windows.Forms.Button butSearch;
- private System.Windows.Forms.ComboBox comboBox1;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.Button butLast;
- private System.Windows.Forms.Button butFirst;
- private System.Windows.Forms.Button butNext;
- private System.Windows.Forms.Button butPrev;
- private System.Windows.Forms.Button butDelete;
- private System.Windows.Forms.Button butAdd;
- private System.Windows.Forms.Button butAlter;
- private System.Windows.Forms.Button AddOrder;
- private System.Windows.Forms.Button butLookOverOrders;
- private System.Windows.Forms.TextBox textForSearch;
- private System.Windows.Forms.Button butShowAll;
- /// <summary>
- /// 必需的设计器变量。
- /// </summary>
- private System.ComponentModel.Container components = null;
- public Form_Customer()
- {
- //
- // 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()
- {
- System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form_Customer));
- this.customeremail = new System.Windows.Forms.TextBox();
- this.customersex = new System.Windows.Forms.TextBox();
- this.customertelephone = new System.Windows.Forms.TextBox();
- this.customeraddress = new System.Windows.Forms.TextBox();
- this.customerinfo = new System.Windows.Forms.TextBox();
- this.label5 = new System.Windows.Forms.Label();
- this.label4 = 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.AddOrder = new System.Windows.Forms.Button();
- this.butLookOverOrders = new System.Windows.Forms.Button();
- this.customername = new System.Windows.Forms.TextBox();
- this.customerID = new System.Windows.Forms.TextBox();
- this.label7 = new System.Windows.Forms.Label();
- this.label8 = new System.Windows.Forms.Label();
- this.comboBox2 = new System.Windows.Forms.ComboBox();
- this.textForSearch = new System.Windows.Forms.TextBox();
- this.butSearch = new System.Windows.Forms.Button();
- this.comboBox1 = new System.Windows.Forms.ComboBox();
- this.label6 = new System.Windows.Forms.Label();
- this.butLast = new System.Windows.Forms.Button();
- this.butFirst = new System.Windows.Forms.Button();
- this.butNext = new System.Windows.Forms.Button();
- this.butPrev = new System.Windows.Forms.Button();
- this.butDelete = new System.Windows.Forms.Button();
- this.butAdd = new System.Windows.Forms.Button();
- this.butAlter = new System.Windows.Forms.Button();
- this.butShowAll = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // customeremail
- //
- this.customeremail.Location = new System.Drawing.Point(177, 216);
- this.customeremail.Name = "customeremail";
- this.customeremail.ReadOnly = true;
- this.customeremail.Size = new System.Drawing.Size(216, 21);
- this.customeremail.TabIndex = 23;
- this.customeremail.Text = "customere-mail";
- //
- // customersex
- //
- this.customersex.Location = new System.Drawing.Point(177, 184);
- this.customersex.Name = "customersex";
- this.customersex.ReadOnly = true;
- this.customersex.Size = new System.Drawing.Size(216, 21);
- this.customersex.TabIndex = 22;
- this.customersex.Text = "customersex";
- //
- // customertelephone
- //
- this.customertelephone.Location = new System.Drawing.Point(177, 152);
- this.customertelephone.Name = "customertelephone";
- this.customertelephone.ReadOnly = true;
- this.customertelephone.Size = new System.Drawing.Size(216, 21);
- this.customertelephone.TabIndex = 21;
- this.customertelephone.Text = "customertelephone";
- //
- // customeraddress
- //
- this.customeraddress.Location = new System.Drawing.Point(177, 120);
- this.customeraddress.Name = "customeraddress";
- this.customeraddress.ReadOnly = true;
- this.customeraddress.Size = new System.Drawing.Size(216, 21);
- this.customeraddress.TabIndex = 20;
- this.customeraddress.Text = "customeraddress";
- //
- // customerinfo
- //
- this.customerinfo.Location = new System.Drawing.Point(177, 88);
- this.customerinfo.Name = "customerinfo";
- this.customerinfo.ReadOnly = true;
- this.customerinfo.Size = new System.Drawing.Size(216, 21);
- this.customerinfo.TabIndex = 19;
- this.customerinfo.Text = "customerinfo";
- //
- // label5
- //
- this.label5.BackColor = System.Drawing.Color.Transparent;
- this.label5.Location = new System.Drawing.Point(80, 216);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(65, 16);
- this.label5.TabIndex = 17;
- this.label5.Text = "E-mail";
- //
- // label4
- //
- this.label4.BackColor = System.Drawing.Color.Transparent;
- this.label4.Location = new System.Drawing.Point(80, 184);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(65, 16);
- this.label4.TabIndex = 16;
- this.label4.Text = "客户性别";
- //
- // label3
- //
- this.label3.BackColor = System.Drawing.Color.Transparent;
- this.label3.Location = new System.Drawing.Point(80, 152);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(65, 16);
- this.label3.TabIndex = 15;
- this.label3.Text = "联系电话";
- //
- // label2
- //
- this.label2.BackColor = System.Drawing.Color.Transparent;
- this.label2.Location = new System.Drawing.Point(80, 120);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(65, 16);
- this.label2.TabIndex = 14;
- this.label2.Text = "客户地址";
- //
- // label1
- //
- this.label1.BackColor = System.Drawing.Color.Transparent;
- this.label1.Location = new System.Drawing.Point(80, 88);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(65, 16);
- this.label1.TabIndex = 13;
- this.label1.Text = "客户信息";
- //
- // AddOrder
- //
- this.AddOrder.BackColor = System.Drawing.Color.Transparent;
- this.AddOrder.Location = new System.Drawing.Point(108, 272);
- this.AddOrder.Name = "AddOrder";
- this.AddOrder.Size = new System.Drawing.Size(64, 24);
- this.AddOrder.TabIndex = 26;
- this.AddOrder.Text = "添加订单";
- this.AddOrder.Click += new System.EventHandler(this.AddOrder_Click);
- //
- // butLookOverOrders
- //
- this.butLookOverOrders.BackColor = System.Drawing.Color.Transparent;
- this.butLookOverOrders.Location = new System.Drawing.Point(44, 272);
- this.butLookOverOrders.Name = "butLookOverOrders";
- this.butLookOverOrders.Size = new System.Drawing.Size(64, 24);
- this.butLookOverOrders.TabIndex = 25;
- this.butLookOverOrders.Text = "查看定单";
- this.butLookOverOrders.Click += new System.EventHandler(this.butLookOverOrders_Click);
- //
- // customername
- //
- this.customername.Location = new System.Drawing.Point(177, 56);
- this.customername.Name = "customername";
- this.customername.ReadOnly = true;
- this.customername.Size = new System.Drawing.Size(216, 21);
- this.customername.TabIndex = 33;
- this.customername.Text = "customername";
- //
- // customerID
- //
- this.customerID.Location = new System.Drawing.Point(177, 24);
- this.customerID.Name = "customerID";
- this.customerID.ReadOnly = true;
- this.customerID.Size = new System.Drawing.Size(216, 21);
- this.customerID.TabIndex = 32;
- this.customerID.Text = "customerID";
- //
- // label7
- //
- this.label7.BackColor = System.Drawing.Color.Transparent;
- this.label7.Location = new System.Drawing.Point(80, 56);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(65, 16);
- this.label7.TabIndex = 31;
- this.label7.Text = "客户名称";
- //
- // label8
- //
- this.label8.BackColor = System.Drawing.Color.Transparent;
- this.label8.Location = new System.Drawing.Point(80, 24);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(65, 16);
- this.label8.TabIndex = 30;
- this.label8.Text = "客户ID";
- //
- // comboBox2
- //
- this.comboBox2.Items.AddRange(new object[] {
- "模糊",
- "精确"});
- this.comboBox2.Location = new System.Drawing.Point(188, 312);
- this.comboBox2.MaxDropDownItems = 2;
- this.comboBox2.Name = "comboBox2";
- this.comboBox2.Size = new System.Drawing.Size(48, 20);
- this.comboBox2.TabIndex = 38;
- this.comboBox2.Text = "模糊";
- //
- // textForSearch
- //
- this.textForSearch.Location = new System.Drawing.Point(252, 312);
- this.textForSearch.Name = "textForSearch";
- this.textForSearch.Size = new System.Drawing.Size(96, 21);
- this.textForSearch.TabIndex = 37;
- this.textForSearch.Text = "";
- //
- // butSearch
- //
- this.butSearch.BackColor = System.Drawing.Color.Transparent;
- this.butSearch.Location = new System.Drawing.Point(364, 312);
- this.butSearch.Name = "butSearch";
- this.butSearch.Size = new System.Drawing.Size(64, 24);
- this.butSearch.TabIndex = 36;
- this.butSearch.Text = "查找客户";
- this.butSearch.Click += new System.EventHandler(this.butSearch_Click);
- //
- // comboBox1
- //
- this.comboBox1.Items.AddRange(new object[] {
- "客户名称",
- "E-mail"});
- this.comboBox1.Location = new System.Drawing.Point(100, 312);
- this.comboBox1.MaxDropDownItems = 2;
- this.comboBox1.Name = "comboBox1";
- this.comboBox1.Size = new System.Drawing.Size(80, 20);
- this.comboBox1.TabIndex = 35;
- this.comboBox1.Text = "客户名称";
- //
- // label6
- //
- this.label6.BackColor = System.Drawing.Color.Transparent;
- this.label6.Location = new System.Drawing.Point(44, 312);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(56, 16);
- this.label6.TabIndex = 34;
- this.label6.Text = "查找方式";
- //
- // butLast
- //
- this.butLast.BackColor = System.Drawing.Color.Transparent;
- this.butLast.Location = new System.Drawing.Point(292, 344);
- this.butLast.Name = "butLast";
- this.butLast.Size = new System.Drawing.Size(56, 24);
- this.butLast.TabIndex = 42;
- this.butLast.Text = ">|";
- this.butLast.Click += new System.EventHandler(this.butLast_Click);
- //
- // butFirst
- //
- this.butFirst.BackColor = System.Drawing.Color.Transparent;
- this.butFirst.Location = new System.Drawing.Point(124, 344);
- this.butFirst.Name = "butFirst";
- this.butFirst.Size = new System.Drawing.Size(56, 24);
- this.butFirst.TabIndex = 41;
- this.butFirst.Text = "|<";
- this.butFirst.Click += new System.EventHandler(this.butFirst_Click);
- //
- // butNext
- //
- this.butNext.BackColor = System.Drawing.Color.Transparent;
- this.butNext.Location = new System.Drawing.Point(236, 344);
- this.butNext.Name = "butNext";
- this.butNext.Size = new System.Drawing.Size(56, 24);
- this.butNext.TabIndex = 40;
- this.butNext.Text = ">";
- this.butNext.Click += new System.EventHandler(this.butNext_Click);
- //
- // butPrev
- //
- this.butPrev.BackColor = System.Drawing.Color.Transparent;
- this.butPrev.Location = new System.Drawing.Point(180, 344);
- this.butPrev.Name = "butPrev";
- this.butPrev.Size = new System.Drawing.Size(56, 24);
- this.butPrev.TabIndex = 39;
- this.butPrev.Text = "<";
- this.butPrev.Click += new System.EventHandler(this.butPrev_Click);
- //
- // butDelete
- //
- this.butDelete.BackColor = System.Drawing.Color.Transparent;
- this.butDelete.Location = new System.Drawing.Point(300, 272);
- this.butDelete.Name = "butDelete";
- this.butDelete.Size = new System.Drawing.Size(64, 24);
- this.butDelete.TabIndex = 48;
- this.butDelete.Text = "删除";
- this.butDelete.Click += new System.EventHandler(this.butDelete_Click);
- //
- // butAdd
- //
- this.butAdd.BackColor = System.Drawing.Color.Transparent;
- this.butAdd.Location = new System.Drawing.Point(236, 272);
- this.butAdd.Name = "butAdd";
- this.butAdd.Size = new System.Drawing.Size(64, 24);
- this.butAdd.TabIndex = 47;
- this.butAdd.Text = "添加";
- this.butAdd.Click += new System.EventHandler(this.butAdd_Click);
- //
- // butAlter
- //
- this.butAlter.BackColor = System.Drawing.Color.Transparent;
- this.butAlter.Location = new System.Drawing.Point(172, 272);
- this.butAlter.Name = "butAlter";
- this.butAlter.Size = new System.Drawing.Size(64, 24);
- this.butAlter.TabIndex = 46;
- this.butAlter.Text = "修改";
- this.butAlter.Click += new System.EventHandler(this.butAlter_Click);
- //
- // butShowAll
- //
- this.butShowAll.BackColor = System.Drawing.Color.Transparent;
- this.butShowAll.Location = new System.Drawing.Point(364, 272);
- this.butShowAll.Name = "butShowAll";
- this.butShowAll.Size = new System.Drawing.Size(64, 24);
- this.butShowAll.TabIndex = 49;
- this.butShowAll.Text = "全部显示";
- this.butShowAll.Click += new System.EventHandler(this.butShowAll_Click);
- //
- // Form_Customer
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
- this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
- this.ClientSize = new System.Drawing.Size(472, 382);
- this.ControlBox = false;
- this.Controls.Add(this.butShowAll);
- this.Controls.Add(this.butDelete);
- this.Controls.Add(this.butAdd);
- this.Controls.Add(this.butAlter);
- this.Controls.Add(this.butLast);
- this.Controls.Add(this.butFirst);
- this.Controls.Add(this.butNext);
- this.Controls.Add(this.butPrev);
- this.Controls.Add(this.comboBox2);
- this.Controls.Add(this.textForSearch);
- this.Controls.Add(this.customername);
- this.Controls.Add(this.customerID);
- this.Controls.Add(this.customeremail);
- this.Controls.Add(this.customersex);
- this.Controls.Add(this.customertelephone);
- this.Controls.Add(this.customeraddress);
- this.Controls.Add(this.customerinfo);
- this.Controls.Add(this.butSearch);
- this.Controls.Add(this.comboBox1);
- this.Controls.Add(this.label6);
- this.Controls.Add(this.label7);
- this.Controls.Add(this.label8);
- this.Controls.Add(this.AddOrder);
- this.Controls.Add(this.butLookOverOrders);
- this.Controls.Add(this.label5);
- this.Controls.Add(this.label4);
- this.Controls.Add(this.label3);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.label1);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
- this.Name = "Form_Customer";
- this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
- this.Text = "Form_Customer";
- this.Load += new System.EventHandler(this.Form_Customer_Load);
- this.ResumeLayout(false);
- }
- #endregion
- SQL sql;
- string oldcustomerID="";
- public static string CUSTOMERID="";
- public static string CUSTOMERNAME="";
- private void butLookOverOrders_Click(object sender, System.EventArgs e)
- {
- Form_Customer_LookOverOrders child=new Form_Customer_LookOverOrders();
- child.ShowDialog();
- }
- private void AddOrder_Click(object sender, System.EventArgs e)
- {
- if(customerID.Text!="")
- {
- Form_Customer_AddOrder child=new Form_Customer_AddOrder();
- child.ShowDialog();
- }
- else
- {
- MessageBox.Show("请先选择一个客户!","提示");
- }
- }
- public void show()
- {
- if(sql.rows.GetLength(0)!=0)
- {
- customerID.Text=sql.rows[sql.getPos(),0].ToString();
- customername.Text=sql.rows[sql.getPos(),1].ToString();
- customerinfo.Text=sql.rows[sql.getPos(),2].ToString();
- customeraddress.Text=sql.rows[sql.getPos(),3].ToString();
- customertelephone.Text=sql.rows[sql.getPos(),4].ToString();
- customersex.Text=sql.rows[sql.getPos(),5].ToString();
- customeremail.Text=sql.rows[sql.getPos(),6].ToString();
- }
- else
- {
- customerID.Text="";
- customername.Text="";
- customerinfo.Text="";
- customeraddress.Text="";
- customertelephone.Text="";
- customersex.Text="";
- customeremail.Text="";
- MessageBox.Show("无符合查询条件的结果!","提示");
- }
- CUSTOMERID=customerID.Text;
- CUSTOMERNAME=customername.Text;
- }
- private void Form_Customer_Load(object sender, System.EventArgs e)
- {
- sql=new SQL("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=图书管理系统数据库.mdb");
- sql.ExecuteSQL("select * from 客户信息表 order by customerID");
- show();
- }
- private void butFirst_Click(object sender, System.EventArgs e)
- {
- sql.pointToFirst();
- show();
- }
- private void butPrev_Click(object sender, System.EventArgs e)
- {
- sql.pointToPrev();
- show();
- }
- private void butNext_Click(object sender, System.EventArgs e)
- {
- sql.pointToNext();
- show();
- }
- private void butLast_Click(object sender, System.EventArgs e)
- {
- sql.pointToLast();
- show();
- }
- private void butAlter_Click(object sender, System.EventArgs e)
- {
- if(butAlter.Text=="修改")
- {
- butAlter.Text="更新";
- oldcustomerID=customerID.Text;
- customerID.ReadOnly=false;
- customername.ReadOnly=false;
- customerinfo.ReadOnly=false;
- customeraddress.ReadOnly=false;
- customertelephone.ReadOnly=false;
- customersex.ReadOnly=false;
- customeremail.ReadOnly=false;
- butAdd.Enabled=false;
- butDelete.Enabled=false;
- butFirst.Enabled=false;
- butPrev.Enabled=false;
- butNext.Enabled=false;
- butLast.Enabled=false;
- butSearch.Enabled=false;
- butLookOverOrders.Enabled=false;
- butShowAll.Enabled=false;
- AddOrder.Enabled=false;
- }
- else
- {
- if(sql.ExecuteSQL("update 客户信息表 set customerID='"+customerID.Text
- +"',customername='"+customername.Text
- +"',customerinfo='"+customerinfo.Text
- +"',customeraddress='"+customeraddress.Text
- +"',customertelephone='"+customertelephone.Text
- +"',customersex='"+customersex.Text
- +"',customeremail='"+customeremail.Text+"' where customerID='"+oldcustomerID+"'")
- ==false||
- sql.ExecuteSQL("update 客户订单信息表 set customerID='"+customerID.Text
- +"' where customerID='"+oldcustomerID+"'")
- ==false)
- {
- show();
- }
- else
- {
- CUSTOMERID=customerID.Text;
- CUSTOMERNAME=customername.Text;
- }
- customerID.ReadOnly=true;
- customername.ReadOnly=true;
- customerinfo.ReadOnly=true;
- customeraddress.ReadOnly=true;
- customertelephone.ReadOnly=true;
- customersex.ReadOnly=true;
- customeremail.ReadOnly=true;
- butAlter.Text="修改";
- butAdd.Enabled=true;
- butDelete.Enabled=true;
- butFirst.Enabled=true;
- butPrev.Enabled=true;
- butNext.Enabled=true;
- butLast.Enabled=true;
- butSearch.Enabled=true;
- butLookOverOrders.Enabled=true;
- AddOrder.Enabled=true;
- butShowAll.Enabled=true;
- }
- }
- private void butAdd_Click(object sender, System.EventArgs e)
- {
- try
- {
- if(butAdd.Text=="添加")
- {
- butAdd.Text="提交";
- customerID.Text="";
- customername.Text="";
- customerinfo.Text="";
- customeraddress.Text="";
- customertelephone.Text="";
- customersex.Text="";
- customeremail.Text="";
- customerID.ReadOnly=false;
- customername.ReadOnly=false;
- customerinfo.ReadOnly=false;
- customeraddress.ReadOnly=false;
- customertelephone.ReadOnly=false;
- customersex.ReadOnly=false;
- customeremail.ReadOnly=false;
- butAlter.Enabled=false;
- butDelete.Enabled=false;
- butFirst.Enabled=false;
- butPrev.Enabled=false;
- butNext.Enabled=false;
- butLast.Enabled=false;
- butSearch.Enabled=false;
- butLookOverOrders.Enabled=false;
- AddOrder.Enabled=false;
- butShowAll.Enabled=false;
- }
- else
- {
- if(sql.ExecuteSQL("insert into 客户信息表 values('"
- +customerID.Text+"','"+customername.Text+"','"+customerinfo.Text+"','"
- +customeraddress.Text+"','"+customertelephone.Text+"','"
- +customersex.Text+"','"+customeremail.Text+"')")
- ==false)
- {
- show();
- }
- else
- {
- CUSTOMERID=customerID.Text;
- CUSTOMERNAME=customername.Text;
- }
- customerID.ReadOnly=true;
- customername.ReadOnly=true;
- customerinfo.ReadOnly=true;
- customeraddress.ReadOnly=true;
- customertelephone.ReadOnly=true;
- customersex.ReadOnly=true;
- customeremail.ReadOnly=true;
- butAdd.Text="添加";
- butAlter.Enabled=true;
- butDelete.Enabled=true;
- butFirst.Enabled=true;
- butPrev.Enabled=true;
- butNext.Enabled=true;
- butLast.Enabled=true;
- butSearch.Enabled=true;
- butLookOverOrders.Enabled=true;
- AddOrder.Enabled=true;
- butShowAll.Enabled=true;
- }
- }
- catch(Exception e1)
- {
- MessageBox.Show(e1.Message);
- }
- }
- private void butDelete_Click(object sender, System.EventArgs e)
- {
- sql.ExecuteSQL("delete from 客户信息表 where customerID='"+customerID.Text+"'");
- show();
- }
- private void butSearch_Click(object sender, System.EventArgs e)
- {
- if(comboBox1.Text=="客户名称")
- {
- if(comboBox2.Text=="精确")
- {
- sql.ExecuteSQL("select * from 客户信息表 where customername='"+textForSearch.Text+"' order by customerID");
- show();
- }
- else
- {
- sql.ExecuteSQL("select * from 客户信息表 where customername like '%"+textForSearch.Text+"%' order by customerID");
- show();
- }
- }
- else
- {
- if(comboBox2.Text=="精确")
- {
- sql.ExecuteSQL("select * from 客户信息表 where customeremail='"+textForSearch.Text+"' order by customerID");
- show();
- }
- else
- {
- sql.ExecuteSQL("select * from 客户信息表 where customeremail like '%"+textForSearch.Text+"%' order by customerID");
- show();
- }
- }
- }
- private void butShowAll_Click(object sender, System.EventArgs e)
- {
- sql.ExecuteSQL("select * from 客户信息表 order by customerID");
- show();
- }
- }
- }