【正文】
amp。管理窗口39。已經(jīng)是最后一條記錄39。管理窗口39。已經(jīng)是最后一條記錄39。信息窗口39。已是第一個記錄39。信息窗口39。已經(jīng)是第一個記錄39。真的想要退出嗎?39。產(chǎn)品管理39。amp。lindeping39。lindeping39。信息窗口39。產(chǎn)品不存在39。 endif select * from carmanage!tabkc where amp。 else MySQL=cif+ +ccif+ 39。 MySQL=cif+ +ccif+ 39。) else if =39。,48,39。在“查詢”按鈕的Click事件中添加以下代碼:cx=0cif=alltrim()ccif=alltrim()ctext=alltrim()if empty(ccif) or empty(ctext)messagebox(39。39。39。39。39。39。39。39。39。39。39。amp。amp。amp。amp。tabrkdj39。 ,。 to ,。 , store 39。數(shù)據(jù)沒有保存,要取消操作嗎?39。產(chǎn)品管理39。amp。amp。amp。操作成功!39。數(shù)據(jù)保存完畢!39。amp。amp。追加新記錄 else update tabkc set 產(chǎn)品名稱=,庫存數(shù)量=庫存數(shù)量+,。 ,) amp。 into cursor lindeping select lindeping if reccount()1 insert into tabkc values(,。 where 產(chǎn)品編號==。 select tabrkdj append from database\ltabrkdj select ltabrkdj go top do while !eof() select *。 ndialogtype=4+32 nAnswer=messagebox(cmessagetext,ndialogtype,cmessagetitle) do case case nAnswer=6 =39。 cmessagetext=39。) else cmessagetitle=39。,48,39。在“保存”按鈕的Click事件中添加以下代碼:if empty() messagebox(39。))endif=date()=.f.=.t.=.t.=.f.單擊“保存”按鈕,將信息保存到入庫登記表“Tabrkdj”中,并清空臨時表。+padl(alltrim(str(cend,4)),4,39。+lday+39。+lmonth+39。查找表tabrkdj中最大的入庫票號存入數(shù)組a中 cend=val(substr(a(1),14))+1 =alltrim(str(year(date()),4)+39。)else select max(入庫票號) from tabrkdj into array a amp。+lday+39。+lmonth+39。)if empty(入庫票號)set cent on=alltrim(str(year(date()),4)+39。)lday=padl(alltrim(str(day(date()),2)),2,39。*自動票號select tabrkdjlmonth=padl(alltrim(str(month(date()),2)),2,39。 ,=39。 to ,。 ,store0to ,store 39。,。具體實現(xiàn)如下。入庫票號由系統(tǒng)日期,字母“rkd”、四位數(shù)字組成。 =0 endif endifendif在“數(shù)量”文本框的When事件中添加以下代碼:=.t.在“數(shù)量”文本框的InteractiveChange事件中添加了以下代碼:jj=sl=je=jj*sl=je=.f.單擊“登記”按鈕,將清空表單上相關(guān)控件的內(nèi)容,做好接收用戶輸入信息的準備。將輸入的數(shù)據(jù)輸入到臨時表ltabtkdj中 =39。) else insert into database\ltabrkdj values(rkph,spnumber,ljnumber,cpname,chexing,chandi,huowei,danwei,ccount,jj,pfj,lsj,je,gysname,rkdate,manager,jsr,jsfs) amp。,48,39。) else if ccount=0 messagebox(39。,48,39。) else select tabspinfo set order to 產(chǎn)品編號 seek spnumber if!found() messagebox(39。,48,39。在“數(shù)量”文本框的LostFocus事件中添加以下代碼:cpname=alltrim()chexing=alltrim()chandi=alltrim()danwei=alltrim()huowei=alltrim()spnumber=alltrim()ljnumber=alltrim()jj=pfj=lsj=ccount=je=gysname=alltrim()rkph=alltrim()rkdate=jsr=alltrim()manager=alltrim()jsfs=alltrim()if empty(spnumber)=.t. messagebox(39。調(diào)用控件的InterActiveChange事件 otherwise return endcase當“數(shù)量”文本框失去焦點時,將用戶輸入的商品信息以插入方式保存到臨時表中。按下回車后判斷產(chǎn)品是否存在 amp。up arrow 按下PageUp if !bof() skip1 else go top endif =產(chǎn)品編號 case nKeyCode=13 amp。dowm arrow 按下PageDown if !eof() skip else go bottom endif =產(chǎn)品編號 case nKeyCode=18 amp。 在“產(chǎn)品編號”組合框的KeyPress事件中添加以下代碼:select tabspinfolocal InRecNoinRecNo=reo()do case case nKeyCode=3 amp。,。,。這種寫法其實將Resize事件當成一個設(shè)置相關(guān)控件是否有效的函數(shù)。tabrkdj39。amp。amp。ltabckdj39。amp。庫存數(shù)量不足,修改嗎?39。出庫登記表39。amp。ltabckdj39。操作失??!39。出庫數(shù)量為0!39。操作失??!39。無此產(chǎn)品!39。amp。amp。操作失??!39。產(chǎn)品編號不能為空!39。具體實現(xiàn)如下。amp。amp。amp。amp。tabckdj39。數(shù)據(jù)沒有保存,要取消操作嗎?39。產(chǎn)品管理39。amp。amp。amp。amp。amp。tabckdj39。操作成功!39。數(shù)據(jù)保存完畢!39。amp。amp。追加新記錄 update tabkc set 產(chǎn)品名稱=,庫存數(shù)量=,進價=,。 ,) amp。 select tabckdj insert into tabckdj values(,。更新數(shù)據(jù)表 case nAnswer=7 endcase else =39。 進價=,庫存金額=庫存數(shù)量*進價 where 產(chǎn)品編號= amp。amp。 ,。賦數(shù)據(jù)源 select tabckdj insert into tabckdj values(,。 amp。 ndialogtype=4+32 nAnswer=messagebox(cmessagetext,ndialogtype,cmessagetitle) do case case nAnswer=6 =39。amp。出庫登記表39。操作失?。?9。庫存中無此商品!39。amp。 order by 。 from carmanage!tabkc。amp。確定要保存嗎?39。出庫登記表39。操作失敗!39。出庫票號不能為空!39。具體實現(xiàn)如下。amp。039。ckd39。39。39。amp。ckd000139。39。39。039。039。ltabckdj39。 ,。39。 ,store .f. to ,。在“登記”按鈕的Click事件中添加了以下代碼:store .t. to ,。首先判斷出庫登記表“Tabckdj”中的出庫票號是否為空,如果為空則出庫票號等于“系統(tǒng)日期+ckd+0001”;如果不為空,則出庫票號等于“系統(tǒng)日期+ckd+四位數(shù)字編碼加1”。系統(tǒng)將自動生成出庫票號。amp。amp。amp。amp。39。操作錯誤!39。無此編號39。order by 。from carmanage!tabspinfo。設(shè)置焦點endif 當用戶輸入或選擇一個零件號時,系統(tǒng)自動在商品信息表Tabspinfo中查找相應(yīng)的記錄,并顯示在相應(yīng)的文本框中,具體實現(xiàn)代碼如下。 amp。調(diào)出系統(tǒng)提示對話框 =39。) amp。,48,39。into cursor lindepingif reccount()0 = =.f. = =.f. = =.f. = =.f. = =.f. = =.f. = else messagebox(39。where 產(chǎn)品編號==cif。,當用戶輸入或選擇以個產(chǎn)品編號時,系統(tǒng)自動在商品信息表Tabspinfo中查找相應(yīng)的記錄,并顯示在相應(yīng)的文本框中,實現(xiàn)代碼如下:在“產(chǎn)品編號”組合框的InteractiveChange事件中添加了以下代碼:cif=alltrim()select *。,。執(zhí)行該控件的InterActiveChange事件 otherwise return endcase在表單的Resize事件中添加以下代碼:store l to ,。 按下PageUp if !bof() skip1 else go top endif =產(chǎn)品編號 case nKeyCode=13 amp。 按下PageDown if !eof() skip else go bottom endif =產(chǎn)品編號 case nKeyCode=18 amp。定義全局變量在“產(chǎn)品編號”組合框的KeyPress事件中添加以下代碼:select tabspinfolocal InRecNoinRecNo=reo()do case case nKeyCode=3 amp。 ,在表單的Load事件中添加了以下代碼:private l amp。,。表單的Resize事件中添加了以下代碼:store l to ,。L是全局變量,這個值會集體賦值給相關(guān)控件的Enabled屬性。設(shè)置字符非精確比較