毕业设计(论文)-书店管理系统设计和实现.doc

上传人:椰子壳 文档编号:3947201 上传时间:2019-10-10 格式:DOC 页数:32 大小:1.25MB
返回 下载 相关 举报
毕业设计(论文)-书店管理系统设计和实现.doc_第1页
第1页 / 共32页
毕业设计(论文)-书店管理系统设计和实现.doc_第2页
第2页 / 共32页
毕业设计(论文)-书店管理系统设计和实现.doc_第3页
第3页 / 共32页
毕业设计(论文)-书店管理系统设计和实现.doc_第4页
第4页 / 共32页
毕业设计(论文)-书店管理系统设计和实现.doc_第5页
第5页 / 共32页
点击查看更多>>
资源描述

《毕业设计(论文)-书店管理系统设计和实现.doc》由会员分享,可在线阅读,更多相关《毕业设计(论文)-书店管理系统设计和实现.doc(32页珍藏版)》请在三一文库上搜索。

1、兰 州 商 学 院本科生毕业论文(设计)论文(设计)题目:书店管理系统设计和实现学 院、 系: 信息工程学院 专 业 (方 向): 计算机科学与技术 年 级、 班: 学 生 姓 名: 指 导 教 师: 书店管理系统设计和实现摘 要本文是关于书店管理系统的相关软件开发的一篇实践性论文。在当今社会,随着计算机的发展及网络技术的应用,日常管理工作应该从以前繁琐的事务中解放出来,从而提高了工作效率。目前在大的书店应有一整套比较完整的信息管理系统,而在一般小型的书店中大部分工作还是进行着手工管理,工作效率很低,并且不能及时了解书店各类图书的库存,读者需求的图书难以在短时间里找到图书的入库和更新比较麻烦等

2、,不便于动态及时调整图书结构。同时由于不可避免的人为因素,造成数据的遗漏误报等。为了更好地适应当前书店的销售需求,缓解手工管理存在的弊端,开发了书店管理系统,该系统向用户提供的服务将在传统的“入库-销售-盘点”基础上,进一步提供全方位的信息服务。根据小型书店的规模和经济能力,本系统具有书店管理系统的基本功能,如图书管理入库管理销售管理综合查询系统管理等,并且界面简单操作简便。作为一种该研究方向的实践性探索,本图书销售管理系统旨在提供一个可以操作的,方便查询,易于修改的辅助管理系统,以满足当前小型书店在管理实践和业务操作中的具体需求。关键词 书店管理 管理系统 辅助管理 软件开发ABSTRACT

3、 This thesis with practical application is concerning about developing programme of the managing system in bookshops.Nowadays, with rapid developing of computers and applying of network technology, in order to make a great difference in efficiency and productivity, daily management should be freed f

4、rom nagging formalities and other unnecessary items. At present, a series of information managing system which is complete and well-working enough has been applied to large bookshops, while for some smaller ones most of work has been done by hand, which is incurring lower efficiency and higher energ

5、y-cost. Worse still, it is quite impossible for them to access to updated information on stock and reserve, being unable restructure promptly and dynamically since it is very hard to update and purchase new books and periodicals. In addition, readers cannot find out what they need as soon as possibl

6、e. On the other hand, inevitably, the loss of data and imprecise delivery is rising. Considering a strong desire to meet the need of sales and reliving heavy pressure from management by hand, sales managing system has been developed to provide clients with all-levels of information services, helping

7、 it be transferred from traditional services: “purchasesalesinventory” to new concept of information services.According to the running scales and the capacity of economy, this system has basic functions such as books management, purchasing management, sales management, system management, comprehensi

8、ve search, and so on. Moreover, it shows simple interface and processing convenience. As an explore with practical meaning, the aim of this system is to offer a user-friendly and supplementary managing system to satisfy detailed needs of managing practice and business process. Key Words developing p

9、rogramme sales managing system books management business process managing system in bookshops.目 录一、前言(1)二、需求分析(2)(一)系统需求(2)(二)功能需求(2)1、权限设置(2)2、图书销售(2)3、图书入库(3)4、图书信息设置(3)5、综合查询(3)6、系统设置(4)7、数据库管理(4)(三)性能需求(4)1、硬件环境(4)2、软件环境(4)三、总体设计(5)(一)基本设计概念和处理流程(5)(二)系统层次模块图(5)(三)数据库设计(6)1、数据库介绍(6)2、使用ODBC数据库接口

10、访问数据库(6)3、数据库需求分析(7)4、数据库概念结构设计(9)四、详细设计与实现(9)(一)系统主控平台(9)1、主控平台界面的设计(9)2、主控平台界面的实现(9)(二)权限设置模块(9)1、权限设置模块IPO图(10)2、权限设置模块的实现(10)(三)图书销售模块(11)1、图书销售模块IPO图(11)2、图书销售模块的实现(12)(四)图书入库模块(17)1、图书入库模块IPO图(17)2、图书入库模块的实现(18)(五)图书信息设置模块(19)1、图书信息设置模块IPO图(19)2、图书信息设置模块的实现(20)(六)综合查询模块(22)1、图书查询子模块(22)2、销售查询子

11、模块(24)(七)系统设置模块(26)(八)数据库管理模块(31)1、数据库管理模块IPO图(31) 2、数据库管理模块的实现(32)五、结论与体会(34)参考文献(35)致谢(35)。 (图1) 书店管理系统主模块用户数据库用户信息录入用户设置系统设置出版社数据库出版社信息录入出版社设置图书类型数据库图书类型设置图书类型录入图书信息录入图书数据库图书入库或图书信息设置销售信息录入图书销售数据库图书销售综合查询输出查询结果销售查询输出查询结果图书查询 1. 权限设置IPO图输入:用户名和密码处理: (1)程序开始启动系统登陆对话框。(2)用户输入用户名和密码。(3)从用户表中检查是否有相应的用

12、户名和密码。(4)如果用户名或密码错误,进行提示;如果错误次数达到三次,则提示并退出。(5)如果正确,则根据该用户的权限类别进行权限设置。(6)进入主程序界面输出:主程序界面2、权限设置模块的实现通过定义CLoginDialog类来实现权限设置模块功能。其主要代码如下:(1) 根据用户名和密码验证用户身份和分配权限/在登陆按钮被点击后,进行权限验证。void CLoginDialog:OnOK() UpdateData(TRUE);CUserSet m_UserSet;CBookShopMISApp *ptheApp = (CBookShopMISApp *)AfxGetApp();tryif

13、(m_UserSet.IsOpen()m_UserSet.Close();m_UserSet.m_strFilter.Format( username= %s and userpassword = %s,m_strUserName, m_strUserPwd);m_UserSet.Open(CRecordset:snapshot, NULL, CRecordset:none); if(m_UserSet.IsEOF() m_UserSet.Close(); if(+i = 3) AfxMessageBox(很抱歉,您的输入错误次数已达到3次.n系统即将退出.);exit(1); AfxMess

14、ageBox(密码错误, 请重试!); return; elseptheApp-m_PresentUser.SetUserInfo(m_UserSet.m_username,m_UserSet.m_userpassword,m_UserSet.m_isAdmin);m_UserSet.Close();AfxMessageBox(密码正确,登陆成功!); catch(CDBException *e)e-ReportError();return;CDialog:OnOK();(三)图书销售模块1图书销售IPO图输入:图书编号图书数量和折扣(缺省为不打折)。处理:(1) 图书销售对话框启动(2) 用

15、户输入图书编号,并点击 “搜索” 按钮,系统进行图书搜索(3) 如果无此编号的图书,进行提示;反之,则列出该图书的基本信息。(4) 输入图书数量,然后,按回车键计算出该笔销售的金额。(5) 按“下一本”按钮,则进行下一本书的销售。(6) 按“结账”按钮,则完成此次的销售功能。并算出总金额。(7) 点击销售列表,按“撤销”按钮,则取消该书的销售。(8) 按“退出”按钮,则退出图书销售。输出:更新图书信息表和图书销售表。2、图书销售模块的实现根据图书销售模块的IPO图,通过定义CBookSaleDialog类来实现图书销售模块的功能。其主要实现代码如下:(1) CBookSaleDialog类使用

16、的图书信息表记录集CBookSet图书销售表记录集CBookSaleSet和临时图书销售表记录集CTempSaleSet.,操作完成后,更新和调整图书信息表,增加图书销售表记录,临时销售表为空。(2) 图书销售。流程: 选择图书编号-点击搜索按钮-输入图书折扣和图书数量-回车键-点击下一本-或结账-退出。/ 根据图书编号进行搜索,如果存在,则显示图书详细信息void CBookSaleDialog:OnButtonSearch() UpdateData(TRUE);if(m_strBookNo = ) MessageBox(图书编号不能为空);return ;CBookSet m_BookSe

17、t;try m_BookSet.m_strFilter.Format(bookno = %s,m_strBookNo); m_BookSet.Open(CRecordset:snapshot, NULL, CRecordset:none); if(m_BookSet.IsEOF() | (m_BookSet.m_number = 0) m_BookSet.Close(); AfxMessageBox(该编号的图书不存在,请重新输入编号!); ResetMembers();return;CString strTemp;strTemp.Format(%d,m_BookSet.m_number);m

18、_strBookName = m_BookSet.m_bookname;m_strPublisher = m_BookSet.m_pubname;m_strAuthor = m_BookSet.m_author;CString TempPrice;TempPrice.Format(%.2f,m_BookSet.m_price);m_strPrice = TempPrice; /m_BookSet.m_price;m_BookSet.Close();UpdateData(FALSE);catch(CDBException *e)e-ReportError();/ 计算销售值void CBookS

19、aleDialog:OnOK() UpdateData(TRUE);if(m_strNumber = )MessageBox(请输入销售图书数量);return;float TempFianalPrice;TempFianalPrice = atoi(m_strNumber) * atof(m_strPrice) * atoi(m_strDisCount) / 100;m_strFianalPrice.Format(%.2f,TempFianalPrice);UpdateData(FALSE);/ 下一本void CBookSaleDialog:OnButtonNext() UpdateDat

20、a(TRUE);if(m_strBookNo = )MessageBox(请输入要销售图书的编号);return;if(m_strNumber = )MessageBox(请输入要销售图书的数量);return;if(atoi(m_strNumber) =0)MessageBox(销售图书数量不能少于一本);return;if(m_strDisCount = )MessageBox(请输入该书要打几折);return;/ 获取当前时间CTime t;t = CTime:GetCurrentTime();CString time = ;CString year;CString month;CSt

21、ring day;year.Format(%d,t.GetYear();month.Format(%d,t.GetMonth();if(t.GetMonth() 9)month = 0 + month;day.Format(%d,t.GetDay();if(t.GetDay() 9)day = 0 + day;time = year + month + day;CBookSet m_BookSet;CTempSaleSet m_TempSaleSet;int TempNumber;trym_BookSet.m_strFilter.Format(bookno = %s,m_strBookNo);

22、m_BookSet.Open(CRecordset:snapshot, NULL, CRecordset:none);if(!m_BookSet.IsEOF()TempNumber = m_BookSet.m_number - atoi(m_strNumber);if(TempNumber Close();/ 添加销售的图书到临时销售表m_TempSaleSet.Open();m_TempSaleSet.AddNew();m_TempSaleSet.m_author = m_strAuthor;m_TempSaleSet.m_publisher = m_strPublisher;m_TempS

23、aleSet.m_bookname = m_strBookName;m_TempSaleSet.m_bookno = m_strBookNo;m_TempSaleSet.m_number = atoi(m_strNumber);m_TempSaleSet.m_discount = atoi(m_strDisCount);m_TempSaleSet.m_sum = atof(m_strFianalPrice);m_TempSaleSet.m_price = atof(m_strPrice);m_TempSaleSet.m_date = atol(time);m_TempSaleSet.Updat

24、e();m_TempSaleSet.Close();m_TempSaleSet.m_pDatabase-Close();/ 显示在销售列表中m_TempSaleSet.Open();m_TempSaleSet.MoveLast();int pos = m_ListSale.GetItemCount();CString TempNumber;CString TempPrice;CString TempDiscount;CString TempSum;TempNumber.Format(%d,m_TempSaleSet.m_number);TempPrice.Format(%.2f,m_TempS

25、aleSet.m_price);TempDiscount.Format(%d,m_TempSaleSet.m_discount);TempSum.Format(%.2f,m_TempSaleSet.m_sum);m_ListSale.InsertItem(pos, m_TempSaleSet.m_bookname);m_ListSale.SetItemText(pos,1,TempNumber);m_ListSale.SetItemText(pos,2,TempPrice);m_ListSale.SetItemText(pos,3,TempDiscount);m_ListSale.SetIte

26、mText(pos,4,TempSum);m_TempSaleSet.Close();ResetMembers();catch(CDBException *e)e-ReportError();return;/ 结账void CBookSaleDialog:OnButtonBill() UpdateData(); if(m_strBookNo != )OnButtonNext(); float m_Sum = 0; CTempSaleSet m_TempSaleSet; CBookSaleSet m_BookSaleSet; try m_TempSaleSet.Open(); m_BookSal

27、eSet.Open(); m_TempSaleSet.MoveFirst(); while(! m_TempSaleSet.IsEOF() /算出总销售额 m_Sum = m_Sum + m_TempSaleSet.m_sum; /- 添加进销售列表中- m_BookSaleSet.AddNew(); m_BookSaleSet.m_author = m_TempSaleSet.m_author; m_BookSaleSet.m_bookname = m_TempSaleSet.m_bookname; m_BookSaleSet.m_bookno = m_TempSaleSet.m_bookn

28、o; m_BookSaleSet.m_date = m_TempSaleSet.m_date; m_BookSaleSet.m_discount = m_TempSaleSet.m_discount; m_BookSaleSet.m_number = m_TempSaleSet.m_number; m_BookSaleSet.m_price = m_TempSaleSet.m_price; m_BookSaleSet.m_moneysum = m_TempSaleSet.m_sum; m_BookSaleSet.m_publisher = m_TempSaleSet.m_publisher;

29、m_BookSaleSet.Update(); /- m_TempSaleSet.Delete(); m_TempSaleSet.MoveNext(); m_TempSaleSet.Close(); m_TempSaleSet.m_pDatabase-Close(); m_BookSaleSet.Close(); m_BookSaleSet.m_pDatabase-Close(); catch(CDBException *e)e-ReportError();return; m_strSaleSum.Format(%.2f,m_Sum); UpdateData(FALSE);(3) 撤销功能。流

30、程:点击销售列表,点击撤销按钮即可完成。void CBookSaleDialog:OnButtonCancel() int i = m_ListSale.GetSelectionMark();CString BookName = m_ListSale.GetItemText(i, 0);int TempNumber = 0;if(i Close(); / 恢复图书原先数量CBookSet m_BookSet;m_BookSet.m_strFilter.Format(bookname = %s, BookName);m_BookSet.Open(CRecordset:snapshot, NULL

31、, CRecordset:none);if(!m_BookSet.IsEOF()m_BookSet.Edit();m_BookSet.m_number = m_BookSet.m_number + TempNumber;m_BookSet.Update();m_BookSet.Close();m_BookSet.m_pDatabase-Close();ListSale();(四)图书入库模块1图书入库模块IPO图输入:图书编号和图书数量处理:(1) 图书入库对话框启动。(2) 等待用户输入图书的编号和数量,可以在此输入图书详细信息,但不是必需的。(3) 将图书添加到图书信息表中输出:更新图书信

32、息表2. 图书入库模块的实现根据图书入库模块的IPO图,通过定义CBookInputDialog类来实现该模块的主体功能。(1) 相关的记录集类CBookSet。(2) 新书录入。处理过程:判断用户是否全部输入必填的图书信息,然后根据用户输入的图书编号查询图书信息表是否有重复编号,是则在原有图书信息基础上增加图书的数量;否则添加新的图书记录在图书信息表中。/ 添加图书到图书信息库中void CBookInputDialog:OnButtonSaveAndGoon() UpdateData(TRUE);CTime t;t = CTime:GetCurrentTime();CString time

33、 = ;CString year;CString month;CString day;year.Format(%d,t.GetYear();month.Format(%d,t.GetMonth();day.Format(%d,t.GetDay();time = year + - + month + -+ day; if(m_strBookNo = )MessageBox(请输入图书编号);return ;if(m_strNumber = )MessageBox(请输入图书数量);return;CBookSet m_BookSet;tryif(m_BookSet.IsOpen()m_BookSe

34、t.Close();m_BookSet.m_pDatabase-Close();m_BookSet.m_strFilter.Format(bookno = %s,m_strBookNo);m_BookSet.Open(CRecordset:snapshot, NULL, CRecordset:none);/ 如果库中无此书,则增加if(m_BookSet.IsEOF()m_BookSet.AddNew();m_BookSet.m_bookno = m_strBookNo;m_BookSet.m_number = atoi(m_strNumber);m_BookSet.m_bookname =

35、m_strBookName; m_BookSet.m_bookbn = m_strBookBn;m_BookSet.m_booktypename = m_strBookType;m_BookSet.m_pubname = m_strPublisher;m_BookSet.m_author = m_strAuthor;m_BookSet.m_price = atof(m_strPrice);m_BookSet.m_date = time;elsem_BookSet.Edit();m_BookSet.m_number = m_BookSet.m_number + atoi(m_strNumber)

36、;m_BookSet.m_date = time;m_BookSet.Update();m_BookSet.Close();m_BookSet.m_pDatabase-Close();catch(CDBException *e)e-ReportError();OnButtonAdd(); (五)图书信息设置模块图书信息模块由图书的信息设置和图书的删除功能。1、 图书信息设置模块IPO图输入:图书编号处理:(1) 图书信息设置对话框启动。(2) 根据图书编号搜索对应的图书,并显示其已填信息。(3) 用户修改或新添图书信息后。图书信息更新到图书信息表中。(4) 根据用户选择删除某一图书信息记录。输

37、出:更新图书信息数据库。2、图书信息设置模块的实现 根据图书信息设置模块的IPO图,通过定义CBookInputDialog类来实现该模块的主体功能。(1) 相关的记录集类CBookSet(2) 图书信息添加或修改/ 图书的添加或修改void CBookinfoSetingDialog:OnOK() UpdateData();if(m_strBookNo = )MessageBox(图书编号不能为空!);return;if(m_strBookBn = ) | (m_strBookName =) | (m_strBookType = ) |(m_strNumber = ) | (m_strPri

38、ce = ) | (m_strPublisher = ) |(m_strAuthor = )MessageBox(图书详细信息中不能有一项为空!);return;CBookSet m_BookSet;m_BookSet.m_strFilter.Format(bookno = %s,m_strBookNo);m_BookSet.Open(CRecordset:snapshot, NULL, CRecordset:none);if(m_BookSet.IsEOF()m_BookSet.Close();MessageBox(该图书不存在,请重新输入图书编号!);elsem_BookSet.Edit(

39、);m_BookSet.m_number = atoi(m_strNumber);m_BookSet.m_bookname = m_strBookName;m_BookSet.m_bookbn = m_strBookBn;m_BookSet.m_booktypename = m_strBookType;m_BookSet.m_pubname = m_strPublisher;m_BookSet.m_author = m_strAuthor;m_BookSet.m_price = atof(m_strPrice);m_BookSet.Update();m_BookSet.Close();m_BookSet.m_pDatabase-Close();MessageBox(保存成功!);ResetMembers();(3) 图书的删除void CBookinfoSetingDialog:OnButtonDelete() UpdateData();if(m_strBookNo = )MessageBox(请输入要删除的图书编号);return;CBookSet m_BookSet;trym_BookSet.m_strFilter.Format(bookno = %s,m_strBookNo);m_BookSet.Open(CRecordset:snapshot, NUL

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 其他


经营许可证编号:宁ICP备18001539号-1