




已阅读5页,还剩45页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
此文档收集于网络,如有侵权,请联系网站删除using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace WindowsApplication1 public partial class Form_BuyAndSale : Form public Form_BuyAndSale() InitializeComponent(); SQL sql; string lastSQL = ; public void show() listBox1.Items.Clear(); listBox2.Items.Clear(); listBox3.Items.Clear(); if (sql.rows.GetLength(0) != 0) for (int i = 0; i + min + and saledate + min + and saledate + min + and saledate + min + and saledate int.Parse(Max.Text) MessageBox.Show(最小值应小于或等于最大值!, 提示); Min.Text = ; Max.Text = ; return; sql.ExecuteSQL(select * from ts_tushuxiaoshou where salequantity between + Min.Text + and + Max.Text); show(); lastSQL = select * from ts_tushuxiaoshou where salequantity between + Min.Text + and + Max.Text; private void button1_Click(object sender, EventArgs e) this.Close(); using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace WindowsApplication1 public partial class Form_Customer : Form public Form_Customer() InitializeComponent(); SQL sql; string oldcustomerID = ; public static string CUSTOMERID = ; public static string CUSTOMERNAME = ; public void show() if (sql.rows.GetLength(0) != 0) customerID.Text = sql.rowssql.getPos(), 0.ToString(); customername.Text = sql.rowssql.getPos(), 1.ToString(); customerinfo.Text = sql.rowssql.getPos(), 2.ToString(); customeraddress.Text = sql.rowssql.getPos(), 3.ToString(); customertelephone.Text = sql.rowssql.getPos(), 4.ToString(); customersex.Text = sql.rowssql.getPos(), 5.ToString(); customeremail.Text = sql.rowssql.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, EventArgs e) /将窗体的任务栏隐藏 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; sql = new SQL(Form_load .connectionString ); sql.ExecuteSQL(select * from ts_kehu order by customerID); show(); private void AddOrder_Click(object sender, EventArgs e) if (customerID.Text != ) Form_Customer_AddOrder child = new Form_Customer_AddOrder(); child.ShowDialog(); else MessageBox.Show(请先选择一个客户!, 提示); private void butAlter_Click(object sender, 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 ts_kehu 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 ts_kehudingdan 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, 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 (this.customeraddress.Text = ) MessageBox.Show(请输入完整信息!); else if (this.customeremail.Text = ) MessageBox.Show(请输入完整信息!); else if (this.customerID.Text = ) MessageBox.Show(请输入完整信息); else if (this.customerinfo.Text = ) MessageBox.Show(请输入完整信息!); else if (this.customername.Text = ) MessageBox.Show(请输入完整信息!); else if (this.customersex.Text = ) MessageBox.Show(请输入完整信息!); else if (sql.ExecuteSQL(insert into ts_kehu 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, EventArgs e) sql.ExecuteSQL(delete from ts_kehu where customerID= + customerID.Text + ); show(); private void butShowAll_Click(object sender, EventArgs e) sql.ExecuteSQL(select * from ts_kehu order by customerID); show(); private void butSearch_Click(object sender, EventArgs e) if (comboBox1.Text = 客户名称) if (comboBox2.Text = 精确) sql.ExecuteSQL(select * from ts_kehu where customername= + textForSearch.Text + order by customerID); show(); else sql.ExecuteSQL(select * from ts_kehu where customername like % + textForSearch.Text + % order by customerID); show(); else if (comboBox2.Text = 精确) sql.ExecuteSQL(select * from ts_kehu where customeremail= + textForSearch.Text + order by customerID); show(); else sql.ExecuteSQL(select * from ts_kehu where customeremail like % + textForSearch.Text + % order by customerID); show(); private void butFirst_Click(object sender, EventArgs e) sql.pointToFirst(); show(); private void butPrev_Click(object sender, EventArgs e) sql.pointToPrev(); show(); private void butNext_Click(object sender, EventArgs e) sql.pointToNext(); show(); private void butLast_Click(object sender, EventArgs e) sql.pointToLast(); show(); private void butLookOverOrders_Click(object sender, EventArgs e) Form_Customer_LookOverOrders child = new Form_Customer_LookOverOrders(); child.ShowDialog(); private void button1_Click(object sender, EventArgs e) this.Close(); using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace WindowsApplication1 public partial class Form_Customer : Form public Form_Customer() InitializeComponent(); SQL sql; string oldcustomerID = ; public static string CUSTOMERID = ; public static string CUSTOMERNAME = ; public void show() if (sql.rows.GetLength(0) != 0) customerID.Text = sql.rowssql.getPos(), 0.ToString(); customername.Text = sql.rowssql.getPos(), 1.ToString(); customerinfo.Text = sql.rowssql.getPos(), 2.ToString(); customeraddress.Text = sql.rowssql.getPos(), 3.ToString(); customertelephone.Text = sql.rowssql.getPos(), 4.ToString(); customersex.Text = sql.rowssql.getPos(), 5.ToString(); customeremail.Text = sql.rowssql.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, EventArgs e) /将窗体的任务栏隐藏 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; sql = new SQL(Form_load .connectionString ); sql.ExecuteSQL(select * from ts_kehu order by customerID); show(); private void AddOrder_Click(object sender, EventArgs e) if (customerID.Text != ) Form_Customer_AddOrder child = new Form_Customer_AddOrder(); child.ShowDialog(); else MessageBox.Show(请先选择一个客户!, 提示); private void butAlter_Click(obje
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 教师公开招聘试题及完整答案详解【历年真题】
- 注册核安全工程师复习提分资料含答案详解(B卷)
- 2024银行岗位能力检测试卷(名师系列)附答案详解
- 2025医院三基考试预测复习及答案详解1套
- 新经济形态下产教融合机制创新研究
- 夏热冬冷地区地源热泵耦合系统的专用性研究
- 施工质量控制体系优化与保障措施研究
- 数据化转型背景下企业管治创新研究
- 企业质量管理流程标准化研究
- 游程经济理论视角下畜牧企业经营资金配置研究
- 进制转换课件-2025-2026学年浙教版高中信息技术必修一
- 电厂电气安全知识培训课件
- 国际汉语考试题及答案
- 交友的智慧(课件)-2025-2026学年七年级道德与法治上册(统编版2024)
- 2025-2026学年语文二年级上册统编版语文园地一 课件
- 2025年中国航空油料集团招聘笔试模拟题与解析
- 人教版(2024)八年级上册英语Unit 3 Same or Different 教案
- 2025四川省水电投资经营集团有限公司所属电力公司员工招聘6人备考练习题库及答案解析
- 广东省深圳市福田区红岭实验学校(上沙)2025-2026学年八年级上学期开学考试英语试卷(含答案)
- 2025年适老化家居市场分析报告
- 社区宣传工作知识培训课件
评论
0/150
提交评论