版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、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 last
2、sql = ; 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(最小值應(yīng)小于或等于最大值!, 提示); min.text =
3、; 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();
4、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 oldcusto
5、merid = ; 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();
6、 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 =
7、; customeraddress.text = ; customertelephone.text = ; customersex.text = ; customeremail.text = ; messagebox.show(無符合查詢條件的結(jié)果!, 提示); customerid = customerid.text; customername = customername.text; private void form_customer_load(object sender, eventargs e) /將窗體的任務(wù)欄隱藏 this.formborderstyle = system.win
8、dows.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.showdia
9、log(); else messagebox.show(請先選擇一個(gè)客戶!, 提示); 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
10、; 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.ena
11、bled = 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.
12、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; customer
13、name = 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.enabl
14、ed = 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 = 添加)
15、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 = fals
16、e; 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.
17、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 = ) mes
18、sagebox.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 + , +
19、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.
20、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 = tru
21、e; 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
22、 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.e
23、xecutesql(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 wher
24、e 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) s
25、ql.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
26、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() initializeco
27、mponent(); 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 =
28、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 = ; custome
29、rname.text = ; customerinfo.text = ; customeraddress.text = ; customertelephone.text = ; customersex.text = ; customeremail.text = ; messagebox.show(無符合查詢條件的結(jié)果!, 提示); customerid = customerid.text; customername = customername.text; private void form_customer_load(object sender, eventargs e) /將窗體的任務(wù)欄隱
30、藏 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(請先選擇一個(gè)客戶!, 提示); private void butalter_click(object sender,
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- GB∕T13861-2022生產(chǎn)過程危險(xiǎn)和有害因素涵義解讀數(shù)據(jù)庫(雷澤佳編制2024B0)
- 確保一次性合格及創(chuàng)優(yōu)措施
- 2024年無極縣一級(jí)造價(jià)工程師《土建計(jì)量》高分沖刺試題含解析
- 2025年《滬科版2020上海高二物理必修第三冊》10.4多用電表(作業(yè))(解析版)
- 年月日教案人教版三年級(jí)下冊數(shù)學(xué)
- 1 小蝌蚪找媽媽 教學(xué)設(shè)計(jì)-2024-2025學(xué)年語文二年級(jí)上冊統(tǒng)編版
- Revision Lesson 2(教案)-2024-2025學(xué)年人教PEP版(2024)英語三年級(jí)上冊
- 高中語文 統(tǒng)編版 必修上冊 第六單元 10《勸學(xué)》《師說》比較閱讀-聞先師之言悟?qū)W習(xí)之道(二)教學(xué)設(shè)計(jì)
- 2024高考化學(xué)一輪復(fù)習(xí)第八章水溶液中的離子反應(yīng)與平衡第25講水的電離和溶液的pH課時(shí)作業(yè)含解析
- 2024-2025學(xué)年新教材高中化學(xué)第五章化工生產(chǎn)中的重要非金屬元素第二節(jié)第1課時(shí)氮?dú)馀c氮的固定一氧化氮和二氧化氮課時(shí)作業(yè)含解析新人教版必修2
- 院感培訓(xùn)心得匯報(bào)
- 人工智能算力中心平臺(tái)建設(shè)及運(yùn)營項(xiàng)目可行性研究報(bào)告
- 寶來汽車使用說明書
- 一汽-大眾供應(yīng)商管理流程介紹.sbx
- 2024春期國開電大專科《政治學(xué)原理》在線形考(形考任務(wù)一至四)試題及答案
- 海上救助與搜救
- 公務(wù)員三季度個(gè)人工作小結(jié)【6篇】
- 招投標(biāo)代理掛靠協(xié)議書
- 消防安全評(píng)估消防安全評(píng)估方案
- 定窯、邢窯和鞏義窯部分白瓷的成分分析及比較研究
- 殘聯(lián)業(yè)務(wù)知識(shí)培訓(xùn)課件
評(píng)論
0/150
提交評(píng)論