药品进销存管理系统数据库课程设计03175_第1页
药品进销存管理系统数据库课程设计03175_第2页
药品进销存管理系统数据库课程设计03175_第3页
药品进销存管理系统数据库课程设计03175_第4页
药品进销存管理系统数据库课程设计03175_第5页
已阅读5页,还剩19页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、数据库课程设计报告课题:药品进销存管理系统计算机科学与技术专业班级:学姓号:名:指导教师:老师学院:信息工程学院 年 6 月 日摘 要. 11 课程设计的目的和意义. 12 需求分析. 2总体设计. 204.详细设计. 54 系统实现. 105 系统调试. 13小结. 18参考文献. 19摘 要信息时代已经来临,信息处理的利器-计算机,应用于商品的日常管理,了无限的潜力.采用计算机管理信息系统已成为商品管理科学化和现代化的标志,给销售商带来了明显的经济效益和社会效益。界面以及药品信息查询界面,分别有添加、删除、查阅等功能。药品进销存管理系统其开发主要包括后台数据库的建立和维护以及前端应用程序的

2、开发两个方者则要求应用程序功能完备,易使用等特点。经过分析,我们使用 v isual Studio2010 以及 SQL2008 开发工具,利用其易于上手和强大的数据库支持,方便我们快速开发出这个系统。1 款能够满足需要的软件,不仅能使办公效率大大提升,也对管理的科学性、安全性、可预见性方面提供了依据。这对企业来说节约了成本、提高了可靠性,也更便于操作。12 的管理、药品基本信息的管理,在药品销售窗体中,功能基本上包括基本药品的查询及选购数量和总价,一些简单的计算包括录入销售单价和数量之后自动计算出总额,在入库管理中,功能基本上包括药品添加、删除和修改等等;在库存管理窗体中基本功能包括基本库存

3、信息的浏览和查询等.数据库方面,和前面的功能相对应的,包括三个表息表.登录表中主要存储用户的账号和密码信息,库存表中存储的包括每一种药品的现存之间的联系时这样的,销售一次药品,库存信息表中的相应的药品的数量减掉销售的数量。上加快管理的效率,提高管理的效率和可靠性。可行性分析分析。通过调查分析,本系统设计主要有以下三个可行性:。1 本系统操作简单,易于理解,只需通过简单指导,上手较快,运行环境要求低。本系统利用Visual studio2010开发工具,并使用SQL Server 2012作为数据库管理系统,来实现医院药品进销存系统的各种功能。SQLServer 2012 属于2据的管理,为客户

4、端应用程序提供一致的接口.3计算功能。总共11要求密码和用户名都正确才能登陆,否则无法使用本系统;菜单选择窗体提示用库存管理功能.后台数据库的设计总共有三个表,包括登录表、药品信息表、库存信息表。作为后台的支持,分别和前面的功能界面连接.本系统事实上是基于C/S需要的数据库,在这里客户机就是指VB开发应用程序,服务器是指SQL Server2000所用的服务器,本系统用的是本地服务器,系统模式图如下图2-1所示:)图2-1 系统模式图这里VB客户应用程序通过本地服务器连接到SQL Server 2000的数据库,3测试SQL Server 2008和本地服务器的连接2. 4一前台应用程序的设计

5、总共包括11个窗体,其中有登录窗体、菜单选择窗体和九个功能窗体,体、药品入库窗体及药品修改窗体等。567否是药品信息药物进出信息修改8:概念结构设计通常是使用 E-R 图对它的描述工具进行设计,对需求分析阶段确定实体之间的联系类型,设计 E-R 图编号94 1. 在药品销售窗体中, datagridview 中显示药品信息;在查询按钮上代码如下private void button2_Click(object sender, EventArgs e)string userName = Box1.Text;string password = Box2.Text;string connString

6、 =”Data Source = 。 ;Initial Catalog =医院药品进销存系统;Integrated Security = true;SqlConnection connection = new SqlConnection(connString);stringsql=String。Format(select from 药品信息 whereypcode=0or ypname = 1”, password, userName);dataAdapter = new SqlDataAdapter(sql, connection);dataset = new DataSet();dataA

7、dapter.Fill(dataset);dataGridView1.DataSource = dataset。Tables0;2. 在确认交易按钮里添加如下代码:private void button1_Click(object sender, EventArgs e)string s = textBox3。Text;string userName = Box1.Text;string password = Box2.Text;int i = Int32。Parse(s);string connString = ”Data Source = 。 ;Initial Catalog =医院药品进

8、销存系统;Integrated Security = true;SqlConnection connection = new SqlConnection(connString);string sql = String。Format(”select kcamount from 库存 where ypcode=0 or ypname =1”, password, userName);SqlCommand command = new SqlCommand(sql, connection);connection。Open();int num = (int)command。ExecuteScalar()

9、;int d;d = num - i;10string sqll = String。Format(”update 库存 set kcamount = 0 whereypcode =1,d, password);SqlCommand commandl = new SqlCommand(sqll, connection);int aa = (int)commandl.ExecuteNonQuery();if (aa 0)MessageBox.Show(出售成功”);3. 在药品信息检索中的执行查询按钮中添加代码如下:string userName = Box1.Text;string passwo

10、rd = Box2.Text;string connString = ”Data Source = . ;Initial Catalog = 医院药品进销存系统Integrated Security = true”;SqlConnection connection = new SqlConnection(connString);string sql =String.Format(select from 药品信息 where ypcode = 0or ypname = 1, password, userName);dataAdapter = new SqlDataAdapter(sql, con

11、nection);dataset = new DataSet();dataAdapter。Fill(dataset);dataGridView1。DataSource = dataset.Tables0;4药品入库代码如下:库存TableAdapter.Update(医院药品进销存DataSet4。库存;MessageBox.Show(您已成功修改药品信息, 您已成功修改药品信息”,MessageBoxButtons.OK, MessageBoxIcon.Exclamation);5 修改药品信息代码如下:tring connString = ”Data Source = 。 ;Initial

12、 Catalog = 医院药品进销存系统IntegratedSecurity = true”;SqlConnection connection = new SqlConnection(connString);DataTable dt = new DataTable();string update = update 药品信息 set ypname=” + textBox2。Text.ToString()+”price=+textBox7.TextToString() +”chengfen=”+textBox5TextToString() +,guige=” + textBox3.Text。ToS

13、tring () +”,yongliang=” + textBox6。Text。11ToString() +,ypcode=+textBox1.Text.ToString() + whereypcode=”+textBox1 。Text + ”;tryconnection.Open();SqlCommand cmd = new SqlCommand(update, connection);int n = cmd.ExecuteNonQuery();if (n 0)MessageBox.Show(”修改药品成功”);elseMessageBox.Show(修改药品失败);catch (Excep

14、tion ex)MessageBox.Show(ex.Message);finallyconnection.Close();6 删除药品代码:private void button1_Click(object sender, EventArgs e)12string bianhao = textBox1.Text;tring connString = Data Source = 。 ;Initial Catalog = 医院药品进销存系统Integrated Security = true”;tryconnection。Open();string sql = String.Format(”de

15、lete from 药品信息 where ypcode=0,bianhao);SqlCommand cmd = new SqlCommand(sql, connection);int num = (int)cmd。ExecuteNonQuery();if (num 0)MessageBox。Show(”删除成功”, ”);elseMessageBox.Show(”删除失败 ”, );catch (Exception a)MessageBox.Show(a.Message, ”错误, MessageBoxButtons.OK,MessageBoxIcon。Error);finallyconnec

16、tion.Close();5 13返回后进入第二个功能窗体,同样执行库存查询显示如下:返回后进入药品销售窗体,图 8。药品销售管理窗体返回后,进入下一个功能窗体:17数据备份和恢复更完善。18 100个编程实例程序入门经典Visual .net程序设计教程1 private void button1_Click(object sender, EventArgs e)string userName = txtname.Text;string password = txtpwd.Text;string connString = Data Source = 。 ;Initial Catalog =

17、医院药品进销存系统;Integrated Security = true”;SqlConnection connection = new SqlConnection(connString);19stringsql=String。Format(”selectcount(*)from 账户密码表 whereusername=0and code =1, userName, password);tryconnection。Open();SqlCommand command = new SqlCommand(sql, connection);int num = (int)command。ExecuteS

18、calar();if (num 0)MessageBox。Show(”, ”登录医院药品进销存系统?成功”,MessageBoxButtons。OK, MessageBoxIcon.Information);Form2 form = new Form2();form。Show();this。Visible = false;elseMessageBox.Show(”您输入有误,”登录失败 ,MessageBoxButtonsOK,MessageBoxIcon.Exclamation);catch (Exception ex)MessageBox.Show(ex.Message, ”操作数据库出错

19、”,MessageBoxButtons。OK, MessageBoxIcon。Exclamation);2private void button1_Click(object sender, EventArgs e)string connString =”Data Source = 。 ;Initial Catalog =医院药品进销存系统;Integrated Security = true;SqlConnection connection = new SqlConnection(connectionString);DataTable dt = new DataTable();20string

20、 update =update 药品信息 set ypname=+ textBox2。Text。ToString()+”,price=+textBox7。Text。ToString()+,chengfen=+textBox5.Text。ToString() + ”,guige= + textBox3.Text。ToString () + ”,yongliang=” +textBox6.Text.ToString ()+,ypcode=”+textBox1.Text。ToString ()+ whereypcode= ”+ textBox1 。Text + ”;tryconnection.Ope

21、n();SqlCommand cmd = new SqlCommand(update, connection);int n = cmd。ExecuteNonQuery();if (n 0)MessageBox.Show(修改信息成功!?”);elseMessageBox。Show(修改信息?”);catch (Exception ex)MessageBox.Show(ex。Message);finallyconnection.Close();213private void button1_Click(object sender, EventArgs e)string bianhao = textBox1。Text;string connString =”Data Source = .;Initial Catalog =医院药品进销存系统;Integrated Security = true;tryconnection.Open();stringsql=String.Format(deletefrom 库存 whereypcode=0”,bianhao);SqlCommand cmd = new SqlCommand(sql, connection);int num = (int)

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论