附录新华书店进销存管理系统部分程序源代码样本.doc
《附录新华书店进销存管理系统部分程序源代码样本.doc》由会员分享,可在线阅读,更多相关《附录新华书店进销存管理系统部分程序源代码样本.doc(45页珍藏版)》请在咨信网上搜索。
附录2 新华书店进销存管理系统部分程序源代码 1、 主程序MAIN.PRG程序代码 SET DEFAULT TO C:\毕业设计 PUBLIC nkfgl,nxsgl,ncggl,nkcgl,nxtgl STORE .f. TO nkfgl,nxsgl,ncggl,nkcgl,nxtgl PUBLIC nname,ndepartment STORE "" TO nname,ndepartment Do Form loginf Read Events Do Form main Read Events Quit 2、 主表单MAIN.SCX代码 2.1 表单Init过程程序代码 do mmenu.mpr with this,.T. this.label2.caption = nname this.label4.caption = ndepartment 3、 系统登入表单LOGINF.SCX代码 3.1 表单登入按钮Click事件程序代码 SELECT user GO TOP *检验用户名和密码是否输入 If empty(thisform.text1.value) then thisform.label3.caption = "请输入用户名" return else if empty(thisform.text2.value) then thisform.label3.caption = "请输入密码" return endif endif *操作USER表,查询满足条件统计 locate for name = alltrim(thisform.text1.value) if !found() thisform.label3.caption="用户不存在" return else if user.password != alltrim(thisform.text2.value) then thisform.label3.caption="密码错误" return endif endif nname = user.name ndepartment = user.department nkfgl = user.kfgl nxsgl = user.xsgl ncggl = user.cggl nkcgl = user.kcgl nxtgl = user.xtgl thisform.release clear events 4、 系统管理表单XTGLF.SCX代码 4.1 表单Init过程程序代码 thisform.text1.enabled = .f. thisform.text2.enabled = .f. thisform.text3.enabled = .f. bo1.enabled = .f. thisform.check1.enabled = .f. thisform.check2.enabled = .f. thisform.check3.enabled = .f. thisform.check4.enabled = .f. thisform.check5.enabled = .f. thisform.label5.visible = .f. thisform.text3.visible = .f. mand10.enabled = .f. mand11.enabled = .f. thisform.dis_record thisform.dis_reccommand 4.2 表单自定义过程DIS_RECORD程序代码 PUBLIC newcommand STORE .f. TO newcommand if reccount("user") = 0 thisform.text1.value = "" thisform.text2.value = "" bo1.value = "" thisform.check1.value = 0 thisform.check2.value = 0 thisform.check3.value = 0 thisform.check4.value = 0 thisform.check5.value = 0 else thisform.text1.value = user.name thisform.text2.value = user.password bo1.value = user.department if user.kfgl then thisform.check1.value = 1 else thisform.check1.value = 0 endif if user.xsgl then thisform.check2.value = 1 else thisform.check2.value = 0 endif if user.cggl then thisform.check3.value = 1 else thisform.check3.value = 0 endif if user.kcgl then thisform.check4.value = 1 else thisform.check4.value = 0 endif if user.xtgl then thisform.check5.value = 1 else thisform.check5.value = 0 endif endif thisform.refresh 4.3 表单自定义过程DIS_RECCOMMAND程序代码 private n store 0 to n n = reccount("user") if n=1 .or. n=0 then mand1.enabled = .f. mand2.enabled = .f. mand3.enabled = .f. mand4.enabled = .f. else if recno("user")=1 then mand1.enabled = .f. mand2.enabled = .f. mand3.enabled = .t. mand4.enabled = .t. else if recno("user")=n then mand1.enabled = .t. mand2.enabled = .t. mand3.enabled = .f. mand4.enabled = .f. else mand1.enabled = .t. mand2.enabled = .t. mand3.enabled = .t. mand4.enabled = .t. endif endif endif thisform.refresh 4.4 表单保留按钮Click事件程序代码 if empty(thisform.text1.value) then =messagebox("请输入用户名",0+48+0,"犯错") thisform.text1.setfocus thisform.refresh return endif if empty(thisform.text2.value) then =messagebox("请输入密码",0+48+0,"犯错") thisform.text2.setfocus thisform.refresh return endif if .not.(alltrim(thisform.text2.value) == alltrim(thisform.text3.value)) then =messagebox("密码反复错误,请重新输入",0+48+0,"犯错") thisform.text2.value = "" thisform.text3.value = "" thisform.text2.setfocus thisform.refresh return endif if empty(bo1.value) then =messagebox("请选择所属部门",0+48+0,"犯错") bo1.setfocus thisform.refresh return endif if thisform.check1.value=0.and.thisform.check2.value=0.and.thisform.check3.value=0.and.thisform.check4.value=0.and.thisform.check5.value=0 then =messagebox("最少选择一个用户权限",0+48+0,"犯错") thisform.check1.setfocus thisform.refresh return endif if thisform.check1.value=1.and.thisform.check2.value=1.and.thisform.check3.value=1.and.thisform.check4.value=1.and.thisform.check5.value=1 then mesbox=messagebox("此用户将含有全部权限,请确定",4+48+0,"警告") if mesbox=7 then thisform.check1.setfocus thisform.refresh return endif endif *用户权限处理 PRIVATE nname,npassword,ndepartment,nkf,nxs,ncg,nkc,nxt nname = alltrim(thisform.text1.value) npassword = alltrim(thisform.text2.value) ndepartment = alltrim(bo1.value) if thisform.check1.value = 1 then nkf = .t. else nkf = .f. endif if thisform.check2.value = 1 then nxs = .t. else nxs = .f. endif if thisform.check3.value = 1 then ncg = .t. else ncg = .f. endif if thisform.check4.value = 1 then nkc = .t. else nkc = .f. endif if thisform.check5.value = 1 then nxt = .t. else nxt = .f. endif *判定是新统计保留还是修改统计 If newcommand then && newcommand = .t. 是新统计保留 locate for user.name=alltrim(thisform.text1.value) if found() then =messagebox("用户已经存在",0+48+0,"犯错") thisform.text1.setfocus thisform.refresh return endif *数据表user保留统计 insert into user(name,password,department,kfgl,xsgl,cggl,kcgl,xtgl) values (nname,npassword,ndepartment,nkf,nxs,ncg,nkc,nxt) =messagebox("保留完成",0+48+0,"提醒") else update user set password= npassword,department=ndepartment,kfgl=nkf,xsgl=nxs,cggl=ncg,kcgl=nkc,xtgl=nxt where name= nname =messagebox("修改完成",0+48+0,"提醒") endif *表单初始化 thisform.text1.enabled = .f. thisform.text2.enabled = .f. thisform.text3.enabled = .f. bo1.enabled = .f. thisform.check1.enabled = .f. thisform.check2.enabled = .f. thisform.check3.enabled = .f. thisform.check4.enabled = .f. thisform.check5.enabled = .f. mand1.enabled = .t. mand2.enabled = .t. mand3.enabled = .t. mand4.enabled = .t. mand5.enabled = .t. mand6.enabled = .t. mand7.enabled = .t. mand8.enabled = .t. mand9.enabled = .t. mand10.enabled =.f. mand11.enabled =.f. mand12.enabled = .t. thisform.label5.visible = .f. thisform.text3.visible = .f. thisform.dis_reccommand thisform.dis_record newcommand = .f. thisform.refresh 4.5 表单浏览按钮Click事件程序代码 DEFINE WINDOW browsewin FROM 1,1 TO 30,80 noFLOAT CLOSE nominimize nogrow nozoom system brow fields name,department,kfgl,xsgl,cggl,kcgl window browsewin noappend nomodify nodelete release window browsewin 5、 图书管理表单TSGL.SCX代码 5.1 自定义过程AUTO_BOOKID程序代码 select book set order to bookid go bottom private autoid1,autoid2,autoid3,autoid4 autoid1 = alltrim(str(val(substr(alltrim(book.bookid),2,6))+1,6,0)) autoid2 = len(autoid1) if autoid2 != 6 then for n = autoid2 to 5 autoid1 = "0" + autoid1 endfor endif autoid4 = "B" + alltrim(autoid1) thisform.text1.value = autoid4 5.2 新建按钮Click事件程序代码 thisform.text2.enabled = .t. thisform.text3.enabled = .t. thisform.text4.enabled = .t. thisform.text5.enabled = .t. thisform.text6.enabled = .t. bo1.enabled = .t. thisform.text7.enabled = .t. thisform.text8.enabled = .t. mand1.enabled = .f. mand2.enabled = .f. mand3.enabled = .f. mand4.enabled = .f. mand5.enabled = .f. mand6.enabled = .f. mand7.enabled = .f. mand8.enabled = .f. mand9.enabled = .f. mand10.enabled =.t. mand11.enabled =.t. mand12.enabled = .t. thisform.text2.value = "" thisform.text3.value = "" thisform.text4.value = "" thisform.text5.value = "" thisform.text6.value = "" bo1.value = "" thisform.text7.value = 0 thisform.text8.value = 0 thisform.auto_bookid thisform.text2.setfocus thisform.newcommand = .t. thisform.refresh 5.3 删除按钮Click事件程序代码 if reccount("book")=1 then =messagebox("只有一条统计,不能删除",0+16+0,"犯错") return else nbookid = alltrim(thisform.text1.value) nbookname = alltrim(thisform.text2.value) mesbox=messagebox("是否删除"+nbookid+"号图书",4+48+0,"警告") if mesbox=7 then return else use book EXCLUSIVE delete from book where bookid=nbookid pack =messagebox(nbookid+"图书已经删除",0+48+0,"提醒") endif endif thisform.dis_record thisform.dis_reccommand thisform.grid1.recordsource = "book" thisform.refresh 5.4 保留按钮Click事件程序代码 if empty(thisform.text2.value) =messagebox("请输入书名",0+48+0,"犯错") thisform.text2.setfocus thisform.refresh return endif if empty(thisform.text3.value) =messagebox("请输入书号",0+48+0,"犯错") thisform.text3.setfocus thisform.refresh return endif if empty(thisform.text4.value) =messagebox("请输入出版社",0+48+0,"犯错") thisform.text4.setfocus thisform.refresh return endif if empty(thisform.text5.value) =messagebox("请输入作者信息",0+48+0,"犯错") thisform.text5.setfocus thisform.refresh return endif if empty(bo1.value) =messagebox("请选择图书类型",0+48+0,"犯错") bo1.setfocus thisform.refresh return endif if thisform.text7.value = 0 =messagebox("请输入价格",0+48+0,"犯错") bo1.setfocus thisform.refresh return endif PRIVATE nbookid,nbookname,nbookno,nbookphouse,nbookwriter,nbookcd,nbookclass,nbookprice,nbookdiscount nbookid = alltrim(thisform.text1.value) nbookname = alltrim(thisform.text2.value) nbookno = alltrim(thisform.text3.value) nbookphouse = alltrim(thisform.text4.value) nbookwriter = alltrim(thisform.text5.value) nbookcd = alltrim(thisform.text6.value) nbookclass = alltrim(bo1.value) nbookprice = thisform.text7.value nbookdiscount = thisform.text8.value *判定是新统计保留还是修改统计 If thisform.newcommand then && newcommand = .t. 是新统计保留 *数据表book保留统计 insert into book (bookid,bookname,bookno,bookphouse,bookwriter,bookcd,bookclass,bookprice,bookdiscount) values (nbookid,nbookname,nbookno,nbookphouse,nbookwriter,nbookcd,nbookclass,nbookprice,nbookdiscount) =messagebox("保留完成",0+48+0,"提醒") else update book set bookname=nbookname,bookno=nbookno,bookphouse=nbookphouse,bookwriter=nbookwriter,bookcd=nbookcd,bookclass=nbookclass,bookprice=nbookprice,bookdiscount=nbookdiscount where bookid=nbookid =messagebox("修改完成",0+48+0,"提醒") endif *表单初始化 thisform.text2.enabled = .f. thisform.text3.enabled = .f. thisform.text4.enabled = .f. thisform.text5.enabled = .f. thisform.text6.enabled = .f. bo1.enabled = .f. thisform.text7.enabled = .f. thisform.text8.enabled = .f. mand5.enabled = .t. mand6.enabled = .t. mand7.enabled = .t. mand8.enabled = .t. mand9.enabled = .t. mand10.enabled =.f. mand11.enabled =.f. mand12.enabled = .t. thisform.dis_record thisform.dis_reccommand thisform.newcommand = .f. thisform.refresh 5.5 浏览按钮Click事件程序代码 DEFINE WINDOW browsewin FROM 1,1 TO 30,160 noFLOAT CLOSE nominimize nogrow nozoom system brow fields bookid,bookname,bookno,bookphouse,bookwriter,bookcd,bookclass,bookprice,bookdiscount window browsewin noappend nomodify nodelete release window browsewin 6、 会员输入表单KFGL_HYSR.SCX程序代码 6.1 自定义过程AUTO_VIPID程序代码 select vip set order to vipid go bottom private autoid1,autoid2,autoid3,autoid4 autoid1 = alltrim(str(val(substr(alltrim(vip.vipid),2,6))+1,6,0)) autoid2 = len(autoid1) if autoid2 != 6 then for n = autoid2 to 5 autoid1 = "0" + autoid1 endfor endif autoid4 = "V" + alltrim(autoid1) thisform.text1.value = autoid4 6.2 保留按钮Click事件程序代码 *输入数据校验 if empty(thisform.text2.value) =messagebox("请输入会员姓名",0+16+0,"犯错") thisform.text2.setfocus return endif if thisform.optiongroup1.value = 0 =messagebox("请选择会员性别",0+16+0,"犯错") thisform.optiongroup1.option1.setfocus return else private nvipsex store "" to nvipsex if thisform.optiongroup1.value = 1 store "男" to nvipsex else stor "女" to nvipsex endif endif if empty(thisform.text4.value) =messagebox("请输入会员联络地址",0+16+0,"犯错") thisform.text4.setfocus return endif if empty(thisform.text5.value) =messagebox("请输入会员联络电话",0+16+0,"犯错") thisform.text5.setfocus return endif if empty(thisform.text6.value) =messagebox("请输入邮政编码",0+16+0,"犯错") thisform.text6.setfocus return endif *保留数据 private nvipid,nvipname,nvipadd,nvipphone,nvipcode nvipid = alltrim(thisform.text1.value) nvipname = alltrim(thisform.text2.value) nvipadd = alltrim(thisform.text4.value) nvipphone = alltrim(thisform.text5.value) nvipcode = alltrim(thisform.text6.value) insert into vip (vipid,vipname,vipsex,vipadd,vipphone,vipcode,vipsum,vipdiscount) values (nvipid,nvipname,nvipsex,nvipadd,nvipphone,nvipcode,0,0) =messagebox("保留成功",0+48+0,"提醒") nmesbox=messagebox("是否打印会员卡?",4+32+0,"会员卡打印") if nmesbox = 6 select vip.vipid,vip.vipname,vip.vipsex,vip.vipadd,vip.vipphone,vip.vipcode from vip where vip.vipid = nvipid into cursor vipcard select vipcard report form vipcard.frx to print use in vipcard endif thisform.auto_vipid mand2.click 6.3 清除按钮Click事件程序代码 thisform.text2.value = "" thisform.optiongroup1.value = 0 thisform.text4.value = "" thisform.text5.value = "" thisform.text6.value = "" thisform.text1.setfocus thisform.refresh 7、 会员查询表单KFGL_HYCX.SCX程序代码 7.1 表单自定义过程DIS_GRID程序代码 thisform.grid1.readonly = .t. thisform.grid1.columncount = 8 thisform.grid1.column1.header1.caption = "会员编号" thisform.grid1.column1.width = 80 thisform.grid1.column1.movable = .f. thisform.grid1.column1.resizable = .f. thisform.grid1.column2.header1.caption = "会员姓名" thisform.grid1.column2.width = 80 thisform.grid1.column2.movable = .f. thisform.grid1.column2.resizable = .f. thisform.grid1.column3.header1.caption = "会员性别" thisform.grid1.column3.width = 80 thisform.grid1.column3.movable = .f. thisform.grid1.column3.resizable = .f. thisform.grid1.column4.header1.caption = "联络地址" thisform.grid1.column4.width = 250 thisform.grid1.column4.movable = .f. thisform.grid1.column4.resizable = .f. thisform.grid1.column5.header1.caption = "联络电话" thisform.grid1.column5.width = 80 thisform.grid1.column5.movable = .- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 附录 新华书店 进销存 管理 系统 部分 程序 源代码 样本
咨信网温馨提示:
1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前自行私信或留言给上传者【快乐****生活】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时私信或留言给本站上传会员【快乐****生活】,需本站解决可联系【 微信客服】、【 QQ客服】,若有其他问题请点击或扫码反馈【 服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【 版权申诉】”(推荐),意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:4008-655-100;投诉/维权电话:4009-655-100。
1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前自行私信或留言给上传者【快乐****生活】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时私信或留言给本站上传会员【快乐****生活】,需本站解决可联系【 微信客服】、【 QQ客服】,若有其他问题请点击或扫码反馈【 服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【 版权申诉】”(推荐),意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:4008-655-100;投诉/维权电话:4009-655-100。
关于本文