Вы находитесь на странице: 1из 26

Phn tich thit k h thng thng tin

Trng i Hc S Phm K Thut Hng Yn


Khoa : Cng Ngh Thng Tin

ti

Sinh vin thc hin:

Nuyn Th Hin
L Th Thu Hin
Nguyn Th Hp

Gio vin hng dn:

Nguyn Minh Qu

1
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin

Nhn xt ca gio vin

..
..........................................................................................................
..........................................................................................................
..........................................................................................................
..........................................................................................................
..........................................................................................................
..........................................................................................................
..........................................................................................................
..........................................................................................................
..........................................................................................................
..........................................................................................................
..........................................................................................................
..........................................................................................................
..........................................................................................................
..........................................................................................................
..........................................................................................................
..........................................................................................................
..........................................................................................................
..........................................................................................................
..................................

2
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin

Li ni u
H thng thng tin no cng c mt i sng, t lc khai sinh n lc b ph b.
l qu trnh tri qua mt s giai on nht nh. Cc giai on chnh thng l : tm
hiu nhu cu, phn tch, thit k, ci t, khai thc v bo dng. Khng nht thit cc
giai on c i qua mt cch tuyn tnh m c th vng i vng li nhiu ln. V
vy i sng ca h thng thng tin thng c gi l chu trnh sng hay chu trnh
pht trin.
Cng vi vic pht trin KHCN ngy cng hin i, CNTT tr thnh ngnh mi
nhn v n du trn con ng bc vo k nguyn mi: k nguyn pht trin ca
th gii CNTT. c bit l cc dch v thng ma in t , th trng o,, dch v
bu chnh vin thng. Cc ng dng qun l trn internet ngy cng c pht trin,
h tr qun l c lc v c hiu qu cao. Mt trong cc ng dng l trong mng
in thoi, n i hi cng ngh rt cao.
V l do ny m chng em chn ti qun l s in thoi ca mt tnh .
y l mt ta mi i hi phi c tnh thc t cao. ti ca chng ti c pht
trin trn ngn ng visual Basic 6.0v c s d liu SQL Server.
Di s hng dn ca thy

Nguyn Minh Qu

chng em xy dng

phn mm Qun l s in thoi ca mt tnh.Qua kho st thc t cc bu in


v c tham kho t mt s phn mn qun l in thoi v mt s nhng weside chng
ti hon thin bi vit ny. y l bc khi u nn bi vit ca chng ti cn
gp nhiu hn ch nn rt mong c s thng cm, ng gp ca qu v v cc bn
bi vit ca chng ti c hon thin.

Chng ti xin chn thnh cm n!

3
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin

Mc lc
Phn I: M t ti.5
I. kho st hin trng.5
II). Phn tch h thng v mt chc nng v v biu BPC 6
Biu phn cp chc nng

2.1.Cp nht thng tin v s l tnh ton 7


2.2.Tra cu, tm kim

2.3.In n .8
2. 4 .Thng k 9

III..Biu lung d liu.. 9


3.1.1 mc 0 .9
3.1.2Mc 1..10

3.2 Phn tch biu lung d liu..13


Biu quan h thc th E-R 14

IV.Thit k h thng. 15
1.La chn ci t c s d liu 15
2.Cc bng d liu.. 15
Bng kt ni d liu...17

V.Lu thut ton..17


5.1.1.Lu thut ton cp nht thng tin17
5.1.2. Lu thut ton tra cu, tm kim.18

5.2. Thit k giao din19


Phn II:kt lun24

4
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin

Phn I: M t ti
Chng ny gii thiu vi qu v v cc bn kt qu ca qu trnh kho st hin
trng tn ti v pht trin ca h thng in thoi hin nay. Qua y chng ti cng
trnh by nhng tng ring ca mnh v vic qun l s in thoi ca mt tnh.
Phn mm cho php ngi s dng c th truy cp kim tra danh b in thoi
, bit thng tin truy cp v mt s cc dch v lin quan ti in thoi nh: gi cc,
gi dch v ... nhng phn mn khng c chc nng cho ngi s dng c th chnh
sa, b sung. Ngi s dng ng nhp thng tin vo phi ng vi nhng quy nh
ca phn mm th kt qu truy cp mi chnh xc.
Vic la chn h qun tr c s d liu cho php xy dng ngn hng d liu
thch ng vi m hnh thng tin a dng v phong ph, p ng nhu cu v ng dng
thc t. ng thi cng la chn mt ngn ng lp trnh c tnh cht tr v hiu qu
cao m bo c yu cu ca h thng t ra. V vy chng em la chn ngn ng
lp trnh VitualBasic 6.0 lm ngn ng lp trnh ca h thng, kt ni c c s
d liu mt cch c hiu qu, d lm
H thng gip cho ngi qun l qun l mt cch d dng thng tin v khch
hng ca mnh, tnh ton mt cch chnh xc v nhanh chng gi cc. Gim c sc
lao ng, c giao din p.
Chng trnh ny c ng dng qun l s in thoi ca mt tnh. Gip
ngi s dng, ngi qun l truy cp thng tin nhanh hn.

I. kho st hin trng


qun l s in thoi ca mt tnh th b phn qun l cn cc yu cu
sau:
-Khi c khch hng ng k s dng in thoi, ngi qun l phi cp nhp
thng tin lin quan ti khch hng nh: h tn, a chvo h thng.
-Hng thng nhn vin bu in tng kt li thi gian m thoi ca khch hng
tnh gi cc tng ng . Nh vy cc thng tin c cp nhp lu tr trong h
thng, qua s l cho ra thng tin nh: ho n in thoi, thng k lng khch hng
s dng in thoi

5
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin

Vi phn mm qun l s in thoi ca mt tnh th ta c Modul


sau:
Cp nht thng tin
- Khch hang
- S in thoi.
- Cc ph
- Thng tin thanh ton

Tm kim
- Tn thu bao
- S my in thoi
- a ch thu bao
(Tm kim gn ng)
In n
- Phiu bo thanh ton
- Ha n thanh ton
- Ha n lu
Thng k
- Theo thng
- Theo chu k.
- Theo cc.
II). Phn tch h thng v mt chc nng v v biu BPC
y l giai on quan trng nht ca h thng, qua biu phn cp chng ta
hiu r hn qu trnh hot ng ca h thng. Theo yu cu qun l, h thng gm cc
chc nng chnh sau:
- Cp nht thng tin
- In n
- Tm kim
- Thng k.

6
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin

Biu phn cp chc nng


Qun l
s in thoi

Cp
nht
thng
tin

Khch hng

S in
thoi

Tm
kim

In n

Thng
k

Tn thu bao

Ho n
thanh ton

Theo thng

s my in
thoi

Bng cc
ph

Theo cc

Cc ph

Da ch thu
bao

tt thanh
ton

Tt thu bao
Theo chu k
Ho n lu

2.1.Cp nht thng tin v s l tnh ton


Chc nng ny s gip nh qun l cp nht thng tin ca khch hng no khi
khch hng n ng k s dng in thoi. Cc thng tin v khch hang s c
nh qun l s l v lu tr trong h thng hang thnh ly ra v thanh ton tin in
thoi i vi tng khch hng.
Cc thng tin ca khch hng nhp vo my nh: tenkh (tn khch hng),
Dckh(a ch khch hng), Sdt(s in thoi)
Cp nhp thng tin l bc u tin v quan trng cho trng trnh, v sau khi
cp nhp thng tin l cc khu k tip nh tnh ton v tm kim cc bc ny thng
tin u c ly t giai on cp nht gi liu.
7
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin


Trong chc nng ny c 4 chc nng con:
a). Nhp thng tin khch hng.
b). S my in thoi.
c).Cc ph .
d).Thng tin thanh ton.

2.2.Tra cu, tm kim


- Chn tm gn ng hay tm chnh xc:
+ Tm gn ng c kt qu c cha cc k t trong t kho a vo. VD:Khi tm
theo tn Ngun Th Hin s cho kt qu tm kim tn thu bao c cha cc k t
Nguyn, Th, Hin.
+ Tm chnh xc : cho kt qu ging ht cc t kho c a vo, nu khng s
bo li khng th tm kim c.
- Tra cu theo tn thu bao:G tn c nhn hoc t chc cn tm vo hp/box
tra cu theo tn thu bao. Kt qu s hin th tt c cc thu bao in thoi v s
in thoi ca c nhn hoc t chc c tn nh bn cn tm.
- Tra cu theo a ch thu bao: G a ch thu bao vo hp tra cu theo tn
thu bao. Kt qu s hin th tn thu bao v s i thoi ca c nhn hoc t chc c
ach nh bn cn tm.
- Tra cu theo tn v a ch cng lc:ta c th da d liu tm kim vo hai hp
thoi, chng trnh s cho ra kt qu ng vi hai iu kin trn. Cch tra cu ny
thng thng ch c kt qu khi tm gn ng.
NOTE: khi tn thu bao hoc a ch thu bao di. d hn cho vic tra cu,
bn ch nn tra cu vi t kho ngnth d c kt qu tm kim ng.
- Tra cu theo s my in thoi:bn c th nhn c tn v a ch thu bao
ca s in thoi (vi iu kin tn ti s my in thoi trong danh b in
thoi)

2.3.In n
Chc nng ny gip nh qun l cung cp thng tin cho khch hang nhng
thng tin v s dng in thoi cng nh s thu bao v cc thng tin khc nh:Cc
ph mi pht ni ht .trong tnh,ngoi tnh khi s dng 171 hoc khng dung 171.V
cho khch hang bit c cc ph s dng trong mi thang,hoc trong mt chu k
no thng qua phiu thanh ton hoc ha n
Chc nng ny gm cc chc nng con nh:
a. Bng cc ph
b. Ha n thanh ton
8
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin


c. Tt thu bao
d. Ha n lu

2. 4 .Thng k
Sau khi thanh ton tin t khch hang nh qun l phi thng k cc
thng tin v khch hang s dng in thoi ,qua lm c trong thng c bao nhiu
cuc gi i cng vi thi gian cuc gi v cc ph mi cuc gi v tng cc ph l
bao nhiu.Chng ta c th thng k theo
a.Theo thng
b.Theo chu k
c. Theo cc

III..Biu lung d liu


3.1.1 mc 0

Thng tin ng nhp

Thng tin ng
nhp

KH

Nhn vin

Thng
tin

y/c thng k
qun l s
in thoi
thng k

Yu cu
xem thng
tin

Yu cu xem thng
tin

9
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin

3.1.2Mc 1

cp nht
thng tin
Yu
cu

Tm kim
thng tin
p
ng

Yu
cu

p
ng

Khch hng
Nhn vin

tp QL cc ph
Nhn vin

Yu
cu

p
ng

Yu
cu

Thng k

p
ng

In n

a. Phn r chc nng cp nht d liu


KH
Thng tin
khch hng
nhp
khch
hng

nhp s
thu bao

tp thu bao
Tp khch
hng

Thng tn
thanh ton

tp thanh
ton

cc ph
Nhn vin
10
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin

b.Phn r chc nng tm kim

tp khch
hng

tp thu bao

tp thanh ton

KH
yu
cu

p
ng
Theo s
in
thoi
p
ng

nhn vin

Theo a
ch

Theo
tn thu
bao
yu
cu

Yu
cu

p
ng

p
ng

yu
cu

nhn vin

KH
p ng

11
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin

c. Phn r chc nng in n

gi

thng
tin

ha n
thanh ton

KH

nhn vin

thn
g tin
tp khch
hng

tp thanh
ton

Tp khch hng
phiu thanh
ton

Tp thu bao

KH
g i
Tp thanh ton

Theo s in
thoi

ha n
lu

Theo s thu
bao

Theo chu k
p
ng
y/c
thong
tin

thng
tin

p
ng

d. Phn r chc nng thng k


yu cu

yu cu
12

Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin


nhn vin

Phn tich thit k h thng thng tin

3.2 Phn tch biu lung d liu.


a. mc 0 (mc ng cnh)
Chc nng qun l tng qut ca h thng l :Qun l s in thoi ca mt tnh.
13
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin


i tc ca h thng l :nhn vin v khch hng. u tin nhn vin bu in
tc dng ln h thng, h s tr ra thng tin v khch hng. H thng s a ra yu
cu v ho n thu tin cc ph in thoi cho khch hng. Khi khch hng s
thanh ton tin in thoi cho nh qun l.
b. Mc 1 (mc nh)
Chc nng ca mc 0 s c phn r thnh cc chc nng con: cp nht thng
tin , tim kim thng tin, in n v thng k. Khi khch hng k hp ng s dng in
thoi thi nhn vin c trch nhim cp nht thng tin v khch hng vo h thng
M
sau ny qua qu trnh thng k s a ra ho n i vi ngi s dng.Khi nh
loi
qun l mun tm hiu thng tin th c th truy cp vo h thng. ng thi nh qun
M TB
Tn
l cng c th yu cu in n i viKH
tp qun l.
c.Mc 2
M
a) Chc nng nhp
S thng tin mc mt c
loiphn r thnh cc chc nng con:
khch hng, s inT
thoi , cc ph v thng tin thanh ton. Khi khch hng k
hp ng th tt c cc thng tin v khch hng s c cp nht vo tp khch hng.
Thng tin v : thi gian gi, cc ph, m loi s c cp nht vo cc tp v tt c
cc thng tin v khch hng s c a n tp thanh ton a n nh qun l.
b). Chc nng tm kim thng tin s c phn r thnh
Scc
thuchc
bao nng con: tm
Khch
kim theo tn,
tm kim theo a ch, tm kim theo s in thoi v c th s dng c
hng
tm kim chnh
xc. Khi khch hng mun tm kim thng tin th ch cn ng nhp ti
chc nng ny , vi yu cu l truy cp theo quy c. Cn i vi nh qun l cng
nh vy.
c). Chc nng in n c phn r thnh cc chc nng con: Bng cc ph,Ha
n thanh
Mton
KH ,Tt thu bao, Ha n lu. Cc ho n thanh ton v phiu thanh
ton c ly t tp khch hng
TnTB
a
S T
chi
S ng
d

Ho n

S T

M H

Biu quan h thc th E-R

Thng

Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin


Ma loi

14

Phn tich thit k h thng thng tin

IV.Thit k h thng
1.La chn ci t c s d liu
Dng h qun tr CSDL Microsoft SQL server thit k c s d liu .To cc
mi quan h kt ni gia cc bng.
15
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin


h qun tr SQL ang c s dng rt rng ri , d s dng , thao tc n gin.
C th thit k cc bng mt cch nhanh chng thun tin , xy dng cc truy vn
gii quyt cc yu cu ca bi . Bn cnh cn c th thit lp cc dng buc
ti u ho d liu .
Cc bng trong CSDL c th c truy nhp trc tip thng qua cc ng dng.
D liu trong cc bng c cp nht , sa , xo nhanh chng , chnh xc.
Chnh v vy m chng em la chn h qun tr CSDL SQL server lu tr c
s d liu .

* Xc nh cc tp thc th
Cn c vo cng vic thc t ca cc b phn, cc dng chy tng quan v chi
tit ca s lung d liu v cc thng tin cn qun l xc nh c cc tp thc th
v thuc tnh ca chng nh sau:

+ tblkhachhang(makh, maloai,sodt, dc, tenkh,socmt).


+ tblthuebao(matb, maloai, tentb, sodt, makh).
+Tblhoadon(mahd, tenkh, sodt, maloai, makh, thtien, GTGT, thang,
tienno, ttien).
+ Bng phiu bo (MaKH, SoDCu, SoDMoi, SoTieuThu, ThanhTien,
MaNV)
+MaKH (SoDCu, SoDMoi, SoTieuThu, ThanhTien, MaNV)

2.Cc bng d liu


Cn c vo cc thuc tnh ,cc thng tin ta thy h thng qun l s in thoi
cua mt tnh gm 5 tp CSDL( 5 Table) sau y:
Tbl Khch Hng
16
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin


STT
1

FIELDS
MaKH

Type
Text

Width
10

Descipition
M khch hng

Maloai

Text

15

M loi

SoT

Text

20

S in thoi

Text

17

a ch

TenKH

Text

30

Tn khch hng

SoCMT

Text

30

s chng minh th

Descipition

Tbl S Thu Bao

STT

FIELDS

Type

Width

MaTB

Text

10

M Thu Bao

Maloai

Text

15

M loi

TenTB

Text

20

M thu bao

sodt

Text

20

S in thoi

MaKH

Text

10

M khch hng

Tbl ha n
STT

FIELDS

Type

Width

Descipition

Tenkh

Text

20

Tn khch hng

Sodt

Text

15

s in thoi

Maloai

Text

15

M loi

Tggoi

Text

10

Thoi gian gi

17
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin


5

Thtien

Text

30

Thnh tin

GTGT

Text

30

Gi tr gia tng

Thang

Text

10

MaKH

Text

10

M khch hng

TenKH

Text

30

Tn khch hng

10

mahd

Text

30

M ho n

11

TienNo

Text

30

Tng tin

12

Ttien

Text

30

Tng tin

5
thng

-Bng phiu bo
Tn trng
MaKH

Kiu d liu
Text

Kch thc
10

M t
M KH

SoDCu
SoDMoi

Text
Text

Integer
Integer

S in c
S in mi

SoTieuThu
ThanhTien

Text
Text

Integer
Integer

S tiu th
Thnh tin

MaNV

Text

Integer

nhn

vin

-Bng n ng
Tn trng
MaKH
ThangNo
TienNo

Kiu d liu
Text
text
Text

Kch thc
10
Integer
30

M t
M khch hng
Thng N
Tin n

Bng kt ni d liu

18
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin

V.Lu thut ton


5.1.1.Lu thut ton cp nht thng tin
19
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin


Bc 1: Nhp d liu vo
Bc 2: Kim tra iu kin nhp
If dk= true then
< lu vo CSDL>
Else <quay li bc 1>
End.

bt u

m tp tin

nhp thng tin thu


bao

gi hm to m khch hng

ng
BEGI
N
Ghi vo c s d
liu
Nhp tiu ch cn tra cu
tip tc
Thc hin duyt v tm
kt thc

Thy

Khng thy
ng tp tin

5.1.2. Lu thut ton tra cu, tm kim


Hin th d liu

Thng bo
20

Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin


END

Phn tich thit k h thng thng tin

C th c nhiu tiu ch tm kim i vi tp CSDL. Sau khi nhp iu kin tm


kim, chng trnh s r sot trong tp c s d liu cn c theo iu kin . Nu trong
CSDL c thng tin cn tm kim th hin th d liu . Nu khng c thng tin cn tm
kim th thng bo khng tm thy.

5.2. Thit k giao din


H thng cho php cp quyn truy nhp cho ngi s dng. Chc nng ny th
hin tnh nng c th cho nhiu ngi c php c th s dng phn mm ny.
Qua mi Form chng ta c th thy c y d cc tnh nng ca h thng.
Thng tin c h thng s c hin th sau khi ta kch hot cc nt ng nhp trn giao
din form. Trong phn ny chng em trnh by ch l hnh nh chp sau khi cho
chy h thng.

Form chnh: chng ta kch vo cc mc v nhn Start chng trnh s chy ra cc


giao din con tng ng vi cc chc nng cn truy cp.

21
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin

Form : Tm kim thng tin


22
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin

Form kt qu tm kim

Khi chng ta mun tm kim thng tin v mt s in thoi no th chng ta


ch cn nhp thong tin vo (a bn, tn, s in thoi) th s c kt qu tr ra
form kt qu.

Form : Cp nht thng tin


23
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin

giai on thng tin ng nhp vo Thng tin khch hang thi s c bng kt qu
ng nhp nh trn.
V t y h thng s c cc thng tin cung cp cho phn tm kimv cng l
a ra thng tin cho phn thng k in n.

Form In n

24
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin

Form : Thng k

Cc thng tin cn thng k c cp nht v c a ra thng tin thanh ton. Chng


ta c th chn thng k theo thng ,theo chu k, hoc l theo cc ph
25
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin

Phn tich thit k h thng thng tin

Phn II.kt lun


Qun l s in thoi ca mt tnh l bi ton a ra ng gp kin ring
ca chng em v vic qun l s in thoi ca mt tnh gim bt s rc ri trong
khu t chc cn b, cho nhn vin bu in khng phi n tng nh thu tin,
cng nh l thng k hng ng giy t. y l bc khi u trong vic lp trnh
phn mn ca chng em, nn trong bi ton cn nhiu thiu st. Chng em mong c
s thng cm ong gp b sung ca thy.
Bi vit l s kt hp ca tt c cc thnh vin trong nhm Nguyn Thi Hin_ L
Th Thu Hin_ Nguyn Th Hp. Trong giai on u tm hiu chng em cng gp
phi nhiu kh khn nhng c s ng tm nht tr ca c ba nn c c bi vit
ny. Chng em cng c s phn cng cc cng vic chnh m mi thnh vin cn hon
thnh:
1.Nguyn Th Hp,Nguyn Th Hin, L Th Thu Hin
Phn tch h thng v mt chc nng(II)
2.L Th Thu Hin, nguyn Th Hp
Biu lung d liu (III)
3. Nguyn TH Hin

Thit k h thng(IV)

26
Sinh vin: Nguyn Th Hin_Nguyn Th Hp_L Th Thu Hin