您好,欢迎来到九壹网。
搜索
您的当前位置:首页库存管理系统计算机毕业设计(论文)

库存管理系统计算机毕业设计(论文)

来源:九壹网
湖 北 民 族 学 院 理 学 院

《面向对象程序设计》课

一个模拟的班级学生成绩管理系统

的设计与实现

学生姓名: 黄秋实 学 号: 021240616 专 业:信息与计算科学 任课教师:陈世强 完成日期___2014/1/3___________________________

目 录

前言 ................................................................................................................ 5 摘要 .................................................................................................................... 3 第一章 系统需求分析 ....................................................................................... 6 第二章系统分析 ................................................................................................. 7

2.1现系统中存在的问题 ........................................................................... 7 2.2可行性分析 ........................................................................................ 7 2.3新系统的目标 ....................................................................................... 8 第三章 系统分析与设计 ................................................................................. 10

3.1 系统功能图 ........................................................................................ 10 3.2 E-R图设计 ......................................................................................... 11 3.3数据流程图: ..................................................................................... 13 3.3数据库设计 ......................................................................................... 14 第四章.概要设计 ........................................................................................... 17

4.1开发工具的选择 ................................................................................. 18 4.2关系型数据库的实现 ......................................................................... 21 4.3二者的结合(DBA) ........................................................................ 22 第五章 系统总体规划 ................................................................................... 23

5.1系统功能 ............................................................................................. 23 5.2系统设计实现 .................................................................................. 23 第六章 系统的维护与调试 ............................................................................. 44 结束语 .............................................................................. 错误!未定义书签。 参考文献........................................................................................................... 46

摘 要

随着现代工业的发展,计算机信息管理系统越来越受到企业重视。本文主要

分析了库存理系统的一些基本功能和组成情况,包括系统的需求分析、系统结构,功能模块划分以及数据库模式分析等,重点对应用程序的实际开发实现作了介绍。达到了数据的一致性和安全性,且应用程序功能完备,符合了库存理系统作为典型的信息管理系统(MIS)的要求。同时简单介绍了Visual Basic编程环境和Access数据库管理系统的功能特点,库存管理系统是企业物流管理中不可或缺的一部分。

Abstract

With the development of modern industry, the information management system of the computer is being paid attention to by enterprises. This paper analyzes the basic functions of inventory management system and composition, including the system requirement analysis, system structure, function modules and database schema analysis, focus on the actual development of the application program realization are introduced in this paper. Achieve data consistency and security, and application functions, in line with the inventory management system as a typical management information system (MIS) requirements. At the same time, introduces the function characteristics of Visual Basic programming environment and Access database management system, the inventory management system is an indispensable part of enterprise logistics management.

前言

伴随着企业规模的不断扩大,原始的、手工的进行管理工作已经不能适应工业企业发展的现状,更无法满足企业对管理工作的快速、准确的要求。而计算机信息管理技术的迅速发展恰恰解决了这个问题,它使计算机技术与现代的管理技术相互配合,来更加准确、高速的完成工业企业日常的库存管理工作。使企业能够以最少的人员来完成更多的工作。

随着科学技术的不断发展,计算机科学日趋成熟,其强大的功能已为人们深刻认识和体现到,它已进入到社会生活的各个领域当中,并发挥着越来越重要的作用。作为计算机应用的一部分,使用计算机对小型工程信息进行管理,具有着手工管理所无法比拟的优点,例如:检索快速、查找方便、可靠性高、存储量大、保密性好、寿命长、成本低等。这些优点能够极大地提高库存管理人员的工作效率,也是企业的科学化、正规化管理的必由之路,与世界接轨的前提条件。 库存管理信息系统主要采用Microsoft Visual6.0 做为开发工具,应用面向对象的程序设计方法,进行开发与设计的。 它是一个典型的信息管理系统。本系统可以根据各应用单位情况,适当加以修改,以便更好应用。

库存管理信息系统是根据某企业所属库存的实际管理情况进行编写的,主要目的是为了方便企业对库存来往业务及库存情况进行集中的查询与管理工作。在社会主义经济高速发展的今天,如果企业对库存的各项管理运做仍然停滞在以纸、笔为主要工具的阶段,就会因为信息量的快速增长而无法迅速、准确的完成各项管理工作,这样,必将成为企业各方面发展的一个瓶颈。而在当代这个以信息时代为主题的社会里,将信息技术应用于对现代企业的管理,不但可以提高信息的处理速度和提高信息处理的准确性,更重要的是,可以劳动力,将他们分配到更需要人力资源的岗位上去,从而加快其现代化、综合化的建设步伐。这样,不但为企业管理部门节省了不必要的开支,更重要的是提高了它的工作效率。

第一章 系统需求分析

本套应用程序名称为“库存管理系统”,主要用于库存货品信息的管理,系统包括库存管理、入库、出库、一些统计查询和报表等几部分组成。

库存管理系统需满足库存管理员及工作人员的需求,他们具有登陆应用系统的权限,所以需要对工作人员的登陆本模块进行更多的考虑,设计不同用户的操作权限和登陆方法。

对于一个库存来说,最大的功能就是存储货品,所以库存管理就是对货品信息,库存信息,短线货品及超储货品的管理,用户可以根据实际情况对各种货品信息进行分类管理,包括添加,删除更新数据库等。

当然,库存中货品入库也是常有的事,入库管理操作就是对于货品入库情况的管理,用户可以方便地输入一些货品的信息。

有了货品的入库,自然也就有货品的出库,这部分提供的功能与入库操作流程差不多,有所区别的只是对一些出库货品的管理,也很方便数据的输入。

库存货品的信息量大,数据安全性和保密性要求高。本系统实现对货品信息的管理和总体的统计等,库存信息,供货单位和经办人员信息的查看及维护。库存管理人员可以浏览、查询、添加、删除等货品的基本信息以及统计等,并可以对一些基本的信息生成报表形式,并打印输出的功能。

报表是一个数据库中最重要的功能之一,有了报表才能清楚地知道货品的出入库情况,在数据报表功能中包括出库报表,库存报表及经办人员报表等一些基本信息的打印,方便简洁。

本系统基本涵盖了库存管理的主要需求,具有完善细致的功能、友好的用户界面、强大的数据处理功能和完备的安全机制;随心所欲的查询和所见即所得的打印功能,并全面支持分析和决策的功能。

第二章系统分析

2.1现系统中存在的问题

现行的通用库存管理系统只是单一管理系统,现已不能满足快速准确的通用库存管理需要。系统输入繁琐,极易产生输入错误,缺少智能化输入功能,如:产品名称输入过程中,产品名称和产品代码不能够相互协调,易产生不匹配现象。另外,整个系统运行较慢,数据处理能力不够,进行一个查询往往需要等待很长时间。该系统还缺少通用库存管理理功能,图书组成条目都是经过手工计算的,工作量很大,且容易产生错误,有一个小错误,核对都需要花费很大的精力,换句话说,当前没有通用库存管理系统。

原通用库存管理系统用basic开发,为单机版,不能实现网络共享,使用是单位内部之间进行信息传递成为很棘手的问题原。系统已不能满足多个人员对数据的索取;如副科长管理计算机,则科长就不能在自己的办公室中查看资料。可见当前系统已不能适应未来管理信息系统发展的趋势,慢慢的将要被淘汰,一个新兴的管理信息系统是当前的迫切需求。 2.2可行性分析

技术上可行:该系统所需硬件设备,市场上销售且价格较低,甚至可以使用原有的设备,软件上,操作系统采用Windows系列操作系统,数据库管理系统采用Visual Basic,这些软件在MIS开发中已被大量应用,技术上都比较成熟。因此在技术上是可行的。

经济上可行:由于各个急需采用计算机来进行库存的管理,因此对开发通用库存系统大力支持,开发经费没有问题。

管理上可行:通用库存管理有很多的管理,每位入库物品都要有相应的记录,出库进也要对相应入库的物品进入删减,同时入和出库必须对每个物品的相应数量和单价进入录入。因此管理上可行。另外,库存管理对开发该系统也是大力支持的,同时制定了培训计划,并进行了实施MIS的物质准备和工作准备。

2.3新系统的目标

按照管理信息系统的原理和生命周期开发方法,采用成熟的信息技术和手段,建设成一个集通用库存管理、产品准确录入于一体的高效管理信息系统。 该系统能高速、快捷、智能化的管理全过程,并加强通用库存管理中的各种信息资源的管理与应用,提高入库和出库产品查找与查询的处理速度,进而提高企业的整体管理水平。

系统业务流程系统的业务流程主要包括三个部分:采购、部门领料和库存盘点。1. 采购的业务流程是:①计划部门制定物资需求单,评审,如果评审通过,根据库存库存情况平衡采购,然后制定采购单。②对采购单进行评审,如果评审通过,则可以签定采购合同进行采购。③到货后,进行登记并入库。

2. 部门领料的流程很简单,各部门主要通过库存领取物资,只需要填写部门领料单即可。

3. 库存盘点用于登记库存中物质的养活和增加情况,并使实际库存和数据库中的库存数目保持一致。

2.库存管理流程

库存管理主要是对库存货物的入库、出库、查询统计、盘点等进行控制和管理,以便及时了解库存情况,达到降低库存量、提高取货备货效率。

库存管理的具体内容有:基础数据维护、系统设置、入库操作、出库操作、查询操作、

统计分析、盘点操作、报表输出等。

第三章 系统分析与设计

3.1 系统功能图

项目 主面板入库 出库 报表 系统 设 置 基本功能: 1.系统

入库操作 出库操作 报表输出 退出系统 包括用户管理,密码管理,关闭系统,以及数据的备份与恢复,可以根据需要对整个数据库进行备份,以确保数据的安全性。

帮助:本系统的帮助信息,包括应用程序的版本信息; 2.库存管理

货品信息管理:对库存里的货品进行登记; 货品库存管理:管理库存的库存情况;

短线货品管理:对库存里短线的货品进行登记,以便及时采购补货; 超储货品管理:对库存里超储的货品进行登记,控制库存量,减少进货; 3.入库管理

入库登记管理:能对货品的入库登记,删除,更改等; 入库期间统计:货品入库期间年度的统计;

供货单位期间供货金额统计:对货品供应的金额进行统计; 4.出库管理

对货品出库期间的年度统计,出库登记,及收获单位金额统计等; 5.报表输出

可根据输入的条件,对货品的入库信息,库存信息等进行简单查询.

具体功能介绍: 1 摸块保称 项 目 功能说明 对系统进行入库出库报表输出,对员工。供应商,客户,材料等进入管理 2 3 4 5 入库 出库 报表 系统 对所入库的产品的所有信息进入录入 对所出库的所有产品信息进行录入 打印出所有入库和出库的产品的信息 退出系统 3.2 E-R图设计

这一设计阶段是在需求分析的基础上,设计出能够满足用户需求的各种实体,以及它们之间的关系,为后面的逻辑结构设计打下基础。

本设计根据上面的设计规划出的实体有库存实体、入库实体、出库实体、采购实

体、还库实体、需求实体。各个实体的E-R图及其关系描述如下: 1)库存实体E-R图:

现有库存

设备号 现有库存 警戒库存 总数 2)入库实体E-R图:

入库

设备号 供应商信息 采购价格信息 采购员 3)出库实体E-R图:

出库 设备号 使用部门 数量时间 经手人

4)部门需求实体E-R图:

部门需求 设备号 需求部门 需求数量 需求时间

5)实体和实体之间的关系E-R图如图所示:

入库 库 存出库 还库 部门需求 设备采购

3.3数据流程图:

登陆仓库管理系统 密码错误 验证用户信息 系统主窗体 仓入出盘 库库库存管管管管 理理理理 货 品入 汇总计算 库 仓库汇总 单 数据备份 备份输出 系统打印报表 货品出库单

图4-1 仓库管理系统数据流程图

商品信息管理数据流程图:

入库货品信息管理

货品其他信息管理 货品调配汇总 出库货品信息管理 货品基本信息管理 基本信息录入 货品登记 3.3数据库设计

图4-2 货品信息管理数据流程图 本库存管理系统是应用在单机系统上的,所以只需建立起一个数据库,在此数据库基础上建立起表格,现将部分数据结构表描述如下:

货品信息表

字段名 货品编码 货品名称 类别 型号 单位 库存编码 存放库存 入库计划单价 出库计划单价 数据类型 文本 文本 文本 文本 文本 文本 文本 货币 货币 字段长度 5 10 8 4 2 5 12 是否为空 入库登记表

字段名 入库日期 入库单号 货物编码 数量 进货价 数据类型 日期/时间 文本 文本 数字 货币 字段长度 10 5 长整型 表2 入库登记表 是否为空

出库登记表

字段名 出库日期 出库单号 货物编码 货物名称 数量 单价 出货价 总额 数据类型 日期/时间 文本 文本 文本 数字 货币 货币 货币 字段长度 10 5 10 长整型 是否为空 库存信息表

字段名 库存编号 库存名称 存货种类 存货价值 数据类型 文本 文本 文本 货币 字段长度 5 12 2 表4 仓库信息表 是否为空 供货单位信息表(收货单位表)

字段名 单位编号 单位名称 单位地址 电话 联系人 数据类型 文本 文本 文本 文本 文本 字段长度 5 50 50 15 8 是否为空

经办人员表

字段名 编号 姓名 家庭住址 办公电话 家庭电话 数据类型 文本 文本 文本 文本 文本 表5 供货单位信息表 字段长度 5 8 50 15 15 表6 经办人员表 是否为空

用户表

字段名 UserID userPWD

数据类型 文本 文本 字段长度 10 6 表7 用户表 是否为空

第四章.概要设计

今天,计算机的价格已经十分低廉,性能却有了长足的进步。它已经被应用于许多领域,计算机之所以如此流行的原因主要有以下几个方面:

首先,计算机可以代替人工进行许多繁杂的劳动; 其次,计算机可以节省许多资源;

第三,计算机可以大大的提高人们的工作效率; 第四,计算机可以使敏感文档更加安全,等等。 3.1用计算机管理图书的意义

现在我国的各个单位库存的管理水平还停留在纸介质的基础上,这样的机制已经不能适应时代的发展,因为它浪费了许多人力和物力,在信息时代这种传统的管理方法必然被计算机为基础的信息管理所取代。我作为一个计算机应用的本科生,希望可以在这方面有所贡献。改革的总设计师同志说过“科学技术是第一生产力”,我希望能用我四年的所学编制出一个实用的程序来帮助各个单位进行更有效的库存管理。

归纳起来,好处大约有以下几点:

1. 可以存储最新的入库和出库产品,安全、高效;

2. 只需一到二名库存管理人员即可操作系统,节省大量人力; 3. 可以迅速查到所需信息。 3.2为将来企业上网做好准备

跟据1999年中国电信的调查报告显示我国的上网人数已达到0万,互联网已经十分普及,各个单位也希望能在世界的任何一个角落查到自己单位的信息,本系统为各个企业将来的上网作了先期工作,比如数据库的建立。

3.3库存管理的设计分析

根据实际情况,我们使用原型法(Rapid Prototyping)即以少量代价快速地构造一个可执行的软件系统模型。使用户和开发人员可以较快地确定需求,然后采用循环进化的开发方式,对系统模型作连续的精化,将系统需具备的性质逐渐增加上去,直到所有的性质全部满足。此时模块也发展成为最终产品了。

4.1开发工具的选择

现在,市场上可以选购的应用开发产品很多,流行的也有数十种。目前在我国市场上最为流行、使用最多、最为先进的可用作企业级开发工具的产品有:

Microsoft公司的Visual Basic.Microsoft公司的Visual C.Borland公司的Delphi. Powersoft公司的PowerBulider在目前市场上这些众多的程序开发工具中,有些强调程语言的弹性与执行效率;有些则偏重于可视化程序开发工具所带来的便利性与效率的得高,各有各的优点和特色,也满足了不同用户的需求。然而,语言的弹性和工具的便利性是密不可分的,只有便利的工具,却没有弹性的语言作支持,许多特殊化的处理动作必需要耗费数倍的工夫来处理,使得原来所标榜的效率提高的优点失去了作用;相反,如果只强调程语言的弹性,却没有便利的工具作配合,会使一些即使非常简单的界面处理动作,也会严重地浪费程序设计师的宝贵时间。作为数据库系统的开发,Visual Basic是一个非常理想选择。数据库是MIS中的重要支持技术,在MIS开发过程中,如何选择数据库管理是一个重要的问题,目前,数据库产品较多,每种产品都具有各自的特点和适用范围,因此,在选择数据库时,应考虑数据库应用的特点及适用范围,本系统选用的数据库语言Visual Basic语言,该开发工具具有很多长处:

Visual Basic是一种可视化的、面对对象和条用事件驱动方式的结构化高级程序设计,可用于开发Windows环境下的种类应用程序。它简单易学、效率高,且功能强大,可以与Windows的专业开发工具SDK相媲美,而且程序开发人员不必具有C/C++编程基础。在Visual Basic环境下,利用事件驱动的编程机制、新颖易用的可视化设计工具,使用Windows内部的应用程序接口(API)函数,以及动态链接库(DLL)、动态数据交换(DDE)、对象的链接与嵌入(OLE)、开放式数据访问(ODBC)等技术,可以高效、快速地开发出Windows环境下功能强大、图形界面丰富的应用软件系统。总的来说,Visual Basic具有以下特点:

可视化编程:

用传统程序设计语言设计程序时,都是通过编写程序代码来设计用户界面,在设计过程中看不到界面的实际显示效果,必须编译后运行程序才能观察。如果

对界面的效果不满意,还要回到程序中修改。有时候,这种编程-编译-修改的操作可能要反复多次,大大影响了软件开发效率。Visual Basic提供了可视化设计工具,把Windows界面设计的复杂性“封装”起来,开发人员不必为界面设计而编写大量程序代码。只需要按设计要求的屏幕布局,用系统提供的工具,在屏幕上画出各种“部件”,即图形对象,并设置这些图形对象的属性。Visual Basic自动产生界面设计代码,程序设计人员只需要编写实现程序功能的那部分代码,从而可以大大提高程序设计的效率。

面向对象的程序设计

4.0版以后的Visual Basic支持面向对象的程序设计,但它与一般的面向对象的程序设计语言(C++)不完全相同。在一般的面向对象程序设计语言中,对象由程序代码和数据组成,是抽象的概念;而Visual Basic则是应用面向对象的程序设计方法(OOP),把程序和数据封装起来作为一个对象,并为每个对象赋予应有的属性,使对象成为实在的东西。在设计对象时,不必编写建立和描述每个对象的程序代码,而是用工具画在界面上,Visual Basic自动生成对象的程序代码并封装起来。每个对象以图形方式显示在界面上,都是可视的。

结构化程序设计语言

Visual Basic是在BASIC语言的基础上发展起来的,具有高级程序设计语言的语句结构,接近于自然语言和人类的逻辑思维方式。Visual Basic语句简单易懂,其编辑器支持彩色代码,可自动进行语法错误检查,同时具有功能强大且使用灵活的调试器和编译器。

Visual Basic是解释型语言,在输入代码的同时,解释系统将高级语言分解翻译成计算机可以识别的机器指令,并判断每个语句的语法错误。在设计Visual Basic程序的过程中,随时可以运行程序,而在整个程序设计好之后,可以编译生成可执行文件(.EXE),脱离Visual Basic环境,直接在Windows环境下运行。

事件驱动编程机制

Visual Basic通过事件来执行对象的操作。一个对象可能会产生多个事件,每个事件都可以通过一段程序来响应。例如,命令按钮是一个对象,当用户单击该按钮时,将产生一个“单击“(CLICK)事件,而在产生该事件时将执行一段程序,用来实现指定的操作。

在用Visual Basic设计大型应用软件时,不必建立具有明显开始和结束的程序,而是编写若干个微小的子程序,即过程。这些过程分别面向不同的对象,由用户操作引发某个事件来驱动完成某种特定的功能,或者由事件驱动程序调用通用过程来执行指定的操作,这样可以方便编程人员,提高效率。

访问数据库

Visual Basic具有强大的数据库管理功能,利用数据控件和数据库管理窗口,可以直接建立或处理Microsoft Access格式的数据库,并提供了强大的数据存储和检索功能。同时,Visual Basic还能直接编辑和访问其他外部数据库,如dBASE,FoxPro,Paradox等,这些数据库格式都可以用Visual Basic编辑和处理。

Visual Basic提供开放式数据连接,即ODBC功能,可通过直接访问或建立连接的方式使用并操作后台大型网络数据库,如SQL Server,Oracle等。在应用程序中,可以使用结构化查询语言SQL数据标准,直接访问服务器上的数据库,并提供了简单的面向对象的库操作指令和多用户数据库访问的加锁机制和网络数据库的SQL的编程技术,为单机上运行的数据库提供了SQL网络接口,以便在分布式环境中快速而有效地实现客户/服务器(client/server)方案。

动态数据交换(DDE)

利用动态数据交换(Dynamic Data Exchange)技术,可以把一种应用程序中的数据动态地链接到另一种应用程序中,使两种完全不同的应用程序建立起一条动态数据链路。当原始数据变化时,可以自动更新链接的数据。Visual Basic提供了动态数据交换的编程技术,可以在应用程序中与其他Windows应用程序建立动态数据交换,在不同的应用程序之间进行通信。

对象的链接与嵌入(OLE)

对象的链接与嵌入(OLE)将每个应用程序都看做是一个对象(object),将不同的对象链接(link)起来,再嵌入(embed)某个应用程序中,从而可以得到具有声音、影像、图像、动画、文字等各种信息的集合式的文件。OLE技术是Microsoft公司对象技术的战略,它把多个应用程序合为一体,将每个应用程序看做是一个对象进行链接和嵌入,是一种应用程序一体化的技术。利用OLE技术,可以方便地建立复合式文档(compound document),这种文档由来自多个不同应用程序的对象组成,文档中的每个对象都与原来的应用程序相联系,并可执行与原来应用程

序完全相同的操作。

动态链接库(DLL)

Visual Basic是一种高级程序设计语言,不具备低级语言的功能,对访问机器硬件的操作不太容易实现。但它可以通过动态链接库技术将C/C++或汇编语言编写的程序加入到Visual Basic应用程序中,可以像调用内部函数一样调用其他语言编写的函数。此外,通过动态链接库,还可以调用Windows应用程序接口(API)函数,实现SDK所具有的功能。 4.2关系型数据库的实现

Access2000 就是关系数据库开发工具,数据库能汇集各种信息以供查询、存储和检索。Access 的优点在于它能使用数据表示图或自定义窗体收集信息。数据表示图提供了一种类似于 Excel 的电子表格,可以使数据库一目了然。另外,Access 允许创建自定义报表用于打印或输出数据库中的信息。Access也提供了数据存储库,可以使用桌面数据库文件把数据库文件置于网络文件服务器,与其他网络用户共享数据库。Access 是一种关系数据库工具,关系数据库是已开发的最通用的数据库之一。如上所述,Access 作为关系数据库开发具备了许多优点,可以在一个数据包中同时拥有桌面数据库的便利和关系数据库的强大功能。 数据库的概念

数据库是一种存储数据并对数据进行操作的工具。数据库的作用在于组织和表达信息,简而言之,数据库就是信息的集合。计算机的数据库可以分为两类:非关系数据库(flat-file)和关系数据库(relational)。关系数据库中包含了多个数据表的信息,数据库含有各个不同部分的术语,象记录、域等。 _ 新建一个数据库

创建任何一个数据库的第一步是仔细的规划数据库,设计必须是灵活的、有逻辑的。创建一个数据库结构的过程被认为是数据模型设计。 1. 标识需要的数据; 2. 收集被标识的字段到表中; 3. 标识主关键字字段; 4. 绘制一个简单的数据图表;

5. 规范数据;

6. 标识指定字段的信息; 7. 创建物理表。

_ 修改已建的数据库

数据库的修改分为:添加、编辑和删除记录。这三种操作均可由Visual Basic 创建的程序来完成,下面的章节将详细描述实现的具体方法。

_ 实现数据库之间的联系

数据库之间的关系指明两个库之间共享一个共同的关键字值。一个连接是指一种虚拟的表,这种表是在当用户要求从相互关联的各个不同的表中获取信息时建立的,关键字段用于在相互连接的不同表中查找匹配的记录。一个更高级的连接形式称为自连接。这种连接是指一个表被连接到它自己的一个字段,或在不同的纪录中由重复数据的组合字段。数据库中有三种不同类型的关键字:主关键字、组合关键字和外关键字。在表中使用的关键字类型用于描述库表示什么以及在数据库中如何与其它的库建立关系。

4.3二者的结合(DBA)

微软的JET数据库引擎提供了与数据库打交道的途径,我们是通过它以及Visual Basic 来访问数据库并对其进行各种操作。Visual Basic、Access以及其他微软的软件产品都是通过共用JET数据库引擎,从而给用户提供了丰富的数据类型。 DATA 控件在数据库中的信息与将信息显示给用户看的Visual Basic程序之间架起了一座桥梁。我们可以设置DATA控件的各个属性,告诉它要调用那个数据库的哪个部分。缺省情况下,DATA控件根据数据库中的一个或多个数据表建立一个dynaset-type(动态集合)类型的记录集合。一个记录集合是动态的也就意味着,当原来的数据表中的容改变了以后,该记录集合中的记录也会随之改变。DATA控件还提供了用来浏览不同记录的各种跳转按钮。将DATA控件放置在窗体

中之后,我们还必须在该控件与要处理的数据库之间建立联系

第五章 系统总体规划

5.1系统功能

1. 可以进行文本操作; 2. 添加一个数据库项目; 3. 删除一个数据库项目; 4. 修改一个数据库项目; 5. 查询信息; 6. 打印一个库存信息。 5.2系统设计实现 用户主界面的实现

主要控件属性: 名称 mdfrmmain

Caption

linktopin

Width 6810

left 3495

库存管理系 mdiform

登录界面中对系统进行入库,出库,报表输出等操作,在设置中可以对员工,供应商,客户,材料等进入分类和管理。也可以对这些个详细资料进入增加,删除等操作。

用户主界面程序代码:

Private Sub CoolBar1_Resize()

MovingText1.Width = CoolBar1.Width End Sub

Private Sub MDIForm_Load()

Unload FrmSet Unload frmRK Unload frmPrint Unload frmCK Unload FrmHY

End Sub

Private Sub M报表输出_Click()

frmPrint.Show

End Sub

Private Sub M出库操作_Click()

frmCK.Show

End Sub

Private Sub M入库操作_Click() frmRK.Show End Sub

Private Sub M设置_Click() FrmSet.Show End Sub

Private Sub 退出_Click() Unload Me End Sub

入库界面的实现

主要控件表:

名称 DBCombo1

分类

DATASOURCE rowsource recordsource left Dtat1

Data1

入库表

3495

按照产品的特性进行对每个产口分类,以对每个产品有一个详细和完整的信息录入 名称

在下拉菜单中对产品的名称进入输入 库存量

显示此产品在库存中的实际数量,使得库存管理人员能够对此产品的库存量有所了解

数量

也就是入库产品数量的实现,能和原库存量相加,最终实现全部库存的显示 单价

输入每个产品的价格,若有好几件产品同时入库时,将会将这些个产品的所有单价以及原库存中的总价相加,显示此产品的总价 供应商

选择供应此产品的供应商,以实现对此产品的来源查看。 经手人

经手人在这里也是很重要的了,在对以后入库中有所问题时,可以实现谁人经手谁人负现的管理制度。

入库程序代码:

Private Sub asPopup3_Click(Cancel As Boolean) If Val(Text1.Text) <= 0 Then MsgBox \"请输入入库数量!\" Exit Sub End If

If DBCombo2.Text = \"\" Then MsgBox \"请选择入库材料名称!\" Exit Sub End If

If DBCombo4.Text = \"\" Then MsgBox \"请选择经手人!\" Exit Sub End If

Dim a As Integer

a = MsgBox(\"********你确定此操作吗?**********\" & vbCrLf _ & \"材料名称:\" & DBCombo2.Text & vbCrLf _

& \"原库存量:\" & Label4.Caption & Label5.Caption & vbCrLf _ & \"本次入库:\" & Text1.Text & Label5.Caption & \" 单价:\" & Text2.Text & \"元\" & vbCrLf _

& \"供应商:\" & DBCombo3.Text & vbCrLf _ & \"经手人:\" & DBCombo4.Text & vbCrLf _

, vbExclamation + vbOKCancel + vbApplicationModal, \"提示\") If a = 1 Then

Data5.Recordset.AddNew

Data5.Recordset(\"名称\") = DBCombo2.Text Data5.Recordset(\"供应商\") = DBCombo3.Text Data5.Recordset(\"数量\") = Text1.Text Data5.Recordset(\"单价\") = Text2.Text Data5.Recordset(\"经手\") = DBCombo4.Text Data5.Recordset(\"日期\") = Date Data5.Recordset(\"时间\") = Time Data5.UpdateRecord

Data5.Recordset.Bookmark = Data5.Recordset.LastModified '************************ Data2.Recordset.Edit

Data2.Recordset(\"数量\") = Val(Label4.Caption) + Val(Text1.Text) Data2.Recordset.Update MsgBox \"入库成功!\" asPopup4.Enabled = True End If

If a = 2 Then Exit Sub End Sub

Private Sub asPopup4_Click(Cancel As Boolean)

DataReport1.Show

DataReport1.Sections(2).Controls(\"Label1\").Caption = \"入库单据

\"

DataReport1.Sections(2).Controls(\"Label2\").Caption =

CStr(DBCombo2.Text)

DataReport1.Sections(2).Controls(\"Label3\").Caption = \"数量:\" &

CStr(Text1.Text)

DataReport1.Sections(2).Controls(\"Label4\").Caption = \"供应商:

\" & CStr(DBCombo3.Text)

DataReport1.Sections(2).Controls(\"Label5\").Caption = \"单价:\" &

CStr(Text2.Text)

DataReport1.Sections(2).Controls(\"Label6\").Caption = \"经手人:

\" & CStr(DBCombo4.Text)

DataReport1.Sections(2).Controls(\"Label7\").Caption = \"时间:\" &

CStr(Date) & \" \" & CStr(Time) & \" \" & CStr(Data5.Recordset(\"ID\"))

asPopup4.Enabled = False

End Sub

Private Sub DBCombo2_Click(Area As Integer) If DBCombo1.Text = \"\" Then MsgBox \"请先选择类别!\" Exit Sub End If

Dim SQL As String

SQL = \"SELECT ID, 分类, 单位, 名称, 备注, 数量 FROM 库存材料表 WHERE 分类 = '\" & CStr(DBCombo1.Text) & \"'\" Data2.Visible = False

Data2.DatabaseName = App.Path & \"\\库存管理.mdb\" Data2.RecordSource = SQL Data2.Refresh DBCombo2.Refresh Timer1.Enabled = True Timer1.Interval = 2000 End Sub

Private Sub DBCombo3_Click(Area As Integer) Timer2.Enabled = True

Timer2.Interval = 2000 End Sub

Private Sub DBCombo4_Click(Area As Integer) Timer3.Enabled = True Timer3.Interval = 2000 End Sub

Private Sub Form_Load() MakeWindow Me

' AlwaysOnTop Me, True

Me.Top = MDIFrmMain.Height / 2 - Me.Height / 2 - 1000 Me.Left = MDIFrmMain.Width / 2 - Me.Width / 2 Data1.DatabaseName = App.Path & \"\\库存管理.mdb\" Data1.Connect = \";pwd=lee1012\" Data1.RecordSource = \"材料分类表\" Data1.Refresh Data1.Visible = False

Data2.DatabaseName = App.Path & \"\\库存管理.mdb\" Data2.Connect = \";pwd=lee1012\" Data2.RecordSource = \"库存材料表\" Data2.Refresh Data2.Visible = False

Data3.DatabaseName = App.Path & \"\\库存管理.mdb\" Data3.Connect = \";pwd=lee1012\" Data3.RecordSource = \"供应商表\" Data3.Refresh Data3.Visible = False

Data4.DatabaseName = App.Path & \"\\库存管理.mdb\"

Data4.Connect = \";pwd=lee1012\" Data4.RecordSource = \"员工表\" Data4.Refresh Data4.Visible = False

Data5.DatabaseName = App.Path & \"\\库存管理.mdb\" Data5.Connect = \";pwd=lee1012\" Data5.RecordSource = \"入库表\" Data5.Refresh Data5.Visible = False asPopup4.Enabled = False End Sub

Private Sub Form_Unload(Cancel As Integer) Dim MyStr As String

MyStr = \"电大(麒麟分校2004春计算机班冯胜楠)设计,王老师指导\" MDIFrmMain.MovingText1.MsgChar = MyStr End Sub

Private Sub imgTitleClose_Click() Unload Me End Sub

Private Sub imgTitleLeft_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) DoDrag Me End Sub

Private Sub imgTitleMain_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

DoDrag Me End Sub

Private Sub imgTitleMinimize_Click() Me.WindowState = 1 End Sub

Private Sub imgTitleRight_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) DoDrag Me End Sub

Private Sub lblTitle_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) DoDrag Me End Sub

Private Sub Timer1_Timer()

Data2.Recordset.FindFirst \"名称 ='\" & DBCombo2.Text & \"'\" If Data2.Recordset.NoMatch = True Then MsgBox \"Err\提示\" Timer1.Enabled = False Exit Sub

Timer1.Enabled = False End If

Label4.Caption = Data2.Recordset(\"数量\") Label5.Caption = Data2.Recordset(\"单位\") Timer1.Enabled = False Dim MyStr As String

MyStr = CStr(DBCombo2.Text) & \" 原库存量\" & CStr(Label4.Caption) & CStr(Label5.Caption)

MDIFrmMain.MovingText1.MsgChar = MyStr End Sub

Private Sub Timer2_Timer() If DBCombo3.Text = \"\" Then MsgBox \"没有选择供应商!\" Timer2.Enabled = False Exit Sub End If

Data3.Recordset.FindFirst \"名称 ='\" & DBCombo3.Text & \"'\" If Data3.Recordset.NoMatch = True Then MsgBox \"Err\提示\" Timer2.Enabled = False Exit Sub End If

Dim MyStr As String

MyStr = CStr(Data3.Recordset(\"名称\")) & \" 地址:\" &

CStr(Data3.Recordset(\"地址\")) & \" 联系人:\" & CStr(Data3.Recordset(\"联系人\")) & \" 电话:\" & CStr(Data3.Recordset(\"电话\")) & \" 备注:\" & CStr(Data3.Recordset(\"备注\"))

MDIFrmMain.MovingText1.MsgChar = MyStr Timer2.Enabled = False End Sub

Private Sub Timer3_Timer() If DBCombo4.Text = \"\" Then

MsgBox \"没有选择供应商!\" Timer3.Enabled = False Exit Sub End If

Data4.Recordset.FindFirst \"姓名 ='\" & DBCombo4.Text & \"'\" If Data4.Recordset.NoMatch = True Then MsgBox \"Err\提示\" Timer3.Enabled = False Exit Sub End If

Dim MyStr As String

MyStr = CStr(Data4.Recordset(\"姓名\")) & \" 职务:\" &

CStr(Data4.Recordset(\"职务\")) & \" 电话:\" & CStr(Data4.Recordset(\"电话\"))

MDIFrmMain.MovingText1.MsgChar = MyStr Timer2.Enabled = False End Sub

出库界面的实现

主要控件表:

对像 窗体 窗体 窗体 Data1 DATA2

属性 Height DRAWWIDTH Linktopic Connoct LEFT

设置 4320 1 Form1 access 40

出库操作中的具体实现与入库操作有所相同,不相同之处只是服务客户,这里边的服务客户就是此产品出库后由何单位所销售,使用。可实现在以后的使用过程中的售后服务提供方便。 出库程序代码:

Private Sub asPopup3_Click(Cancel As Boolean) If Val(Label4.Caption) - Val(Text1.Text) < 0 Then MsgBox \"库存量不够!请及时采购。\" Exit Sub

End If

If DBCombo2.Text = \"\" Then MsgBox \"请选择出库材料名称!\" Exit Sub End If

If DBCombo4.Text = \"\" Then MsgBox \"请选择经手人!\" Exit Sub End If

Dim a As Integer

a = MsgBox(\"********你确定此操作吗?**********\" & vbCrLf _ & \"材料名称:\" & DBCombo2.Text & vbCrLf _

& \"原库存量:\" & Label4.Caption & Label5.Caption & vbCrLf _ & \"本次出库:\" & Text1.Text & Label5.Caption & vbCrLf _ & \"服务客户:\" & DBCombo3.Text & vbCrLf _ & \"经手人:\" & DBCombo4.Text & vbCrLf _

, vbExclamation + vbOKCancel + vbApplicationModal, \"提示\") If a = 1 Then

Data5.Recordset.AddNew

Data5.Recordset(\"名称\") = DBCombo2.Text Data5.Recordset(\"用途\") = DBCombo3.Text Data5.Recordset(\"数量\") = Text1.Text Data5.Recordset(\"经手人\") = DBCombo4.Text Data5.Recordset(\"日期\") = Date Data5.Recordset(\"时间\") = Time Data5.UpdateRecord

Data5.Recordset.Bookmark = Data5.Recordset.LastModified '************************ Data2.Recordset.Edit

Data2.Recordset(\"数量\") = Val(Label4.Caption) - Val(Text1.Text)

Data2.Recordset.Update MsgBox \"出库完成!\" asPopup4.Enabled = True End If End Sub

Private Sub asPopup4_Click(Cancel As Boolean) DataReport1.Show

DataReport1.Sections(2).Controls(\"Label1\").Caption = \"出库单据\"

DataReport1.Sections(2).Controls(\"Label2\").Caption = CStr(DBCombo2.Text) DataReport1.Sections(2).Controls(\"Label3\").Caption = \"数量:\" & CStr(Text1.Text) DataReport1.Sections(2).Controls(\"Label4\").Caption = \"用途:\" & CStr(DBCombo3.Text) DataReport1.Sections(2).Controls(\"Label5\").Caption = \"\"

DataReport1.Sections(2).Controls(\"Label6\").Caption = \"经手人:\" & CStr(DBCombo4.Text) DataReport1.Sections(2).Controls(\"Label7\").Caption = \"时间:\" & CStr(Date) & \" \" & CStr(Time) & \" \" & CStr(Data5.Recordset(\"ID\")) asPopup4.Enabled = False End Sub

Private Sub DBCombo2_Click(Area As Integer) If DBCombo1.Text = \"\" Then MsgBox \"请先选择类别!\" Exit Sub End If

Dim SQL As String

SQL = \"SELECT ID, 分类, 单位, 名称, 备注, 数量 FROM 库存材料表 WHERE 分类 = '\" & CStr(DBCombo1.Text) & \"'\" Data2.Visible = False

Data2.DatabaseName = App.Path & \"\\库存管理.mdb\" Data2.RecordSource = SQL Data2.Refresh

DBCombo2.Refresh Timer1.Enabled = True Timer1.Interval = 2000 End Sub

Private Sub DBCombo3_Click(Area As Integer) Timer2.Enabled = True Timer2.Interval = 2000 End Sub

Private Sub DBCombo4_Click(Area As Integer) Timer3.Enabled = True Timer3.Interval = 2000 End Sub

Private Sub Form_Load() MakeWindow Me ' AlwaysOnTop Me, True

Me.Top = MDIFrmMain.Height / 2 - Me.Height / 2 - 1000 Me.Left = MDIFrmMain.Width / 2 - Me.Width / 2 Data1.DatabaseName = App.Path & \"\\库存管理.mdb\" Data1.Connect = \";pwd=lee1012\" Data1.RecordSource = \"材料分类表\" Data1.Refresh Data1.Visible = False

Data2.DatabaseName = App.Path & \"\\库存管理.mdb\" Data2.Connect = \";pwd=lee1012\" Data2.RecordSource = \"库存材料表\" Data2.Refresh Data2.Visible = False

Data3.DatabaseName = App.Path & \"\\库存管理.mdb\" Data3.Connect = \";pwd=lee1012\"

Data3.RecordSource = \"客户表\" Data3.Refresh Data3.Visible = False

Data4.DatabaseName = App.Path & \"\\库存管理.mdb\" Data4.Connect = \";pwd=lee1012\" Data4.RecordSource = \"员工表\" Data4.Refresh Data4.Visible = False

Data5.DatabaseName = App.Path & \"\\库存管理.mdb\" Data5.Connect = \";pwd=lee1012\" Data5.RecordSource = \"出库表\" Data5.Refresh Data5.Visible = False asPopup4.Enabled = False End Sub

Private Sub Form_Unload(Cancel As Integer) Dim MyStr As String

MyStr = \"电大(麒麟分校2004春计算机班冯胜楠)设计,王老师指导\" MDIFrmMain.MovingText1.MsgChar = MyStr End Sub

Private Sub imgTitleClose_Click() Unload Me End Sub

Private Sub imgTitleLeft_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) DoDrag Me End Sub

Private Sub imgTitleMain_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

DoDrag Me End Sub

Private Sub imgTitleMinimize_Click() Me.WindowState = 1 End Sub

Private Sub imgTitleRight_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) DoDrag Me End Sub

Private Sub lblTitle_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) DoDrag Me End Sub

Private Sub Timer1_Timer()

Data2.Recordset.FindFirst \"名称 ='\" & DBCombo2.Text & \"'\" If Data2.Recordset.NoMatch = True Then MsgBox \"Err\提示\" Timer1.Enabled = False Exit Sub

Timer1.Enabled = False End If

Label4.Caption = Data2.Recordset(\"数量\") Label5.Caption = Data2.Recordset(\"单位\") Timer1.Enabled = False Dim MyStr As String

MyStr = CStr(DBCombo2.Text) & \" 原库存量\" & CStr(Label4.Caption) & CStr(Label5.Caption)

MDIFrmMain.MovingText1.MsgChar = MyStr End Sub

Private Sub Timer2_Timer() If DBCombo3.Text = \"\" Then MsgBox \"没有选择服务客户!\" Timer2.Enabled = False Exit Sub End If

Data3.Recordset.FindFirst \"名称 ='\" & DBCombo3.Text & \"'\" If Data3.Recordset.NoMatch = True Then MsgBox \"Err\提示\" Timer2.Enabled = False Exit Sub End If

Dim MyStr As String

MyStr = CStr(Data3.Recordset(\"名称\")) & \" 地址:\" & CStr(Data3.Recordset(\"地址\")) & \" 联系人:\" & CStr(Data3.Recordset(\"联系人\")) & \" 电话:\" & CStr(Data3.Recordset(\"电话\")) & \" 需求产品:\" & CStr(Data3.Recordset(\"产品\")) & \" 数量:\" & CStr(Data3.Recordset(\"数量\")) & \" 备注:\" & CStr(Data3.Recordset(\"备注\")) MDIFrmMain.MovingText1.MsgChar = MyStr Timer2.Enabled = False End Sub

Private Sub Timer3_Timer() If DBCombo4.Text = \"\" Then MsgBox \"没有选择供应商!\" Timer3.Enabled = False Exit Sub

End If

Data4.Recordset.FindFirst \"姓名 ='\" & DBCombo4.Text & \"'\" If Data4.Recordset.NoMatch = True Then MsgBox \"Err\提示\" Timer3.Enabled = False Exit Sub End If

Dim MyStr As String

MyStr = CStr(Data4.Recordset(\"姓名\")) & \" 职务:\" & CStr(Data4.Recordset(\"职务\")) & \" 电话:\" & CStr(Data4.Recordset(\"电话\")) MDIFrmMain.MovingText1.MsgChar = MyStr Timer3.Enabled = False End Sub

报表输出界面的实现

报表输出界面中可以对入库的所有的产品名称,数量。单价,供应商等信息进入报表打印,也可以对出库的所有信息进行打印。

_ 数据库的实现 入库数据库

入库数据库里存储了产品的信息包括:名称,供应商,数量,单价。经手人等 列名(中文)数据类型宽度小数点位数是否为空名称Name Date8No供应商CodeInteger6No数量SexDate2No单价AgeDate6No经手人NationDate6No等 入库模块:

该模块主要完成入库基本信息的录入、删除 、更新等功能。在此模块中定义了八个域名来进行入库的信息存储。如果用户修改某一纪录中的某一项,可单添加按钮进行入库记录的编辑,此窗口使用数据窗口的FREEDOM风格(典型的录入界面)。该种风格特点是列标题紧挨着数据列在此窗口还可以增加新产品的纪录。 出库数据库

读者信息数据库里存储了出库产品的信息包括:名称,数量,经手人,用途,日期,时间等

列名(中文)列名(英文)数据类型宽度小数点位数是否为空名称Name Date8No数量CodeInteger6No经手人ScoreDate10No用途RecordDate15No 等 供应商管理数据库

存储的是供应商的名称,地址,电话,联系人,级别,备注等

第六章 系统的维护与调试

系统维护的目的是保证管理信息系统正常而可靠地运行,并能使系统不断

得到改善和提高,以充分发挥作用。换言之,系统维护就是为了保证系统中的各个要素随着环境的变化始终处于最新的、正确的工作状态。系统维护的工作量往往是很大的,其费用大约占整个生命周期的60%,所以我们必须对系统维护给予足够的重视。

1、系统维护的内容

按照维护对象的不同,系统维护的内容可分为以下几类: (1)系统应用程序维护 (2)数据维护 (3)代码维护

(4)硬件设备维护

2、系统维护的类型

系统维护的重点是系统应用软件的维护工作,按照软件维护的不同性质,可以划分为下面四种类型:

(1)纠错性维护 诊断和修正系统中遗留的错误。 (2)适应性维护 使系统适用环境的变化而进行的维护。 (3)完善性维护 为满足用户的需求而进行的维护。

(4)预防性维护 为将要发生的变化或调整而进行的主动性维护。 3、系统维护的组织与管理

系统维护工作,首先必须建立一个维护组织,确定进行维护工作所应遵循的原则和规范化的过程,此外还应建立一套适用于具体系统维护过程的文档及管理措施,以及进行复审的标准。

根据系统维护的组织管理,一般维护过程如下:

(1)维护人员提出维护个性建议或要求。

(2)管理部门进行审批,并对修改带来的影响作出充分的估计。 (3)根据审批的修改方案进行相关的修改并作严格的测试。 (4)更新文档资料的相关部分。

第七章 总结

经过一个多月的设计和开发,库存管理统基本开发完毕。其功能基本符合用户需求,能够实现图书信息的录入、更新、删除、打印等基本功能,

从而实现库存的管理。对于数据的一致性的问题也通过程序进行了有效的解

决。但是由于毕业设计时间较短,所以该系统还有许多不尽如人意的地方,比如联机文档比较少,用户界面不够美观,出错处理不够等多方面问题。这些都有待进一步改善。 致谢

在本次毕业设计中,我从指导老师王老师身上学到了很多东西。王老师认真负责的工作态度,严谨的治学精神和深厚的理论水平都使我收益匪浅。他无论在理论上还是在实践中,都给与我很大的帮助,使我得到不少的提高这对于我以后的工作和学习都有一种巨大的帮助,感谢他耐心的辅导。

另外,在系统开发过程中助手同学也给于我很大的帮助,帮助解决了不少的难点,使得系统能及时开发完成,还有同组的同学同样给与我不少帮助,这里一并表示感谢。

参考文献

[1] Visual Basic 6.0 使用指南

作者:Bob Reselman , Richard Peasley , Wayne Pruchniak. 出版社:电子工业出版社

[2] 中文版Microsoft Office 2000 自学通 作者:Ned Snell 出版社:机械工业出版社

[3] Visual Basic 6.0 中文版控件大全 作者:Microsoft 出版社;电子工业出版社

[4] 中文Access 2000 24学时教程 作者:Craig Eddy ,Timothy Buchanan 出版社:机械工业出版社

[5]、《中文版Access2002入门及提高》

d ings? Cle. Perhaps not.

Ath. Not \"Perhaps not,\" but \"Certainly not,\" my good sir, is theright answer. There never has been a truer method than this discoveredby any man. Cle. I bow to your authority, Stranger; let us proceed in the waywhich you propose.

Ath. Then, as would appear, we must compel the guardians of ourdivine state to perceive, in the first place, what that principle iswhich is the same in all the four-the same, as we affirm, in courageand in temperance, and in justice and in prudence, and which, beingone, we call as we ought, by the single name of virtue. To this, myfriends, we will, if you please, hold fast, and not let go ure, and know how great is their power, as far as in man lies? doindeed excuse the mass of the citizens, who only follow the voice ofthe laws, but we refuse to admit as guardians any who do not labour toobtain every possible evidence that there is respecting the Gods;our city is forbidden and not allowed to choose as a guardian of thelaw, or to place in the select order of virtue, him who is not aninspired man, and has not laboured at these things.

Cle. It is certainly just, as you say, that he who is indolent aboutsuch matters or incapable should be rejected, and that thingshonourable should be put away from him. Ath. Are we assured that there are two things which lead men tobelieve in the Gods, as we have already stated? Cle. What are they?

Ath. One is the argument about the soul, which has been alreadymentioned-that it is the eldest, and most divine of all things, towhich motion attaining generation gives perpetual existence; the otherwas an argument from the order of the motion of the stars, and ofall things under the dominion of the mind which ordered theuniverse. If a man look upon the world not lightly or substances, and to these theyassigned the causes of all things. Such studies gave rise to muchatheism and perplexity, and the poets took occasion to beabusive-comparing the philosophers to she-dogs uttering vain howlings,and talking other nonsense of the same sort. But now, as I said, thecase is reversed. Cle. How so?

Ath. No man can be a true worshipper of the Gods who does not knowthese two principles-that the soul is the eldest of all things whichare born, and is immortal and rules over all bodies; moreover, as Ihave now said several times, he who has not contemplated the mind ofnature which is said to exist in the stars, and gone through theprevious training, and seen the connection of music with these things,and harmonized them all with laws and institutions, is not able togive a reason of such things as have a reason. And he who is unable toacquire this in addition to the ordinary virtues of a citizen, canhardly be a good ruler of a whole state; but he should be thesubordinate of other rulers. Wherefore, Cleinias and Megillus, letus consider whether we may not add to all the other laws which we havediscussed this further one-that the nocturnal assembly of themagistrates, which has also shared in the whole scheme of educationproposed by us, shall be a guard set according to law for thesalvation of the state. Shall we propose this?

Cle. Certainly, my good friend, we will if the thing is in anydegree possible.

Ath. Let us make a common effort to gain such an object; for I toowill gladly share in the attempt.

Ath. In the first place, a list would have to be made out of thosewho by their ages and studies and dispositions and habits are wellfitted for the duty of a guardian. In the next place, it will not beeasy for them to discover themselves what they ought to learn, orbecome the disciple of one whor the city; none of the present company oflegislators, as I may call them, would hesitate about that. And thestate will be perfected and become a waking reality, which a littlewhile ago we attempted to create as a dream and in idea only, minglingtogether reason and mind in one image, in the hope that our citizensmight be duly mingled and rightly educated; and being educated, anddwelling in the citadel of the land, might become perfect guardians,such as we have never seen ionship and right, as we enactedbefore. Now we must not conceal from ourselves that such laws areapt to be oppressive and that there may sometimes be a hardship in thelawgiver commanding the kinsman of the dead man to marry his relation;be may be thought not to have considered the innumerable hindranceswhich may arise among men in the execution of such ordinances; forthere may be cases in which the parties refuse to obey, and areready to do anything rather than marry, when there is some bodily ormental malady or defect among those who are bidden to marry or bemarried. Persons may fancy that the legislator never thought ofthis, but they are mistaken; wherefore let us make a common prelude onbehalf of the lawgiver and of his subjects, the law begging the latterto forgive the legislator, in that he, having to take care of thecommon weal, cannot order at the same time the various circumstancesof individuals, and begging him to pardon them if naturally they aresometimes unable to fulfil the act which he in his ignorance imposesupon them. Cle. And how, Stranger, can we act most fairly under thecircumstances?

Ath. There must be arbiters chosen to deal with such laws and thesubjects of them. Cle. What do you mean?

Ath. I mean to say, that a case may occur in which the nephew,having a rich father, will be unwilling to marry the daughter of hisuncle; he will have a feeling of pride, and he will wish to lookhigher. And there are cases in which the legislator will be imposingupon him the greatest calamity, and he will be compelled to disobeythe law, if he is required, for example, to take a wife who is mad, orhas some other terrible malady of soul or body, such as makes lifeintolerable to the sufferer. Then let what we are saying concerningthese cases be embodied in a law:-If any one finds fault with theestablished laws respecting testaments, both as to other matters andespecially in what relates to marriage, and asserts that thelegislator, if he were alive and present, would not compel him toobey-that is to say, would not compel those who are by our lawrequired to marry or be given in marriage, to do either-and somekinsman or guardian dispute this, the reply is that the legislatorleft fifteen of the guardians of the law to be arbiters and fathers oforphans, male or female, and to them let the disputants have recourse,and by their aid determine any matters of the kind, admitting theirdecision to be final. But if any one thinks that too great power isthus given to the guardians of the law, let him bring hisadversaries into the court of the select judges, and there have thepoints in dispute determined. And he who loses the cause shall havecensure and blame from the legislator, which, by a man of sense, isfelt to be a penalty far heavier than a great loss of money.

Thus will orphan children have a second birth. After their firstbirth we spoke of their nurture and education, and after theirsecond birth, when they have lost their parents, we ought to takemeasures that the misfortune of orphanhood may be as little sad tothem as possible. In the first place, we say that the guardians of thelaw are lawgivers and fathers to them, not inferior to their naturalfathers. Moreover, they shall take charge of them year by year as oftheir own kindred; and we have given both to them and to thechildren's own guardians a suitable admonition concerning thenurture of orphans. And we seem to have spoken opportunely in ourformer discourse, when we said that the souls of the dead have thepower after death of taking an interest in human affairs, aboutwhich there are many tales and traditions, long indeed, but true;and seeing that they are so many and so ancient, we must believe them,and we must also believe the lawgivers, who tell us that thesethings are true, if they are not to be regarded as utter fools. But ifthese things are really so, in the first place men should have afear of the Gods above, who regard the loneliness of the orphans;and in the second place of the souls of the departed, who by natureincline to take an especial care of their own children, and arefriendly to those who honour, and unfriendly to those who dishonourthem. Men should also fear the souls of the living who are aged andhigh in honour; wherever a city is well ordered and prosperous,their descendants cherish them, and so live happily; old persons arequick to see and hear all that relates to them, and are propitiousto those who are just in the fulfilment of such duties, and theypunish those who wrong the orphan and the desolate, considering thatthey are the greatest and most sacred of trusts. To all whichmatters the guardian and magistrate ought to apply his mind, if he hasany, and take heed of the nurture and education of the orphans,seeking in every possible way to do them good, for he is making acontribution to his own good and that of his children. He who obeysthe tale which precedes the law, and does no wrong to an orphan,will never experience the wrath of the legislator. But he who isdisobedient, and wrongs any one who is bereft of father or mother,shall pay twice the penalty which he would have paid if he had wrongedone whose parents had been alive. As touching other legislationconcerning guardians in their relation to orphans, or concerningmagistrates and their superintendence of the guardians, if they didnot possess examples of the manner in which children of freemen shouldbe brought up in the bringing up of their own children, and of thecare of their property in the care of their own, or if they had notjust laws fairly stated about these very things-there would havebeen reason in making laws for them, under the idea that they were apeculiar-class, and we might distinguish and make separate rules forthe life of those who are orphans and of those who are not orphans.But as the case stands, the condition of orphans with us not differentfrom the case of those who have father, though in regard to honour anddishonour, and the attention given to them, the two are not usuallyplaced upon a level. Wherefore, touching the legislation aboutorphans, the law speaks in serious accents, both of persuasion andthreatening, and such a threat as the following will be by no meansout of place:-He who is the guardian of an orphan of either sex, andhe among the guardians of the law to whom the superintendence ofthis guardian has been assigned, shall love the unfortunate orphanas though he were his own child, and he shall be as careful anddiligent in the management of his possessions as he would be if theywere his own, or even more careful and dilligent. Let every one whohas the care of an orphan observe this law. But any one who actscontrary to the law on these matters, if he be a guardian of thechild, may be fined by a magistrate, or, if he be himself amagistrate, the guardian may bring him before the court of selectjudges, and punish him, if convicted, by exacting a fine of double theamount of that inflicted by the court. And if a guardian appears tothe relations of the orphan, or to any other citizen, to actnegligently or dishonestly, let them bring him before the samecourt, and whatever damages are given against him, let him payfourfold, and let half belong to the orphan and half to him whoprocured the conviction. If any orphan arrives at years of discretion,and thinks that he has been ill-used by his guardians, let himwithin five years of the expiration of the guardianship be allowedto bring them to trial; and if any of them be convicted, the courtshall determine what he shall pay or suffer. And if magistrate shallappear to have wronged the orphan by neglect, and he be convicted, letthe court determine what he shall suffer or pay to the orphan, andif there be dishonesty in addition to neglect, besides paying thefine, let him be deposed from his office of guardian of the law, andlet the state appoint another guardian of the law for the city and forthe country in his room.

Greater differences than there ought to be sometimes arise betweenfathers and sons, on the part either of fathers who will be of opinionthat the legislator should enact that they may, if they wish, lawfullyrenounce their son by the proclamation of a herald in the face ofthe world, or of sons who think that they should be allowed toindict their fathers on the charge of imbecility when they aredisabled by disease or old age. These things only happen, as amatter of fact, where the natures of men are utterly bad; for whereonly half is bad, as, for example, if the father be not bad, but theson be bad, or conversely, no great calamity is the result of suchan amount of hatred as this. In another state, a son disowned by hisfather would not of necessity cease to be a citizen, but in our state,of which these are to be the laws, the disinherited must necessarilyemigrate into another country, for no addition can be made even of asingle family to the 5040 households; and, therefore, he whodeserves to suffer these things must be renounced not only by hisfather, who is a single person, but by the whole family, and what isdone in these cases must be regulated by some such law as thefollowing:-He who in the sad disorder of his soul has a mind, justlyor unjustly, to expel from his family a son whom he has begotten andbrought up, shall not lightly or at once execute his purpose; butfirst of all he shall collect together his own kinsmen extending tocousins, and in like manner his son's kinsmen by the mother's side,and in their presence he shall accuse his son, setting forth that hedeserves at the hands of them all to be dismissed from the family; andthe son shall be allowed to address them in a similar manner, and showthat he does not deserve to suffer any of these things. And if thefather persuades them, and obtains the suffrages of more than halfof his kindred, exclusive of the father and mother and the offenderhimself-I say, if he obtains more than half the suffrages of all theother grown-up members of the family, of both sexes, the fathershall be permitted to put away his son, but not otherwise. And ifany other citizen is willing to adopt the son who is put away, nolaw shall hinder him; for the characters of young men are subject tomany changes in the course of their lives. And if he has been putaway, and in a period of ten years no one is willing to adopt him, letthose who have the care of the superabundant population which issent out into colonies, see to him, in order that he may be suitablyprovided for in the colony. And if disease or age or harshness oftemper, or all these together, makes a man to be more out of hismind than the rest of the world are-but this is not observable, exceptto those who live with him-and he, being master of his property, isthe ruin of the house, and his son doubts and hesitates aboutindicting his father for insanity, let the law in that case or, thathe shall first of all go to the eldest guardians of the law and tellthem of his father's misfortune, and they shall duly look into thematter, and take counsel as to whether he shall indict him or not. Andif they advise him to proceed, they shall be both his witnesses andhis advocates; and if the father is cast, he shall henceforth beincapable of ordering the least particular of his life; let him beas a child dwelling in the house for the remainder of his days. And ifa man and his wife have an unfortunate incompatibility of temper,ten of the guardians of the law, who are impartial, and ten of thewomen who regulate marriages, shall look to the matter, and if theyare able to reconcile them they shall be formally reconciled; but iftheir souls are too much tossed with passion, they shall endeavourto find other partners. Now they are not likely to have very gentletempers; and, therefore, we must endeavour to associate with themdeeper and softer natures. Those who have no children, or only afew, at the time of their separation,

should choose their new partnerswith a view to the procreation of children; but those who have asufficient number of children should separate and marry again in orderthat they may have some one to grow old with and that the pair maytake care of one another in age. If a woman dies, leaving children,male or female, the law will advise rather than compel the husbandto bring up the children without introducing into the house astepmother. But if he have no children, then he shall be compelledto marry until he has begotten a sufficient number of sons to hisfamily and to the state. And if a man dies leaving a sufficient numberof children, the mother of his children shall remain with them andbring, them up. But if she appears to be too young to livevirtuously without a husband, let her relations communicate with thewomen who superintend marriage, and let both together do what theythink best in these matters; if there is a lack of children, let thechoice be made with a view to having them; two children, one of eithersex, shall be deemed sufficient in the eye of the law. When a child isadmitted to be the offspring of certain parents and is acknowledged bythem, but there is need of a decision as to which parent the childis to follow-in case a female slave have intercourse with a maleslave, or with a freeman or freedman, the offspring shall alwaysbelong to the master of the female slave. Again, if a free womanhave intercourse with a male slave, the offspring shall belong tothe master of the slave; but if a child be born either of a slave byher master, or of his mistress by a slave-and this be provenceoffspring of the woman and its father shall be sent away by thewomen who superintend marriage into another country, and the guardiansof the law shall send away the offspring of the man and its mother.

Neither God, nor a man who has understanding, will ever advise anyone to neglect his parents. To a discourse concerning the honour anddishonour of parents, a prelude such as the following, about theservice of the Gods, will be a suitable introduction:-There areancient customs about the Gods which are universal, and they are oftwo kinds: some of the Gods we see with our eyes and we honour them,of others we honour the images, raising statues of them which weadore; and though they are lifeless, yet we imagine that the livingGods have a good will and gratitude to us on this account. Now, if aman has a father or mother, or their fathers or mothers treasured upin his house stricken in years, let him consider that no statue can bemore potent to grant his requests than they are, who are sitting athis hearth if only he knows how to show true service to them.

Cle. And what do you call the true mode of service?

Ath. I will tell you, O my friend, for such things are worthlistening to. Cle. Proceed.

Ath. Oedipus, as tradition says, when dishonoured by his sons,invoked on them curses which every one declares to have been heard andratified by the Gods, and Amyntor in his wrath invoked curses on hisson Phoenix, and Theseus upon Hippolytus, and innumerable othershave also called down wrath upon their children, whence it is clearthat the Gods listen to the imprecations of parents; for the curses ofparents are, as they ought to be, mighty against their children asno others are. And shall we suppose that the prayers of a father ormother who is specially dishonoured by his or her children, areheard by the Gods in accordance with nature; and that if a parent ishonoured by them, and in the gladness of his heart earnestlyentreats the Gods in his prayers to do health, and flattering his too sanguine hopes with the illusion that her mind would settle back to its right balance also, and she would soon be entirely her former self.

The first time she left her chamber was at the commencement of the following March. Mr Linton had put on her pillow, in the morning, a handful of golden crocuses; her eye, long stranger to any gleam of pleasure, caught them in waking, and shone delighted as she gathered them eagerly together.

`These are the earliest flowers at the Heights,' she exclaimed. `They remind me of soft thaw winds, and warm sunshine, and nearly melted snow. Edgar, is there not a south wind, and is not the snow almost gone?'

`The snow is quite gone down here, darling,' replied her husband; `and I only see two white spots on the whole range of moors: the sky is blue, and the larks are singing, and the becks and brooks are all brim full. Catherine, last spring at this time, I was longing to have you under this roof, now, I wish you were a mile or two up those hills: the air blows so sweetly, I feel that it would cure you.

`I shall never be there but once more,' said the invalid; `and then you'll leave me, and I shall remain for ever. Next spring you'll long again to have me under this roof, and you'll look back and think you were happy today.

Linton lavished on her the kindest caresses, and tried to cheer her by the fondest words; but, vaguely regarding the flowers, she let the tears collect on her lashes and stream down her cheeks unheeding. We knew she was really better, and, therefore, decided that long confinement to a single place produced much of this despondency, and it might be partially removed by a change of scene. The master told me to light a fire in the many-weeks-deserted parlour, and to set an easy chair in the sunshine by the window; and then he brought her down, and she sat a long while enjoying the genial heat, and, as we expected, revived by the objects round her: which, though familiar, were free from the dreary associations investing her hated sick chamber. By evening, she seemed greatly exhausted; yet no arguments could persuade her to return to that apartment, and I had to arrange the parlour sofa for her bed, till another room could be prepared. To obviate the fatigue of mounting and descending the stairs, we fitted up this, where you lie at present: on the same floor with the parlour; and she was soon strong enough to move from one to the other, leaning on Edgar's arm. Ah, I thought myself she might recover, so waited on as she was. And there was double cause to desire it, for on her existence depended that of another: we cherished the hope that in a little while, Mr Linton's heart would be gladdened, and his lands secured from a stranger's gripe, by the birth of an heir.

I should mention that Isabella sent to her brother, some six weeks from her departure, a short note, announcing her marriage with Heathcliff. It appeared dry and cold; but at the bottom was dotted in with pencil an obscure apology, and an entreaty for kind remembrance and reconciliation, if her proceeding had offended him: asserting that she could not help it then, and being done, she had now no power to repeal it. Linton did not reply to this, I believe; and, in a fortnight more, I got a long letter which I considered odd, coming from the pen of a bride just out of the honeymoon. I'll read it: for I keep it yet. Any relic of the dead is precious, if they were valued living. DEAR ELLEN, it begins:--

I came last night to Wuthering Heights, and heard, for the first time, that Catherine has been, and is yet, very ill. I must not write to her, I suppose, and my brother is either too angry or too distressed to answer what I sent him. Still, I must write to somebody, and the only choice left me is you.

Inform Edgar that I'd give the world to see his face again--that my heart returned to Thrushcross Grange in twenty-four hours after I left it, and is there at this moment, full of warm feelings for him, and Catherine! I can't follow it, though--(those words are underlined) they need not expect me, and they may draw what conclusions they please; taking care, however, to lay nothing at the door of my weak will or deficient affection.

The remainder of the letter is for yourself alone. I want to ask you two questions: the first is--How did you contrive to preserve the common sympathies of human nature when you resided here? I cannot recognize any sentiment which those around share with me.

The second question, I have great interest in; it is this--Is Mr Heathcliff a man? If so, is he mad? And if not, is he a devil? I shan't tell my reasons for making this inquiry; but, I beseech you to explain, if you can, what I have married: that is, when you call to see me; and you must call, Ellen, very soon. Don't write, but come, and bring me something from Edgar.

Now, you shall hear how I have been received in my new home, as I am led to imagine the Heights will be. It is to amuse myself that I dwell on such subjects as the lack of external comforts: they never occupy my thoughts, except at the moment when I miss them. I should laugh and dance for joy, if I found their absence was the total of my miseries,

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- 91gzw.com 版权所有 湘ICP备2023023988号-2

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务