HỆ CHUYÊN GIA QUẢN LÝ TRONG KHO BẠC NHÀ NƯỚC - MỘT SỐ VẤN ĐỀ VỀ THIẾT KẾ VÀ CÀI ĐẶT
NGUYỄN NGỌC TUẤN
Trang nhan đề
Mục lục
Đặt vấn đề
Phần1: Cơ sở lý thuyết ứng dụng.
Phân2: Kho bạc nhà nước và nhu cầu về một hệ chuyên gia quản lý.
Phân3: Thiết kế và cài đặt hệ hỗ trợ thẩm định dự án vay.
Tổng kết
Phụ lục
Tài liệu tham khảo
45 trang |
Chia sẻ: maiphuongtl | Lượt xem: 1744 | Lượt tải: 0
Bạn đang xem trước 20 trang tài liệu Luận văn Hệ chuyên gia quản lý trong kho bạc nhà nước - Một số vấn đề về thiết kế và cài đặt, để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên
'A
PHAN 3
THIET KE vA eAI DATHE HO. .
,,? ~
TRO THAM DINH DU AN VAY. ..
Trang31
OJ,a:tflfjJ:
CONGTAc TRAM BJNH Dl)'AN
? ,.(' " ....
VAY GIAI QUYET VI~C LAM
- "," ? ","...,
L QUY QUOC CIA CIAI QUYET VIJj;CLAM
XuatphcHtUtamquantrQngvatlnhbucxuccuavande giaiquyetvi$c
lamchonguaidentuoilacdqngcanvi$clam,dongthaimqtso kh.ongnholac
dQngdoithLJadosapxepI~ibQmaytrongcactochuc,bQdQixuatngO,lacdQng
di lamvi$cnudcngoaitrdve,...;ngay11/04/1992,HQiqpngBe)trudng(nayla
Chfnhphu)daranghiquyetso 120/HE>BTvechutruong,phuonghuangvabi$n
phapgiaiquyetvi$clam.
~ Bi$nphapdautiendu~cderatrongnghiquyetlaI~pOuyOuocgiagiai
quyefvi~clam.Nguonhlnhthanhquynayla:
- TrfchmQttll$ nhatdinhtrongNga.nsach Nhanudc,
- ThudodualacdQngdilamvi$cdnuacngoai.
- ThuWsl,itrQgiupvegiaiquyetvi$clamcuacautochl1cquocteho~c
Chfnhphucacnudc.
QuyduQcsudl)ngdechoyayvdilaisuc1tnangdoho~cbaatongiatricho
yaycho cacca nhan,doanhnghi$pt~oduQccho lamvi$cmdiho~cthuhut
themlacdQng;cacchuangtrInh,dl,lant~ovi$clam;cactrungtamd~yngheva
dichVI)vi$clam;cac trungtamapdl,mgtienbe)khoahockYthu~tvachuyen
giaocongngh$su dl)ngnhieulacdQng,_.
Ng.uyentacchoyayWnguonquyQuocgiagiaiquyetvi$clamla:
-ChoyaydungdoittJQng,dungdiachitheedl,ia!1daduQcduy$tvathee
dungtiendQsanxuat,tiendQthuhutlacdqng.
-Vanyayphaisu dl,mgdungml)Cdfchghitrongdl,Jan;va phaihoantra
dungh~n,dayduvanvalaitheekhelidcchovay.
-Vanvayphaidll~cbaadambangthechaphaytinchap.
IL THAM fJ!NH Dl/ AN VAY
Dotlnhchatllu daiveIaisuat,vi$cthftmdinhcacdl,J.anyaygiaiquyet
vi$clamlaratquantrQng,Daylanhi$mVI)cuaKBNN,nhamdliaraketlu~n:
- Cochapnh~nchayayhaykhong?
- MucvandliQCvaylabaanhieu?
- Thaih~nvalaisuatlabaanhieu?
Trang32
Cocacl1utiennaocuadljan?
£)aivoicacdljandavay.naydenhc;invaxindl1Qcgiahc;in.ho?cxintang
themvanvay.thl vi$cthamdinhdenhamxetxemcochapnh~ndl1QCkheng?
Co themetaquitrlnhthamdinhbangsddot6ngquatsau:
HSmoi duQc
cha'pthu~n
th(jih~n
Giah~n
duQccha'p
thu~n
H'Osomoi
khong duQc
cha'pthu~n
HSmoi
duQccha'p
thu~nv6n
Giah~n
khongduQc
cha'pthu~n
Uii sua't
h'OsOmoi.
Uii sua't
h'Osogia
h~n
HS tangv6n
duQcchip
thu~n
HS tangv6n
khongduQc
cha'pthu~n
v6ntang
duQccha'p
thu~
Mucv6n
khongduQc
chipthu~n
Cac uu tieD
cuadt!an
QUI TRINH THA~I DJNH DV AN VAY
Trang33
Theo quitrlnhnay,taco thechiaquatrlnhthamdinhracac bl1dc:
- Tiep nh~nva phanlo~ihesd dl)'an: he sd dl)'an co daydu va
hQp 1$kheng?
- Xetduy$tsovanchovay:sovanma dl)'andenghivayco phu
hQpkheng?
- Xet duy$tthaih~ncho vay:thai h~nvay ma dl)'an de nghico
phu hQpkheng?
- Xac dinhlaisuat:laisuathangthangla baanhieu?
- Xetcac l1utiencuadl)'an:dl)'andl1Qchl1c;ngcac l1u'tienaG?
Vi$c thamdinhdoivditUngbl1dcdl1Qcqui dinhtrongcac van blmco the
dl1QCmeta nhl1sau:
1.Tie'pnh~nvaphanlo~ih'osd dt1an
Cac hesd dl)'anvaycanthcimdinhdl1QCchiathanh3 lo~i:
- Hesd dl)'anmdL
- He sd xingiah~n:hesd da dl1Qcduy$tcho vay trl1dcday,nay
denh~nphaihoanvan,nhl1ngxindl1Qcgiah~nthem.
- He sd xintangvanvay:hesd da dl1Qcduy$tcho vaytrl1dcday,
nayxintangthemso vanvay.
Sl1dctiepnh~nvaphanlo~ihesd nayS6xac dinhhosd thuQclo~inaGva
co dl1QCchapthu~nhaykheng?
Cac dieuki$ndehesd dl)'andl1QCchapnh~ngom:
- Doi vaicachoseJmai:
+Neula dl)'ancuacac ca nhan,hQgiadlnh,.. thl can phaico
xacnh~nhQkhauthl1angtrucua chinhquyencia phl1dng.
+ Neu la dl)'an cua cac t6 hQp,cd sc;san xuat-kinhdoanhthl
can phaicogiayphepdangkykinhdoanh .
+ Neu la dl)'an cua cac doanhnghi$ptl1nhan,doanhnghi~p
nha nl1dc,..thl can phaico giay phepdang kY kinhdoanhva
quyetdinhthanhI~pdoanhnghi~p.
Ngo~itrucac dl)'ancua doanhnghi$pnha nl1dcho~ccac lien
doanhVi$t-Ti$p, cac dl)'an khacdeu phai dl1QCthe chap ho~cUn
chap.
- Doi vai cachoseJxingia h~nho?c tangvanyay:cd sc;de than,
dinhlavi$csu dl,mgvanvaydungml,JCarchaa khaitrongdl)'an,
thl)'csl)'co thuhutlacaQng,-
Qui trlnhconxetduy$thosd nayco themeta bangsd dosau:
Trang34
H'Osdmdi
duQccha'p
thu~n
saJ.
H'Osdmdi
khongduQc
cha'pthu~n
H'Osdmdi
duQccha'p
thu~n
H'Osdmdi
duQccha'p
thu~n
H'Osdmdi
khongduQc
cha'pthu~n
QUI TRlNH CON 1:
,., ... ,... '...
TIEP ~N VA PHAN LO~I HOSO
HSgiah~n
duQccha'p
thu~n
HS giah~n
khongduQc
cha'pthu~
HStangv6n
duQccha'p
thu~n
HS tangv6n
khongduQc
cha'pthu~n
Cac hesddliQCchapthu~nS8chuyensangbliocthamdinhtiepthee;dai
voicachesdxingiah~nho?ctangvanvaythJkhongdmthietphaithamdinh
Trang35
Ic;litatea,machi xetcaebu'oeco lienquan;VIdl,l,voi hosd xintangvanthl
khongcanxetIc;lithaihc;ln,tu'dngtL,t,voicaehosdxingiahc;lnthlkhongcanphai
xetIc;liso yon.
2.Xet duy~tmuev6nehoyay:
Nguyentaexetduy~tmuevanehovayla muevannaykhongvu'<,1tqua
hc;lnmuetienvay,voihc;lnmuetienvaydu'<,1exa djnhnhu'sau:
- 80i voicaedl,!aneanhan,hQgiadlnh,hc;lnmuetienyayla 5
tri~udong.
- 80i voicaedu'ansanxuatkinhdoanhthuhutnhieulacdQng
euacaet6 h<,1p,doanhnghi~p,hc;lnmuetienvayla 200tri~u
dong;nhu'ngblnhquanso vandautu'ehomoiehovi~elammoi
khongqua5tri~udong;tUela:
h~nmuctienvay=min(200,5*solacdQng)
(ddnvitfnh18.tri~udong)
tuyrihi~n,doivoicaedl,!anthuhutlacdQngWTi~pkhac(cO)
trdve,sovanyaykhongbihc;lnehebdi200tri~unhu'tren,tUela
doivdicaedl,!annaythl:
h~nmuctienvay=5*solacdQng
80i voicaehosdxintangvanyaythlt6ngsovandayaytru'ocdayvaso
vanxinyaythemGOngkhongdu'<,1ephepvu'<,1tquahc;lnmuctiemyaynhu'tren.
Doanhnghic$p
Hl,lnroueti'enyay=
Stri~u
Hl,lnroueti'enyay=
S tri~u*s61aodQng
Hl,lnroueti'enyay=
min(200tric$u,Stric$u*s61aodQng)
Mue y6n du'<;fe
cha'pthu~n
Muc y6nkhong
du'<;feha'p thu~n
QUI TRINH CON 2:
xET DUY£TMUC VaN CHO VAY
Trang36
3.Xet duy~thOih~nchoyay
Thaihc;inchovayphaiphuhopvoichukysanxuatkinhdoanhcuadl,lan,
nhlingkh6ngvlietqua36thang.
Co 3 mocthaihc;indliQCdungkhixetduy~tthaihc;inchovay:
- TLi 24den36thang:cadl,lancandautlidaih~n.
- TLi 12den24thang:cadl,lancandautli trunghc;in.
- Dliai12thang:cacdL!anconIc;ii.
Khidenhc;in,neuchudl,lanconhucaugiahc;invayvachap.hanhtotcac
dieuki~ncuakheliacvaytrliacdothiKBNNse dliQCgiahc;inthemkYnQmoi,
theethaihc;indaxetduy~ttrliacday.
Thai h1;l.nyay dlf<jc
chilp thu~n
Thai h1;l.llyay khong
dlf<jccha'pthu~n
Thai h1;l.nyay dlf<jc
cha'pthu~o
Thai h1;l.llyaykhoog
dlf<jcha'pthu~n
Thai h1;l.llyay dlf<jc
cha'pthu~n
Thai h1;l.oyay khoog
dlf<jccha'pthu~n
QUI TRINH CON 3:
xETDUYETTHOI~NCHOVAY
4.Xacdinhlaisu3'tchoyay
LaisuatvayhangthangdliQC xac dinhtheethai hc;inchovaynhlisau:
- TLi 12 thang trd xuong: 0.6%
- TLi12thangden24thang:0.5%
- TLi24thangden36thang:0.4%
Rieng doi vai cac dl,lan vay thuQccac cd sd san xuat kinhdoanhcua
thlidngb~nhbinh,ngliaitant~tthi laisuatquidinhla 0.4%kh6ngphan bi~thai
hc;in.
Trang37
Uii sua't=O.6%
QUITRINHCON4:xAc DfNHLAI SUAT
5.Caehuang1iutien
-Veaoi tuc;fngthamgiadl/ an:lacdQngdoi ra trongkhu vt,teNha nl1oe;
ngl1oidi lac dQngnl1oengoaive; bQdQixuat ngO;hQesinh tot nghi$p cae trl1ong
chuyen nghi$p, dQ-Ynghe; cac doi tl1<;1ngthl1dngbinh-xa hQi;ngl1CJitan t~t,mat
suc; doi tl1<;1ngt$ nQ-nxa hQi;-
- Veaiaban:cac diaphl1dngco nhucau Ion ve vi$c lamcho ngl1CJilac
dQng:thanhphoIon;khuGongnghi$pt~ptrung;.-
- Ve nganhnghe,huangkinhdoanh:san xuatva ma mangdichVt),khoi
phl,JCva phattrienngheco truyen,ehuyengiaoGongngh$,giaeongxuatkhau,
ung dl,mgGongngh$sinh hQc;nuoitrongd?c san co gia t~xuatkhaucao;khai
thacdatdaidei,rung,venbien;khaithaetainguyendiaphl1dng;-
Trang38
DT KHAC
Djaban
slmxullt
DB KHAc
TmJdNG B~NHBINH
A A '" -
BQ DQI XUA T NGD
NGU<JITAN TAT
""
HQC SINH NGHE
DT T~NANxA H(n
, "',
THANHPHOL0N
SX-M0 MANG DV
"" /l ""
NGHE CO TRUYEN
CONGNG~Mal
'" /l
PV XUAT KHAU
KHAI THAC Dcn RUNG
SD TAl NGUYEN DP
Uu tienv'ed6itu'Qngcua
THUcJNG B~NH BINH
Uu tienv'ed6itu'QngcuaA A '" -
BQ DQI XUAT NGD
Uu tienv'ed6i tu'Qngctia
NGDOI TAN TAT
Uu tienv'ed6itu'Qngcua""
HQC SINH NGHE
Uu tienv'ed6itu'Qngcua
DT'It N~~xA HOI
Uu tienv'edjabancua
THANHPHOLON
Uu tienv'edjabancua
K.HUCONG NG~P
Uu tiennganhngh'e
SX-M0 MANG OV
Uu tienllI!:anhngh'e"" r ""
NGHE CO TRUYEN
Uu tiennganhngh'e
CONG NG~ Mal
Uu tiennganhngh'e
'" /l
PIDJC VV XUA T KHAD
Uu tiennganhngh'e
KHAI THAC 001 RUNG
Du tiennganhngh'e
SO TAl NGUYEN DP
QUITRINHCON5: lic BfNH CAC UUTIEN
Trang39
IlL NILj.N XEr
Cho vaygiaiquyetvi~clamla mQtchutnJdngcua Chfnhphunhamml)C
lieu giaiquyetvandebuGxuchi~nnaylavi~clamchongvailacdQng.Dodo
vi~ccho vaykhongnhamml)Cdichsinhlaicho NgansachNhanVdc,malai
suat dVQcqui dinh6 daychi nhambu dapchi phi cho hoQ.tdQngcua Gonglac
nay.
£)~ml)c lieu trendQ.tketquatot,khaudau lien cua Gonglac cho vay la
thEimdinh dl,ian phaixacdinhdungdoitvQngdVQcvay,so vanva thaihQ.nvay
phuhQpvdiml)Cdfchdl,ian.So vdiGonglac thEimdinhdl,ian 6cacNganhang,
ndi ma ml,JClieu cua vi~cchovayla IQinhu~n,sl,ikhacbi~tquantrong6 dayla
nokhongnhungchixetvevi~canloancuadongvanmaconbatbuQcdongvan
phaidVQcsudl)ngtheeml)Clieudadefa.
Ngoaivi~cphatsinhnhieu"thamso"phaixet duy~tnhVtrem,mQtthl,icte
khacGOngco th~lamGonglac thEimdinhdl,iancua ngvaicanbQtindl)ngKBNN
tr6nenkhokhanhdn,dolanhungdinhhuanglQ.icd cau lacdQng,nganhnghe,..
thongquavi~cdieu'chlnhlaisuat,cacVulienvedoitvQng,nganhnghe,_.Khido,
nhungqui dinhma ngVaican bQtindl)ngda "thuQc"trvdcdaytr6thanhkhong
con phuhQpnuavaho lQ.iphai,xemnhV,batdaulQ.iW dau.
Tli cac nh~nxettren,vi~cxaydl,ingmQtchuang trJnhmaytfnhcothehe
trQchoGonglac thfimdinhdl,ianvaytrongKBNN lathl,icsl,icanthiet.
Cd s6 trithUGcua h~co th~dVQcthietke dl,iavaoso docacquitrJnhthEim
dinhcon trenday.
Trang40
ek,((0'Ifj'1:
THIET ICEHEHOTRO
THAMBJNHD0 ANVAY
L CACHij CON
Ol,J'atheoquitrinhthamdinh dl,J'an,tachiah~h6trQthamdinhdl,J'anvay
thanhcac h~con:
- H~conxetduy~thesd.
- H~conxetduy~tmucvanchovay.
- H~conxetduy~thaihc;lnchovay.
- H~conxacdinhlaisuatchovay.
- H~conxacdinhcacuuti€mcuadl,J'an .
Voi mf)the sd dl,J'anva yeucau ve cac vande can thamdinh,co th~la
toanbf)hof;3.cmf)tvaivande manguaisu dl,mgquantam;h~S6thl,J'chi~ntham
dinhbangcachchuy~nhesd quacach~conco lienquan.
M6ih~conS6tienhanhsuydientrenmf)tbf)lu~tdanrieng,vaco mQtcd
che giaithiGhketquathamdjnhriengcuano.
,," ,,"? "
IL THIET KE cd sa TRI TH(/C
Ta dung mQtdanh sach biensl,J'ki~nd~chua dl,J'ngcac thongtin ve dl,J'an
dang dLiQCthamdjnh: 10G1idl,tan,nganhnghe,diaban,so ILiQnglaodf)ngmadl,t
an thuhut, 10G1ilaodQng,sotiendenghidLiQCvay,-
M6im~nhdetrongcacphangiathietcua mQtlu~tdanco dc;lng:
trongdoco thecosl,tthamgiacuacac biensl,J'ki~nkhac.
Cac m~nhdetrongphanketlu~nduQcbieudientheodc;lng:
=
Vidu:
+Sl,tki~n!lOl,tandangxetlacuahQgiadinh"dLiQCbieudien:
CHU_OUAN="HQGIA SiNH"
.
+Sl,tki~n"So tiende nghiduQCvaycua dl,J'an vLiQtqua qui dinh"duQC
I bieudien:
l SOTIEN_VAY>HM_TIENVAY
Trang41
H~lu$tdanbaagemcae lu$tdanthehi~ncae nguyent~e,qui djnhve
vi~etham dinhdl,ian. Ta S8 phanehiah$ lu$tdan ra thanhtUngnh6m,moi
nh6mlacaelu$ttl1dngungvdimQth$candaphanehia(j tren.
1. Danh sachbie'nslf ki~n
Cae sl,iki$nlienquandenvi$ethamdinhdl1Qebieudienthongquacae
biensau:
TT Tenbie'n
1 LOA! HOSO
2 CHU_DUAN
3 I HOKHAU
4 aD THANHLAP
5 DK KINHDOANH
6 DUNG MDICH
7 THECHAP
8 TINCHAP
9 KL_HOSO
10 SOLAODONG
11 LOAILAODONG
12 SOTIEN VAY
13 HM TIENV AY
14 KL_SOTIEN
15 DT TRUNGRAN
16 DT DAIHAN
17 THOIHAN YAY
18 KL_THOIRAN
Ynghia
H6 5dd1,1'anmoi,~ngy6nh<ly~_~~n
CM th~l~pd1,1'an
Co ht)khiluthlti'fngtrukhong?
Co quye'td~nhthanhl~pkhong?
Co dangIcYkinhdoanhkhong?
Sli'd1plgv6nyaycodungm1,lcdfch?
TInh tr~ngy'ethe'chip
TInb .rangv'etinchip
KSi lu~ny'etinhd'aydii vahdpl~ciia
h6 50 d1,1'an xin thiim d~.
S61aodt)ngthuhUtdudcciiad1,1'an
Lo~id6itIi'1nglaodt)ngthuhUtdu'1c
cuad1,1'an
s6 y6nd€ nghjdudeyay
s6 ti'ent6idadudephepyay
Ke'tlu~nv'esO'ti'end€ ngh!dU'1eyay
DIt ane'and'autlitrunghan?
D1,1'ane'and'autitdaihan?
S6 thangd€ nghjdudevay
Ke'tlu~ny€ th<1ih~nd'enghjdu'1eyay
Kiill
Chu6i
Chu6i
Chu6i
Chu6i
Chu6i
Chu6i
Chu6i
Chu6i
Chu6i
s6
Chu6i
s6
56
1 Chu6i
Mi'8ngiatri
"DUNG","SAI"
"HO GIA BlNH", ,
:t
"TO H<.1P",
"DOANH NGHItp TV
NHAN",
"DOA.NHNGHItp NHA
NUdc",
"LIEN DOANH Vn;:T-T~P"
"CO", "KHONG"
"CO", "KHONG"
"CO", "KRONG"
,"CO", "KHONG"-
"CO","KHONG","MIF" .-
"CO", "KHONG","MrE;, ,
"R5 Mal DAY mJ", .--
"HSMal KHONGDX rDU"
"HS GIARANmJQc C1-,\p
THUAN"
"HSTANGVONmJQC {:HAP
THUAN"
"HSGIA RAN KHONGDuC1C
i CHAPTHUAN" ,I '
, "HS TANG VaN KRONG DuC1c
~ - '
CHAP THU AN "
..
"THVONG BENH BINH", ,
"LB Tf1TIEP vB", ,
"NGUCfITAN TAT",.. K -
"BQ BQI XUAT NOD"
'"
"HQC SINH NGHE ",
"BT 1$ NAN xA H(H",
"B6r TV<.JNGKHAC"
~ .
"CHAPTHUAN"- '~ -
"KHONG CHAP THUAN"
"E>UNG","SAI"
"DUNG","SAI"
Chu6i
Chu6i
s6
Chu6i
I
"CHAPTHUAN"
, "KHONGcHh TIill}.N"
Trang42
19 LAISUAT
20 DIABAN
Liii sua't
Bja b1111sanxua'tkinhdoanh
so'
Chu6i
Khu V1!csanxua'tkinhdoanh
Nganhngh~sanxua'tkinhdoanh
Chu6i
Chu6i~KHUVUC22 NGANHNGHE
Co u'U tien v~Mi tu'<;1ng?
Co u'Utienv~djaban?
Co u'Utienv~nganhngh~?
Yell CllUtMm dinh:toanbi?dl1anhay
tungphlln?
Chu6i
Chu6i
Chu6i
Chu6i
23 UT DOITDONG
24 UT DIA BAN
25 UT NGNGHE
26 VANDE
2. H~ lu~tdftn
a) Caelwjt tiep nh~nvaphan IO/:lihi) sd (19 lu#t)
IF LOACHOSO="MOl"
ANDCHU_DUAN="HQGlABINH""
ANDHOKHAU="CO"
ANDTHECHAP"KHONG"
THENKL_HOSO="HSMal BAY Bir
IF LOACHOSO="MOl"
ANDCHU_DUAN="HQGIABINH""
ANDHOKHAU="CO"
ANDTINCHAP"KHONG"
, '" ,
THEN KL_HOSO="HSMOl BAY BU"
IF LOAI_HOSO="MOl"
AND CHU_DUAN="HQGIA BINH"
AND HOKHAU="KHONG"
THENKL_HOSO="HSMal KHONGBAY Bir
IF LOAl HOSO="MOl"- :!
AND CHU_DUAN="TOH<!P"
AND DK_KINHDOANH="CO"
AND THECHAP"KHONG"
, '" ,
THEN KL_HOSO="HSMOl BAY BU"
27 I VANDECON
Iudt 101
IudtlO2
Iudt 103
Iudt 104
Qui trinhthilmdinhcondangthl1chi~n. IChu6i
"THANHPHOLdN"
"KHU CONGNG~P"
"B~ BANKHAc
"THANH~". "NONGTHON"
"SX-MdMANGDV"
'" /l '"
"NGHE CO TRUYEN"
"CONG NGHE MdI"
. '" /l
"PHUC VU XUAT KHAU"
"K1IAI iliAc BOI Rf1NG~
"DUNG TAl NGUYEN BP"- "',
"NGANH NGHE KHAC"
"CO". "KHONG"
"CO". "KHONG"
"CO". "KHONG"
~ '"
"THAM BJNH". "HOSd".
"VON" "THOIRAN"'" . '" ..:' '"
"THECHAP"."LA! SUAr.
"W'l1EN"
"HO Sd", "VON"."THOI
RAN"
. ",' '" - '"
"THECHAP","LAI SUAr.
"W TIEN"
Trang43
Luat1O5
LuatlO6
LuatlO7
LuatlO8
LuatlO9
Luat110
Luat112
Lua!113
LOAI HOSO="MOI"- '"
AND COO_DUAN="TOH<)P"
AND DK_KINHOOANH="CO"
AND TINCHAPo "KHONG"
, '" .
THENKL_HOSO="HSMOl BAY DU"
IF LOAI HOSO="MOI"- '"
AND COO_DUAN="TOH<)P"
AND DK_KINHDOANH="KHONG"
, A"'.
THEN KL_HOSO="HSMOl KHONG BAY BU"
IF LOAI_HOSO="Mal"
AND COO DUAN"HOGIA BINH"- k
AND COO_DUAN"TOH<)P"
AND QD_THANHLAP="KHONG"
THEN KL_HOSO="HSMOl KHONG BAY DU"
IF LOACHOSO="Mal"
AND COO DUANo"HO GIA BINH"- k
AND COO_DUAN"TOH<)P"
AND QD_THANHLAP="CO"
AND DK_KINHDOANH="CO"
AND THECHAPo "KHONG"
, '" .
THEN KL_HOSO="HSMdl BAY BU"
IF LOACHOSO="MOI"
AND COO DUAN"HOGIA BINH"
- k
AND COO_DUAN"TOH<)P"
AND QD- THANHL AP="CO"
AND DK_KINHDOANH="CO"
AND TINCHAPo "KHONG"
THEN KL_HOSO="HSMal BAY DU"
IF LOAI_HOSO="MOI"
AND THECHAP="KHONG"
AND TINCHAP="KHONG"
A ,'" .
THEN KL_HOSO="HSKHONG MOl BAY BU"
IF
- '"
IF LOAI_HOSO="TANGVON"
ANDDUNG_MDICH="CO"
THENKL_HOSO="HSTANGVaN BU<)CCHAPrnuAN"- '"
IF LOAI_HOSO="TANGVaN"
AND DUNG_MDICH="KHONG"- '" A '" A
THEN KL_HOSO="HS TANG VaN KHONG BU<)CCHAP THUAN"
Trang-t4
Lulit114
Lulit115
LueU116
Luat117
Luat118
Luat119
Luat201
Luat202
Luat203
Luat204
Luat205
Luat301
Luat302
IF LOAI_HOSO="GIA HAN"
AND DUNG_MDICH="CO"
THEN KL_HOSO="HSGIA HAN BUqC CHAP THUAN"
LOAI_HOSO="GIA HAN"
AND DUNG_MDICH="KHONG"
THEN KL_HOSO="HSGIA HAN KHONG DUqC CHAP THUAN"
IF CHU_DUAN="LIEN DOANH Y$T-TI$P"
THEN THECHAP="MIEN"
IF CHU_DUAN="LIEN DOANH Y$T-TI$P"
IF
THENTINCHAP="MIEN"
IF CHU_DUAN="OOANHNGHre;pNHANUdc"
THENTHECHAP="MIEN"
IF CHU_DUAN="DOANHNGHre;pNHANUdc"
. THEN TINCHAP="MIEN"
b) Cae/~t xetduYftmtleYOnehoyay(5/~t)
IF CHU_DUAN="HQGIABINH"
THEN HANMUC_STIEN=5000000
IF CHU DUAN"HOGIA BINH"
AND-SOLAODONG--BJET
AND LOAILAOOONG"LAO BQNG TI1 TI$P vE"
THEN HM_TIENV AY=min(5000000*SOLAODONG,200000000)
IF CHU DUAN"HOGIA BINH"
- '-<,
ANDSOLAOOONG:BlliT
AND LOAILAOOONG:" LAO BQNG TI1 Tre;PvE"
THEN HM_TIENV AY=5000000*SOLAOOONG
IF
-<'
HM_TIENV AY=BIET
AND SOTIEN- VAY<=HM-TIEN VAY
-<' A
THEN KL_SOTIEN=" CHAP THU AN"
IF HM_TIENV AY=BIET
AND SOTIEN- VAY>HM_TIEN VA Y
A -<' A
THEN KL_SOTIEN="KHONG CHAP THUAN"
e) Cae/~t xetduYftthtYih:;lnehoyay(6/wjt)
IF THOIHAN_VAY<=12
THEN KL_THOIHAN="CHAP THUAN"
IF THOIHAN- VAY>36
Trang45
LlUlt303
LulU304
Lwit 305
LlUlt306
Luat501
Luat502
Luat503
Luat504
Luat505
Lllat601
Luat602
THEN KL- THOIHAN= "KHONG CHAP TOO AN"
THOIHAN- VAY>12
AND DAUTU_DAIHAN="f}UNG"
THEN KL_THOIHAN="CHAP THUA.N"
IF
THOIHAN- V AY>12
AND THOIHAN- VAY <=24
AND DAUTU_TRUNGHAN="DUNG"
THEN KL_THOlHAN="CHAP THUA.N"
IF
,
THOIHAN- VAY>12
AND THOlHAN- VAY<=24
AND DAUTU_TRUNGHAN="SAI"
AND DAUTU_DAIHAN="SAI"
THEN KL_THOIHAN="KHONG CHAP THUAN"
IF
THOIHAN- VAY>24
AND DAUTU_DAIHAN="SAI"
THEN KL- THOIHAN="KHONG CHAP THUAN"
IF
d) Cae lwjt xae a/nhlfji suitt(51wjt)
IF LOAILAOOONG="THUONGB~NHBINH"
THENLAISUAT:=O.4
IF LOAILAODONG="NGDOI TAN TAT"
THEN LAISU AT:=O.4
IF THOIHAN- VAY<=12
THEN LAISUAT:=O.4
LOAILAODONG"THUONGB~NHBINH"
AND LOAILAODONG"NGDOITAN TAT"
AND THOlHAN- VAY >12
AND THOlHAN- VAY <=24
THEN LAISUAT:=O.5
IF LOAILAOOONG"THUONGB~NHBINH"
AND LOAILAODONG"NGDOITAN TAT"
AND THOIHAN- VAY >24
IF
THEN LAISUAT:=0.6
e) Cae lwjt xae dfnhcaeu'ulien eUadtfan (161wjt)
IF LOAILAODONG="THUONG B~NHBINH"
THEN UT_OOITUONG="CO"
IF LOAILAOOONG="BQDQIxuAT NGU"
Trang46
Luo.t603
Luat604
Luo.t60S
Luo.t606
Luo.t607
Luo.t608
Luat609
Luo.t610
Luat611
Luo.t612
Luo.t613
Luo.t614
Luo.t615
Luo.t616
THEN VT_DOITUONG--"CO"
IF LOAILAODONG--"NGDOI TAN TAT"
THEN UT_DOITUONG--"CO"
'"
IF LOAILAODONG--"HQC SINH NGHE"
THEN UT_DOITUONG--"CO"
IF LOAILAODONG--"BT ~ NANxA HOI"
THEN UT_DOITUONG--"CO"
IF LOAILAOOONG--"B61 ruqNG KHAc"
THEN UT_DOlTUONG--"KHONG"
, '" /
IF DIABAN="THANHrHO LON"
THENUT_DIABAN="CO"
IF DIABAN="KHUCONGNGmEP"
THENUT_DIABAN="CO"
IF DIABAN="BfABANKHAc"
THENVT_DIABAN="KHONG"
IF
, '" /
NGANHNGHE="NGANH NGHE KHAC"
THENVT_NGNGHE="KHONG"
IF KHUVUC="THANHTm"
ANDNGANHNGHE="sX-Md MANGDJCHvcr
THEN UT_NGNGHE="CO"
"';/ '"
IF NGANHNGHE="NGHECO TRUYEN"
THEN N UT_NGNGHE="CO"
IF NGANHNGHE="CONGNGHI;:MOl"
THEN UT_NGNGHE="CO"
'" ;/
IF NGANHNGHE="Pffi)CV{)XUATKHAU"
THEN UT_NGNGHE="CO"
IF KHUVUC=" NONG THON "
, '" ,
AND NGANHNGHE="KHAI THAC 001 RUNG"
THEN UT_NGNGHE="CO"
IF KHUVUC="NONGTHON"
ANDNGANHNGHE="DUNGTAl NGUYENBP"
THENUT_NGNGHE="CO"
Trang47
IlL THIET KE sd DOHf!;THONG
1.Chtidngtrmhchfnh
Hoc;l.tdQngchlnhcuah$thongcoth~dligcmetabangsddokhoisau:
KL v'ehosd va
gi:iitmeh
KL v'emuev6n
vagi:iithleh
KL v'ethaih;,ln
vagi:iithleh
KL v'enil sua't
vagi:iithleh
KL v'ecae Itu
tieDva gi:ii thleh
Ke'tlu~nvagiai
thlehchung
Theosddo,h$nh~ncacyeu cauvevandecanthamdjnhtUngLlOi
sli dl,mg,do 180cacvande tlngvoi cac quitrJnhthamdinhcon da neu.Sau
do,h$ phanphoitUngyeucauchoh$contlidngtlng,nh~nvecautralojva
st!giaithiGhchotUngvandecon do.CuoiclIng,h$UchhgpthanhmQtcau
traloichungvast!giaithiGhchungchocacyeucaudadligcdexuat.
Trang48
2.Caeh~eon
Sd doho<;ltdQngeuamOih~connhu'sau:
Khih~condu'c;1egQi,noS8dQeVaGbQnhonhomlu$td~ntu'dngLIngvoi
quitrlnhconmah~phaigiaiquyet.DayeOngehfnh180quatrlnhh~conkhait?O
caecautruedLili~udu'c;1edungehotientrlnhsuydien,baogom:danhsaehcae
bienstj ki~n,danhsaehcaem~nhdetrongphangiathietvadanhsaehcaeket
lu$neuacaelu$t.
SaudonoS8tienhanhsuydientheocdeheI$plu$nluidE!tlmketqua
thamdjnh;trongquatrlnhsuydien,h~coneOngS8ghinh$n"vet"euaquatrlnh
suydien,tUe180ghinh$ncaelu$td~ndadu'c;1esadl,mgvadungdolamcdsa
ehovi~egiaithiehketquathamdinh. .
Thu$ttoimsuydienthee cd ehe I$p lu$n luidu'c;1eapdl,mgco thE!mota
nhu'sau:
Trang49
Yeudiub6sung
1u~nvaoCSTI
BUNG
f)~quivdiyen
c:iu1ake't1n~n
SAI
BUNG
Ghi nh~ns6 hi~n1~t
vao ve'tsuy di~n
Trongso dothu~toanI~plu~nluitrenday,tagQibiensl/ ki~nnguyen
thuyla caebiensl,iki~nmakhongn~mtrongph~mketlu~ncua mQtlu~tnaoca.
Doivdicaebiensl,iki~nnguyenthuynaythitachicothebietdV<;1cgiatricua no
thongquavi~choingVoisu dl,mg;ngV<;1cI~i,doivdicaebienkhongnguyenthuy,
thl thu~toangQid~quivdiyeucauthAmdinhlabiensl,iki~ndo.
So Ianphaid~quicuathu~toanchfnhlaso Ianman6phaith\Jchi~nvi~c
I suy diEmgia tri cho cae bien Sl,iki$n khongnguyenthuytren; do la cae ket lu$.n
I
Trang50
trunggianmathu$ttoanphaitlmratrliockhicothe katlu$nchoyeu cautham
dinhbandau.Doi voi thamdinhdl)'an vay,so Ian phaitlmkat lu$ntrunggian
nay khongnhieu;doivoi h$ lu$tdanda de xuatthl chi co 2 trliangh<;1pthu$t
toanphaid$qui1Ian:
- Khixetduy$tmucvanvayphaixacdinhh~nmuctienvay.
- Khixacdinhlai5Uatphaixetthaih~nvay.
Do v$y,vi$cdungmQtthu$ttoand$ quicho cd cha I$p lu$nlui d dayla
chap nh$n dli<;1c.
Trang51
(jJ,t(t11f/5:
eM BAT HE HOTRO
;? . ." .
TRAM BINH DU AN VAY. .
H$ hotrQth~mdinhdl,tanvayduQcd~ttenla KBEX, va duQccaid~t
bangngonnguC, phi$nbanBorlandC 4.5ForWindows.
L CA£; TRUC DO LIJj;U
3 cautrucduIi$uquantrongsadt,mgtrongcdchesuydienI~plu~nluila
biensl,tki$n,bienm$nhde,ketlu~nduQccaid~tbangcaccautrucnhusau:
1.Danhsachbie'nsriki~n
Mojbiensl,tki$nduQcluutrathongquacautrucsau:
struct {
char *sukien;
short loai;
short kieu;
short biet;
short giatri;
};
trongdo:
- sukien:tenbiensl,tki$n,chuoikytL!nayS6duQcdungd~trao
d5ithongtinvoinguoisadl,mgvebiensl,tki$ndo.
- loai:phanlo<;lib ensl,tki$n:O-khongnguyenthuy;1-nguyemthuy.
- kieu:kieucuagiatribiensl,tki$n:O-bienSl,tki$nco giatriso,
1-biensl,tki$ncogiatrikieuchuoi.
- biet:dflbietgiatricuabienchua?(0:chua,1:dflbiet)
- giatri:giatricuabiensl,tki$n.Doivoicac bienco giatrichuoi,ta
dungmQtmangdeluumiengiatricuano;khido,thanhphan
giatrinaylachisocuagiatribientrongmlmg.
Cacbiensl,tki$ndudcluutratrongmQtmangmQtchieucacc~utructren.
2.Danhsachbie'nm~nhd'e
Trongh$lu~tdan,tachisadl,mgcacm$nhdecod<;lng:.
voibieuthuG(jvetraicothela:
- mQthang,VIdl,J:
LOAI_HOSO="Mdl"(m$nhde 1, lu~t101)
Trang52
- mQtbienm~nhdekhac,VIdl.J:
SOTIEN_VAY<=HM_TIENVAY(m~nhde 1, lu?t204)
- WkhoaBIET,VIdl.J:
SOLAODONG=BIET(m~nhde2, lu?t202)
Ta ILiutrGmoim~nhde trongphangia thietcua mQtlu?t daribangcau
trucnhLisau:
struct {
short
short
short
bien;
phepsosanh;
giatri;
trongdo:
- bien:chiso trongmangdanhsach biensl,tki~ncuabiensl,tki~n
(j vetrai m~nhde.
- phepsosanh:phepso sanhdLi<;1Cdungtrongm~nhde.d dayta
dungmQtso d~kyhi~uchomQtphepso sanh:
+0:vetrailaW khoaBIET
+1:sosanh=vetraivaimQthang
+2: sosanh>vetraivaimQthang
+3: sosanh<vetraivaimQthang
+4:sosanh>=vetraivaimQthang
+5:sosanh<=vetniivaimQthang
+6:sosanhvetraivaimQthang
+101:so sanh=vetraivaimotbiensLikienkhac.. '.
+102:sosanh>vetraivdimQtbiensl,tki~nkhac.
+103:sosanh<vetraivdimQtbiensl,tki~nkhac.
+104:sosanh>=vetniivdimQtbiensl,tki~nkhac.
+105:so sanh<=vetraivdimQtbiensl,tki~nkhac.
+106:sosanhvetraivdimQtbiensl,tki~nkhac.
- giatri:bi~uthivetraicua phepso sanh,tuytheotrLiongh<;1p:
+ Khi ve trai la mQthangthi thanhphannaychlnhla gifttr;
cuahangdo.
+ Khi ve trai la mQtbiensl,tki~nkhac thi thanhphannay
chuachiso mangcua biensl,tki~n(j ve traitrongmangdanhsach
biensl,tki~n.
+KhivetrailaW khoaBIET thithanhphannaylao.
Danhsach bienm~nhde dLi<;1CILiutmtrongmQtmang2 chieu,trongdo
chieuthu nhatla theoso lu?ttrongh~lu?t,chieuthuhai theocac biensl,tki~n
thamgiavaophangiathietcualu?t.
Trang53
3.Danhsachke'tlu~n
Danhsachketlu~nlamQtmangluutrucacketlu~ncuacaclu~ttrongh$
lu~td§.n.
Moiketlu~nc6'cautrucnhusau:
struct{
char *vande;
char *traloi;
};
trongd6:
- vande:tencuavandecanketlu~n.
- traloi:cautraloicualu~tchovande.
1-
4. Vi dQ
£)ai voih$conXetduy$tmucvan,h$'lu~td§.ngem5 lu~t:
IF CHU_DUAN="HQGIABINH"
THEN HM_TIENVAY=5
3..
CHU DUAN"HOGIA BINH"
ANDSOLAODON~BffiT
AND LOAILAODONG"LAO DQNGTI1 mp vE"
THEN HM_TIENV AY=min(5*SOLAODONG,200)
IF CHU DUAN"HOGIA BINH"
- . '"
AND SOLAODONG=BIET
AND LOAILAOOONG=" LAO DQNGTI1mp vE"
2- IF
THEN HM_TIENV AY=5*SOLAOOONG
4- IF
'"
HM_TIENV AY=BIET
AND SOTIEN- VAY<=HM_TIEN VAY
'" A
THEN KL_SOTIEN="CHAP THU~"
5-
'"
IF HM_TIENVAY=BIET
AND SOTIEN-VAY>HM_TIEN VAY
THEN KL_SOTIEN="KHONGCHAPTHUAN"
Cd scitrithuGnayse dlJc;1CbieudiennhlJsau:
-Danhsachbiensl,iki$n:
1 "Chudl,ian",O,1,0,0
2 "HGlnmuctiEmva ",1,0,0,0
3 "LOc;lilacdQn",0,1,0,0
4 "Solao dQn",0,1,0,0
5 "Sotienva ',0,0,0,0
Miengiat~caebienki~uchuoiduc;1C"soh6a"bAngchiso mangnhtJsau:
Trang54
+ Chu dl,i an: O-CHUA;BIET,1-HO GIA DINH, 2-TO HOP, 3-DOANH
NGHI~P
+Loailac dQng:O-CHUABIET, 1-LAODONG TU TI~P VE, 2-THUdNG
B~NH BINH,... .
- Danhsach bienm~nhde:
- Danh sach ket lu~n:
Lu~t1 Hc;iIJmuctien vay
Lu~t2 - Hc;inmuctien va
Lu~t3 Hc;inmuctien va
Lu~t4 Ket lu~nso tien va
Lu~t5 Ket lu~nso tien va
? ",/ A/ ""
IL MODULE CIAI QUYET VAN BE
Moi h~con tien hfmhsuy dien thee thu~ttoan I~p lu~nlui da trlnh bay.
Thu~t toan nay dLi<;JCcai d~ttrong ham BACKWARD_CHAINING cua t~ptin
CHAINING.C nhLi sau:
int BACKWARD CHAINING(char *vandecon)
{
int i,kq;
if (strcmp(vandecon,VANDE)==O) ivet=O;
for (i=O;i<SOLUAT;i++) {
if (strcmp(DS_ketluan[i] .vande,vandecon) ==0)
kq=TestIFClause(i);
if (kq==l) {
moluat(i); II mo luat
vet[ivet++]=i; II va ghi nhan vet suy dien
if (strcmp(vandecon,VANDE)==O) return i;
} II if
} I I for i
return -1;
}
int TestIFClause(int rule_number)
1*-------------------------------------------------------
Kiem tra phan IF cua luat co so hieu rule_number:
-nghiem dung: tra ve 1
-sai : tra ve 0
-co bien thuoc ds ket luan : goi de qui
*1 '
{
int j; II menhde thu j
Trang55
Mnh de 1 Mnh de2 Mnh de3 Mnh de4 Mnh de5
Lut 1 1,1,1
Lut 2 1,6,1 4,0,0 3,6,1
Lut 3 1,6,1 4,0,0 3,1,1
Lut 4 2,0,0 5,105,2
Lut 5 2,0,0 5,104,2
for (j=Oij<SOBIENij++) {
if (DS_bien_menhde[rule_~urnber] [j] .bien)
vao luat
if (DS_bien[j] .biet==O) {
if (DS_bien[j].loai!=O)
CallDlg(j)i
{I I bien co tham gia
else
II if 2 nhung chua biet no
II neu la bien "nguyen thuy"
II thi hoi gia tri bien
II bien co trong dsKL
BACKWARD_CHAINING(hWnd,DS_bien[j] .sukien)i
}
if (Nghiem(DS_bien[j] .giatri,
DS_bien_menhde[rule_number] [j] .phepsosanh,
DS_bien_menhde[rule_number] [j] .giatri)==O)
return 0i
} II if
} I I for j
return Ii II IF clause thoa
int Nghiem(int giatri_l,int sosanh, int giatri_2)
I* ~-
kiem tra phep so sanh :
tra ve 1: dungi 2: sai
*1
{
switch (sosanh)
{
case 101: 11=bien khac
if ((DS_bien[giatri_2].biet)&&(giatri_l==
DS_bien[giatri_2].giatri») return Ii
else return Oi
case 102: 11<=bien khac
if ((DS_bien[giatri_2] .biet) &&(giatri_l<=
DS_bien[giatri_2].giatri» return Ii
else return Oi
case 103: 11>=bien khac
if ((DS_bien[giatri_2].biet)&&(giatri_l>=
DS_bien[giatri_2] .giatri» return Ii
else return Oi
case 104: /1# bien khac
if ((DS_bien[giatri_2] .biet)&&(giatri_l!=
Trang56
(:ase 1: 1/==
if (glatrl_l==giatrl_2) return lielse return Oi
case 2: //<=
if (giatri_l<=glatrl_2) return lielse return Oi
case 3: //>=
if (giatrl_l>=glatri_2) return lielse return Oi
case 4: 1/#
if (giatrl_l!=giatri_2) return lielse return Oi
case 5: //<
if (giatri_l<glatrl_2) return Ii else return Oi
case 6: II>
if (giatri_l>glatrl_2) return Ii else return Oi
DS_bien[giatri_2] .giatri)) return 1;
else return 0;
case 105: 11<bien khac
if ((DS_bien[giatri_2].biet)&&(giatri_l<
DS_bien[giatri_2] .giatri)) return 1;
else return 0;
case 106: II> bien khac
if ((DS_bien[giatri_2] .biet)&&(giatri_l>
DS_bien[giatri_2].giatri)) return 1;
else return 0;
default:
return 1;
void moluat(int rule_number)
I* ~--------------------------
mo luat thu rule_number sau khi tat ca cae gia thiet cua no
duoc thoa
*/
{
switch (rule number)
{
case 15:
DS_bien[HMTV] .biet=l;
DS_bien[HMTV] .giatri=5;
break;
case 16:
DS bien [H}!TV] .biet=l;
DS_bien[HMTV] .giatri=5*DS_bien[SLLD].giatri;
break;
case 17:
DS_bien[HMTV] .biet=l;
DS_bien[HMTV] .giatri=min(200,5*DS_bien[SLLD] .giatri);
break;
default:
break;
Trang hamBACWARD_CHAINING,ta dungmfmgvetOva chi
56 ivetde ghi nh~ncaelu~tda dl1<;1emC1.Bay la caedi1li~uto~mCI,lC,
va 56dl1<;1edungdexaydl,lngeaugiaithfehchokatquath~mdinh.
HammoluatOdl1<;1egOikhitatea caegiathiefcua lu~tdeuthoa.
Nhi~mVI,Ieuan6laxaedinhgia trj euave phaim~nhde kef lu~nva
gangiatrjd6chobiensl,lki~n(jvetrai.
0 day, do chl1acai d~tdl1<;1cthu tl,lCphan tfehmQtbieu thuc, nen
d6ivdicac lu~te6vephainhl1v~y,trongh~lu~tdanhi~ntGii,d6lacac
lu~tkatlu~nve hGinmuetiienvay:
HM- TI ENV AY =5"SOLA ODONG. (Ju~t202)
Trang57
hay HM_TIENVAY=min(200,5*SOLAODONG)(Iu~t203)
hammoluatOphaitrnhtn,Jctiepgia tli nay.flay la mQth~nche quan
trngdmkhacphucdoivdiham.
IlL MODULE QUANLY TRI Tn(fC
1.LoU tru cdsOtri thuc
Cd sd tri thuccua h~th6ngdl1c;1c111utra trong2 t~ptin van bansau:
a) VAR.KBE:chua danhsach cae biensl,iki~n,cungvdi lo~i
(nguyen thuy hay khong nguyen thuy), kieu (s6 hay chuoi) va
miengiatli cuanokhikieulachuoi. '
Moi biensl,iki~n111uthanh 1 dong,theocau truesau:
;;;
trongdo la miengia tli cua biensl,iki~n,
va chI co khi giatribien 180chuoi, tUc180khi kieu=1.
Vf dl,l:
- Bien LOAI_HOSO dl1c;1cghinhl1sau:
Loai ho so;0;1;MOI,GIA HAN,TANG VaN
- BienHM_TIENVAY dlic;1cghi:
Han mUGlien vay;O,O
b) RULE.KBE: chuah~lu~tdan.Moi lu~tdl1c;1C11udl1did~ng:
,
IF
THEN
trongdo:
- vande:gomcaes6 chIrah~connaoS8dunglu~tnay.
- giathiet1,giathiet2,- lacaem~nhdetrongphangiathiet
cualu~t.d day h~th6ngchI xetcae lu~tvdi ph~mgiathiet
gomcacm~nhde dl1c;1Ckat hc;1Pnhau bangloan tUAND.
- katlu~n:phankatlu~ncualu~t.
Vi~cquanIy tri thuGcho h~ dl1c;1Cthl,ihi~nbdicaehamtrongt~ptin
RULE.C; baa gem cae chuGnangchuyeusau:
Trang58
2. N~pcd sittri thucvaobQnha
Thu t!,Jcnaydoccact~ptintrenvaocac cautrucda Ii$u:danhsach
biensl,iki$n,danhsachbienm$nhde,danhsachket lu~nva khClitc;iOcac
mangmiengiatrichocacbiensl,iki~n.
Ham READ_VAR dLlQCgOikhikhClidQngd~doctatca cac biensl,i
ki$nW VAR.KBE vaobQnhd;dongthaitc;iOra cac mangchuamiengiatri
cuacac bienco giahi chuoi.Khitc;iomangmiengiatrichobien,hamtI,icho
themvaophantltthu0 giatri "CHUABIET" . .
int READVAR(void)
{
FILE *ifvar;
int i,j,k; .
char tmp[30],c;
if ((ifvar = fopen("VAR.KBE",. "rt") )== NULL) return 1;
fscanf (ifvar, "%i \n", &SOBIEN) ;
for (i=O;i<SOBIEN;i++) {
j=O;
while ((c=fgetc(ifvar))!=';') tmp[j++]=c;
tmp [j ] =, \ 0 ' ;
strcpy (DS_bien [i] .sukien,tmp);
fscanf(ifvar,"%i\n",&DS_bien[i].loai);
c=fgetc(ifvar};
fsc3.nf(ifvar,"%i\n",&DS_bien[i] .kieu);
//Doc mang mien gia tri
if (DS bien[i] .kieu==l) {
//phan tu thu 0 la chua biet
strcpy(Mien_Giatri[i] [0], "CHUA BIET");
k=l;
c=fgetc (ifvar) ;
while (c!='\n') {
j=O; .
while (( (c=fgetc (ifvar)) !=', I) &&(c!='\n I))
tmp[j++]=c;
tmp[j]='\O' ;
strcpy(Mien_Giatri [i] [k], tmp) i
k++i
}
fclose(ifvar)i
return 0;
}
HamREAD_RULEtrongRULE.C dLl<;1C cac h$congOid~docvaoh$
lu~tdankhih$condokhClidQng;dl,iavao,thub,lcsechond~chi
nGiPvaocac lu~tco lienquan.Ngoaira,hamcOngco cd che ki~mtraxem
co phai h$ lu~ttLldngung da dLlQCnapvao va dangco hi$u II,iCkhong,
nhamm!,Jcdfchchithl,ichi~nkhithl,icsl,icanthiet.
Trang59
Ket qua.thljehi~neuaham180khbit<;iOdli<;JecaeeautruedCili~udanh
saehbienm~nhdevadanhsaehketlu~n.
int READRULE(void)
{
FILE *rulef;
int ii,i,jj,j,ifclause,ivande,tongsoluat,luatmoi;
char tmp[100],c;
for (i=O;i<MAXSOLUAT;i++)
for (j=O;j<MAXCLAUSE;j++) DS_bien_menhde [i] [j] .bien=-1;
if ({rulef = fopen("RULE.KBE", "rt") )==
fscanf(rulef,"%i\n",&tongsoluat);
i=O;
ii=O;
SOLUAT=1 ;
luatmoi=1;
while (i<tongsoluat) {
if (luatmoi) {
fscanf(rulef,"%i\n",&ivande);
luatmoi=O;
jj =0;
}
NULL) return 1;
j=O;
while ((c=fgetc{rulef») !='\n') tmp[j++]=c;
tmp[j]='\O';
if (strcmp(tmp,"IF")==O) ifclause=1;
else if (strcmp(tmp,"THEN")==O) ifclause=O;
else if {(i_VANDE==O) II (ivande==i_VANDE» {
Process_a_line{tmp,ii,jj++,ifclause);
if (ifclause==O)
{luatmoi=1;i++;ii++;SOLUAT++;}
}
else if (ifclause==O) {luatmoi=1;i++;ii=0;}
}
SOLUAT--;
fclose{rulef);
return 0;
}
/*----------------------------------------------------
Xu ly mot dong vua doc duoc tu RULE.KBE
*/
int Process_a_line{char tmp[lOO],int rule_num,int
clause_Dum, int ifclause)
{
int j,jj,k,l, tinhtheobien;
char tmpvt[50],tmpop[5],tmpvp[50];
tinhtheobien=O;
j=O;
while { (tmp [j ] ! =' =' ) && (tmp [j] ! =' <' )
&&(tmp[j] !='>')&&{tmp[j] !='#'»
tmpvt[j]='\O';
tmpvt[j++]=tmp[j];
Trang60
jj=Oi
while ((tmp[j]='=') II (tmp[j]=='<')
II (tmp[j]=='>') II (tmp[j]=='#'))tmpop[jj++]=tmp[j++]i
tmpop[jj]='\O'i
if (tmp[j]=='&') { tinhtheobien=lij++i}
j j =0 i
while (tmp[j] !='\O') tmpvp[jj++]=tmp[j++]i tmpvp[jj]='\O'i
if (ifclause) {
k=Oi
while ((strcmp(tmpvt,DS_bien[k] .sukien) !=O)&& (k<SOBIEN))
k++i
if (k>=SOBIEN) return 1i
DS_bien_menhde[rule_number] [clause_number] .bien=ki
if (strcmp(tmpop,n=n)==o)
DS_bien_menhde[rule_num] [clause_num].phepsosanh=l;
else if (strcmp (tmpop, n<=n)==0)
DS_bien_mehhde[rule_num] [clause_num].phepsosanh=2;
else if (strcmp (tmpop, n>=n)=~O)
DS_bien_menhde[rule_num] [clause_num].phepsosanh=3;
else if (strcmp(tmpop,n#n)==o)
DS_bien_menhde[rule_num] [clause_num] .phepsosanh=4;
else if( strcmp (tmpop, n<n)==0)
DS_bien_menhde[rule_num] [clause_num] .phepsosanh=5;
else if (strcmp(tmpop,n>n)==o)
DS_bien_menhde[rule_num] [clause_num] .phepsosanh=6;
if (strcmp(tmpvp,nBlEATn)==O)
DS_bien_menhde[rule_num] [clause_num] .phepsosanh=O;
else if (tinhtheobien) .{
DS_bien_menhde[rule_num] [clause_num].phepsosanh+=100;
l=Oi
while ((strcmp(tmpvp,DS_bien[l].sukien) !=O)
&&(l<SOBIEN)) l++i
if (l>=SOBIEN) return 1i
DS_bien_menhde[rule_num] [clause_num].giatri=li
}
else if (DS_bien[k].kieu) {
l=Oi .
while (strcmp(tmpvp,Mien_Giatri[k] [1]) !=O) l++i
DS_bien_menhde[rule_num] [clause_num].giatri=l;
}
else II nhan gia tri so
DS_bien_menhde[rule_num] [clause_num].giatri=
atoi (tmpvp) i
}llifclause
else { II then clause
strcpy(DS_ketluan[rule_num].vande,tmpvt);
strcpy(DS_ketluan[rule_num].traloi,tmpVP)i
}
return Oi}
Trang61 ~
3.Hi~uchinhcdsittri thU'c
Vi$cchophepngl1C1isudl,mghi~uehlnhcdsc;trithuGehoh$thong
baagom2thutI,Ie:
Hi$uchlnhdanhsachbiensl,tki$n.
- Hi$uehInh $lu?tdan.
Cacthutl,lenaydl1Qcthl,tchi$nthongquacacbl1oesau:
- Th~hi$ndanhsaehbien/lu?ttrongmQthQpthoc;iithongquacac
cau truc dO'Ii$u 111utrO'.
- Chonbien/lu?ncanhi$uchInh.
- Thl,tehi$nvi$chi$uchlnhtrenhQpthoc;ii.
- C?Pnh?tcaecautruedO'li$u.
- C?P nh?tt~ptinVAR.KBE/RULE.KBE
!imm...-_mm ..m_m_m '-"-"""",wD. h~jGhbiin ~u'ben m
m_.",_.", m__.__...-.----.....-..
HQptho9ihi~uchlnhdanhsachbien
Oanhsachbien:chophepchonbiencanhi$uchlnh.
Cae0 tens1./ki~n,loq.i,kieu,mtengia trj:thongtinvebien dangchon,
vi$chi$uchInhbiendl1Qethl,tchi$nc;cae0 nay.
Them:themvaomQtbienmoL
- X6a:x6abiendangchon.
Save:chamdUthi$uchInhva111uIc;iicaethaydOL
Cancel:chamduthi$uchlnhva khong100Ic;iicacthaydOL
Trang62
H{jptho9ihi~uchinhh~luq.t
CacnutchQnTfitca,Xelduy~thoSd,..:chQnnh6mlu~t.
6 Luq.tso: s6 thL1tl,Iva tong s6 lu~ttrongnh6mlu~tdangchQn.
Cac 0 IF,THEN: gia thietva ket lu~ncua lu~tdl1QcchQn;moi0 trong
phan IF L1ngvoi m9tm$nhde cua gia thiet(nhl1da trlnhbay,ta chi
dung loan tli AND trong gia thiet). Vi$c hi$u chlnh lu~tduQc thljc hi$n
trong cac 0 nay.
Them:them m9tlu~tmoLnh6mlu~tdangchQn.
X6a:x6a lu~tdangchQn.
-> : chuy~nsang lu~ttiepthee.
<-: chuydnsangluq.ttrtidc.
Save: cham dL1thi$uchlnhva hJu li;licac thaydoL
Cancel: cham dL1thi$uchlnhva khonghlu li;licac thaydoL
IY. MODULE TcI(JNG TAGNGclal-MAY
Cac thu tl,lCtl1dnglac voi ngl1oisadl,lngcua h$th6nggem:
Tiep nh~nyeucauthamdjnh.
Hoigiatricacbienslj ki$n
Cungcapketquathamdjnh
CungcaploigiaithiGhve ketquathamdjnh.
Cac giaotiepnaydl1Qcthljchi$nthongquah9PthoGlichinhsau:
I
Trang63
HQpthofJith5mdinh
HQptho9inay duQcgOi b~i ham CallDlg_ThamDinhOtrong t~ptin
CHAINING.C
1.Tie'"pnh~nyell c'auth~mdinh
Cac vandecanthamdinhduQcngudisa dl,mgnh~pvaothongqua
hQpto9ivdi cac 0 kiemtra (checkboxcontrol)Yeu cau thamdinh.Moi 0
ungvdi 1trongcac quitrlnhconthamdjnh.
Cac yeu cau thamdinh duQcchon sa duQCghi nh~nvao mang
VANDE[7];dayla mQtmangloanCI,IC,kieu56,giatriphantUthui la 1
neuvan de i tLidngungdudcchonva la 0 neungLi<;1cIc;li.d day,yeucau
thamdinhve uu liencua dl,ian sa baagem3 "yeucau con":UUlien ve
IO9idoitLi<;1ng,Liulienvedjabanvauulienve nganhnghe.
for (i=O;i<4;i++)
if (IsDlgButtonChecked(hWndDlg,IDC_HOSO+i))
VANDE [i] =1;
else VANDE[i]=O;
if (IsDlgButtonChecked(hWndDlg,IDC_UUTIEN)
for (i=4;i<7;i++) VANDE[i]=1;
else for (i=4;i<7;i++) VANDE [i]=O;
Trang64
2.Hoigiatri caebie'ns1(ki~n
HamDLG_SUKIEN(intvacnum)dl1<;1cgoidenh?pvaogiatricho
bien51,!ki~nthl1var_num,mOikhitrongquatrlnhsuydienh~can h6igia
tricua biendo.
Doi VOlcac biengia tr;chuOi,hamdl,!aVaGmangmiemgia tricua
biende dl,!ara hQpthOc;liVOlcac 0 chonIl,!a(optioncontrol),moichonIl,ta
la mQtgiatrithuQcmiengiatr;cua bien.
!Chobi~'tgii tri :;1['kit%n £1
m__m.m W
Vi~c gan gia tri dl1c;1cchon cho cau truc cua bien dl1<;1ccai d~tnhv
sau:
for (i=Oii<number_of_radii++) {
if(IsDlgButtonChecked(hWndDlg,IDC_RADO+i)) {
DS_bien[var_num] .giatri=ii
if (i==O) DS_bien[var_num] .biet=Oi
else DS_bien[var_num].biet=li
}
trongdonumber_oCradlaso giatr;thuQcmiengiatr;cua bien.
DoiVOlcac biengiatr;so, hamdungchung1 hQpthoc;lide nh?pgia
trichobien.
Trang65
Sau do, gia tri nh~ndl1c,1cnayse dl1c,1Cgan vao bien nhl1 sau:
GetDlgIternText(hWndDlg,IDC_EDIT,tmp,255);
DS_bien[var_nurn] .giatri=atoi(trnp);
if (DS_bien[var_nurn] .giatri==O)
DS_bien[var_nurn] .biet=O;
else DS_bien[var_nurn] .biet=l;
Vi~c phan bi~tbien nh~ngia tri ki~uso hay chuoidl1c,1Cthl,!Chi~n
dl,!avao thanh phan kieutrongcau truccua bien.
Sau khi nh~ndl1c,1Cgia tri cua bien, danh sach 51,!ki~n trong h(>p
thOGlithAm dinh sedl1c,1cc~pnh~t.Danhsach naydungth~hi~nloan b(>
cac 51,!ki~nda dl1c,1cbiet.
3. Cung dip ktt quathim dinh
Ket quathAmdinhth~hi~ntrongvungKefqua!himc1j'nhcuah(>p
thOGlithAmdinh.Vungnaygem7 donglingvoicacyeucaucon.(yeucau
ve l1ulien baa geml1ulien doi tl1c,1ng,l1ulien dia banva l1ulien nganh
nghe).
Mangint iKQ[7]dl1c,1chamBACKWARD_CHAINING thietI~pgiatri
la chiso cua ketlu~nphuhc,1ptrongDS_ketluanho?cla -1 neukhongco
ket lu$nchovan de dangthAmdinh(khih~lu$tchl1adaydu cho moitlnh
huang).Nhado,h~dl1acack€t quathAmdinhfa:
for (i=O;i<7;i++)
if (iKQ[il>-l) SetDlgIternText(hWndDlg,IDC_KQHOSO+i,
DS_ketluan[iKQ[i]] .traloi);
4. Cung ca"p1mghii thfchv'ektt quathim dinh.
- 7 commandbuttons?trongh(>pthoGlithamdinhbencGl-nhcacket
quathAmdinhcho phepngl1aisu dl)ngxemgiaithiGhcua ketquatl1dng
ling. SI,!giai thiGhnaychlnhla vi~cdl1ara cac lu$tda dl1Qcdungd~di
denketqua.
Hamgiaithich()thl,!Chi~nGangvi~cnaydl,!avaovet cua quatrlnh
suydiendl1Qc111utrongmlmgVETDDtrongdochisothunhatchivande
thAmdinh,chisothu2chisothutI,tcualu~tda911dCdung:
void giaithich(HWND hWnd, int ivande)
{
char szBuf[255],szBufl[255]="";
int i,j,k;
for (i=O;VET[ivande] [i]>=O;i++) {
for (j=O;j<MAXCLAUSE;j++)
for (k=O;k<SOBIEN;k++) {
if (DS_bien_rnenhde[VET[ivande] [ill [j].bien==k) {
Trang66
wsprintf(szBuf,"%s",DS_bien[k].sukien);
strcat(szBufl,szBuf);
wsprintf(szBuf,"%s","=");
strcat(szBufl,szBuf);
if (DS_bien[k] .kieu)
wsprintf(szBuf,"%s\n",
Mien_Giatri[k] [DS_bien[k] .giatri]);
else wsprintf(szBuf,"%i\n",DS_bien[k].giatri);
strcat(szBufl,szBuf);
}
}
strcat(szBufl,"=>");
wsprintf(szBuf,"%s",DS_ketluan[VET[ivande] [i]] .traloi);
strcat(szBufl,szBuf);
strcat(szBufl,"\n\n");
}
MessageBox(hWnd,szBufl,"Giai thich",MB_OK);
}
ir oo"~".='=.,o.,.o.w.w.w.o.w ' w."","""""""..".""""..~ "_m.o.""""o",,-~"",wo",o."-",,o.,--.w.o.,..
; :J
! ChudtJan=TO HOP
! s6LD-thuhut=2.
! LoaiLD thuhut=DTKHAc
! =>H~nmilelienvay:MIN(200,5~SOLDthuhut)=10
;
I H~nmilelienvay=10
! s6lienvay=15
! =>Khongehapthu~nsolienvay
!
!
!
I
~
-ii thiGh m
[ OK J
Trang67
(}J,((0'1(j'6:
? A
THU NGHIEM
Gia sli canthamdinhdl,l'ansAN XUAT 80 THU~C(j phI,!Il,!cC. Thongtin
ve dl,ianco th~tomt§.tnhlisau:
Ten dl,l'an:SAN XUAT 80 THIEC
LOc;1i dl,l'an:moivayIandautien.
Chudl,l'an:To hQpChITrung.
Giayphepkinhdoanhso 01095VL,dliQCcapngay04/09/95.
Nganhnghesanxuat:dothiec.
S6 laodQngthuhut:2
So vanvay:15.000.000dong.
Thai gianvay:1 nam.
Tiii santhechap:trigia150.000.000dong.
Qua trlnhthamdjnhdl,l'ancua h$nhlisau:
,:""""""""" ',W,',"","',',', ',',"", ",",:", ',',',",',", 'm,'" 0'0 '",m,o'm, '",o',o'",wmmm, '"mAWMoW,",o"o" ",', "w ", '""o',ow,o',w,"o""""w,' ',0,,ow,',,, 0,," ',"~o "',",0 ',wm,'o,,', '., w ',"", ". W,o',w ',', ',"W,",'i ' .
Thfmdinhdu'anYay , ,..: . m
Do can thamdjnhtoanbQcac vandecua d1,lan,ta danhdauchontatca
cac0 ki~mtratrongYell call th5mdjnh,saud6chonnutI$nhOK d~b§.tdau
thamdjnh.
Trang68
H$b£ltdaubangvi$cxetduy$thesd.Lu~tdautiendU<;1cxetla lu~t101;
m$nhde dautiencua lu~tla LOAI_HOSO="MOI",LOAI_HOSOla m(>tbien
nguyenthuychuabiet,dodoh$heig.iatribienLOAI_HOSO:
:.'m '~'m'mm~~m~"'_"mm'___" ~,~"" ,~,""""'-- ~"'" ~m" "'-,"-~~ ,.
Chobit!ft,gii tri:\l.tkit%n EJ
Vdigiatri"Mal"dU<;1cchon,m$nhdenaythea,h$chuy§nsangxetm$nh
de tieptheo: CHU_DUAN="HQGIAt)lNH",vatudngtvtren,h$heigiatricua
CHU_DUAN:
,m", "m m" mm"~~ ~~~~~"'m ""'~~~ ~m" "'" m",m """"'" mm~,~""" _m_m'
Chobidtgii tri:'.11'kit%n' . £J
Jl
Gicitridu<;1cchonla"TOHOP"lamchom~nhdedangxetkhongthea;h~
chuyensangtimm(>tlu~tkhacphuh<;1pvdicac biendabiet(LOAI_DUANva
CHU_DUAN);dolalu~t104. .
Hai m$nhde daucualu~tla:LOAI_HOSO="MOI"va CHU_DUAN="TO
HOP"da nghi$mdung,h$xetm$nhdetiepthee:DK_KINHDOANH="t)UNG",
vaheigiatribienDK_KINHDOANH:
Trang69
f""'"" """"'""""'"""'""'",""-",-
j~>: ,"",""-"'""""'-"--"
r
I::
I
!
I
II
I:r,,
Chobig!gii tri:>u'b~n. £J
Gia triduocchon 180"BUNG",m$nhde thoa;h$ xet m$nhde tieptheo:
THE_CHAP"SAI"vahoigiatr;bienTHE_CHAP:
Gia triduocchon180"BUNG",m$nhde"thoa.Ben lucnay,tatca caem$nh
de tronggia thietcua lu?t 104deuthoa,n€mh$ ml1lu?tnayghi nh?ndieunay
vao mangiVET:
IVET[O][O]=104
(chiso 0 thl1nhatcua iVET d~chivandeconla Xlitduy~tho seJ,chi so 0 thl1hai
chi ra day180lu?tdautientrongchuoisuy lu?n va 104180so hi$ucualu?tdo.
Bongthai,h$cOngganiKQ[O]=104,d~chirarfulgvi$cXlit duy~tho seJ180
thanhcong,vaketquathamdinh180ketlu?ncualu?t104.
Tiep tI,IC,h$ chuy~nsang Xliiduy~tmucvanvay.
Trang70
Lu?tdaulientrongnhomlu?tXetduyt?tmilevanvaylalu?t204.
IF HM_TIENVAY~BIETAND SOTIEN_VAY<=HM_TIENVAY
THEN KL_SOTIEN="CHAPTHUAN"
Xetm~nhdedauliencua lu?t.Do HM_TIENVAYlamQtbien khong
nguyenthuy,h~gOid~quythutl,lCsuydienvdiml,lC tieucan ket lu?n la
HM_TIENVAY.
Lu?t dau tien trongnhomlu?t dangxetvacoketlu?nvehc;ln mUGtien vay
la lu?t202.
M~nhdedautienla CHU_DUAN"HOGIA 8iNH" thoa(viCHU_DUAN
hi~nla"TOHOP").M~nhdetiepthee:SOLAODONG=BIETdtJ<;1cxetvadobien
SOLAODONGchl1abietnenh~hoi:
Chabiit gii tri~u'b~n £1
Saudo,h~xetm~nhdeketiep:LOAILAODONG="LAOBONG TV TI~P
VE"vahoigiatricuaLOAILAODONG:
Chabiit gii tri~u'b~n EJ
86i vdidt,J'annaythiIOc;lilac dQngthuhutkhongco gid?cbi~tnenngtJC1i
su dl,lngchongiatri"861TUcjNGKHAc".
Tatcacacm~nhdephangiathietcualu?t203dathoa,h~mCllu?tnayva
xac dinhdL1<;1Chc;lnmUGtienvaytheeketlu$ncua lu?t:
Trang71
HM- TIENV AY=min(200,5*SOLAODONG)=10
8ong thai lu~t203 eOngplioeghi nh~nvao vetsuy dien: iVET[1][0]=203
Thu tl,Je d~qui chamdill, h~trC1I~ivoi m~nhde dau tiemeua lu~t204
HM_TIENVAY="BIET",luenaym~nhde nay da thbanen h~ehuy~nsang xet
m~nhde thl1hai:SOTIEN_VAY<=HM_TIENVAY.Do SOTIEN_VAY ehlia dlioe
bietnenh~hbi:
Voi gia tri 15 nh~ndlioe ella'SOTIEN_VAY, m~nhde dangxet khong
thea;h$ehuy~nsanglu~tketiep205:
IF HM_TIENVAY=BIETAND SOTIEN_VAY>HM_TIENVAY
THEN KL_SOTIEN="KHONGCHAP THu.~N"
Trongngucanhhi$nt~ithiea,2 m~nhde giathieteua lu~tdeuthea,lu~t
dlioc m(jvah~dae6keflu~nveso tienvay.
Ket lu~nnayvaso hi~ulu~tdliOCghinh~n:iVET[1,1]=205,iKQ[1]=205.
VandedliocxettieptheolaXetduy~tthiJihEj.nyay.
Lu~td~iUtientrongnh6mla lu~t105:
... A
IF THOIHAN_VAY<=12THEN KL_THOIHAN="CHAPTHUAN"
H$ xetm~nhde giathiefvaheivethaihc;lnvay:
Chobitit:;i1trilu'h~n £J
Voi giatri12cuabien,giathieftheanenlu~tdlioemC1,vah~ghinh~n:
Trang72
iVET[2J[0]=301; iKQ[2]=301
Van detieptheelaXacdjnhlaisuat.
Lu$t dllc;1cxet trllac tien la lu$t501:
IF LOAILAODONG="THVdNGB~NHBINH"THENLAISUAT=O.4
Trang ngi1canh hi$n tc;ii,LOAILAODONG mang gia tri "BOI TVONG
KHAc", nenlu$tkhongthea.
Tlldng tt,ilu$t 502 vai gia thietla LOAlLAODONG="NGVOITAN TAT"
GOngkhongthea.Lu$tdllc;1cxetsaudola503:
IF THOIHAN_VAY<=12THEN LAISUAT=OA.
BienTHOIHAN_VAY dangdllc;1cbietco giatr;12,theamangiathiet,nen
lu$tdllc;1cmd,vah$ghinh$n:iVET[3][0]=503,iKQ[3]=503.
Van de tieptheedllc;1cyeucauthAmdinh laXacdjnhcaetlutiencuadlj
an.Nhllda trlnhbay,co3 hllangllu tien ph~ixet lEi:llu tienve IOc;iidoi tlic;1nglac
dQng,llu tienve diabanSXKD va llutienvenganhngheSXKD.
Vi$c xac dinh tlu tien ve loq.idoi ttl(/ng laD dQngdlja vao bien
LOAILAODONG.Trangngi1canhhi$ntc;ii,biennayla "f)01TVQNG KHAc",nen
lu$t606: .
IF LOAILAODONG="f)OITVONG KHAc" THEN UT_DOITUONG="KHONG"
dllQCmdva iVET[4][0]=606,iKQ[4]=606.
Vai yeucauxac dinhtlulienvedjabimSXKD,trllacheth$xetlu$tco ket
lu$nphuhQpla lu$t607:
IF DIABAN="THANHPHO LdN"THEN UT_DIABAN="CO"
Bien DIABANchllabiennenh$hei:
."""""" "."-,, - ".""._~"""". ""."".w..",,--- --" ",,".w"",."""".-""" w.
liL.,..."hObiit .'ii tri ::u'kien ... . Ef
H
I:
I:'
1
j
I:
Vai giatrjnh$ndllc;1c"f)!ABAN KHAc", giathietlu$tkhongthea.Lu$t608
tiep thee vai gia thietDIABAN="KHUGONG NGHI~P" GOngkhongthea.Cuoi
Trang73
clinglu~t609:
IF DIABAN="E}!ABAN KHAc" THEN UT_DIABAN="KHONG"
duQcmdva: iVET[5][0}=609,iKQ[5}=609.
Vandecuoiclingcanth~mdinhlaxetliu tienvenganhngheSXKD.
Lu~t610:
IF NGANHNGHE="NGANHNGHE KHAc" THEN UT_NGANHNGHE="KHONG"
bienNGANHNGHE:duQC'xet va h$ hbigia tr;
Chobigtgii tri~u'bell 13
Voi gia tri "NGANH NGHE KHAc", lu~tduQcmd voi iVET[6][0}=610,
iKQ[6]=610.
Luc naytoanbQcacyeucaudaduQcth~mdinh,h$thehi$nketqua:
Trang74
TranghQptho~inay,ngl1oisudt,mgc6th~xemI~igiatricaebiensl)'ki~n
danh?pvaothongquaOanhsachbiensl/ki~n.
CommandbuttonAborddl1c;1Cdungd~x6aloanbqcaethongtinvedl1an,
d~chuy~nsangthAmdinhmqtdl1ankhac.
Caecommandbutton?dl1c;1CgQikhidm giaithlchveketquathAmdjnh,
moibuttonungvoimQtvande.VIdl,Jkhidl1c;1Cyeucaugiaithlchvekefquatham
dinhmucvan,hQptho~igiaithlchxuathi~nnhl1sau:
""""",-""""""""""""""""""""-,,
"
"'V'~-&";"i$::' ,',,':' ""'v'",,,' "":"..~,,,, ~, ,"v'."""'~' ',w.'v~' " """?~{"""'S-"""~,*";$:",~"" , '~$' ' ~t' "'M!i!:"~~/.~"".""""""",:..J~t,::,;:";,,:,,_%,*,,,»w,
!jMM1&NMMMii
:!i;i::E\;;mm::;;;;;lli""",:,:,:",,:,:,:,:,:,,:,:,:,:""':':'"
,,~,~---,~,
"
Trang75