Anda di halaman 1dari 33

(SOURCE CODE OF CRS)

SPLASH SCREEN
Public Class splash Private Sub Timer1_Tick(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Timer1.Tick pb1.Value & pb1.Value ' 1( )* pb1.Value & +(( Then Timer1.St,p($ -e.%ide($ -ain.Sh,.($ "nd )* "nd Sub Private Sub splash_/,ad(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles -yBase./,ad "nd Sub Private Sub PictureB,01_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles PictureB,01.Click "nd Sub "nd Class

LOGIN FOR EMPLOYEES


)mp,rts -yS1l.2ata.-yS1lClient Public Class -ain 2im ServerStrin# As Strin# & 3Server&l,calh,st45id&r,,t4P.d&crs42atabase&yash3 2im S1lC,nnecti,n As -yS1lC,nnecti,n & 6e. -yS1lC,nnecti,n 2im db As -yS1l2ata7eader 2im cmd As -yS1lC,mmand & 6e. -yS1lC,mmand Private Sub -ain_2isp,sed(ByVal sender As Ob ect! ByVal e As System."ventAr#s$ %andles -e.2isp,sed splash.Cl,se($ "nd Sub Private Sub -ain_/,ad(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles -yBase./,ad S1lC,nnecti,n.C,nnecti,nStrin# & ServerStrin# "nd Sub 8insertin# data int, database Public Sub 5ser)n*,(By7e* S9/Statement As Strin#$ S1lC,nnecti,n.Open($ :ith cmd .C,mmandTe0t & S9/Statement .C,mmandType & C,mmandType.Te0t .C,nnecti,n & S1lC,nnecti,n ."0ecute6,n9uery($ "nd :ith S1lC,nnecti,n.Cl,se($ -s#B,0(36e. 5ser Created 3$

;r,upB,0+.Visible & <alse cls(;r,upB,0+$ S1lC,nnecti,n.2isp,se($ "nd Sub 8clearin# the te0t b,0es Public Sub cls(By7e* ,b As C,ntr,l$ 2im ,b 1 As C,ntr,l <,r "ach ,b 1 )n ,b .C,ntr,ls )* TypeO* ,b 1 )s Te0tB,0 Then ,b 1.Te0t & 33 "nd )* 6e0t "nd Sub Private Sub Butt,n=_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n=.Click -e.Cl,se($ "nd Sub Private Sub Butt,n+_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles nub+.Click cls(;r,upB,0+$ "nd Sub 8Checkin# *,r user and pass.,rd validati,n Private Sub Butt,n>_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n>.Click S1lC,nnecti,n.Open($ 2im usrname As Strin# 2im pass.d As Strin# 2im *la#,k As )nte#er *la#,k & 1 usrname & eut1.Te0t.T,Strin# pass.d & eut+.Te0t.T,Strin# 2im up1uery As Strin# up1uery & 3S"/"CT usr_name!pass <7O- user_l,#in3 cmd & 6e. -yS1lC,mmand(up1uery! S1lC,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead )* usrname & db.)tem(3usr_name3$ Then )* pass.d & db.)tem(3pass3$ Then *la#,k & =(= "nd )* "nd )* "nd :hile 8Checkin# i* entered is c,rrect ,r n,t )* *la#,k & =(= Then cls(;r,upB,01$ C7SCC.C7SCC_status.Te0t & 3:elc,me 3 ? usrname ? 33 -e.%ide($ C7SCC.Sh,.($ "lse -s#B,0(3"ither user name ,r pass.,rd is inc,rrect 3$ "nd )* S1lC,nnecti,n.Cl,se($ "nd Sub Private Sub /ink/abel1_/inkClicked(ByVal sender As System.Ob ect! ByVal e As System.:ind,.s.<,rms./ink/abel/inkClicked"ventAr#s$ %andles /ink/abel1./inkClicked

2im adminpass As Strin# adminpass & )nputB,0(3"nter Admin Pass.,rd @ 3$.T,Strin# )* adminpass & 3yash3 Then ;r,upB,0+.Visible & True "lse -s#B,0(3pass.,rd inc,rrect3$ "nd )* "nd Sub 8sendin# t, *uncti,n t, insert value Private Sub nub1_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles nub1.Click )* nut1.Te0t & 33 Or nut+.Te0t & 33 Or nut>.Te0t & 33 Or nut=.Te0t & 33 Then -s#B,0(3<ill all 2etails 3$ "lse)* nut>.Te0t AB nut=.Te0t Then -s#B,0(3Pass.,rd did8t -atch3$ "lse 2im S9/Statement As Strin# & 3)6S"7T )6TO user_l,#in VA/5"S(83 ? nut1.Te0t ? 38!83 ? nut+.Te0t ? 38!83 ? nut>.Te0t ? 38$3 5ser)n*,(S9/Statement$ "nd )* "nd Sub Private Sub nut1_CeyPress(ByVal sender As Ob ect! ByVal e As System.:ind,.s.<,rms.CeyPress"ventAr#s$ %andles nut1.CeyPress! nut=.CeyPress! nut>.CeyPress! nut+.CeyPress 2im hu As Strin# hu & 1> )* e.CeyChar & 383 Then e.%andled & True "lse e.%andled & <alse "nd )* )* e.CeyChar & hu.T,Strin# Then nut+.<,cus($ "nd )* "nd Sub Private Sub nut1_Te0tChan#ed(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles nut1.Te0tChan#ed "nd Sub Private Sub PictureB,01_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles PictureB,01.Click "nd Sub "nd Class

CRSCC CONTROL CENTER


)mp,rts System.:ind,.s.<,rms Public Class C7SCC 2im #amel,ca As Strin#

Private Sub "0itT,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles "0itT,,lStrip-enu)tem.Click -ain.Sh,.($ -e.Cl,se($ "nd Sub Private Sub Ab,utT,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Ab,utT,,lStrip-enu)tem.Click C7SCC_ab,ut.-diParent & -e C7SCC_ab,ut.Sh,.($ "nd Sub Private Sub C7SCC_/,ad(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles -yBase./,ad 8 -s#B,0(3h@3 ' -e.%ei#ht.T,Strin# ' 3DD3 ' -e.:idth.T,Strin#$ "nd Sub Private Sub AddVehicleT,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles AddVehicleT,,lStrip-enu)tem.Click C7SCC_Add_Vehicles.-diParent & -e -e.PictureB,01.Visible & <alse C7SCC_Add_Vehicles.Sh,.($ "nd Sub Private Sub AddClientT,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles AddClientT,,lStrip-enu)tem.Click C7SCC_Clients_detail.-diParent & -e -e.PictureB,01.Visible & <alse C7SCC_Clients_detail.Sh,.($ "nd Sub Private Sub Clients_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Clients.Click "nd Sub Private Sub 7entACarT,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles 7entACarT,,lStrip-enu)tem.Click C7SCC_7ent_A_Car.-diParent & -e -e.PictureB,01.Visible & <alse C7SCC_7ent_A_Car.Sh,.($ "nd Sub Private Sub 7ecievebackT,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles 7ecievebackT,,lStrip-enu)tem.Click C7SCC_7eceive_back.-diParent & -e -e.PictureB,01.Visible & <alse C7SCC_7eceive_back.Sh,.($ "nd Sub Private Sub -aEe;ameT,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles -aEe;ameT,,lStrip-enu)tem.Click #ame1.-diParent & -e -e.PictureB,01.Visible & <alse

#amel,ca & 3"@FCar 7ent(pr, ect$F;amesFbirdDinvaderD*lashD #ames.s.*3 /abel1.Te0t & #amel,ca #ame1.Sh,.($ "nd Sub Private Sub AimAndSh,,tT,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles AimAndSh,,tT,,lStrip-enu)tem.Click #ame1.-diParent & -e -e.PictureB,01.Visible & <alse #amel,ca & 3"@FCar 7ent(pr, ect$F;amesFaimDandDsh,,tD*lashD #ames.s.*3 /abel1.Te0t & #amel,ca #ame1.Sh,.($ "nd Sub Private Sub AirBattleT,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles AirBattleT,,lStrip-enu)tem.Click #ame1.-diParent & -e -e.PictureB,01.Visible & <alse #amel,ca & 3"@FCar 7ent(pr, ect$F;amesFcarDcanDracin#D*lashD #ames.s.*3 /abel1.Te0t & #amel,ca #ame1.Sh,.($ "nd Sub Private Sub BillardsT,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles BillardsT,,lStrip-enu)tem.Click #ame1.-diParent & -e -e.PictureB,01.Visible & <alse #amel,ca & 3"@FCar 7ent(pr, ect$F;amesFbillardsD*lashD#ames.s.*3 /abel1.Te0t & #amel,ca #ame1.Sh,.($ "nd Sub Private Sub 2eleteVehicleT,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles 2eleteVehicleT,,lStrip-enu)tem.Click delete_vehicle.-diParent & -e -e.PictureB,01.Visible & <alse delete_vehicle.Sh,.($ "nd Sub Private Sub 2eleteClientT,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles 2eleteClientT,,lStrip-enu)tem.Click 2elete_Client.-diParent & -e -e.PictureB,01.Visible & <alse 2elete_Client.Sh,.($ "nd Sub Private Sub "ditVehicle7ec,rdT,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles "ditVehicle7ec,rdT,,lStrip-enu)tem.Click "dit_Vehicle_7ec,rd.-diParent & -e

-e.PictureB,01.Visible & <alse "dit_Vehicle_7ec,rd.Sh,.($ "nd Sub Private Sub SaveAsT,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles SaveAsT,,lStrip-enu)tem.Click 9uick_l,,kup.-diParent & -e -e.PictureB,01.Visible & <alse 9uick_l,,kup.Sh,.($ "nd Sub Private Sub 5nd,T,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles 5nd,T,,lStrip-enu)tem.Click Vehicle_list.-diParent & -e -e.PictureB,01.Visible & <alse Vehicle_list.Sh,.($ "nd Sub Private Sub 7ed,T,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles 7ed,T,,lStrip-enu)tem.Click 7ental_2etail.-diParent & -e -e.PictureB,01.Visible & <alse 7ental_2etail.Sh,.($ "nd Sub Private Sub <indCar/,cati,nT,,lStrip-enu)tem_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles <indCar/,cati,nT,,lStrip-enu)tem.Click ;PS.-diParent & -e -e.PictureB,01.Visible & <alse ;PS.Sh,.($ "nd Sub "nd Class

ADD VEHICLE
)mp,rts -yS1l.2ata.-yS1lClient Public Class C7SCC_Add_Vehicles 2im ServerStrin# As Strin# & 3Server&l,calh,st45id&r,,t4P.d&crs42atabase&yash3 2im S1lC,nnecti,n As -yS1lC,nnecti,n & 6e. -yS1lC,nnecti,n 2im db As -yS1l2ata7eader 2im cmd As -yS1lC,mmand & 6e. -yS1lC,mmand 2im st,ck_n, As )nte#er 2im picpath As Strin# 8n, need aut, increment in there in db Public Sub st,ck_inc($ S1lC,nnecti,n.Open($ 2im db1uery As Strin# db1uery & 3S"/"CT st,ck_n, <7O- car_in*,rmati,n3 cmd & 6e. -yS1lC,mmand(db1uery! S1lC,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead st,ck_n, & db.)tem(3st,ck_n,3$ ' 1 "nd :hile S1lC,nnecti,n.Cl,se($ "nd Sub

8insertin# data in db Public Sub car_in*,(By7e* S9/Statement As Strin#$ Try S1lC,nnecti,n.Open($ :ith cmd .C,mmandTe0t & S9/Statement .C,mmandType & C,mmandType.Te0t .C,nnecti,n & S1lC,nnecti,n ."0ecute6,n9uery($ "nd :ith S1lC,nnecti,n.Cl,se($ -s#B,0(36e. Car Added3$ cls1(av#b1$ cls1(av#b+$ /PB1.)ma#e & 6,thin# st,ck_inc($ /P_l,c.Te0t & 33 cdt1.Te0t & st,ck_n, S1lC,nnecti,n.2isp,se($ Catch -s#B,0("rr,rT,Strin#$ "nd Try "nd Sub Public Sub cls1(By7e* ,b As C,ntr,l$ 2im ,b 1 As C,ntr,l <,r "ach ,b 1 )n ,b .C,ntr,ls )* TypeO* ,b 1 )s Te0tB,0 Then ,b 1.Te0t & 33 "nd )* )* TypeO* ,b 1 )s C,mb,B,0 Then ,b 1.Te0t & 33 "nd )* 6e0t "nd Sub Private Sub Butt,nG_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,nG.Click C7SCC.PictureB,01.Visible & True -e.Cl,se($ "nd Sub Private Sub C7SCC_Add_Vehicles_/,ad(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles -yBase./,ad S1lC,nnecti,n.C,nnecti,nStrin# & ServerStrin# st,ck_inc($ cdt1.Te0t & st,ck_n, "nd Sub Private Sub Butt,n=_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n=.Click cls1(av#b1$ cls1(av#b+$ /PB1.)ma#e & 6,thin# /P_l,c.Te0t & 33 "nd Sub 8Sendin# data t, insert int, car_in*,rmati,n table Private Sub Butt,n>_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n>.Click

2im m,del_n, As Strin# 2im re#_n, As Strin# 2im car_year As )nte#er 2im car_c,l,ur As Strin# 2im car_class As Strin# 2im car_en#ine As Strin# 2im car_rate_day As )nte#er 2im car_rate_.eekly As )nte#er 2im pic_l,c As Strin# m,del_n, & cdt>.Te0t.T,Strin# re#_n, & cdt+.Te0t.T,Strin# car_c,l,ur & cdtG.Te0t.T,Strin# car_class & cdc1.Te0t.T,Strin# car_en#ine & cdc+.Te0t.T,Strin# pic_l,c & st,ck_n, )* cdt+.Te0t & 33 Or cdt>.Te0t & 33 Or cdt=.Te0t & 33 Or cdtG.Te0t & 33 Or cdc1.Selected)nde0 A ( Or cdc+.Selected)nde0 A ( Or /P_l,c.Te0t & 33 Then -s#B,0(3<ill all the details and /,ad Picture3$ "lse Try car_year & )nte#er.Parse(cdt=.Te0t$ car_rate_day & )nte#er.Parse(rt1.Te0t$ car_rate_.eekly & )nte#er.Parse(rt+.Te0t$ )* car_year A +(G( And car_year B 1H(( Then )* car_rate_day A& car_rate_.eekly Then 2im S9/Statement As Strin# & 3)6S"7T )6TO car_in*,rmati,n VA/5"S(83 ? st,ck_n, ? 38!83 ? re#_n, ? 38!83 ? m,del_n, ? 38!83 ? car_year ? 38!83 ? car_c,l,ur ? 38!83 ? car_class ? 38!83 ? car_en#ine ? 38!83 ? car_rate_day ? 38!83 ? car_rate_.eekly ? 38!83 ? pic_l,c ? 38!($3 car_in*,(S9/Statement$ "lse -s#B,0(32aily rent is m,re than :eekly rent I C,rrect it3$ "nd )* "lse -s#B,0(3"nter year bet.een 1H((D+(G(3$ "nd )* Catch e0 As "0cepti,n -s#B,0(3"nter inte#er data 3$ "nd Try "nd )* "nd Sub Private Sub Butt,n+_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n+.Click /PB1.)ma#e & 6,thin# /P_l,c.Te0t & 33 "nd Sub Private Sub Butt,n1_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n1.Click AV_O<21.<ilter & 3J. p#KJ. p#3 AV_O<21.Sh,.2ial,#($ picpath & AV_O<21.<ile6ame

/P_l,c.Te0t & picpath /PB1.)ma#e/,cati,n & picpath "nd Sub Private Sub av#b1_"nter(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles av#b1."nter "nd Sub Private Sub Timer1_Tick(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Timer1.Tick Anicar1./e*t & Anicar1./e*t ' + )* Anicar1./e*t B -e.:idth ' L Then Anicar1./e*t & ( "nd )* "nd Sub Private Sub Timer+_Tick(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Timer+.Tick Anicar+./e*t & Anicar+./e*t ' + )* Anicar+./e*t B -e.:idth ' L Then Anicar+./e*t & ( "nd )* "nd Sub Private Sub Anicar1_-,use%,ver(ByVal sender As Ob ect! ByVal e As System."ventAr#s$ %andles Anicar1.-,use%,ver Timer1."nabled & <alse "nd Sub Private Sub Anicar1_-,use/eave(ByVal sender As Ob ect! ByVal e As System."ventAr#s$ %andles Anicar1.-,use/eave Timer1."nabled & True "nd Sub Private Sub Anicar+_-,use%,ver(ByVal sender As Ob ect! ByVal e As System."ventAr#s$ %andles Anicar+.-,use%,ver Timer+."nabled & <alse "nd Sub Private Sub Anicar+_-,use/eave(ByVal sender As Ob ect! ByVal e As System."ventAr#s$ %andles Anicar+.-,use/eave Timer+."nabled & True "nd Sub "nd Class

CLIENT DETAILS
)mp,rts -yS1l.2ata.-yS1lClient )mp,rts System.7untime.)nter,pServices 8<,r .eb Cam Public Class C7SCC_Clients_detail 2im ServerStrin# As Strin# & 3Server&l,calh,st45id&r,,t4P.d&crs42atabase&yash3 2im S1lC,nnecti,n As -yS1lC,nnecti,n & 6e. -yS1lC,nnecti,n 2im db As -yS1l2ata7eader 2im cmd As -yS1lC,mmand & 6e. -yS1lC,mmand 2im client_id As )nte#er 2im *la#1 As )nte#er

8DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD DDDDDDDDDD 8.ebcam initialisati,n C,nst :-_CAP As Sh,rt & ?%=((S C,nst :-_CAP_27)V"7_CO66"CT As )nte#er & :-_CAP ' 1( C,nst :-_CAP_27)V"7_2)SCO66"CT As )nte#er & :-_CAP ' 11 C,nst :-_CAP_"2)T_COPM As )nte#er & :-_CAP ' >( C,nst :-_CAP_S"T_P7"V)": As )nte#er & :-_CAP ' G( C,nst :-_CAP_S"T_P7"V)":7AT" As )nte#er & :-_CAP ' G+ C,nst :-_CAP_S"T_SCA/" As )nte#er & :-_CAP ' G> C,nst :S_C%)/2 As )nte#er & ?%=((((((( C,nst :S_V)S)B/" As )nte#er & ?%1((((((( C,nst S:P_6O-OV" As Sh,rt & ?%+S C,nst S:P_6OS)N" As Sh,rt & 1 C,nst S:P_6ONO72"7 As Sh,rt & ?%=S C,nst %:62_BOTTO- As Sh,rt & 1 2im i2evice As )nte#er & ( 2im h%.nd As )nte#er 2eclare <uncti,n Send-essa#e /ib 3user>+3 Alias 3Send-essa#eA3 (ByVal h.nd As )nte#er! ByVal .-s# As )nte#er! ByVal .Param As )nte#er! A-arshalAs(5nmana#edType.AsAny$B ByVal lParam As Ob ect$ As )nte#er 2eclare <uncti,n Set:ind,.P,s /ib 3user>+3 Alias 3Set:ind,.P,s3 (ByVal h.nd As )nte#er! ByVal h:nd)nsertA*ter As )nte#er! ByVal 0 As )nte#er! ByVal y As )nte#er! ByVal c0 As )nte#er! ByVal cy As )nte#er! ByVal .<la#s As )nte#er$ As )nte#er 2eclare <uncti,n 2estr,y:ind,. /ib 3user>+3 (ByVal hnd. As )nte#er$ As B,,lean 2eclare <uncti,n capCreateCapture:ind,.A /ib 3avicap>+.dll3 (ByVal lpsE:ind,.6ame As Strin#! ByVal d.Style As )nte#er! ByVal 0 As )nte#er! ByVal y As )nte#er! ByVal n:idth As )nte#er! ByVal n%ei#ht As Sh,rt! ByVal h:ndParent As )nte#er! ByVal n)2 As )nte#er$ As )nte#er 2eclare <uncti,n cap;et2river2escripti,nA /ib 3avicap>+.dll3 (ByVal .2river As Sh,rt! ByVal lpsE6ame As Strin#! ByVal cb6ame As )nte#er! ByVal lpsEVer As Strin#! ByVal cbVer As )nte#er$ As B,,lean 8DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD DDDDDDDDDD Private 2im 2im 2im 2im 2, 1(($ Sub /,ad2evice/ist($ str6ame As Strin# & Space(1(($ strVer As Strin# & Space(1(($ b7eturn As B,,lean 0 As )nte#er & ( b7eturn & cap;et2river2escripti,nA(0! str6ame! 1((! strVer!

)* b7eturn Then lst2evices.)tems.Add(str6ame.Trim$ 0 '& 1 /,,p 5ntil b7eturn & <alse "nd Sub Private Sub OpenPrevie.:ind,.($ 2im i%ei#ht As )nte#er & picCapture.%ei#ht 2im i:idth As )nte#er & picCapture.:idth h%.nd & capCreateCapture:ind,.A(i2evice! :S_V)S)B/" Or :S_C%)/2! (! (! O=(! =L(! picCapture.%andle.T,)nt>+! ($ )* Send-essa#e(h%.nd! :-_CAP_27)V"7_CO66"CT! i2evice! ($ Then Send-essa#e(h%.nd! :-_CAP_S"T_SCA/"! True! ($

Send-essa#e(h%.nd! :-_CAP_S"T_P7"V)":7AT"! OO! ($ Send-essa#e(h%.nd! :-_CAP_S"T_P7"V)":! True! ($ Set:ind,.P,s(h%.nd! %:62_BOTTO-! (! (! picCapture.:idth! picCapture.%ei#ht! S:P_6O-OV" Or S:P_6ONO72"7$ "lse 2estr,y:ind,.(h%.nd$ btnSave."nabled & <alse "nd )* "nd Sub Private Sub btnSave_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles btnSave.Click 2im data As )2ataOb ect 2im bmap As )ma#e Send-essa#e(h%.nd! :-_CAP_"2)T_COPM! (! ($ data & Clipb,ard.;et2ataOb ect($ )* data.;et2ataPresent(;etType(System.2ra.in#.Bitmap$$ Then bmap & CType(data.;et2ata(;etType(System.2ra.in#.Bitmap$$! )ma#e$ picCapture.)ma#e & bmap Cl,sePrevie.:ind,.($ btnSave."nabled & <alse )* s*d)ma#e.Sh,.2ial,# & 2ial,#7esult.OC Then bmap.Save(s*d)ma#e.<ile6ame! )ma#in#.)ma#e<,rmat.Bmp$ "nd )* "nd )* Clipb,ard.Clear($ picCapture.)ma#e & 6,thin# ppb1.)ma#e/,cati,n & s*d)ma#e.<ile6ame check.Te0t & s*d)ma#e.<ile6ame.T,Strin# "nd Sub Private Sub Cl,sePrevie.:ind,.($ Send-essa#e(h%.nd! :-_CAP_27)V"7_2)SCO66"CT! i2evice! ($ 2estr,y:ind,.(h%.nd$ "nd Sub Private Sub Butt,n+_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n+.Click )* *la#1 & ( Then OpenPrevie.:ind,.($ *la#1 & 1 "lse Cl,sePrevie.:ind,.($ *la#1 & ( "nd )* btnSave."nabled & True "nd Sub Public Sub cls1(By7e* ,b As C,ntr,l$ 2im ,b 1 As C,ntr,l <,r "ach ,b 1 )n ,b .C,ntr,ls )* TypeO* ,b 1 )s Te0tB,0 Then ,b 1.Te0t & 33 "nd )* )* TypeO* ,b 1 )s C,mb,B,0 Then ,b 1.Te0t & 33 "nd )* )* TypeO* ,b 1 )s PictureB,0 Then ,b 1.Back#r,und)ma#e & 6,thin# "nd )*

6e0t "nd Sub Public Sub client_inc($ S1lC,nnecti,n.Open($ 2im db1uery As Strin# db1uery & 3S"/"CT client_id <7O- client_in*,rmati,n3 cmd & 6e. -yS1lC,mmand(db1uery! S1lC,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead client_id & db.)tem(3client_id3$ ' 1 "nd :hile S1lC,nnecti,n.Cl,se($ "nd Sub Public Sub client_in*,(By7e* S9/Statement As Strin#$ Try S1lC,nnecti,n.Open($ :ith cmd .C,mmandTe0t & S9/Statement .C,mmandType & C,mmandType.Te0t .C,nnecti,n & S1lC,nnecti,n ."0ecute6,n9uery($ "nd :ith S1lC,nnecti,n.Cl,se($ -s#B,0(36e. Client Added3$ cls1(pi#b1$ cls1(ci#b1$ ppb1.)ma#e & 6,thin# client_inc($ act1.Te0t & client_id S1lC,nnecti,n.2isp,se($ Catch -s#B,0("rr,rT,Strin#$ "nd Try "nd Sub Private Sub Butt,n=_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n=.Click cls1(pi#b1$ cls1(ci#b1$ ppb1.)ma#e & 6,thin# "nd Sub Private Sub C7SCC_Clients_detail_/,ad(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles -yBase./,ad /,ad2evice/ist($ S1lC,nnecti,n.C,nnecti,nStrin# & ServerStrin# *la#1 & ( client_inc($ act1.Te0t & client_id "nd Sub Private Sub Butt,n>_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n>.Click 2im *ull_name As Strin# 2im d_,_b As Strin# 2im p_,_b As Strin# 2im p_a As Strin# 2im state As Strin# 2im c,untry As Strin# 2im pass_n, As Strin# 2im m,b_n, As )nte#er

2im e_id As Strin# 2im im#_l,c As Strin# *ull_name & pit1.Te0t.T,Strin# d_,_b & d,bc1.Selected)tem ' 3D3 ' d,bc+.Selected)tem ' 3D3 ' d,bc>.Selected)tem p_,_b & pit>.Te0t.T,Strin# p_a & pit=.Te0t.T,Strin# state & pitG.Te0t.T,Strin# c,untry & pitO.Te0t.T,Strin# pass_n, & pitH.Te0t.T,Strin# e_id & cit+.Te0t ' 3P3 ' cit>.Te0t im#_l,c & client_id )* pit1.Te0t & 33 Or pit>.Te0t & 33 Or pit=.Te0t & 33 Or pitG.Te0t & 33 Or pitO.Te0t & 33 Or pitH.Te0t & 33 Or cit1.Te0t & 33 Or cit+.Te0t & 33 Or cit>.Te0t & 33 Or d,bc1.Selected)nde0 A ( Or d,bc+.Selected)nde0 A ( Or d,bc>.Selected)nde0 A ( Or check.Te0t & 33 Then -s#B,0(3<ill all details and l,ad ur pic 3$ "lse Try m,b_n, & )nte#er.Parse(cit1.Te0t$ 2im S9/Statement As Strin# & 3)6S"7T )6TO client_in*,rmati,n VA/5"S (83 ? client_id ? 38!83 ? *ull_name ? 38!83 ? d_,_b ? 38!83 ? p_,_b ? 38!83 ? p_a ? 38!83 ? state ? 38!83 ? c,untry ? 38!83 ? pass_n, ? 38!83 ? m,b_n, ? 38!83 ? e_id ? 38!83 ? im#_l,c ? 38$3 client_in*,(S9/Statement$ Catch e0 As "0cepti,n -s#B,0(3"nter )nte#er data in m,b *ield 3$ "nd Try "nd )* "nd Sub Private Sub Butt,nG_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,nG.Click C7SCC.PictureB,01.Visible & True -e.Cl,se($ "nd Sub Private Sub ppt1_Tick(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles ppt1.Tick alert./e*t & alert./e*t ' G )* alert./e*t & -e.:idth Then alert./e*t & ( "nd )* "nd Sub "nd Class

DELETE CLIENT
)mp,rts -yS1l.2ata.-yS1lClient Public Class 2elete_Client 2im serverstrin# As Strin# & 3Server&l,calh,st45id&r,,t4P.d&crs42atabase&yash3 2im s1lc,nnecti,n As -yS1lC,nnecti,n & 6e. -yS1lC,nnecti,n 2im db As -yS1l2ata7eader 2im cmd As -yS1lC,mmand & 6e. -yS1lC,mmand 2im client_ima#e_l,cati,n As Strin# & 3"@FCar 7ent(pr, ect$F)ma#esFClient_)ma#eF3

2im *la#1 As )nte#er Public Sub l,ad_client(ByVal cl_id As )nte#er$ s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3S"/"CT J <7O- client_in*,rmati,n3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead )* cl_id & db.)tem(3client_id3$ Then cit1.Te0t & db.)tem(3client_id3$ cit+.Te0t & db.)tem(3*ull_name3$ cit>.Te0t & db.)tem(3date_,*_birth3$ cit=.Te0t & db.)tem(3passp,rt_n,3$ citG.Te0t & db.)tem(3m,bile_n,3$ citO.Te0t & db.)tem(3email_id3$ citH.Te0t & db.)tem(3permanent_address3$ cip1./,ad(client_ima#e_l,cati,n ' db.)tem(3client_picture3$ ' 3.bmp3$ "nd )* "nd :hile s1lc,nnecti,n.Cl,se($ "nd Sub Public Sub del_client_list($ 2im s1lstrin# As Strin# s1lstrin# & 32"/"T" <7O- client_in*,rmati,n .here client_id & 83 ? cit1.Te0t ? 38 3 2im s1lstrin#+ As Strin# s1lstrin#+ & 3S"/"CT client_id <7O- client_in*,rmati,n :%"7" client_id n,t in(S"/"CT client_id <7O- rent_car$ 3 *la#1 & ( Try s1lc,nnecti,n.Open($ cmd & 6e. -yS1lC,mmand(s1lstrin#+! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead )* Te0tB,01.Te0t & db.)tem(3client_id3$ Then *la#1 & 1 "0it :hile "nd )* "nd :hile s1lc,nnecti,n.Cl,se($ s1lc,nnecti,n.Open($ )* *la#1 & 1 Then :ith cmd .C,mmandTe0t & s1lstrin# .C,mmandType & C,mmandType.Te0t .C,nnecti,n & s1lc,nnecti,n ."0ecute6,n9uery($ "nd :ith -s#B,0(3Success3$ -e.Cl,se($ C7SCC.PictureB,01.Visible & True "lse -s#B,0(3This Client %ired S,me Cars ! C,uld 6,t Be 2eletedIIIIIIII3$ "nd )* s1lc,nnecti,n.Cl,se($ s1lc,nnecti,n.2isp,se($ Catch

-s#B,0("rr,rT,Strin#$ "nd Try "nd Sub Private Sub Te0tB,01_Cey2,.n(ByVal sender As Ob ect! ByVal e As System.:ind,.s.<,rms.Cey"ventAr#s$ %andles Te0tB,01.Cey2,.n )* e.CeyC,de & Ceys."nter Then *la#1 & ( s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3S"/"CT client_id <7Oclient_in*,rmati,n 3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead )* Te0tB,01.Te0t & db.)tem(3client_id3$ Then *la#1 & 1 "0it :hile "nd )* "nd :hile e.%andled & True s1lc,nnecti,n.Cl,se($ )* *la#1 & 1 Then ci#1.Visible & True l,ad_client(Te0tB,01.Te0t$ "lse ci#1.Visible & <alse -s#B,0(3Client n,t *,und3$ "nd )* "nd )* "nd Sub Private Sub Client_del_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Client_del.Click 2im B,0 As -s#B,07esult )* ci#1.Visible & True Then B,0 & -s#B,0(3Are M,u Sure3! -s#B,0Style.Mes6,$ )* B,0 & -s#B,07esult.Mes Then del_client_list($ "nd )* "lse -s#B,0(36, Client T, 2eleteIII3$ "nd )* "nd Sub Private Sub 2elete_Client_/,ad(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles -yBase./,ad s1lc,nnecti,n.C,nnecti,nStrin# & serverstrin# "nd Sub Private Sub Butt,n+_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n+.Click -e.Cl,se($ C7SCC.PictureB,01.Visible & True "nd Sub "nd Class

DELETE RECORD
)mp,rts -yS1l.2ata.-yS1lClient Public Class delete_vehicle

2im serverstrin# As Strin# & 3Server&l,calh,st45id&r,,t4P.d&crs42atabase&yash3 2im s1lc,nnecti,n As -yS1lC,nnecti,n & 6e. -yS1lC,nnecti,n 2im db As -yS1l2ata7eader 2im cmd As -yS1lC,mmand & 6e. -yS1lC,mmand 2im *la#1 As )nte#er 2im car_ima#e_l,cati,n As Strin# & 3"@FCar 7ent(pr, ect$F)ma#esF3 Public Sub delete_car($ 2im s1l1uery As Strin# 2im s1l1uery+ As Strin# s1l1uery & 32"/"T" <7O- car_in*,rmati,n .here st,ck_n,&83 ? Te0tB,01.Te0t ? 383 s1l1uery+ & 3S"/"CT st,ck_n, *r,m car_in*,rmati,n .here st,ck_n, n,t in (S"/"CT st,ck_n, *r,m rent_car$3 *la#1 & ( Try s1lc,nnecti,n.Open($ cmd & 6e. -yS1lC,mmand(s1l1uery+! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead )* Te0tB,01.Te0t & db.)tem(3st,ck_n,3$ Then *la#1 & 1 "0it :hile "nd )* "nd :hile s1lc,nnecti,n.Cl,se($ s1lc,nnecti,n.Open($ )* *la#1 & 1 Then :ith cmd .C,mmandTe0t & s1l1uery .C,mmandType & C,mmandType.Te0t .C,nnecti,n & s1lc,nnecti,n ."0ecute6,n9uery($ "nd :ith -s#B,0(3Success3$ dr#b1.Visible & <alse cdt1.Te0t & 33 "lse -s#B,0(3This car is ,n hireII c,uld n,t be deleted3$ "nd )* s1lc,nnecti,n.Cl,se($ s1lc,nnecti,n.2isp,se($ Catch -s#B,0("rr,rT,Strin#$ "nd Try "nd Sub Private Sub Te0tB,01_Cey2,.n(ByVal sender As Ob ect! ByVal e As System.:ind,.s.<,rms.Cey"ventAr#s$ %andles Te0tB,01.Cey2,.n )* e.CeyValue & Ceys."nter Then *la#1 & ( s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3S"/"CT st,ck_n, <7O- car_in*,rmati,n 3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead )* Te0tB,01.Te0t & db.)tem(3st,ck_n,3$ Then *la#1 & 1 "0it :hile

"nd )* "nd :hile e.%andled & True s1lc,nnecti,n.Cl,se($ )* *la#1 & 1 Then dr#b1.Visible & True l,ad_car(Te0tB,01.Te0t$ "lse dr#b1.Visible & <alse -s#B,0(3Car n,t *,und3$ cdt1.Te0t & 33 "nd )* "nd )* "nd Sub Public Sub l,ad_car(ByVal cl_id As )nte#er$ s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3Select J *r,m car_in*,rmati,n3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead )* cl_id & db.)tem(3st,ck_n,3$ Then cdt1.Te0t & db.)tem(3st,ck_n,3$ cdt+.Te0t & db.)tem(3re#_n,3$ cdt>.Te0t & db.)tem(3m,del3$ cdt=.Te0t & db.)tem(3year3$ cdtG.Te0t & db.)tem(3c,l,ur3$ cdtO.Te0t & db.)tem(3class3$ cdtH.Te0t & db.)tem(3en#ine3$ rt1.Te0t & db.)tem(3rate_per_day3$ rt+.Te0t & db.)tem(3rate_.eekly3$ drpb1./,ad(car_ima#e_l,cati,n ' db.)tem(3st,ck_n,3$.T,Strin# ' 3. p#3$ "0it :hile "nd )* "nd :hile s1lc,nnecti,n.Cl,se($ "nd Sub Private Sub Butt,n1_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n1.Click -e.Cl,se($ C7SCC.PictureB,01.Visible & True "nd Sub Private Sub delete_vehicle_/,ad(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles -yBase./,ad s1lc,nnecti,n.C,nnecti,nStrin# & serverstrin# "nd Sub Private Sub Te0tB,01_Te0tChan#ed(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Te0tB,01.Te0tChan#ed "nd Sub Private Sub Butt,n+_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n+.Click )* cdt1.Te0t AB 33 Then 2im b,0 As -s#B,07esult b,0 & -s#B,0(3Are y,u sure3! -s#B,0Style.Mes6,$

)* b,0 & -s#B,07esult.Mes Then delete_car($ "nd )* "lse -s#B,0(36, Car Selected IIIIIIIIIII3$ "nd )* "nd Sub "nd Class

EDIT VEHICLE RECORD


)mp,rts -yS1l.2ata.-yS1lClient Public Class "dit_Vehicle_7ec,rd 2im serverstrin# As Strin# & 3Server&l,calh,st45id&r,,t4P.d&crs42atabase&yash3 2im s1lc,nnecti,n As -yS1lC,nnecti,n & 6e. -yS1lC,nnecti,n 2im db As -yS1l2ata7eader 2im cmd As -yS1lC,mmand & 6e. -yS1lC,mmand 2im *la#1 As )nte#er 2im car_ima#e_l,cati,n As Strin# & 3"@FCar 7ent(pr, ect$F)ma#esF3 Private Sub Te0tB,01_Cey2,.n(ByVal sender As Ob ect! ByVal e As System.:ind,.s.<,rms.Cey"ventAr#s$ %andles Te0tB,01.Cey2,.n )* e.CeyValue & Ceys."nter Then *la#1 & ( s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3S"/"CT st,ck_n, <7O- car_in*,rmati,n 3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead )* Te0tB,01.Te0t & db.)tem(3st,ck_n,3$ Then *la#1 & 1 "0it :hile "nd )* "nd :hile e.%andled & True s1lc,nnecti,n.Cl,se($ )* *la#1 & 1 Then dr#b1.Visible & True l,ad_car(Te0tB,01.Te0t$ "lse dr#b1.Visible & <alse cdt1.Te0t & 33 -s#B,0(3Car n,t *,und3$ "nd )* "nd )* "nd Sub Public Sub l,ad_car(ByVal cl_id As )nte#er$ s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3Select J *r,m car_in*,rmati,n3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead )* cl_id & db.)tem(3st,ck_n,3$ Then cdt1.Te0t & db.)tem(3st,ck_n,3$ cdt+.Te0t & db.)tem(3re#_n,3$

cdt>.Te0t & db.)tem(3m,del3$ cdt=.Te0t & db.)tem(3year3$ cdtG.Te0t & db.)tem(3c,l,ur3$ cdc1.Te0t & db.)tem(3class3$ cdc+.Te0t & db.)tem(3en#ine3$ rt1.Te0t & db.)tem(3rate_per_day3$ rt+.Te0t & db.)tem(3rate_.eekly3$ drpb1./,ad(car_ima#e_l,cati,n ' db.)tem(3st,ck_n,3$.T,Strin# ' 3. p#3$ "0it :hile "nd )* "nd :hile s1lc,nnecti,n.Cl,se($ "nd Sub Private Sub "dit_Vehicle_7ec,rd_/,ad(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles -yBase./,ad s1lc,nnecti,n.C,nnecti,nStrin# & serverstrin# "nd Sub Private Sub Cl,se1_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Cl,se1.Click -e.Cl,se($ C7SCC.PictureB,01.Visible & True "nd Sub Public Sub car_save(By7e* S9/Statement As Strin#$ Try s1lc,nnecti,n.Open($ :ith cmd .C,mmandTe0t & S9/Statement .C,mmandType & C,mmandType.Te0t .C,nnecti,n & s1lc,nnecti,n ."0ecute6,n9uery($ "nd :ith s1lc,nnecti,n.Cl,se($ -s#B,0(37ec,rd Success*ully "dited3$ dr#b1.Visible & <alse cdt1.Te0t & 33 s1lc,nnecti,n.2isp,se($ Catch -s#B,0("rr,rT,Strin#$ "nd Try "nd Sub Public Sub edit_car($ 2im m,del_n, As Strin# 2im re#_n, As Strin# 2im car_year As )nte#er 2im car_c,l,ur As Strin# 2im car_class As Strin# 2im car_en#ine As Strin# 2im car_rate_day As )nte#er 2im car_rate_.eekly As )nte#er 8 2im pic_l,c As Strin# m,del_n, & cdt>.Te0t.T,Strin# re#_n, & cdt+.Te0t.T,Strin# car_c,l,ur & cdtG.Te0t.T,Strin# car_class & cdc1.Te0t.T,Strin# car_en#ine & cdc+.Te0t.T,Strin# 8 pic_l,c & st,ck_n,

)* cdt+.Te0t & 33 Or cdt>.Te0t & 33 Or cdt=.Te0t & 33 Or cdtG.Te0t & 33 Or cdc1.Selected)nde0 A ( Or cdc+.Selected)nde0 A ( Or /P_l,c.Te0t & 33 Then -s#B,0(3<ill all the details and /,ad Picture3$ "lse Try car_year & )nte#er.Parse(cdt=.Te0t$ car_rate_day & )nte#er.Parse(rt1.Te0t$ car_rate_.eekly & )nte#er.Parse(rt+.Te0t$ )* car_year A +(G( And car_year B 1H(( Then )* car_rate_day A& car_rate_.eekly Then 2im S9/Statement As Strin# & 35P2AT" car_in*,rmati,n S"T re#_n,&83 ? re#_n, ? 38!m,del&83 ? m,del_n, ? 38!year&83 ? car_year ? 38!c,l,ur&83 ? car_c,l,ur ? 38!class&83 ? car_class ? 38!en#ine&83 ? car_en#ine ? 38!rate_per_day&83 ? car_rate_day ? 38!rate_.eekly&83 ? car_rate_.eekly ? 38 :%"7" st,ck_n,&83 ? Te0tB,01.Te0t ? 383 car_save(S9/Statement$ "lse -s#B,0(32aily rent is m,re than :eekly rent I C,rrect it3$ "nd )* "lse -s#B,0(3"nter year bet.een 1H((D+(G(3$ "nd )* Catch e0 As "0cepti,n -s#B,0(3"nter inte#er data 3$ "nd Try "nd )* "nd Sub Private Sub Save_rec,rd_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Save_rec,rd.Click )* cdt1.Te0t AB 33 Then 2im b,0 As -s#B,07esult b,0 & -s#B,0(3Are y,u sure3! -s#B,0Style.Mes6,$ )* b,0 & -s#B,07esult.Mes Then edit_car($ "lse dr#b1.Visible & <alse cdt1.Te0t & 33 "nd )* "lse -s#B,0(36, Car Selected IIIIIIIIIII3$ "nd )* "nd Sub "nd Class

GAME
Public Class #ame1 )nherits System.:ind,.s.<,rms.<,rm Private Sub Butt,n1_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n1.Click :ith <lashOb .St,p($

.-,vie & C7SCC./abel1.Te0t .Play($ "nd :ith "nd Sub Private Sub Butt,n>_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n>.Click <lashOb .2isp,se($ -e.Cl,se($ C7SCC.PictureB,01.Visible & True "nd Sub "nd Class

QUICK LOOKUP
)mp,rts -yS1l.2ata.-yS1lClient Public Class 9uick_l,,kup 2im serverstrin# As Strin# & 3Server&l,calh,st45id&r,,t4P.d&crs42atabase&yash3 2im s1lc,nnecti,n As -yS1lC,nnecti,n & 6e. -yS1lC,nnecti,n 2im db As -yS1l2ata7eader 2im cmd As -yS1lC,mmand & 6e. -yS1lC,mmand Private Sub cl,se1_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles cl,se1.Click -e.Cl,se($ C7SCC.PictureB,01.Visible & True "nd Sub Private Sub 9uick_l,,kup_/,ad(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles -yBase./,ad Try s1lc,nnecti,n.C,nnecti,nStrin# & serverstrin# s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3S"/"CT J <7O- rent_car3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead /istB,01.)tems.Add(db.)tem(3st,ck_n,3$$ /istB,0+.)tems.Add(db.)tem(3client_id3$$ "nd :hile s1lc,nnecti,n.Cl,se($ Catch -s#B,0("rr,rT,Strin#$ "nd Try "nd Sub "nd Class

RECEIVE BACK
)mp,rts -yS1l.2ata.-yS1lClient Public Class C7SCC_7eceive_back 2im serverstrin# As Strin# & 3Server&l,calh,st45id&r,,t4P.d&crs42atabase&yash3 2im s1lc,nnecti,n As -yS1lC,nnecti,n & 6e. -yS1lC,nnecti,n 2im db As -yS1l2ata7eader 2im cmd As -yS1lC,mmand & 6e. -yS1lC,mmand

2im *la#1 As )nte#er 2im daily_char#e As )nte#er 2im client_ima#e_l,cati,n As Strin# & 3"@FCar 7ent(pr, ect$F)ma#esFClient_)ma#eF3 Public Sub l,ad_client(ByVal cl_id As )nte#er$ s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3S"/"CT J <7O- client_in*,rmati,n3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead )* cl_id & db.)tem(3client_id3$ Then cit1.Te0t & db.)tem(3client_id3$ cit+.Te0t & db.)tem(3*ull_name3$ cit>.Te0t & db.)tem(3date_,*_birth3$ cit=.Te0t & db.)tem(3passp,rt_n,3$ citG.Te0t & db.)tem(3m,bile_n,3$ citO.Te0t & db.)tem(3email_id3$ citH.Te0t & db.)tem(3permanent_address3$ cip1./,ad(client_ima#e_l,cati,n ' db.)tem(3client_picture3$ ' 3.bmp3$ "nd )* "nd :hile s1lc,nnecti,n.Cl,se($ "nd Sub Public Sub l,ad_car(ByVal cl_id As )nte#er$ c,rl1.)tems.Clear($ s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3Select J *r,m rent_car3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead )* cl_id & db.)tem(3client_id3$ Then c,rl1.)tems.Add(db.)tem(3st,ck_n,3$$ "nd )* "nd :hile s1lc,nnecti,n.Cl,se($ s1lc,nnecti,n.Open($ 2im db11uery As Strin# & 3Select J *r,m rent_car3 cmd & 6e. -yS1lC,mmand(db11uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead )* cl_id & db.)tem(3client_id3$ Then rbdl1.Te0t & db.)tem(3receive_date3$ "nd )* "nd :hile s1lc,nnecti,n.Cl,se($ "nd Sub Public Sub del_car_list($ 2im s1lstrin# As Strin# s1lstrin# & 32"/"T" <7O- rent_car .here client_id & 83 ? cit1.Te0t ? 38 3 Try s1lc,nnecti,n.Open($ :ith cmd .C,mmandTe0t & s1lstrin# .C,mmandType & C,mmandType.Te0t .C,nnecti,n & s1lc,nnecti,n ."0ecute6,n9uery($

"nd :ith -s#B,0(3Success3$ s1lc,nnecti,n.Cl,se($ s1lc,nnecti,n.2isp,se($ -e.Cl,se($ C7SCC.PictureB,01.Visible & True Catch -s#B,0("rr,rT,Strin#$ "nd Try "nd Sub Private Sub Te0tB,01_Cey2,.n(ByVal sender As Ob ect! ByVal e As System.:ind,.s.<,rms.Cey"ventAr#s$ %andles Te0tB,01.Cey2,.n )* e.CeyC,de & Ceys."nter Then *la#1 & ( s1lc,nnecti,n.Open($ 2im l As TimeSpan 2im db1uery As Strin# & 3S"/"CT client_id <7O- rent_car 3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead )* Te0tB,01.Te0t & db.)tem(3client_id3$ Then *la#1 & 1 "0it :hile "nd )* "nd :hile e.%andled & True s1lc,nnecti,n.Cl,se($ )* *la#1 & 1 Then ci#1.Visible & True l,ad_client(Te0tB,01.Te0t$ c,r#1.Visible & True l,ad_car(Te0tB,01.Te0t$ yrl1.Visible & True yrl+.Visible & True 8 Calculati,n ,* days 8is late ,r n,t l & 2ate.6,. D 2ateTime.Parse(rbdl1.Te0t$ )* l.2ays A ( Then yrl1.Te0t & 3 M,u are 3 ? (l.2ays J D1$ ? 3 2ays "arly 3 "lse)* l.2ays B ( Then yrl1.Te0t & 3 M,u are 3 ? l.2ays ? 3 2ays /ate 3 )* l.2ays A > Then yrl+.Te0t & 3 M,u Pay <ine O* 3 ? l.2ays J =(( ? 37upees3 "nd )* )* l.2ays A O And l.2ays B > Then yrl+.Te0t & 3 M,u Pay <ine O* 3 ? l.2ays J G(( ? 37upees3 "nd )* )* l.2ays B O Then yrl+.Te0t & 3 M,u Pay <ine O* 3 ? l.2ays J L(( ? 37upees3 "nd )* "lse)* l.2ays & ( And l.%,urs A += Then yrl1.Te0t & 3M,u are ,n time 3 "nd )* "lse

ci#1.Visible & <alse c,r#1.Visible & <alse yrl1.Visible & <alse yrl+.Visible & <alse -s#B,0(3Client n,t *,und3$ "nd )* "nd )* "nd Sub Private Sub C7SCC_7eceive_back_/,ad(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles -yBase./,ad s1lc,nnecti,n.C,nnecti,nStrin# & serverstrin# "nd Sub Private Sub Butt,n+_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n+.Click -e.Cl,se($ C7SCC.PictureB,01.Visible & True "nd Sub Private Sub Butt,n1_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n1.Click 2im B,0 As -s#B,07esult )* ci#1.Visible & True Then B,0 & -s#B,0(3Are M,u Sure3! -s#B,0Style.Mes6,$ )* B,0 & -s#B,07esult.Mes Then del_car_list($ "nd )* "lse -s#B,0(36, Client III3$ "nd )* "nd Sub "nd Class

RENT A CAR
)mp,rts -yS1l.2ata.-yS1lClient Public Class C7SCC_7ent_A_Car 2im ServerStrin# As Strin# & 3Server&l,calh,st45id&r,,t4P.d&crs42atabase&yash3 2im s1lc,nnecti,n As -yS1lC,nnecti,n & 6e. -yS1lC,nnecti,n 2im db As -yS1l2ata7eader 2im cmd As -yS1lC,mmand & 6e. -yS1lC,mmand 2im client_ima#e_l,cati,n As Strin# & 3"@FCar 7ent(pr, ect$F)ma#esFClient_)ma#eF3 2im car_ima#e_l,cati,n As Strin# & 3"@FCar 7ent(pr, ect$F)ma#esF3 2im .eek_n,! day_n, As )nte#er 2im datest As 2ate & 2ate.6,. Private Sub 7ent_A_Car_/,ad(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles -yBase./,ad s1lc,nnecti,n.C,nnecti,nStrin# & ServerStrin# date_l1.Te0t & <,rmat(datest! 3yyyyD--Ddd3$ "nd Sub Private Sub Butt,n1_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n1.Click

s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3S"/"CT *ull_name *r,m client_in*,rmati,n .here client_id n,t in(select client_id *r,m rent_car$3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead cnlb.)tems.Add(db.)tem(3*ull_name3$$ "nd :hile s1lc,nnecti,n.Cl,se($ "nd Sub Public Sub l,ad_client($ cip1.)ma#e & 6,thin# s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3S"/"CT J *r,m client_in*,rmati,n .here client_id n,t in (select client_id *r,m rent_car$3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader Try :hile db.7ead )* cnlb.Selected)tem & db.)tem(3*ull_name3$ Then cit1.Te0t & db.)tem(3client_id3$ cit+.Te0t & db.)tem(3*ull_name3$ cit>.Te0t & db.)tem(3date_,*_birth3$ cit=.Te0t & db.)tem(3passp,rt_n,3$ citG.Te0t & db.)tem(3m,bile_n,3$ citO.Te0t & db.)tem(3email_id3$ citH.Te0t & db.)tem(3permanent_address3$ cip1./,ad(client_ima#e_l,cati,n ' db.)tem(3client_picture3$ ' 3.bmp3$ "nd )* "nd :hile Catch -s#B,0(3)ma#e ,* client n,t *,und 3$ "nd Try s1lc,nnecti,n.Cl,se($ "nd Sub Public Sub l,ad_carlist($ s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3S"/"CT J *r,m car_in*,rmati,n .here st,ck_n, n,t in (select st,ck_n, *r,m rent_car$3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader Try :hile db.7ead )* avl1.Selected)tem & db.)tem(3st,ck_n,3$ Then acpb1./,ad(car_ima#e_l,cati,n ' db.)tem(3picture3$ ' 3. p#3$ "nd )* "nd :hile Catch -s#B,0(3)ma#e ,* car n,t *,und3$ "nd Try s1lc,nnecti,n.Cl,se($ "nd Sub Private Sub Butt,n+_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n+.Click -e.Cl,se($ C7SCC.PictureB,01.Visible & True

"nd Sub Private Sub cnlb_-,use2,ubleClick(ByVal sender As Ob ect! ByVal e As System.:ind,.s.<,rms.-,use"ventAr#s$ %andles cnlb.-,use2,ubleClick l,ad_client($ "nd Sub Public Sub insert_car_rent(By7e* S9/Statement As Strin#$ Try s1lc,nnecti,n.Open($ :ith cmd .C,mmandTe0t & S9/Statement .C,mmandType & C,mmandType.Te0t .C,nnecti,n & s1lc,nnecti,n ."0ecute6,n9uery($ "nd :ith s1lc,nnecti,n.Cl,se($ s1lc,nnecti,n.2isp,se($ Catch -s#B,0("rr,rT,Strin#$ "nd Try "nd Sub Public Sub disp_avail_car($ 82isplayin# available cars t, avl1 list b,0 s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3S"/"CT J *r,m car_in*,rmati,n .here st,ck_n, n,t in (select st,ck_n, *r,m rent_car$3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader Try :hile db.7ead avl1.)tems.Add(db.)tem(3st,ck_n,3$$ avl+.)tems.Add(db.)tem(3rate_per_day3$$ avl>.)tems.Add(db.)tem(3rate_.eekly3$$ "nd :hile Catch -s#B,0(36, Car Available3$ "nd Try s1lc,nnecti,n.Cl,se($ "nd Sub Private Sub Butt,nG_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,nG.Click disp_avail_car($ "nd Sub Private Sub avl1_Selected)nde0Chan#ed(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles avl1.Selected)nde0Chan#ed l,ad_carlist($ "nd Sub Private Sub Butt,n>_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n>.Click 8Addin# cars t, the rllb car list 2im num As )nte#er num & rllb1.)tems.C,unt 2im *la#1 As )nte#er & ( Try )* num B ( Then :hile num B (

"lse

)* avl1.Selected)tem & rllb1.)tems(num D 1$ Then *la#1 & ( num & ( "lse *la#1 & 1 "nd )* num & num D 1 "nd :hile

rllb1.)tems.Add(avl1.Selected)tem$ *la#1 & + "nd )* )* <la#1 & 1 Then rllb1.)tems.Add(avl1.Selected)tem$ "nd )* )* *la#1 & ( Then -s#B,0(3Already Added3$ "nd )* Catch -s#B,0("rr,rT,Strin#$ "nd Try "nd Sub Private Sub Butt,n=_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n=.Click rllb1.)tems.7em,ve(rllb1.Selected)tem$ "nd Sub Private Sub Butt,nO_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,nO.Click 2im n As )nte#er n & ( 2im num As )nte#er 2im S9/Statement As Strin# 2im startdate As Strin# 2im enddate As Strin# 2im t As TimeSpan 2im B,0 As -s#B,07esult startdate & date_l1.Te0t enddate & <,rmat(2ateTimePicker1.Value.2ate! 3yyyyD--Ddd3$ 8*indin# t,tal time t & 2ateTime.Parse(enddate$ D 2ateTime.Parse(startdate$ .eek_n, & -ath.Truncate(t.2ays Q H$ day_n, & t.2ays D (.eek_n, J H$ )* cit1.Te0t & 33 Then -s#B,0(3Select a Client3$ "lse )* rllb1.)tems.C,unt A 1 Then -s#B,0(3Select any car3$ "lse B,0 & -s#B,0(3Are M,u Sure3! -s#B,0Style.Mes6,$ )* t.2ays B ( Then )* B,0 & -s#B,07esult.Mes Then num & rllb1.)tems.C,unt 8)nsertin# data int, the rent_car :hile n A num

S9/Statement & 3)6S"7T )6TO rent_car VA/5"S(83 ? cit1.Te0t ? 38!83 ? rllb1.)tems(n$ ? 38!83 ? .eek_n, ? 38!83 ? day_n, ? 38!83 ? startdate ? 38!83 ? enddate ? 38$3 insert_car_rent(S9/Statement$ n & n ' 1 "nd :hile -s#B,0(3d,ne I :e are m,vin# t, bill desk3$ 8cl,sin# and m,ve t, parent Bill.client_idl1.Te0t & cit1.Te0t Bill.bdp1.)ma#e & cip1.)ma#e Bill.dl1.Te0t & day_n, Bill..l1.Te0t & .eek_n, -e.Cl,se($ Bill.Sh,.($ "lse -s#B,0(3S,rry3$ "nd )* "lse -s#B,0(3"nter Valid 2ate 3$ "nd )* "nd )* "nd )* "nd Sub "nd Class

RENTAL DETAIL
)mp,rts -yS1l.2ata.-yS1lClient Public Class 7ental_2etail 2im serverstrin# As Strin# & 3Server&l,calh,st45id&r,,t4P.d&crs42atabase&yash3 2im s1lc,nnecti,n As -yS1lC,nnecti,n & 6e. -yS1lC,nnecti,n 2im db As -yS1l2ata7eader 2im cmd As -yS1lC,mmand & 6e. -yS1lC,mmand 2im client_ima#e_l,cati,n As Strin# & 3"@FCar 7ent(pr, ect$F)ma#esFClient_)ma#eF3 2im car_ima#e_l,cati,n As Strin# & 3"@FCar 7ent(pr, ect$F)ma#esF3 2im *la#1 As )nte#er Private Sub Butt,n1_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n1.Click -e.Cl,se($ C7SCC.PictureB,01.Visible & True "nd Sub Public Sub l,ad_car(ByVal cl_id As )nte#er$ s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3Select J *r,m car_in*,rmati,n3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead )* cl_id & db.)tem(3st,ck_n,3$ Then cdt1.Te0t & db.)tem(3st,ck_n,3$ cdt+.Te0t & db.)tem(3re#_n,3$ cdt>.Te0t & db.)tem(3m,del3$ cdt=.Te0t & db.)tem(3year3$ cdtG.Te0t & db.)tem(3c,l,ur3$ cdtO.Te0t & db.)tem(3class3$ cdtH.Te0t & db.)tem(3en#ine3$

rt1.Te0t & db.)tem(3rate_per_day3$ rt+.Te0t & db.)tem(3rate_.eekly3$ drpb1./,ad(car_ima#e_l,cati,n ' db.)tem(3st,ck_n,3$.T,Strin# ' 3. p#3$ "0it :hile "nd )* "nd :hile s1lc,nnecti,n.Cl,se($ "nd Sub Public Sub l,ad_client(ByVal cl_id As )nte#er$ s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3S"/"CT J <7O- client_in*,rmati,n :%"7" client_id &(S"/"CT client_id <7O- rent_car :%"7" st,ck_n,&83 ? cl_id ? 38$3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead 8)* cl_id & db.)tem(3client_id3$ Then cit1.Te0t & db.)tem(3client_id3$ cit+.Te0t & db.)tem(3*ull_name3$ cit>.Te0t & db.)tem(3date_,*_birth3$ cit=.Te0t & db.)tem(3passp,rt_n,3$ citG.Te0t & db.)tem(3m,bile_n,3$ citO.Te0t & db.)tem(3email_id3$ citH.Te0t & db.)tem(3permanent_address3$ cip1./,ad(client_ima#e_l,cati,n ' db.)tem(3client_picture3$ ' 3.bmp3$ 8"nd )* "nd :hile s1lc,nnecti,n.Cl,se($ "nd Sub Private Sub 7ental_2etail_/,ad(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles -yBase./,ad s1lc,nnecti,n.C,nnecti,nStrin# & serverstrin# 2im 1uery1 As Strin# & 3S"/"CT st,ck_n, <7O- rent_car3 s1lc,nnecti,n.Open($ cmd & 6e. -yS1lC,mmand(1uery1! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead C,mb,B,01.)tems.Add(db.)tem(3st,ck_n,3$$ "nd :hile s1lc,nnecti,n.Cl,se($ "nd Sub Private Sub C,mb,B,01_Selected)nde0Chan#ed(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles C,mb,B,01.Selected)nde0Chan#ed l,ad_car(C,mb,B,01.Selected)tem$ l,ad_client(C,mb,B,01.Selected)tem$ "nd Sub "nd Class

VEHICLE LIST
)mp,rts -yS1l.2ata.-yS1lClient Public Class Vehicle_list

2im serverstrin# As Strin# & 3Server&l,calh,st45id&r,,t4P.d&crs42atabase&yash3 2im s1lc,nnecti,n As -yS1lC,nnecti,n & 6e. -yS1lC,nnecti,n 2im db As -yS1l2ata7eader 2im cmd As -yS1lC,mmand & 6e. -yS1lC,mmand 2im *la#1 As )nte#er 2im car_ima#e_l,cati,n As Strin# & 3"@FCar 7ent(pr, ect$F)ma#esF3 Private Sub Butt,n1_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Butt,n1.Click -e.Cl,se($ C7SCC.PictureB,01.Visible & True "nd Sub Private Sub Vehicle_list_/,ad(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles -yBase./,ad s1lc,nnecti,n.C,nnecti,nStrin# & serverstrin# 2im d1uery As Strin# & 3S"/"CT st,ck_n, <7O- car_in*,rmati,n3 cmd & 6e. -yS1lC,mmand(d1uery! s1lc,nnecti,n$ s1lc,nnecti,n.Open($ cmd & 6e. -yS1lC,mmand(d1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead vlb1.)tems.Add(db.)tem(3st,ck_n,3$$ "nd :hile s1lc,nnecti,n.Cl,se($ "nd Sub Public Sub l,ad_car(ByVal cl_id As )nte#er$ s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3Select J *r,m car_in*,rmati,n3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead )* cl_id & db.)tem(3st,ck_n,3$ Then cdt1.Te0t & db.)tem(3st,ck_n,3$ cdt+.Te0t & db.)tem(3re#_n,3$ cdt>.Te0t & db.)tem(3m,del3$ cdt=.Te0t & db.)tem(3year3$ cdtG.Te0t & db.)tem(3c,l,ur3$ cdtO.Te0t & db.)tem(3class3$ cdtH.Te0t & db.)tem(3en#ine3$ rt1.Te0t & db.)tem(3rate_per_day3$ rt+.Te0t & db.)tem(3rate_.eekly3$ drpb1./,ad(car_ima#e_l,cati,n ' db.)tem(3st,ck_n,3$.T,Strin# ' 3. p#3$ "0it :hile "nd )* "nd :hile s1lc,nnecti,n.Cl,se($ "nd Sub Public Sub check_rent(ByVal cl_id As )nte#er$ s1lc,nnecti,n.Open($ 2im *la# As )nte#er *la# & ( 2im db1uery1 As Strin# db1uery1 & 3S"/"CT J <7O- rent_car3 cmd & 6e. -yS1lC,mmand(db1uery1! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead )* cl_id & db.)tem(3st,ck_n,3$ Then

*la# & 1 "nd )* "nd :hile s1lc,nnecti,n.Cl,se($ )* *la# & 1 Then crl1.Te0t & 3O6 7"6T3 "lse crl1.Te0t & 3<7"" TO 7"6T3 "nd )* "nd Sub Private Sub vlb1_Selected)nde0Chan#ed(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles vlb1.Selected)nde0Chan#ed l,ad_car(vlb1.Selected)tem$ check_rent(vlb1.Selected)tem$ "nd Sub "nd Class

GPS(TRAIL)

)mp,rts -yS1l.2ata.-yS1lClient )mp,rts System.Te0t Public Class ;PS 2im serverstrin# As Strin# & 3Server&l,calh,st45id&r,,t4P.d&crs42atabase&yash3 2im s1lc,nnecti,n As -yS1lC,nnecti,n & 6e. -yS1lC,nnecti,n 2im db As -yS1l2ata7eader 2im cmd As -yS1lC,mmand & 6e. -yS1lC,mmand 2im state As Strin# & Strin#."mpty 2im c,untry As Strin# & Strin#."mpty 2im permanent As Strin# & Strin#."mpty 2im 1ueryaddress As 6e. Strin#Builder($ Private Sub cl,se1_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles cl,se1.Click -e.Cl,se($ C7SCC.PictureB,01.Visible & True "nd Sub Private Sub ;PS_/,ad(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles -yBase./,ad s1lc,nnecti,n.C,nnecti,nStrin# & serverstrin# 2im 1uery1 As Strin# & 3S"/"CT st,ck_n, <7O- rent_car3 s1lc,nnecti,n.Open($ cmd & 6e. -yS1lC,mmand(1uery1! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead C,mb,B,01.)tems.Add(db.)tem(3st,ck_n,3$$ "nd :hile s1lc,nnecti,n.Cl,se($ "nd Sub Public Sub l,adstc,($ Try 2im 1uery1 As Strin# & 3S"/"CT permanent_address!state!c,untry <7O- client_in*,rmati,n :%"7" client_id&(S"/"CT client_id <7O- rent_car :%"7" st,ck_n,&83 ? C,mb,B,01.Selected)tem ? 38 $3 s1lc,nnecti,n.Open($ cmd & 6e. -yS1lC,mmand(1uery1! s1lc,nnecti,n$

db & cmd."0ecute7eader :hile db.7ead state & db.)tem(3state3$ c,untry & db.)tem(3c,untry3$ permanent & db.)tem(3permanent_address3$ "nd :hile s1lc,nnecti,n.Cl,se($ sl1.Te0t & state cl1.Te0t & c,untry ctl1.Te0t & permanent 1ueryaddress.Append(3http@QQmaps.#,,#le.c,mQmapsR1&3$ permanent & permanent.7eplace(3 3! 3'3$ state & state.7eplace(3 3! 3'3$ c,untry & c,untry.7eplace(3 3! 3'3$ 1ueryaddress.Append(permanent ' 3!3 ? 3'3$ 1ueryaddress.Append(state ' 3!3 ? 3'3$ 1ueryaddress.Append(c,untry ' 3!3 ? 3'3$ :ebBr,.ser1.6avi#ate(1ueryaddress.T,Strin#$ 1ueryaddress.Clear($ Catch -s#B,0(35nable T, <ind /,cati,n3$ "nd Try "nd Sub Private Sub C,mb,B,01_Selected)nde0Chan#ed(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles C,mb,B,01.Selected)nde0Chan#ed l,adstc,($ "nd Sub "nd Class

BILL

)mp,rts -yS1l.2ata.-yS1lClient Public Class Bill 2im num! t,tal1 As )nte#er 2im serverstrin# As Strin# & 3Server&l,calh,st45id&r,,t4P.d&crs42atabase&yash3 2im s1lc,nnecti,n As -yS1lC,nnecti,n & 6e. -yS1lC,nnecti,n 2im db As -yS1l2ata7eader 2im cmd As -yS1lC,mmand & 6e. -yS1lC,mmand Private Sub Cl,seb1_Click(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles Cl,seb1.Click -e.Cl,se($ C7SCC.PictureB,01.Visible & True "nd Sub Private Sub Bill_/,ad(ByVal sender As System.Ob ect! ByVal e As System."ventAr#s$ %andles -yBase./,ad -e.-diParent & C7SCC s1lc,nnecti,n.C,nnecti,nStrin# & serverstrin# s1lc,nnecti,n.Open($ 2im db1uery As Strin# & 3S"/"CT J *r,m car_in*,rmati,n .here st,ck_n, in (select st,ck_n, *r,m rent_car .here client_id&83 ? client_idl1.Te0t ? 38$3 cmd & 6e. -yS1lC,mmand(db1uery! s1lc,nnecti,n$ db & cmd."0ecute7eader :hile db.7ead

rl>.)tems.Add(db.)tem(3st,ck_n,3$$ rl1.)tems.Add(db.)tem(3rate_per_day3$$ rl+.)tems.Add(db.)tem(3rate_.eekly3$$ "nd :hile s1lc,nnecti,n.Cl,se($ num & rl>.)tems.C,unt Try :hile num B ( t,tal1 & t,tal1 ' (dl1.Te0t J rl1.)tems(num D 1$ ' .l1.Te0t J rl+.)tems(num D 1$$ num & num D 1 "nd :hile t,tal.Te0t & 3 7s . 3 ? t,tal1 ? 3.((3 Catch -s#B,0("rr,rT,Strin#$ "nd Try "nd Sub "nd Class