版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、專科生畢業(yè)論文(設(shè)計(jì))題 目: 圖書綜合管理系統(tǒng) 學(xué)生姓名: 尹 良 英 學(xué) 號(hào): 200316200126 指導(dǎo)教師: 黃 鐵 專業(yè)班級(jí): 計(jì)算機(jī)信息管理03202班 完成時(shí)間: 2006年6月 摘 要3關(guān)鍵詞3第一章 系統(tǒng)需求分析41.1圖書管理系統(tǒng)的功能要求41.2 圖書管理系統(tǒng)的性能需求41.3圖書管理系統(tǒng)的數(shù)據(jù)需求51.4 圖書管理系統(tǒng)的功能分析模塊:5第二章 系統(tǒng)詳細(xì)設(shè)計(jì)72.1主窗體設(shè)計(jì)72.1.1 程序相關(guān)代碼72.2菜單設(shè)計(jì)72.2.1設(shè)計(jì)步驟72.3數(shù)據(jù)模塊設(shè)計(jì)82.4主要功能模塊設(shè)計(jì)112.4.1 系統(tǒng)登錄模塊設(shè)計(jì)112.4.2 程序相關(guān)代碼:122.5圖書信息管理模塊設(shè)
2、計(jì)142.5.1程序相關(guān)代碼152.6圖書借閱與歸還模塊設(shè)計(jì)342.7操作員管理模塊設(shè)計(jì)34第三章 數(shù)據(jù)庫(kù)設(shè)計(jì)363.1 創(chuàng)建數(shù)據(jù)庫(kù)363.2 創(chuàng)建數(shù)據(jù)表373.3 創(chuàng)建觸發(fā)器38第四章 office web component的應(yīng)用404.1 office web component使用40第五章 系統(tǒng)總結(jié)415.1圖書種類的樹型結(jié)構(gòu)415.2 窗體最大最小尺寸限制415.3 Ttree view組件的應(yīng)用41第六章 結(jié)束語43致謝44參考文獻(xiàn):45圖書綜合管理系統(tǒng)摘 要: 本系統(tǒng)采用c/s結(jié)構(gòu),是根據(jù)國(guó)內(nèi)圖書批發(fā),銷售領(lǐng)域的業(yè)務(wù)流程和特點(diǎn),在綜合了很多書店管理系統(tǒng)的基礎(chǔ)上開發(fā)的業(yè)務(wù)管理軟件
3、。其內(nèi)容涵概了圖書流通領(lǐng)域的各個(gè)環(huán)節(jié),實(shí)用于各類中小型書店、圖書賣場(chǎng)及圖書批發(fā)企業(yè)。圖書信息管理系統(tǒng)設(shè)計(jì)采用了信息管理系統(tǒng)完整實(shí)用的開發(fā)方法,系統(tǒng)的最大特點(diǎn)是突出了實(shí)用和實(shí)效性,緊密結(jié)合用戶的使用要求,設(shè)計(jì)界面新穎,操作方便。 關(guān)鍵詞: c/s結(jié)構(gòu) office web component組件English summary:This system adoption c/s structure, wholesale according to the local book, sale realm of business process and characteristics, develop in
4、 synthesizing a lot of bookstore a management system of foundation of business management software.Its contents 涵 all the book circulate realm of each link, practical wholesale a business enterprise in the small scaled bookstore, book selling exhibition and the book in every variety.The management s
5、ystem design of the book information adopted an information a management the system complete practical development method, the biggest characteristics of system was outstanding practical with real results, close combine the usage request of customer, design interface novel, operate convenience.Keywo
6、rd: C/s structure office web component module第一章 系統(tǒng)需求分析1.1圖書管理系統(tǒng)的功能要求管理系統(tǒng)的總目標(biāo)是:在計(jì)算機(jī)網(wǎng)絡(luò),數(shù)據(jù)庫(kù)和先進(jìn)的開發(fā)平臺(tái)上,利用現(xiàn)有的軟件,配置一定的硬件,開發(fā)一個(gè)具有開放體系結(jié)構(gòu)的、易擴(kuò)充的、易維護(hù)的、具有良好人機(jī)交互界面的管理系統(tǒng),實(shí)現(xiàn)自動(dòng)化的計(jì)算機(jī)管理系統(tǒng), 1.2 圖書管理系統(tǒng)的性能需求為了保證系統(tǒng)能夠長(zhǎng)期、安全、穩(wěn)定、可靠、高效的運(yùn)行,檔案管理系統(tǒng)應(yīng)該滿足以下的性能需求:1 系統(tǒng)處理的準(zhǔn)確性和及時(shí)性系統(tǒng)處理的準(zhǔn)確性和及時(shí)性是系統(tǒng)的必要性能。在系統(tǒng)設(shè)計(jì)和開發(fā)過程中,要充分考慮系統(tǒng)當(dāng)前和將來可能承受的工作量,使系統(tǒng)
7、的處理能力和響應(yīng)時(shí)間能夠滿足對(duì)信息處理的需求。2 系統(tǒng)的開放性和系統(tǒng)的可擴(kuò)充性管理系統(tǒng)在開發(fā)過程中,應(yīng)該充分考慮以后的可擴(kuò)充性。例如用戶查詢的需求也會(huì)不斷的更新和完善。所有這些,都要求系統(tǒng)提供足夠的手段進(jìn)行功能的調(diào)整和擴(kuò)充。而要實(shí)現(xiàn)這一點(diǎn),應(yīng)通過系統(tǒng)的開放性來完成,既系統(tǒng)應(yīng)是一個(gè)開放系統(tǒng),只要符合一定的規(guī)范,可以簡(jiǎn)單的加入和減少系統(tǒng)的模塊,配置系統(tǒng)的硬件。通過軟件的修補(bǔ)、替換完成系統(tǒng)的升級(jí)和更新?lián)Q代。3 系統(tǒng)的易用性和易維護(hù)性管理系統(tǒng)是直接面對(duì)使用人員的,而使用人員往往對(duì)計(jì)算機(jī)并不時(shí)非常熟悉。這就要求系統(tǒng)能夠提供良好的用戶接口,易用的人機(jī)交互界面。要實(shí)現(xiàn)這一點(diǎn),就要求系統(tǒng)應(yīng)該盡量使用用戶熟悉的
8、術(shù)語和中文信息的界面;針對(duì)用戶可能出現(xiàn)的使用問題,要提供足夠的在線幫助,縮短用戶對(duì)系統(tǒng)熟悉的過程。管理系統(tǒng)中涉及到的數(shù)據(jù)是相當(dāng)重要的信息,系統(tǒng)要提供方便的手段供系統(tǒng)維護(hù)人員進(jìn)行數(shù)據(jù)的備份,日常的安全管理,系統(tǒng)意外崩潰時(shí)數(shù)據(jù)的恢復(fù)等工作。4 系統(tǒng)的標(biāo)準(zhǔn)性系統(tǒng)在設(shè)計(jì)開發(fā)使用過程中都要涉及到很多計(jì)算機(jī)硬件、軟件。所有這些都要符合主流國(guó)際、國(guó)家和行業(yè)標(biāo)準(zhǔn)。例如在開發(fā)中使用的操作系統(tǒng)、網(wǎng)絡(luò)系統(tǒng)、開發(fā)工具都必須符合通用標(biāo)準(zhǔn)。如規(guī)范的數(shù)據(jù)庫(kù)操縱界面、作為業(yè)界標(biāo)準(zhǔn)的TCP/IP網(wǎng)絡(luò)協(xié)議及ISO9002標(biāo)準(zhǔn)所要求的質(zhì)量規(guī)范等;同時(shí),在自主開發(fā)本系統(tǒng)時(shí),要進(jìn)行良好的設(shè)計(jì)工作,制訂行之有效的軟件工程規(guī)范,保證代碼的
9、易讀性、可操作性和可移植性。5系統(tǒng)的響應(yīng)速度 管理系統(tǒng)系統(tǒng)在日常處理中的響應(yīng)速度為秒級(jí),達(dá)到實(shí)時(shí)要求,以及時(shí) 反饋信息。在進(jìn)行統(tǒng)計(jì)分析時(shí),根據(jù)所需數(shù)據(jù)量的不同而從秒級(jí)到分鐘級(jí), 原則是保證操作人員不會(huì)因?yàn)樗俣葐栴}而影響工作效率。1.3圖書管理系統(tǒng)的數(shù)據(jù)需求管理系統(tǒng)的數(shù)據(jù)需求包括如下幾點(diǎn):1 數(shù)據(jù)錄入和處理的準(zhǔn)確性和實(shí)時(shí)性數(shù)據(jù)的輸入是否準(zhǔn)確是數(shù)據(jù)處理的前提,錯(cuò)誤的輸入會(huì)導(dǎo)致系統(tǒng)輸出的不正確和不可用,從而使系統(tǒng)的工作失去意義。數(shù)據(jù)的輸入來源是手工輸入。手工輸入要通過系統(tǒng)界面上的安排系統(tǒng)具有容錯(cuò)性,并且對(duì)操作人員要進(jìn)行系統(tǒng)的培訓(xùn)。在系統(tǒng)中,數(shù)據(jù)的輸入往往是大量的,因此系統(tǒng)要有一定的處理能力,以保證迅
10、速的處理數(shù)據(jù)。2 數(shù)據(jù)的一致性與完整性由于系統(tǒng)的數(shù)據(jù)是共享的,在不同的客戶端中,檔案文件是共享數(shù)據(jù),所以如何保證這些數(shù)據(jù)的一致性,是系統(tǒng)必須解決的問題。要解決這一問題,要有一定的人員維護(hù)數(shù)據(jù)的一致性,在數(shù)據(jù)錄入處控制數(shù)據(jù)的去向,并且要求對(duì)數(shù)據(jù)庫(kù)的數(shù)據(jù)完整性進(jìn)行嚴(yán)格的約束。對(duì)于輸入的數(shù)據(jù),要為其定義完整性規(guī)則,如果不能符合完整性約束,系統(tǒng)應(yīng)該拒絕該數(shù)據(jù)。1.4 圖書管理系統(tǒng)的功能分析模塊:圖書綜合管理系統(tǒng)退出幫 助分析總結(jié)借閱管理進(jìn)銷存管理基礎(chǔ)信息退 出 系 統(tǒng)重 新 登 錄關(guān) 于銷 售 分 析借 閱 分 析庫(kù) 存 分 析查 詢 歸 還借 閱查 詢?nèi)?庫(kù)書證管理圖書信息管理圖書種類管理 第二章
11、系統(tǒng)詳細(xì)設(shè)計(jì)2.1主窗體設(shè)計(jì)(1) 新建一個(gè)工程,工程名稱為“bookmanager”,工程會(huì)自動(dòng)創(chuàng)建一個(gè)窗口,默認(rèn)主窗口,將該窗口命名為“main”。(2) 設(shè)置main窗口的caption屬性為“圖書綜合管理系統(tǒng)”。(3) 設(shè)置main窗口的position屬性為“poscreencenter”。(4) 窗體外觀需要用代碼控制。2.1.1 程序相關(guān)代碼 因?yàn)楸鞠到y(tǒng)的主窗體將要采用與以往windows不同的風(fēng)格,所以窗體界面需要使用代碼來繪制。當(dāng)窗體需要重繪時(shí),windows會(huì)向窗體發(fā)送wm_ncpaint消息,利用該消息對(duì)非客戶進(jìn)行重繪,消息攔截的方法如下:procedure WMNCPA
12、INT(var msg:TWNCPAINT);messageWM_NCPAINT;這樣就攔截了wm_ncpaint消息只要窗口接受到wm_ncpaint消息,就會(huì)執(zhí)行wm_ncpaint過程。2.2菜單設(shè)計(jì) 菜單是windows用戶界面的重要組成部分,用戶通過鼠標(biāo)選擇菜單中的選項(xiàng)便可輕松操控系統(tǒng)各個(gè)模塊功能,delphi提供了一個(gè)tmainmenu組件,該組件封裝了windows的下拉菜單,開發(fā)人員利用該組件可以輕松地設(shè)計(jì)出所需的普通主菜單,也在本系統(tǒng)中,普通菜單外觀與主界面不是很協(xié)調(diào),所以在這里設(shè)計(jì)一個(gè)與以往風(fēng)格不一樣的主菜單。2.2.1設(shè)計(jì)步驟(1) 向main中添加一個(gè)tmainmenu
13、組件,命名為“mainmenu1”.(2) 在設(shè)計(jì)界面中雙擊mainmenu組件,彈出菜單設(shè)計(jì)器窗口(3) 在設(shè)計(jì)器中單擊一個(gè)空白菜單選項(xiàng),在object inspector窗口中修改該菜單項(xiàng)屬性,當(dāng)成功設(shè)置了一個(gè)菜單項(xiàng)后,菜單設(shè)計(jì)器會(huì)自動(dòng)添加一個(gè)空白菜單項(xiàng)(4) 在設(shè)計(jì)器中設(shè)計(jì)主菜單,按照系統(tǒng)功能添加所有菜單項(xiàng)(5) 關(guān)閉菜單設(shè)計(jì)器,這時(shí)菜單已經(jīng)顯示在main窗體的最上方,這里設(shè)置main窗體的menu屬性為空,這樣菜單就不會(huì)顯示在main 窗體中了(6) 在main中添加TTOOLBAR組件,命名為“toolbar1”(7) 設(shè)置toolbar1組件的menu屬性為“mainmenu1”;
14、設(shè)置Flat屬性為”true”,這樣主菜單就顯示到了toolbar1組件中(8) 在菜單編輯器中雙擊菜單欄的菜單項(xiàng),delphi會(huì)自動(dòng)為菜單建立單擊事件代碼,如果要為其他事件編寫代碼,可單擊菜單欄中的菜單項(xiàng),然后在object inspector窗口中的event頁中雙擊onadvanced drawitemg事件右邊的組合框添加事件處理過程(9) 程序相關(guān)代碼: procedure ToolBar1AdvancedCustomDraw(Sender: TToolBar;const ARect: TRect; Stage: TCustomDrawStage; var DefaultDraw:
15、Boolean);beginStretchBlt(TToolbar(sender).Canvas.Handle,arect.Left,arect.Top,arect.Right,arect.Bottom,toolbarbmp.Canvas.Handle,0,0,toolbarbmp.Width,toolbarbmp.Height,srccopy);end;這樣toolbar1組件就可以通過代碼自我重繪了2.3數(shù)據(jù)模塊設(shè)計(jì) 數(shù)據(jù)模塊是一個(gè)數(shù)據(jù)處理中心,本系統(tǒng)使用數(shù)據(jù)模塊對(duì)數(shù)據(jù)組件進(jìn)行統(tǒng)一管理,首先在工程中新建一個(gè)數(shù)據(jù)模塊,命名為data,然后向數(shù)據(jù)模塊中添加操作數(shù)據(jù)庫(kù)的組件。 模塊概述 本系統(tǒng)使
16、用ado組件對(duì)數(shù)據(jù)庫(kù)進(jìn)行操作,首先在數(shù)據(jù)模塊中添加tado connection組件,命名為“adoconnection1”,該組件用于建立數(shù)據(jù)庫(kù)的連接,然后想數(shù)據(jù)模塊中添加用來對(duì)數(shù)據(jù)庫(kù)操作的組件,如tadoquery,tadocommand,tadostoredproc組件,設(shè)置這些ado組件的connection屬性為“adoconnection1”,最后添加數(shù)據(jù)源等組件,數(shù)據(jù)模塊如圖:程序相關(guān)代碼如下:procedure TData.DataModuleCreate(Sender: TObject);var ZAppName: array0.127 of char; Hold: Stri
17、ng; setstring:string; Found: HWND;begin hold:=application.Title; Application.Title := 'OnlyOne'+ IntToStr(HInstance); strPcopy(ZAppName,Hold); Found:=Findwindow(nil, ZAppName); Application.Title := Hold; if Found <> 0 then begin ShowWindow(Found, SW_RESTORE); BringWindowToTop(Found); A
18、pplication.Terminate; end; getdir(0,dir); try setini:=Tinifile.Create(dir+'system.ini'); servername:=setini.ReadString('server','string','Provider=SQLOLEDB.1;Persist Security Info=True;User ID=sa;Initial Catalog=BookManager'); except showmessage('配置文件不存在!'); e
19、nd; try ADOConnection1.ConnectionString:=servername; adoconnection1.Open; except application.MessageBox('因服務(wù)器關(guān)閉或其他原因,無法連接到數(shù)據(jù)庫(kù)!請(qǐng)從新設(shè)置連接','提示',64); setstring:=promptdatasource(application.Handle,''); if trim(setstring)<>'' then setini.WriteString('server',&
20、#39;string',setstring); /setini.WriteString('server','string',promptdatasource(application.Handle,''); Application.Terminate; end;end;procedure TData.Timer1Timer(Sender: TObject);begin if adoconnection1.Connected then begin proc.Close; proc.ProcedureName:='stopdatepas
21、s;1' proc.ExecProc; proc.Close; proc.ProcedureName:='passdate;1' proc.ExecProc; end;end;end.2.4主要功能模塊設(shè)計(jì) 2.4.1 系統(tǒng)登錄模塊設(shè)計(jì) 系統(tǒng)啟動(dòng)后,會(huì)彈出登錄窗口來驗(yàn)證操作員權(quán)限,操作員通過驗(yàn)證后才能進(jìn)入系統(tǒng)(1) 系統(tǒng)為登錄模塊對(duì)worker表查詢,并且列出所有操作員的用戶名(2) 等待操作員選擇用戶,輸入密碼。(3) 驗(yàn)證用戶名,密碼是否正確,如果正確則進(jìn)入系統(tǒng)主窗體 系統(tǒng)登錄模塊運(yùn)行結(jié)果如圖: 設(shè)計(jì)步驟:(1) 在工程中新建一個(gè)窗體,該窗體命名為“l(fā)oginfor
22、m”,設(shè)置窗體borderstyle屬性為”bsnone”.(2) 在loginform窗體中添加label組件,用于顯示標(biāo)題(3) 添加tcombobox組件,該組件用于列出所有用戶名,添加Teedit組件,用于密碼輸入,設(shè)置該組件passwordchar屬性為“*“(4) 添加兩個(gè)Tspeedbutton組件作為按鈕,設(shè)置caption屬性為”登錄”和”退出”2.4.2 程序相關(guān)代碼: procedure TLoginForm.FormShow(Sender: TObject);begin combobox1.Clear; with data.PublicQuery do begin cl
23、ose; sql.Clear; sql.Add('select * from Worker'); open; if recordcount<1 then begin showmessage('目前沒有任何用戶!請(qǐng)建立一個(gè)管理員用戶。' ); UserManagershow; close; sql.Clear; sql.Add('select * from Worker'); open; while not Eof do begin combobox1.Items.Add(fieldbyname('Username').AsS
24、tring); next; end; end else begin while not Eof do begin combobox1.Items.Add(fieldbyname('Username').AsString); next; end; end; end;end;procedure TLoginForm.FormCloseQuery(Sender: TObject; var CanClose: Boolean);begin if main.userPurview.username<>'' then begin with data.Public
25、Query do begin close; sql.Clear; sql.Add('select * from Worker where username=:username'); parameters.ParamByName('username').Value:=main.userPurview.username; open; if recordcount < 1 then begin myshowmessage(#13+'對(duì)不起!請(qǐng)重新登錄!'); canclose:=false; end; end; end;end;2.5圖書信息管理
26、模塊設(shè)計(jì) 圖書信息系統(tǒng)管理模塊提供對(duì)圖書信息系統(tǒng)的管理的功能,該模塊能夠?qū)?kù)存中的所有圖書的信息進(jìn)行操作,其中包括出版日期,出版社,作者等信息,在該模塊中,圖書封面圖象使用了數(shù)據(jù)庫(kù)圖形存取技術(shù),在數(shù)據(jù)庫(kù)中存放圖象數(shù)據(jù)的字段類型為image,該字段類型是采用了二進(jìn)制數(shù)據(jù)存取的方式,圖象數(shù)據(jù)可以直接保存在該字段中,但是將圖象數(shù)據(jù)存儲(chǔ)到數(shù)據(jù)庫(kù)中的不能用普通字段的修改或添加方法,圖書信息管理模塊的運(yùn)行結(jié)果如圖: 設(shè)計(jì)步驟:(1) 新建一個(gè)窗體,命名為“bookinfoform“,設(shè)置窗體的caption屬性為”圖書信息管理”設(shè)置borderstyle屬性為”bssingle”.(2) 向“bookin
27、foform“中添加TPANEL組件,命名為”panel1”,設(shè)置該組件的align屬性為altop,并適當(dāng)調(diào)整其高度。(3) 在”panel1” 組件中添加用于數(shù)據(jù)編輯和瀏覽的Tedit,tcombox,timage組件,這些組件用于顯示和編輯圖書信息。(4) 在”panel1” 組件中添加tmaskedit組件,用于出版年月的格式化輸入,并分別命名為maskedit1 maskedit2,設(shè)置maskedit1組件的屬性為”!0000;1;0”, ,設(shè)置maskedit2組件的屬性為”!90;1;0”(5) 在TPANEL組件下方添加4個(gè)TSPEEDBUTTON組件,設(shè)置其caption屬
28、性為”&E修改”、 ”&S 確定”、 ”&X 關(guān)閉”。2.5.1程序相關(guān)代碼 在模塊中使用了數(shù)據(jù)庫(kù)圖象存取技術(shù),添加或修改數(shù)據(jù)庫(kù)中的圖象需要用二進(jìn)制的存取方法,進(jìn)入入庫(kù)操作時(shí),用條形掃描儀或鍵盤在“圖形條碼,如果圖書在庫(kù)存中有記錄,則在入庫(kù)詳單中將添加一條入庫(kù)信息;如果在庫(kù)存中沒有該圖書的記錄則提示輸入圖書詳細(xì)信息。整個(gè)模塊代碼如下:unit BookInfo;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls
29、, ComCtrls, ToolWin,ExtCtrls,buttons, ADODB, ImgList, ExtDlgs, MyComboBox, Mask;type TbookInfoForm = class(TForm) SpeedButton1: TSpeedButton; SpeedButton2: TSpeedButton; SpeedButton3: TSpeedButton; SpeedButton4: TSpeedButton; Panel1: TPanel; Label1: TLabel; Label2: TLabel; ComboBox1: TComboBox; Labe
30、l4: TLabel; Label5: TLabel; Edit2: TEdit; Label6: TLabel; Edit3: TEdit; Label7: TLabel; Edit4: TEdit; Label8: TLabel; Label9: TLabel; Edit6: TEdit; Label10: TLabel; Edit7: TEdit; Label11: TLabel; Edit8: TEdit; Label12: TLabel; Edit9: TEdit; Memo1: TMemo; Label13: TLabel; GroupBox1: TGroupBox; Image1
31、: TImage; OPDialog1: TOpenPictureDialog; Label3: TLabel; ComboBox4: TComboBox; ComboBox3: TMyComboBox; ComboBox2: TMyComboBox; MaskEdit1: TMaskEdit; MaskEdit2: TMaskEdit; Label14: TLabel; Label15: TLabel; procedure CreateParams(var Params: TCreateParams); override; procedure FormCreate(Sender: TObje
32、ct); procedure SpeedButton1Click(Sender: TObject); procedure SpeedButton3Click(Sender: TObject); procedure FormShow(Sender: TObject); procedure showfield; procedure SpeedButton2Click(Sender: TObject); procedure setedit(value:Boolean); procedure ComboBox1KeyPress(Sender: TObject; var Key: Char); proc
33、edure Customshowfield(const field,str:string); procedure ComboBox1Select(Sender: TObject); procedure ComboBox21KeyPress(Sender: TObject; var Key: Char); procedure ComboBox31KeyPress(Sender: TObject; var Key: Char); procedure ComboBox31Select(Sender: TObject); procedure ComboBox21Select(Sender: TObje
34、ct); procedure writefield(test:boolean;fieldname:string;value:variant); procedure imagetotable; procedure Image1Click(Sender: TObject); procedure SpeedButton4Click(Sender: TObject); procedure Edit3KeyPress(Sender: TObject; var Key: Char); procedure Edit2KeyPress(Sender: TObject; var Key: Char); proc
35、edure Edit5KeyPress(Sender: TObject; var Key: Char); procedure Edit4KeyPress(Sender: TObject; var Key: Char); procedure Edit8KeyPress(Sender: TObject; var Key: Char); procedure Edit6KeyPress(Sender: TObject; var Key: Char); procedure Edit7KeyPress(Sender: TObject; var Key: Char); procedure Edit9KeyP
36、ress(Sender: TObject; var Key: Char); procedure ComboBox4KeyPress(Sender: TObject; var Key: Char); procedure MaskEdit1KeyPress(Sender: TObject; var Key: Char); procedure MaskEdit2KeyPress(Sender: TObject; var Key: Char); private procedure WMPAINT1(var msg:TMESSAGE);message WM_PAINT; procedure WMNCPA
37、INT1(var msg:TWMNCPAINT);message WM_NCPAINT; procedure Active1(var msg:Tmessage);message WM_ACTIVATE; procedure WMNCLBUTTONDBLCLK1(var msg:Tmessage);message WM_NCLBUTTONDBLCLK; Private declarations public cbdrawdown:boolean; titleBmp:Tbitmap; / procedure FormCreate(Sender: TObject); Public declarati
38、ons end;var recordMemory:string; imagechanged:boolean;implementationuses MainForm,DataModule;$R *.dfmfunction MyShowmessage(text:Pchar):boolean; external 'resource.dll'procedure TbookInfoForm.WMNCLBUTTONDBLCLK1(var msg:Tmessage);begin /end;procedure TbookInfoForm.Active1(var msg:Tmessage);be
39、gin self.WMPAINT1(msg);end;procedure TbookInfoForm.CreateParams(var Params: TCreateParams);begin inherited; params.Style:=params.Style-WS_SYSMENU;end;procedure TbookInfoForm.WMPAINT1(var msg:TMESSAGE);begin sendmessage(self.Handle,WM_NCPAINT,0,0); inherited;end;procedure TbookInfoForm.WMNCPAINT1(var
40、 msg:TWMNCPAINT);var dc1:HDC; y,frame:integer; oldbrush:HBrush; oldpen,pen:HPEN; canvas:Tcanvas;begin canvas:=Tcanvas.Create; dc1:=getwindowdc(Handle); y:=GetSystemMetrics(SM_CYSIZE); frame:=GetSystemMetrics(SM_CYSIZEFRAME); oldbrush:=selectobject(dc1,getstockobject(null_brush); pen:=createpen(PS_SO
41、LID,1,rgb(155,155,155); oldpen:=selectobject(dc1,pen); RoundRect(dc1,0,0,Width,Height,12,12); pen:=createpen(PS_SOLID,frame*2-5,rgb(255,255,255); selectobject(dc1,pen); RoundRect(dc1,2,2,Width-2,Height-2,8,10); StretchBlt(dc1,frame,frame,Width-2*frame,y+frame div 2,titlebmp.Canvas.Handle,0,0,titlebm
42、p.Width,titlebmp.Height,srccopy); canvas.Handle:=dc1; canvas.Brush.Style:=bsclear; canvas.TextOut(frame*3,(y-frame)div 2,self.Caption); selectobject(dc1,oldbrush); selectobject(dc1,oldpen); deleteObject(pen); canvas.Handle:=0; canvas.Free; releasedc(Handle,dc1);end;procedure TbookInfoForm.FormCreate
43、(Sender: TObject);begin titlebmp:=Tbitmap.Create; titlebmp.LoadFromResourceName(main.resource,'TItle');end;procedure TbookInfoForm.SpeedButton1Click(Sender: TObject);begin setedit(true); speedbutton1.Enabled:=false; recordmemory:=combobox1.Text; combobox1.Enabled:=false;end;procedure TbookIn
44、foForm.SpeedButton3Click(Sender: TObject);begin data.PublicQuery.Close; close;end;procedure Tbookinfoform.setedit(value:Boolean);var i:integer;begin for i:=0 to self.panel1.ControlCount-1 do begin if self.panel1.Controlsi is Tedit then begin (self.panel1.Controlsi as Tedit).Enabled:=value; continue;
45、 end; end; maskedit1.Enabled:=value; maskedit2.Enabled:=value; combobox4.Enabled:=value; memo1.Enabled:=value;end;procedure TbookInfoForm.FormShow(Sender: TObject);begin combobox1.Items.Clear; combobox2.Items.Clear; combobox3.Items.Clear; combobox4.Items.Clear; with data.PublicQuery do begin close;
46、sql.Clear; sql.Add('select * from BookKind'); open; while not eof do begin combobox4.Items.Add(fieldbyname('KindName').AsString); next; end; close; sql.Clear; sql.Add('select * from bookinfo'); open; while not eof do begin combobox1.Items.Add(fieldbyname('bookID').AsS
47、tring); combobox2.Items.Add(fieldbyname('barcode').AsString); combobox3.items.Add(fieldbyname('bookname').AsString); next; end; first; end; showfield; recordmemory:=combobox1.text; setedit(false);end;procedure TbookInfoForm.showfield;begin if data.PublicQuery.Active then with data.Pu
48、blicQuery do begin combobox1.Text:=fieldbyname('bookid').AsString; combobox2.Text:=fieldbyname('barcode').AsString; combobox3.Text:=fieldbyname('bookname').AsString; edit3.Text:=fieldbyname('AuthorNation').AsString; maskedit1.Text:=copy(fieldbyname('PrintDate'
49、).AsString,0,4); maskedit2.Text:=copy(fieldbyname('PrintDate').AsString,6,8); /edit5.Text:=fieldbyname('PrintDate').AsString; edit8.Text:=fieldbyname('CDCount').AsString; edit7.Text:=fieldbyname('PageCount').AsString; edit2.Text:=fieldbyname('AuthorName').AsSt
50、ring; edit4.Text:=fieldbyname('Compny').AsString; edit6.Text:=fieldbyname('Version').AsString; edit9.Text:=fieldbyname('Place').AsString; Combobox4.Text:=fieldbyname('kindname').AsString; memo1.Text:=fieldbyname('Memo').AsString; if fieldbyname('picture
51、9;).IsNull then image1.Picture.Assign(nil); image1.Picture.Assign(fieldbyname('picture'); end;end;procedure TbookInfoForm.SpeedButton2Click(Sender: TObject);begin if not speedbutton1.Enabled then begin / change speedbutton1.Enabled:=true; if edit2.Modified then writefield(false,'AuthorNa
52、me',edit2.Text); if edit3.Modified then writefield(false,'AuthorNation',edit3.Text); try if maskedit1.Modified or maskedit2.Modified then writefield(false,'PrintDate',maskedit1.EditText+'-'+maskedit2.EditText); except end; if edit5.Modified then writefield(false,'Prin
53、tDate',edit5.Text); if edit4.Modified then writefield(false,'Compny',edit4.Text); if edit6.Modified then writefield(false,'Version',edit6.Text); if edit7.Modified then writefield(false,'PageCount',strtoint(edit7.Text); if edit8.Modified then writefield(false,'CDCount',strtoint(edit8.Text); if edit9.Modified then writefield(false,'Place',edit9.Text); if memo1.Modified then writefield(false,'Memo',memo1.Text); writefield(true,'barcode',combobox2.Text); writefield(true,'bookname',combobox3.Text); writefield(false,
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年廣東博時(shí)基金管理有限公司招聘筆試參考題庫(kù)含答案解析
- 2025年度房屋買賣合同智能家居系統(tǒng)維護(hù)范本下載
- 2024年華師大新版九年級(jí)歷史上冊(cè)階段測(cè)試試卷
- 2025年四川瀘州市興瀘股權(quán)投資基金管理有限公司招聘筆試參考題庫(kù)附帶答案詳解
- 二零二五年度美甲店知識(shí)產(chǎn)權(quán)保護(hù)與專利申請(qǐng)合同3篇
- 2025年新世紀(jì)版八年級(jí)地理上冊(cè)月考試卷
- 二零二五年度儲(chǔ)售煤場(chǎng)租賃合同(含能源交易服務(wù))4篇
- 業(yè)主裝修與物業(yè)簽合同范本2篇
- 2025年度木模板木方新型復(fù)合材料研發(fā)與應(yīng)用合同3篇
- 2024年度黑龍江省公共營(yíng)養(yǎng)師之三級(jí)營(yíng)養(yǎng)師全真模擬考試試卷B卷含答案
- 蝦皮shopee新手賣家考試題庫(kù)及答案
- 四川省宜賓市2023-2024學(xué)年八年級(jí)上學(xué)期期末義務(wù)教育階段教學(xué)質(zhì)量監(jiān)測(cè)英語試題
- 價(jià)值醫(yī)療的概念 實(shí)踐及其實(shí)現(xiàn)路徑
- 2024年中國(guó)華能集團(tuán)燃料有限公司招聘筆試參考題庫(kù)含答案解析
- 《紅樓夢(mèng)》中的男性形象解讀
- 安全生產(chǎn)技術(shù)規(guī)范 第49部分:加油站 DB50-T 867.49-2023
- 《三國(guó)演義》中的語言藝術(shù):詩(shī)詞歌賦的應(yīng)用
- 腸外營(yíng)養(yǎng)液的合理配制
- 消防安全教育培訓(xùn)記錄表
- 2023年河南省新鄉(xiāng)市鳳泉區(qū)事業(yè)單位招聘53人高頻考點(diǎn)題庫(kù)(共500題含答案解析)模擬練習(xí)試卷
- 2023年小升初簡(jiǎn)歷下載
評(píng)論
0/150
提交評(píng)論