数据库仓库管理系统课程设计
#? 覺得本文對你有用的話點(diǎn)個(gè)關(guān)注吧
目錄
- 概述......................................................
- 需求分析..................................................
- 念結(jié)構(gòu)設(shè)計(jì)................................................
- 邏輯結(jié)設(shè)計(jì)................................................
- 軟件功設(shè)計(jì)................................................
- 代碼設(shè)計(jì)和心得............................................
- 概敘
?1.0 項(xiàng)目背景;
倉庫在現(xiàn)實(shí)生活中用途十分廣泛,各種商城、超市要利用倉庫存放物資,藥房、醫(yī)院等要利用倉庫存放藥品,企業(yè)、工廠等要利用倉庫存放原材料、生產(chǎn)成品,因此倉庫的管理成了一項(xiàng)十分重要的工作。
人工管理倉庫既費(fèi)時(shí)又費(fèi)力,而且容易造成混亂,嚴(yán)重時(shí)會影響商城、企業(yè)的正常運(yùn)作,造成惡劣的后果。隨著信息技術(shù)的發(fā)展,辦公自動(dòng)化的普及,如何快速,高效,便捷的管理倉庫受到了高度的關(guān)注;因此為了解決這個(gè)問題我們提供這個(gè)系統(tǒng)以滿足倉庫管理需求,本系統(tǒng)是基于超市倉庫的管理系統(tǒng)。
1.1 編寫目的:
編寫實(shí)用的倉庫管理系統(tǒng)為倉庫管理系統(tǒng)提供一個(gè)基礎(chǔ),方便企業(yè)的商品管理。
1.3 軟件定義
企業(yè)倉庫管理系統(tǒng)(Equipment Managerment System); 是實(shí)現(xiàn)企業(yè)對貨物的出、入庫進(jìn)行高效的管理。通過應(yīng)用系統(tǒng)應(yīng)能對商品基本信息進(jìn)行管理。新的商 品信息的入庫、出庫等操作也是其中的一部分。 同時(shí)按照一定的條件查詢、 統(tǒng)計(jì)符合條件的商品信息。
第2章 需求分析
2.1 系統(tǒng)流程圖
2.1.1 系統(tǒng)流程圖符號
2.1.2本系統(tǒng)使用的總的系統(tǒng)流程圖;
2.1.3 數(shù)據(jù)項(xiàng);
第三章?? 概念結(jié)構(gòu)設(shè)計(jì)
3.1? E-R圖 ??
- 邏輯結(jié)構(gòu)設(shè)計(jì)
邏輯結(jié)構(gòu)設(shè)計(jì)的任務(wù)就是把概念結(jié)構(gòu)設(shè)計(jì)階段設(shè)計(jì)好的基本E-R圖轉(zhuǎn)換為選用DBMS產(chǎn)品所支持的數(shù)據(jù)模型相符合的邏輯結(jié)構(gòu)。把基本E-R圖轉(zhuǎn)換成關(guān)系模型。
??????????? 第五章? 軟件功能設(shè)計(jì)
5.1系統(tǒng)功能結(jié)構(gòu)
?? 可得如下系統(tǒng)功能結(jié)構(gòu)圖;
- ?代碼設(shè)計(jì)和心得
6.1核心代碼
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是:否)
)
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)
)
create table Storage
(
Sno char (4) primary key,
Sname char (20) ,
Sdress char (20)
)
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)
)
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)
)
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)
)
create table Provider(
Pno char (4) primary key,
Pname char (20) ,
Phone char (20)
)
數(shù)據(jù)庫鏈接與處理類;
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,”操作數(shù)據(jù)庫出錯(cuò)”,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,"操 作數(shù)據(jù)庫出錯(cuò)”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;"操作數(shù)據(jù)庫出錯(cuò)",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,” 操作數(shù)據(jù)庫出錯(cuò)”,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密碼驗(yàn)證失敗”,”請確認(rèn)密碼用戶名編號是否正確”,MessageBoxBut tons.0K, MessageBoxIcon. Information) ;
return false;
?}
}
Catch? (Exception? ex)
{
MessageBox. Show(ex. Message,"操 作數(shù)據(jù)庫出錯(cuò)”,MessageBoxButtons. OK,MessageBoxIcon. Exclamation) ;
return false;
}
Finally
{
connection。Close();
}
}
}
設(shè)計(jì)心得:
我從這次實(shí)驗(yàn)實(shí)踐中,我學(xué)到了從最基本的地方入手,了解行情從實(shí)際出發(fā)解決實(shí)際問題。我也對實(shí)驗(yàn)設(shè)計(jì)有了更加清楚認(rèn)識。我下去積極和同學(xué)交流,發(fā)現(xiàn)了自己很多的問題所在,希望在日后的訓(xùn)練中不斷加強(qiáng)自己的短板,
總結(jié)
以上是生活随笔為你收集整理的数据库仓库管理系统课程设计的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 背景框代码
- 下一篇: 企业信息化与BI系统建设规划