圖書管理系統(tǒng)C++源代碼_第1頁
圖書管理系統(tǒng)C++源代碼_第2頁
圖書管理系統(tǒng)C++源代碼_第3頁
圖書管理系統(tǒng)C++源代碼_第4頁
圖書管理系統(tǒng)C++源代碼_第5頁
已閱讀5頁,還剩45頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(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ì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論