数据库仓库管理系统课程设计

#  觉得本文对你有用的话点个关注吧

目录

  • 概述......................................................
  • 需求分析..................................................
  • 念结构设计................................................
  • 逻辑结设计................................................
  • 软件功设计................................................
  • 代码设计和心得............................................

  • 概叙

 1.0 项目背景;

仓库在现实生活中用途十分广泛,各种商城、超市要利用仓库存放物资,药房、医院等要利用仓库存放药品,企业、工厂等要利用仓库存放原材料、生产成品,因此仓库的管理成了一项十分重要的工作。

人工管理仓库既费时又费力,而且容易造成混乱,严重时会影响商城、企业的正常运作,造成恶劣的后果。随着信息技术的发展,办公自动化的普及,如何快速,高效,便捷的管理仓库受到了高度的关注;因此为了解决这个问题我们提供这个系统以满足仓库管理需求,本系统是基于超市仓库的管理系统。

1.1 编写目的:

编写实用的仓库管理系统为仓库管理系统提供一个基础,方便企业的商品管理。

1.3 软件定义

企业仓库管理系统(Equipment Managerment System); 是实现企业对货物的出、入库进行高效的管理。通过应用系统应能对商品基本信息进行管理。新的商 品信息的入库、出库等操作也是其中的一部分。 同时按照一定的条件查询、 统计符合条件的商品信息。

第2章 需求分析

2.1 系统流程图

2.1.1 系统流程图符号

2.1.2本系统使用的总的系统流程图;

2.1.3 数据项;

第三章   概念结构设计

3.1  E-R图   

  • 逻辑结构设计

逻辑结构设计的任务就是把概念结构设计阶段设计好的基本E-R图转换为选用DBMS产品所支持的数据模型相符合的逻辑结构。把基本E-R图转换成关系模型。

            第五章  软件功能设计

5.1系统功能结构

   可得如下系统功能结构图;

  •  代码设计和心得

6.1核心代码

  1. 用户信息——表    Users

create table Users (

Userno char( 10) primary key,

Userame char(20) not mull,

UserPassword char( 20) not mull,

Usercon char(2) not null check(Usercon in(C是:否)

)

  1. 商品信息——表 Goods

create table Goods(

(

Gno char(4) primary key,

Gname char(20) not null,

Pno char(4) not null,

Gdate datetime,

foreign key (Pno ) references Provider(Pno)

)

  1. 仓库表——Storages

create table Storage

(

Sno char (4) primary key,

Sname char (20) ,

Sdress char (20)

)

  1. 库存表-----Storage

create table Storage

(

Gno char (4) primary key,

Sno char (4) not null,

Gnum int not null check(Gnum=0),

foreign key (Sno ) references Storages(Sno),

foreign key (Gno) references Goods(Gno)

)

  1. 入库信息-----表

Instoragecreate table Instorage(

Gno char (4) not null

Indate datetime primary key

Userno char (10) not null,

Addnum int not null,

Sno char (4) not null,

foreign key (Gno) references Goods(Gno),

 foreign key (Sno ) references Storages(Sno),

 foreign key(Userno) references Users(Userno)

)

  1. 出库信息-----表Outstorage

create table Outstorage (

Gno char (4) not mull ,

Indate datetime primary key

Usemo char (10) not null,

Denum int not null,

Sno char (4) not null,

foreign key (Gno) references Goods(Gno),

foreign key (Sno ) references Storages(Sno)

foreign key(Userno) references Users(Userno)

)

  1. 供应商Porvider

create table Provider(

Pno char (4) primary key,

Pname char (20) ,

Phone char (20)

数据库链接与处理类;

public class DBhelper

{

public static string connSting ="Data Source= (1ocal) ;Database- WMS_ Project;User ID = 49; Pwd=123"

SqlConnection connection new SqlConnection (connSting) ;

public bool Userselectstring usersname, string password, string

IS)

{

string sqlJ String. Format(" select count(*) from Users where Username-' (0) and UserPassword=' (1)' and Usercon =' (2);" usersname,password,IS);

Try

   {

connection. 0pen();

SqlCommand command Hew SqlCommand (sql, connection) ;

int num in() command. ExecuteScalar0 ;

if (num ) 0)

{

return true;

}

Else

    {

return false ;

}

}

Catch( Exception ex)

{

MessageBox. Show (ex. Message,”操作数据库出错”,MessageBoxButtons. OK MessageBoxIcon. Exclamation) ;

return false;

     }

finally

     {

connection, Close();

     }

public bool SelectUserstring usersname, string password, string user)

{

string sql 8tring. Format("select Username from Users where Username-' (0)' and UserPassword-' (1)' and Usercon .=" (2);" usersname, password) ;

try

{

connection. 0pen();

Sq1Command command Hew Sq1Command (sql, connection)

SqlDataReader reader command. ExecuteReader0;

while (reader. Read( ));

{

user=reader. GetString(0);

}

return true ;

catch (Exception ex)

  {

MessageBox. Show(ex. Message,"操 作数据库出错”MessageBoxButtons. oK,MessageBoxIcon. Exclamation) ;

return false;

}

Finally

{

connection. Close();

}

}

public bool AddUser(string usno, string user sname, string password, string IS)

{

String   sq1   = String. Format (" INSERT

Users (Userno, Username, UserPassword, Usercon)" + "VALUES(' (0)','(1)',' (2)',' (3)')",usno,

Try

{

connection. 0pen0();

SqlCommand command new SqlCommand (sql,

int num F int) command. ExecuteNonQuery( ;

if (num > 0)

MessageBox. Show('添加用户成功”,” 添加成功”,MessageBoxButtons. OK,MessageBoxIcon. Information) ;

return true;

}

else

{

MessageBox. Show("添加用户失败”,”添 加失败”,MessageBoxButtons. OK, MessageBoxIcon. Information) :

return false;

}

}

catch (Exception ex)

{

MessageBox. Show (ex. Message,

}

MessageBoxIcon. Excl amation) ;return false;"操作数据库出错",MessageBoxButtons. OK,

Return false;    

}

Finally

{

Connect.Close();

}

}

public bool DeleteUser(string usno)

{

String sql 8tring. Format("Delete From users Where Userno=' (0)' űsno);

try

{

connection. 0pen();

SqlCommand command new SqlCommand (sql, connection) ;

 int num = int) command. ExecuteNonQuery :

if (num > 0)

{

MessageBox. Show("HB HFiDhj", " H P 1l, Jh ", MessageBoxButtons. 0K,MessageBoxIcon. Information) ;

return true;

}

Else

{

MessageBox. Show("HlHRHPkWx", "HFRE k ", MessageBoxButtons. 0K,MessageBoxIcon. Information);

return false;

}

}

catch'( Exception ex)

MesageBox. Show(ex. Message,” 操作数据库出错”,MessageBoxButtons. OK,MessageBoxIcon. Exclamation) :

return false;

    }

finally

{

connection. Close() ;

}

public bool ChangePWD(String Usno, string i Usname, string Uspassword,newpassword)

{

string sql - String. Format("UPDATE users set UserPassword- (0 where Userno-' ()'", newpassword, Usno);

string sqla String.Format("select count(*) from Users where Userno-' (0)' and Username' (1)' and UserPassword-" (2)': Usno, Usname, Uspassword):

try

{

connection.0pen0;

SqlComand command new SqlCommand (sqla, connection) ;

int num =in0) command. ExecuteScalar0 ;

if (num > 0)

{

Sq1Command commands new SqlCotmand (sql, connection) ;

Try

{

MessageBox. Show("修改密码成功 " “修改密码成功”MessageBoxButtons. оK, MessageBoxIcon. Information);

return true;

}

catch

        {

MessageBox. Show("修改密码失败“,”修改密码失败“MessageBoxButtons. 0K, MessageBoxIcon. Information) ;

return false ;

}

}

else

{

MessageBox. Show(T密码验证失败”,”请确认密码用户名编号是否正确”,MessageBoxBut tons.0K, MessageBoxIcon. Information) ;

return false;

 }

}

Catch  (Exception  ex)

{

MessageBox. Show(ex. Message,"操 作数据库出错”,MessageBoxButtons. OK,MessageBoxIcon. Exclamation) ;

return false;

}

Finally

{

connection。Close();

}

}

}

设计心得:

我从这次实验实践中,我学到了从最基本的地方入手,了解行情从实际出发解决实际问题。我也对实验设计有了更加清楚认识。我下去积极和同学交流,发现了自己很多的问题所在,希望在日后的训练中不断加强自己的短板,

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇
下一篇>>