Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
FACULTY OF ENGINEERING DEPARTMENT OF COMPUTER ENGINEERING
GOVERNMENT LAW OF 36/2005 DISCOUNT PROJECT FOR ELECTRICITY BILLS
GRADUATION PROJECT COM-400
Student : Mustafa HARUTOGLU
Supervisor : Assoc.Prof. Dr. Rahib ABIYEV
Nicosia -2006
ACKNOWLEDGMENT ABSTRACT
1. INTORDUCTION
TABLE OF CONTENT
2. GOVERNMENT LAW OF 36\2005 PROGRAM CONTENT 3
2.1. DATABASE CONTENT
2.1.1. 2005 TABLE
2.1.2. aktifiptal TABLE
2.1.3. aktifkayrt TABLE
2.1.4. borclu TABLE
2.1.5. data TABLE
2.1.6. pasifiptal TABLE
2.1.7. pasifkayit TABLE
3
4
5
6
7
8
9
10
2.2. DEVELOPMENT OF DISCOUNT SYSTEM OF VISIUAL BASIC 11
3. 4.
2.2.1. Visual basic 6.0 main form
2.2.2. Login form
2.2.3. Main menu
2.2.4. 2004 year accounts form
2.2.5. Passive consummers form
2.2.6. Informations of contracts
2.2.7. Create text files form
2.2.8. Delete operations form
2.2.9. Daily informations
2.2.10. 2005 year accounts
2.2.11. Print form of acctive customers
2.2.12. Print form for cahier (acctive custommer)
2.2.13. Print form of passive customers
2.2.14. Print form for cahier (passive custommer)
2.2.15 Module form
CONCLUSION REFFERANCES
11
12
13
15
16
17
18
19
20
21
22
23
24
25
26
27 28
5. APPENDIX 29
ACKNOWLEDGMENTS
Before beginning to introduce my project, i want to say something about me and
university. I am 35 years old and i work in Electricity Authority as a Analist Programmer. I
graduated from EMU in 2000 from Computer Science and Information Technology
Department. This university is my second university that i take certificate and i am happy to
graduate from this university. I want to say special thanks to the university staff and
department staff very much. Because they help me when i have problems. They are very
polite and helpful persons. I also want to say thanks for my managers and my friends in the
work because they give me the change to follow the lessons.
ABSTRACT
In this century in the world, thecnology is growing very fast, and we must study very
hard to catch this. Computers are eneter everywhere in the life and make works very easy.
While i am working in authority we have a computer systems which is online with 7
district. This system is old, because it is Unix Operating System and COBOL programing
language which is clumsy. It is difficult to write new programs and difficult to take reports
when wanted. Me and my friend decided to rechange the system and network with the new
technolgy. And we decided to set Windows Servers, Sql Server and .NET programming
language with the 2 Mb rent Leased Lines to be online our district. This project that i prepare
for the graduation project is only one part of our programs.
1.INTRODUCTION
This project is prepared by me in 5th of september 2005. The aim of writing this
program is, the Government Law 36/2005 which is discounting the penalties for electricity
bills and make change to installments up to 36 months. This program calculate many
possibilities to the consumers accounts and obtained discount amount, revenue amounts and
instalments automatically. By this program we make a contract with the consumers. This
program is used 7 different district office and make contract. By this program we make
more than 8000 contracts. End of the day each office convert the database to the text format
and send to the center office with the hyper terminals and then we load the data to the main
server for customers accounts. in this program there are three main program which is directly interested with
customers. These are: 1. 2004 accounts : These accaounts are interested with up to 31-12-2004 date. The
program calculate the unpaid bills, total paid and capital penalties till to end of 2004 ,
and calculate the discounts and installments and diveded in to months. The
installments are obtained the government law. These are never change by the user. If
the installment is obtained 6 month user can not make 12 month, but if the
installment is 12 month user can decrease it 6 month. The installment rates are like
that: 100 YTL- 500 YTL 6 month
500 YTL - 1000 YTL 12 month
1000 YTL - 2000 YTL 18 month
2000 YTL - 5000 YTL 24 month
up to 5000 YTL 36 month
2. 2005 accounts : This module is diceded our managers. It is not government law.
Because the customers didn't paid their bills and wait the law, and we can't delivered
the money, and they diceded that to give a change to the customers to pay their bills
as installments. This module include only 2005 year accounts not before. The
installments rates are like that:
1
Less than 200 YTL : .1 month
200 - 400 YTL .2 month
400 - 600 YTL 3 month
600 - 1500 YTL .4 month
1500- 3000 YTL 6 month
3. The accounts which are never paid and we can not delivered them and the accounts
which the customers were changed their addresses and didn't paid their accounts.
The installment rates are same as the 2004 accounts.
The other modules are introduced with the forms next.
4. This program is prepared with Visual Basic 6.0 and MsAccess 2000 database.
First of all, All forms connect to the MS Access. All forms have Data controls for
connecting to the Database. The Database Design is defined before. I used SQL queries in
the codes that connect to the data. Always i didn't connect database by data controls at the
design time of the form. Generally I used queries within the code. The usage of SQL is more
practical, more usable and flexible.You can search everything according to your wish.
For example, makes searching according to the consumer number (Tuketici No).It
searches and finds consumer within the 120,000 consumers and brings the name, surname,
address, dept for ending of 2004 including capital interest, the total capital interest from
1998 until 2004 and total collecting money until the end of 2004 for consumer that we
searches in the text box. I used text boxes, labels option boxes, frames, data controls. Also I
connected to the system date and it comes authomatically when the program starts. Of course
the consumer that has dept by end of 2004 can apply this form calculations if not they should
apply to the 2005 active instalment process with no discount.
In this form, consummer is responsible all debt untill the applying date and should
pay 20% of the unpaid capital interest and 80% of that interest will get discount. User should
enter present dept, present interest, present collecting money, the last bill number, identitiy
no and phone number. If user doesn't enter any of these, program gives a message until user
enter informations correctly. For example, if user enter bill number less than 9 characteer
program gives error message. After all, program finds discount amount, instalment amount
automatically.Program gives chance to the consumer to change instalment periods.
Finally, if you press record data will be added to the table as a new record.
2
2.GOVERNMENT LAW OF 36\2005 PROGRAM CONTENT
2.1. DATABASE CONTENT
r.J Miuo!'.ofl Ac<:e~s I dh1 : l),)f,1hdS(' (Aucss /000 file ftuni.tl)I ' - (c.:.; rRJ B!J E~ ~dit !'..ieW jrsert Iools ~indow !jelp
D~kltii (!t[}.::" i ~n ,,. !a· l,:i,· ft cw; im"·~,ili· (7).
l% Macros
4 Moduies
--~~-- (i) Favorites
1,
11
I•
·'-:start._-- O, _1 ·":1c--·r.,',.,,:,·,~ i:., .::~ .Jr:~ ;-i,.:,,:,.: "<~, .. ~-•
Figure 1.1 MsAccess Database Tables
In this window there are 7 tables that we used to call or write data on it. These tables are :
1. 2005 : this table includes the 2005 year accounts.
2. aktifiptal : this table stores the data which the contracts are deleted.
3. aktifkayit : this is the table that we stored data to the contracts.
4. borclu : this is the table that, the data which is interested with unpaid accounts. It
stores 31,428 records.
5. data: this table is the main table which includes the using accounts and stores
110,428 records.
6. pasifiptal : this table stores data that the deleted unpaid accounts.
7. pasifkayit : this table is the other main table that stores the operations related
unpaid accounts.
3
2.1.1. 2005 TABLE '.J Microsoft Access (]00'.J: l.sblc] - )i:" ~~J
Type a QUeStkln for hob • _ ~ X
~_gm;'"'
------ -- -·· .... - - ·-·····-
--- -
l --=--~--- -- - -_ + + +
+ t- - ~ . , -=-:-4-4::::=-c:=-_ - - -- - - ~ :: : - -'- _: -=:--=---- _- - _- - J ----------
Gene,~ 1,-., I Field Size 1<1
'""'" ,,..,.._ (option Defd Voiue \laid&IOf'l Rl.Ae 11~.ionText Req.Med No Allow Zero Lerqt:h Yes Index.eel No Uric.ode Compression ves 11'>'£ Mode No Control 11'¥£ Sentence Mode None
A field rwne con be'-" to 64 ctwocters long, h::ludioo soeces. Press Fl frx het> on Reid names,
OesqlvieW. F6•5"""'tchp.yies. Fl•Help.
Figure 1.2. (2005 Table)
This table stores 2005 years data . This table is use to call data. In this table there are three fields which are includes the customer number , customer name and surname and customer address. It is used to installments the 2005 year bills.
4
TypeequtSlionfothl!llp "' _ ~ X
_pesq~
1
_-_-------~ --~ j Field Properties
Gene, .1 ' '"°""" l Field Sile 14 Fonnot Input~ (opt"" Del..Jt , ••.•• V~lonRule \laidation Text Reql#ed Alow Zero Lenoth Indexed UnlcodeC~essiori ,...,Mode 1/'l'E Sentence Mode
r-- 1
A field Mtne can be I.() to 64 characters IMQ, ncludnQ spaces. Press Fl for~ on~ nomes.
Yes No Yes(NolA.Olicates) Yes No Control None
:.; stari' Q , _1 ,,:: • , •• -::,1 c,.;:,:.~.,:,(·•;, Ji;. 11t1 ·<@, •... ""' Desqlview. F6•5',vil:chpanes, Fl •Hei>,
Figure 1.3. (Aktif iptal TABLE) :
This table is used to write which records are deleted. When any record is deleted we never delete permanently, we write the same record to another table to control any mistakes for the users. In this table we stores these fields :
tukno :the customers number and it is primary key. sonbakiye : this field is contain the daily account. songz : the penalties that shown at that time. sontahsilat : the amount that the customer paid. fatno : bill number (it is used to load the main server.UNIQUE) kimlik : customers id number. tel : customer telephone number. tarih : operation date comes automatically. y20 : this is the money that we must bring the out of %80 discount of penalties. y80 : the money that we discount from the penalties. ylO: we take it cash at that time and it is the %10 of total amount after discount. toptah : the total amount that we will bring it with installments or cash. aytak : the money that the customer will pay monthly after installment. taksay : the number of installment. bak04 : the amount of 2004 accounts. gz04 : the penalties up to 31-12-04 top0405 : the total amount with 2004 and 2005 years bills. kod : the code of installment. Y is named make installments P is cash.
5
2.1.3. aktifkayit TABLE
ll!lJ Eje Eot Y~ tnsert 1oo1, )'(<>dew tjeip
., • c • • [I] 11 ;~ 5" ~ :'~ cei ~ • CD •
- --~-
-=----- • -- --_- -·i
FleldPr~rties --,----,,-''-'- -- ------. . . -- - -- - FieklSiZe l'I Format
'""""°"' Caption Default Value Valid&iOn Rule ll~k)nText Re<pr'ed Ves: AIJw Zero LenQth No Indexed Yes (No Dldc:4'tes) Llnk:ode COl'l"()r'es:SOO Yes 111£ Mode No Ceint:rol 1/'l'E Sentence Mode None
A i1e\d n¥T1e can be~ to &t characters Iorio, ridudino spaces. Press Fl for he() on field ,woes.
~~;f7rt O • _1 ,,:· '.ttf· ~ ·'- ill ct.: -J (It! ~· < @ I :: -"-
DesqlvieW. F6-~chpM"les. Fl-He~.
Figure 1.4. (aktifkayrt TABLE):
This table is used to write data when customer comes and make contracts. This table is same with the aktifiptal table. They are same because when any contract is deleted the same record is copy to the aktifiptal table. The aim is controlled the users. In this table we stores these fields :
tukno :the customers number and it is primary key. sonbakiye : this field is contain the daily account. songz : the penalties that shown at that time. sontahsilat : the amount that the customer paid. fatno : bill number (it is used to load the main server.UNIQUE) kimlik : customers id number. tel : customer telephone number. tarih : operation date comes automatically. y20 : this is the money that we must bring the out of %80 discount of penalties. y80 : the money that we discount from the penalties. ylO : we take it cash at that time and it is the % 10 of total amount after discount. toptah : the total amount that we will bring it with installments or cash. aytak : the money that the customer will pay monthly after installment. taksay : the number of installment. bak04 : the amount of 2004 accounts. gz04 : the penalties up to 31-12-04 top0405 : the total amount with 2004 and 2005 years bills.
6
kod : the code of installment. Y is named make installments P is cash.
2.1.4. borclu TABLE
Ll Microsofl Access [ borclu : T abte I ~:) d!J E.lle ~dit ~Jew Insert Iools '.!{indow tjelp TypeaquestlOnforhciJ • .• ~ x
n!!!l • lil ti .,;, i3. :J- ~ ~ 8 ., 1 lo/ ;: •• §>- ~ ::'.' 10 ,t)J: 11).
-~ J ,oo1wo I Field Size Form~ Input Mask C~ion o.fdV..., V~tlonRule ValidotiOnText Req.jrtd Ak,w Zero Le()Qth Indexed unicode Comp,esslon '"'Mode
, l I
A f"ie!d nome t¥1 be l_.:> to 6'4 characters lono, lndudino spaces. Pross Fl for het> on freld nomes.
No Yes No No No Control
!ME Sentence Mode None
Design view. F6 • Switch pe-es. Fl• Help.
Figure 1.5. (borclu TABLE):
This table stores the data that related with passive costomers account. The passive
customers mean that they are not using, closed accounts but unpaid.
In this table we stores these fields:
musno : the customer number.
borno : is the depth number for customer.
isim : customer number.
sayacno : meter number.
kapgz : the total capital penalties.
7
2.1.5. data TABLE
~ Eie sdt l~W insert !ools l))ndow !jelp
I~ v i ~ f' n • ., ~ 11 ;~ $" ltfi' ::~ if] -:t) • 11).
-J 1
-j - - 1
--·- - --~ - -- -- -· - -- -- - ~ - -·------ ---
G"'°'elJLooi<L,)J FieldSiie 255 Fom•< Inc:,ut.Mosk Caption De/out Vu VoldotlonRl.ie ValtdationText Req..if'ed No Allow Zero LertQth Yes indexed No urkode C~ession No Ifi'E Mode No Control Ill£ seeeeee Mode None
-·.
-- - - - * - ___::::::-- -
FieldPr~rties
A field name c&n be l,C) to M cl'wacters long, nck.Ol'l9 spaces. Press Fl fOf' het, on Flekl names.
DeSIQrl view. F6 • Switch pe-es. Fl • Help.
Figure 1.6. (data TABLE): This is the main table that we stores all the customers informations. We use this table
to call data to the program. And inclueds 110283 records.
The fields that we used are :
tukno : customer number
!fil!!!....: customer name and surname.
adres : customer addres.
tarife : the tarifs of consumers.
kod : code for the consummers.
bakiye: the amount till the 31-12-2004.
~ kapital penalties till the 31-12-2004.
odenen : the amount that the customer paid till to the 31-12-2004.
8
2.1.6. pasifiptal TABLE r...J Microsoft Aness [ pesifiptal : TdbleJ =-· ,-e· f~-J
Type~QIJeStjonfwivlb " - ~ X
Oesc(iption
---··--- /' --------------
___ Field Properties
0..-.r~ l Lookl.l) I Field Size 11 Formait fl"\Pl,t:MMk Capt""' Def"-'tVh V~tlof'IRIM Validation Text Required No Akrw Zero Lenoth Yes indexed Yes (No Ol.()licotes) Unicode Compression Yes !ME Mode No Control 111£ Sentence Mode None
A field !'Wlllfle can be 1,4> to 6-t characters klnQ, nck.dnQ spaces. Press Fl for het> on field n&rneS,
Oes!Qn ..•. iew. F6 • Switch oeoes. fl • Help.
Figure 1. 7. (pasifiptal TABLE) :
This table is used to write data which deleted from the "pasifkayit" table . We never delete records permanently the aim is control the mistakes for the users. In this table we stores these fields :
borno : depth number tukno : customer number. fatno : bill number. telno : customer phone number. kimno : customer id number. bakOS : depth for 2005 year gzOS : total pnalties with related 2005 topgz : total capital penalties. y20b : the amount which we will take after discount. y80b : the discount amount. topgen : total amount that we will take. ylO: the money that we take at that time %10. toptak : the amount that the total installment amount. aytak : the installment per month. taks: the installment number. kod : installment code Y is called installed P is called cash. tarih : operation date.
9
2.1.7. pasifkayrt TABLE
r.:J Microsoft Acc:css [ pasifkayrt : T ebte] Typeec,.estklJlfOfhelp .• _ f'} X
Description
-------- -- - ---- -------
- --·---------------------- ·------ ---··-------------
-~1,-..1 Field Sile 14 Formeit Input Mask c~oo Def out Value V-!lldationRIJe Validation Text R~ed Alow Zero Length Indexed Unicode Comp<esslon IP'E"""'
Afiek:I namec¥lbe 1.,¥>to 6't chatacterslonQ, nduanospaces. Press Fl for ~onfie«jnames.
No Yes Yes (No Duplicates) Vos NoContr'ol
Jf'!E Sentence Mode None
Figure 1.8. (pasifkayrt TABLE) : "'"",: start· Q , _1 • i •••. ;!",: r -J ~.. 0111 '<@, •. ~ DesiQn view. F6 • SWitch panes. Fl• Help.
This table is used to write data for passive customers. And same as the "pasifiptal" table. The fields are same .
borno : depth number tukno : customer number. fatno : bill number. telno : customer phone number. kimno : customer id number. bakOS : depth for 2005 year gzOS : total pnalties with related 2005 topgz : total capital penalties. y20b : the amount which we will take after discount. y80b : the discount amount. topgen : total amount that we will take. ylO: the money that we take at that time %10. toptak : the amount that the total installment amount. aytak : the installment per month. taks: the installment number. kod : installment code y is called installed p is called cash. tarih : operation date.
10
2.2. DEVELOPMENT OF DISCOUNT SYSTEM OF VISUAL BASIC
2.2.1. Visual Basic 6.0 main FORM.
E_ile '-cit: 'tiew 0"o)eCt Fi;i<mat Qel:o,J BIXl Qyery ~am !ools Add-Ins W.indow ljelp
1~-h-=-"'!IT~lilll lil)ftiM,;,~ ~-T. II. ~~<8'§~6Ul mlll(Ej-·· ····-·------·· . .
rit"; I Arool 0 _J P' r-
x]
,, .tU.J ~
Forms }-0. Form I (forml .frrr f-tl. FormlO {Prlnt:Borc -eJ.Formll~C
I t-0. Fonn12 (Form12.I f.. 0. Form13 (Form13.I Lei forml<I {Form14.I Lo. FormtS{FotmlS.I - t1. fOl'm2 {Form2.fm ~ Form3 (Form3Jm
1 - t,. Form4 {fO(mS.firr I 1 0. Form5 (Form6.fur 1 i-t:1. Form6 (form7.fnr
~-ei. Form7 (Fonn8.frrr I- tl, FOl'm8 (Prrt.Form. -ClForm9(PrWMo,b
ta:!Mod<.4e<
t!,g Ii')
1(51'
Iii~ [i 111 • !Ill lilll ~ S,} f:ill ~ ...'...J
r: ID J:i1I ~
ll!lll Ej IIDl !Bl
Form 1.1. (Main page for Visual Basic 6):
This form is the main page of the visual basic 6 that we choose the form to create our forms and developed our codes.
11
2.2.2. login FORM
...., Projett1 Mif1osoft Vis11<1I H.t!.ic [design]
E.ile t.dt '.iiew e,-oject F!2rmat ~ B.un Qyery ()\aQram tools 8dd·lns ~ndow t!elp
r~-:'b. 'lllr.;i; 111r ~e.~~- ~ I; .:tili:fi''8 w~6ui mlllBJ ~ ' "' Iii Afaiii
0 _J J;1 r.
PtOJ«l • Pro Jed 1 EJ
Fo,ms
LO. Form! (Forml.frm) . 0. FOl'mlO (PriltBordu,frm) 1-1:l. Fooml I (P,r<Bo<duMokbuz.frm) ~tl Form!Z (Form12.frm) l 0. FOl'ml3 (Fotm13.frm.) J-0, Forml4 (Forml4.frm) t tL Form IS (FormlS.frm)
t::l. Form2 (Fo,Jn2,hm) J t::l. Fonn3 (FormJ.hm) t---·tl Fo,rrt4 (FormS.frm) -0 Foom5 (For..-6.frm)
l!l,. Form6 (FOfm7.frm) tL Form7 (Form8.frm}
f 0, FormB (Prntfo,·m.frm} 0. Form9(PrW:Mbkbuz.frm) ca Modules
.!.ILi .!.I
"' @81
D~ 1151'
'1~ [ii 111 M !1111 111!1 ss ~ m1 ];I .'..J ~a •• 1€c. ti'~ r: . .'..J ..!.!I;,,:, •• to. ::· 0 r: tH 1$.I J~ Ill LI ~
Form-1-2
When you run the program, you must enter your password. if you don't enter the true
password, program is closing. When you enter true password, main menu comes to the
screen.
12
2.2.3. Main Menu FORM
...., Projccl1 Microsoft Visu<1IB11Sic [design) (form] (lorm)] - 6J~_j 0. Eje tdit '!'.iew ~oject FQrmat ~buQ !iLl"l Qyery ~~m Iools Add-Ins ~ ttelP
,~-. b :-11r~ ijliutb)1,1>1J.:, ;.:,-1 • II .T" ~ <8 w ~ 61.ltl I b o, 105 tJ17280x 12960
K.K.T.C ELEKTRIK KURUMU
BiLGi iNCELEME
Form-1-3 Form-2 shows the main menu of the Electricity Authority of TRNC(Discount
project). This menu contains the sign of Authority and command buttons.
The caption of command buttons of the main menu describes the main subjects.These
buttons links to the differenet calculations for discount project for the authority.
The main subject of the commands buttons are listed as below;
Commandl :2004 AktifHesap Islemleri.t'Ihe processes of active accounts for 2004)
Command2 : 2005 Aktif Hesap i~lemleri(The processes of active accounts for 2005)
Command3 : Kesik Borclu lslemlcri/Passive processes)
Command4: Text dosyasi olusturmatf.onverting to text files)
Commands: Bilgi inceleme(Informations about consumers)
Command6: Iptal islemleritcancel process)
Command7: G-Un sonu toplam kontroller(End of the day totals as monetary)
Command8 : C::1k1~ (Exit Program)
For understanding the captions of command buttons I want to explain as a briefly,
13
Electricity Authority has two type of consumers generally. First one is active that
usses electricity now and the other consumers type is passive users that used
electricity in the past and leave the home but left the bills unpaid. And new
consummer enters the building, the unpaid bills are store to another database.
These consummers are called as passive. The discount process that electricity
authority enforces to the end of the 2004. If consummer doesn't has any unpaid
bill for 2004, he/she has to apply to second button for 2005 bills.
14
2.2.4. 2004 year accounts FORM.
~ E.'6 E.dit 'fJew er"oiect Fiirmat QebuQ B.Lrl Q\tery Di;aoram Tools 8.dd-lns w_indol,a,< tlelp r~ --b • '11 j~liil T ~-!iG!-lii4. I :; ,.;. r ; -II - • ~ ~ '8W~-6t Jll fo -0, 105 - .J:i 17280 Xl2960 ··········~·····················-·························,·······
AKTiF TUKETiCi HESAPLARI TAKSiTLENDiRME iSLEMLERi
Tuketici No
''[ · 1 ••• ,s.,...., :: ~s...,~-i,e(KopitolGZOallilJ:
· . '. '. : : Be1vuru ANndaki Beki,e :
Adto&:
T-KopilolGZ : 20045...,f-Tah1ilat
Son fatura Nuaarat1:
ea,vuru Anlndaki Gz -;-~··: ~~~ · '. 8..-,uru Anlndaki Top T ah,ilot :
iiaalik NU1Mtaat: I . · · Tel No:
200-4 Y,li Hesaplanna Ait Bilgiler 2005 Y1l1 Hesaplauna AK Bilgiler Sefenckli T aksit Oranl,a,1
31/12/04 SonuTuketim Bakilteai
2004 e •• ;,-.Gelen Gz r 12Ay Odenecek Mikl•t: I
ll I .. I
1 label46 2004 ode._.n Tuk e •• Label47 Gep,it O-,... GZ r GAv
2005 fatusalar1 bekiyesi
T ah1il Edilecol< Gz. 2:20 2005 Top. Alacak Mill.Ian r is As BOO,.,_.,. Gz. 2:80 A,t.k Taluit Niki.-,:
2004 Alacak + 2005 Atacak
2004 Heaaplaundan Top Alacak Nik.tan r 24Ay
%10 pefin
:t10pefin Kalan laksil
KolanToklil
.. 11 ,.,.,ii• T-T-1i1Mik1 •• , fr2005H~,c
~ loklil ,.,.., Aylok T .,.,ii Mikloro
- - .. - : : : .. ffiG]o.1a2
. 'vi
form 1-4
This form is related with the 2004 year account. In this form when the customer
comes with his bill. We look to the customer number, search and find the updated accounts
form the main program (UNIX) and then, in this form we type the customer number to the
related textbox and the related informations about the customer, comes automatically to the
form then we type the new data which are the new depth, new penalties after 31-12-2004,
total paid amount, last bill number, customer id number and phone number of the customer
and then program makes the calculations automatically. The discount amount and the
installment amount and other amounts are prepared at that time. If the installment number is
obtained 12 month customer decrease it to the 6 month or pay cash but never increased up to
18 or more. If customer accept the contract then we print it and sign and customer pay the
%10 amount and go.
15
2.2.5. passive consummers FORM .
.-. Projccl1 Microsotl Visudl Hasic (design) (form4 (form)) ~--:'r:1 :25.J
·b o,-,os .L'J112aoxi2960
BOR<;LU TUKETiCiLERiN TAKSiTLENDiRME i~LEMLERi
Afiti 0.-J ~ r. 1: iaioo: [§I [§B .11.tJ ~
c) GI :, I Ba111uru antndaki Baki,e:
CJ~ :1 Ba4vuru anendaki Gz: 115)'
Iii~ I T..,,_K..,;,alG:r:
;. •• 1 Genell..,,_Gzc
~ 11111
l!I ~ 11 %20 T llhsi edilecel< Gz:
~ l1i1 ·I %80 Ba6,1lanaca1< Gz:
JsJ .:.J :1 T ..,,_ Net Alacal<: .ul .a I '" )€,_ :t10Pofiniidonocot.:
::' ~ 1:1
ToplaM Takait Miklau: /'c: . .:.J .ul i:i: A,.. T abit M,t•1:
'" [,. Ii r•,tt ,.,..,: ::• " :, r: m l1i1 ~ Ill E:l
(" 6 (" 12 ("· 18 (" 24
T oplam T aka.I: ailc.lan: A,t.k Taktit Milr.tau:
*
I : ..
• .• lliII]o •• ,1
.,. 1<1 r=:----- - --- .. -- --·-·· .. i P
~ sta~rt O . _. .,. ·, !• ,•~ Iii' , ...,, ,_, - ,, , :l , .. · , , ~< , ••• 1 • ~
Form 1-5
This form is for the passive consummers. Which they leave the homes and didn't pay
the bills. They can also apply this law and make installments or they can pay cash after
discount. This form is like the above form, we type the depth number and informations of
customers comes automatically to the form. These are customer number, name\sumame. We
type the data like bill number, the new depth and the new penalties and program makes
calculations and obtained the amount of %20 that the customer must paid cash or
installment, %80 discount amount and % 10 amount which is cash paid if he accept to sign
contract. If customer accept the amounts we print the contracts and sign it.
16
2.2.6. Informations of contracts FORM. ,... Projcct1 Microsoft Visual Basic f design) l form5 (form)] -
0, ·105
G*s; "1 A lab[
0...J i;; (>
~~ JJ!J ;
ao li'l
"'5l '-
Iii~ tiJ •#I
~ 1!1111
Ill~ !Ii 1111
I.:: I•
]~ ..:J ~ a: •• J;;,_
:r t!l1
~ . ..:J ~ cc '"E ::• ~ ~. 1H m J1I Ill E:l
·.::::::DataViewWindowl:: •. • • • • •
KAYIT YAPILMI$ TUKETICI BILGILERI KAYIT EOiLMi:;i AKTiF TLlKETici BiLGiLERi
1
KA YIT EDiLMi:;i PASiF TUKETiCi BiLGiLERi
Form 1-6
This form just for user knowlage for controlling or searching the contract
informations. Two DB Grids are used.
17
2.2.7. Creating text files of contracts FORM.
""ProJect1 Microsoft V1sudlB<1S1c [design] (formJ (form)
-~, . -·---·~--
- !XI IOl!M
0, -105
TEXT DOSYASI OLU$TURM A i$LEMLERi
(/) 0
~~ 1151'
Iii~ !iii •• 1 "1!1111 Ill ss ~ t1il ~ ..:.J
r: . ..:.J
r: m 11!1 ]~
Iii El ...........
·:::.~ ··. 1<1 r- - -- ····--- ----···· • 1•
,f: start O · _. , , lio ~ f-' 1 1 • l . · , , < s .• ~ 1
··~--~--·-~ ~~·- < ~-~T
<'
Form 1-7
A lot of contracts are done by branch offices (Nicosia ,Famagusta, Kyrenia,
Guzelyurt, Lefke, iskele). All these contracts are collected at the end of the each day. And
with this form they export automatically to the text files from the database by entering the
date. Electricity Authority main system works with UNIX OS and COBOL programming.
We collect all text files to the center office by Hyper terminals and open the instalment
information for each consummer that maked contract. This is done everyday. I used
OUTPUT reserved words and commands for this process in the code.
18
2.2.8. Delete operation FORM
""ProJe< 11 M1crosof1 V1sudl Haste {design) (torm6 (I orm)
~ E.ie tdit '!iew fro}ect Fqf'mat ~buo 8.1.J'l Qye,y Di;aQram Iool5 &;ld-ln5 ~ ttelP
Iii· -i;->111 c;i; Ii) Ti" lit;, e. ,i"f .-, ,-.;T~ --;,-. ~di'~ w ~ 6Utl IIIIIIEl xj
. ; : : Silmek istediijiniz Tiiketici Numerearm Giriniz AktJ Koy, Sime I •
-"-"" Protect I (Ptojectl.vbt Forms 0. Forml(FormJ.frrr -a FormlO(PfntBofc
LO. Formll (PrWBorc a Forml2 (Form12,I 0. FOfml3(Form13.I
1 tl, Fo,·ml4(Fo,m.1'4.I -t:l, FormlS(FormlS.I f-1:l Foml2(fo,m2.fm
I i-tl. Form3 (Form3.fr,r 1-t::i. Form4 (FormS.frn r- t'i,. FCf'mS (Form6Jrrr .-0, Form6{Form7.Frr, 0. FOl'm7 (Form8.frn 0, FonrlS(PrlntForm ClForm9(-
Clil-.es
.!J!.I ~ .:J
c)g CJ~ ~' Eil~ r.. ••I "!Ill m ~ 9~ rm ]~ ..:.i
AKTiF KAYITLI T0KETiciLERi KAYIT iPTALi
: • : i.!ili]oo1a2 .ilill i.!ili] 0 ota 1 .ilill
PASiF KAVITLI T0KETiCiLERi KAVIT iPTALi
r.:. ~
r.:. tD till~ 111111 LI ~
Form 1- 8
This form helps user for cancel any processes. If there is something wrong with the
contract, they can cancel it by writing consummer number. Before deleting that contract
program asks to the user, if he/she is sure. If there is no contract belongs to the consumer
number entered it gives wamning message. While I am writing delete code before deleting
permanently take a copy the record and paste it to another table to control the delete of
contracts.
19 .
2.2.9. Daily informations.
...., Prcjcct l M1crosofl V1sualUas1c [design] [Form17 (form) - !5
l:l. tie [dit llew e,oject FQ<rMt i;ebuo [<X1 Q\lefY ""°"""' !ools /!dd·lns ','!mow !:!elo
111:!J · 'b. • 'II li.i liil I i ~ 1u• I ;;-c=.1 ,-11 -; • ~ Q' ~ w ~ ea Jti"'.i:i _,, '° -=:I . - -·- -----~ ----~~~--~ --------~~~-~----
gUn sonu toptamlar r
.1:'117280x 12960 ,
1~'iiiJ Forms j.....l:). Fo'" t,-tl,Forrr · C:,.. Fonr
r l:l. '"" eJ, Fom
j....l:). Fom i-0, Fotrr 1--0. For,r -0. fotrr t" f'.:l. Fof'l'r
I j,-~ Forrr
f---ti. '"'" 0, Forlf C:,.. Fom
ti."'" C (iJ ModJleS
GUNLUK HE SAP i$LEMLERiNiN TOPLAMLARI
Aklif hetapla,
* ,J .!J 1.1 ~{
$8 [ii
~ .•.•..
Iii~ !ii •• 1 ~ Ill ll!l ~ ~ 1111
]~ ..'..J
••.. Ji1,_
::* ~ I:":. III l111 ]ii
II El ·. IQ ,- .. -- -- - -- - - ------ ·--··- .. .. ..• V ,, ..
1;start Q· _ .· ,.,. Git ..._1 'l ;). •• • ,, 1 ·<,~ .• ··
Form 1-9
As shown above, User should see the total that made contracts within the day. How
much money (10%,cash) enetered to the auothority within the day.
20
2.2.10. 2005 year accounts. FO~
"" Pro Jee 11 M1cro!.oft V1sudl Basic I dc~1gnl If orm1 3 (I orm)
C:,. tie ~dt - e,01e<t f'll<mat Qebuo Run Q,;e,v D;ao,am look add-Ins l'{irdow Jjelp
1~--~j'liTwiilill"i ~-;;.r;.., C-:T .- II •ISt:2i'<8W~6UJtb 0,0 .i:J1na,ix12%0 T ~ 2005 YIU HESAPLARININ TAKSiTLENDiRiLMESi
I ~ 111 · • • f _ ~- A laiii I c~,---- ,_ ··--------,._ L.J __J :: Tut.eliciN...,aao: ]i i.
- U®Ml@fflflf xr
(,g CJ l!'l 1151'
Iii~ r; •• , "1111 I! ss 9~ l1il ~ _j
.J
"'""' ~-t:l. Form! (Forml.frrr t-tl. FolmlO(PrlntBorc ~ti. Form! l (Prlnt:Borc -0. Form12 (Forml2.f . 0. Fo,m!J (Form!J.f
! L..-tl. Form14(Forml4.f I 0. FormlS(Form!S.I ;--Cl Form? {Forrn2,frrr r-0. Form3 (Form3,frrr t-t:3. form4 (FormS.frrr i-0, fofm5 (Form6.frrr ~~ Form6 (Form7.frrr 0. Form7 (FormB.frrr
~ 0. Form8 (PrintForm. 1.. ·O. Fol'm9(Pr~
""'*"°'
Mo,
··::Lebel6
: .. Fatura Nu.aia11:
FOOlveTok"l (' 1A)'W<
(' 2A;W<
(' 3A)'W<
FaizMilr.t••
TOl)lam0donecok
. : : Tolefon no : : : T..._tit Se,m
; • TOl)lam Baki,e : (' 4A)'W<
• : A,W,. Tekoil Miktar,
r: _j
(' SA)'W<
I' 6 Aylls
··. 1q ··-·· ~ B I<""" -; J start Q ' -1 • Qi , ,.._ ' '1 '' Ji i ' ' • • < I ,.: ' '
Form 1-10
If the consumer has a dept that only includes unpaid 2005 bills. For this type consummer
calculations and options are different for instalment processes. There is no discount, only
installment chance exists here. Also there is exstra interest, cash interest and it changes
according to the number of instalments.
There is another table for these consumers in the database. Also here, user should
enter consumer number because it is a primary key of the table. After pressing enter button,
name, surname and adress come automatically from database by using queries in the code.
User has to enter present dept, present interest, bill number, identity no and phone number e
and press enter, the total dept comes. There is a difference between previous form and
this.Consumer can select advance payment of dept.Form-3 has rule that 10% should be given
advance payment not more or not less.
21
2.2.11. Print form for active custommers contracts .
...,, Projec:11 MicrosoftVisudlBasicfdcsign} [torm8(1orm)J - -~-lgJ 0. E1e tdtt 'ilew froject Flll'mat Qebuo !3.u, Q1.tet'y ~am look add-Ins ~ tielP
11~·-b~i;i'~T:i. ~-AT;;~-11-~r~~ cei w~1:r~ 111111B] ~ 1~. Alaiii C ..J l;7 I>
~~ jJ!J ;
08 D~ 115) '-
Iii~ (i #II "i!IIII 1111!1 ~
~ tiil ];J ..'..l .<JJ l:r
•• Jee_
::2 " r: . ..:.i ..!.ad a ...-11:,_ ::t~ r: m tiil J;J Ill e
ti 105, 105 i!1 t0635 X 12075
K1b-Tek Alacaklanm Taksitle Odeme Basvurusu ve Taahhutname r F• '0 ""'"' (36/2005 sayoh yasa madde 8.)
X
Tarh: ProjecU (ProJtttt.vbj
seems -0. Form! (FOfmt.for r-t:1 Form!O (.Prnt.Borc ;-t:1, Form! l (PrW.Borc !'-t!. form12 (Form12J - l':i, Form13(Fotml3.f 1,., 0, fCNml't (Forml4,/ 0. FormlS(FormlS.f t1. Form2 (Form2.frrr 0. Form3 (Form3Jm 0, ForlT\'4 (FormSJr,r 0. FormS (F0tm6.fm
i-0. Form6 (Forrn7.frrr . t:\. For·m7 (FormS.frrr 0. Form8 (P1intfofm, ti. Fo,m9 (P•intMol<t,
lii:IMo<>Jes
K'mlil.No:
Tel No:
a • Ba;\l\.l'u t~lnndekl tOketin bofcv miklai1.,
b , 31112/2004 tar'ihindeki kaplal geclkrne Z8lfltl"f lriklar1. .•..
c. ea;\IU'u tt'lri'lrtdelcl gdme Z&rTIITII mlktan .
d • Ba~ tev-i'llnde 31112/2004 Odcrwneyen gdme IOlfVf'il miktan.
e . Ba;V\.#'u !~I'll ~t»ri ile 31f12./2004'de Odenmeyen t[;(etin borcu ..•..
r - Aflediecek gecll<me zamnu mildCN"1 '%80 ...
Teihsl e<ileeek geeH:me zt11mtn1 midet'I %20 ....
h. Odenmesl gereken t()J)l$rn bot'q: (2004+2005).
1 - Odenmesl gerekeo %10 pe;inat
J. T&ksitle 6dervnesl gerekM mlktm'.
k. ToplMl t86(sit saycs1 ...
{, Aylktaksl mikt&rt
YukarlCM g()stefimekte olan vc Ooenmesi gereken %10 pe;iNd1 6demlt b1An.ryor1.ITI. Bot~ rni.1611"11 0), Odemeyi !tlltlhh(t cder, gOs'lerilmekte OWi %80 gecicme J:&IMWlll'I (f) slinmesl 11;:ifl ITU'acMI oder'm,
Belirtien ttlll(sl milrtam gOrO'lde Odemedigim t8kctirde, takslde ba~l Olan tOm borcurru veyt11 bM:'.iyesinl gecikme tM'IITllnl"l tOroo le bel'tllber derh$1 Odemelde yOk(,rr«l olduOt,mu ve Klb-Tek"ln bu ~19 eileyhime her ttrt1 'fMel l~leml yapmtllkta eereest oldu).nu kab!J ...,,.,,
Vezne Bklwim Formu Dold.tnU
Ook~Al
fmza: lmu
~Im:
Form 1-11 ~ start Q ' -.1 t.iJ ••..• t·•,' '! /' :}t)- '< s ,..-
KJb-TekYetkili!l
This form is comes automatically if the customer accept the contract. This form is
print out and show the amounts and also the rules of law. This is the contracts between the
customer and authority.
22
•
2.2.12. print form for cahier (active custommer)
.l:'J I 0350 X 7590
'°'"" Q Form I (Forml .frrr -0. FormlO(PrW:Borc ti. FO<mll (P<.,Bo,c
~0, Form12(FOHl'l12./ r a Form13 (Forml3J 1 ~ FCW"m14 (Form14.f , -Cl Form!S (FormIS.f 0. Forrn2: (Form2.frrr r 0. FormJ (Fo,m3.frrr 0. Form4 (FormS.frrr t:1. Forms (form6.frrr
1-f'.:1. Form6 (Form7.frrr t:\. Form7 (Form8.frrr
1- 0. Form8 (Print:Form. ,.tl,Fo,m9{P, •• Mol<I,
C;JMo<iJie,
"' I orm9 ,- r;:'[8"]
Alabi C ...J
VEZNE BiLDiRiM FORMU
(TJg CJ 00 "9' Iii~ • Iii
"· il!l ~ ?~ rm Jsl ..:J
Odeme TOrO: LabelJ
TOketiclNo: Label1
Adi sovadr Label2
Fatura No: Label4
Tar1h: Label5
Vezneye Odenecek
Label7
OOkiimAI
/:': . ..:J
::' t, r: m till ];I 11111 el ~
form 1- 12
This form is given to the customer and send to the main cashier to pay the money.
And also this form shows the operations code like cash "P" or installment "T" and cashier
understand what type of operations he will do.
23
2.2.13. Print form for passive custommers contracts.
!:). Elo (dt \'>OW E,ojeet Fo<mat QebuQ B'-" Qo;e,y =om !ools !l<Xi·Ins - tjeip
llril·'b·'llfi;;i;liil1i 'GJIU\,.., "'T ,--;;--.,-~di"'8W~6l.lt{b 1os,1os
A fa6i CJ _J i;, r,
~~ .!l.tJ ;
$GI
~ "51 '- Iii~ •.. , • 1111
111!1 ~
~} 1111
Jsl ..:J .I.II l:r r.-[,_
nt ~ I:: . ..:J .i..!l Er ••.. ffl'_
:p 1' I::. m
iD 10740 X 12135
" I orm10 i~ 'ff~] ><)
Fo,mB1 .:
Ktb-Tek Alacaklanrn Taksitle Oderne Basvurusu ve Taahhlitname r Fl to"'"~ (36/2005 say,h yese mad de 8.)
Fo""' r 0. Form! (Form I .frrr t-~ Fo,m!O (Prnt:Bon: -0. Form! l (f'frtt:Borc f-~ fuml2 (Fo,n,12.I t- 0. Form13 (Forml3.f . 0. F01ml't (Form!4.I ·0. F01m15(Form15,I -0. Form2 (Form2.frrr 0. Form3 (Form3.frrr Cl, Fonn4 (FormS .frrr tl. ftlfm5 (Form6.frrr 0. Form6(f0tm7.firr 0. Form7 (FormB.frrr 0. Form8 {Prnt:Form.
;_O, Form9 {PrntMbkbi -·
r. Nounal
T«ih:
TuketiciNo: l(imlikNo:
TelNo:
a • B4;wru lat'ihndetl tru.:etim borcu miktl!lll'L ..
b • 31112!2004 letihi'\dekll(dtllgeell(rne I6!rill'll miid&rn ..•......
c . Batvuru l1Mhlndekf gec¥c:me zeimm1 midao.
d . Ba;vuru t~ihinde 31 ft 2!2004 6denmeyen geei:me IatTlml miklan,
e • ~u i&rlli ltbaft ile 31f1212004'dc Odenmeyen tuketlfl borcu.
f. Affei:Qecek gec"-,r.e IMVTII mi.1evi %80 ....•
g • TahsM e<Hecek gecikme l9l1Ylll 1Tikt1111 %20.
h. Odenmesi gereken lopiam bor" (2004+2005)
1. ~ ger~en %10 pe;~ ..
j. T&ksile 6::lenmeal gereken mikteir ..
k. Top6&,n taksil sayis,, ....
t-Ayliklat:dmiktan .•...•........
Yukarlda gOsterilmel..1e olan ve Ode:nme-sl \)el'eken %1 O ~lnelt1 Oderl'q bt.JUl'MJyon.im. Bor,; milda,rn (D, OdemeyitNhhtl ecer. gOsterllmekte olan %80 gecikrne Z&lMIOl"I (f) shne!l i'tin mu'ecNt ~im .
Belirtien tek'Sl rriklarn gOrU'!de 6oemedgm teikcirde, taksldc ~! oll:ln tum bot·cumu veve baldyesini oeclkme ZlWIUnnn ICimO Ve berllber cie'rh$1 Odemekle yOk('Mnl(l ~ ve Ki>- Tek'in bu ~le aleytime her Miu yasal iflemi yapmakt& serbesl oldugl...oJ keb.i ederim.
Vezne Bikwim F0tmu Doi<Un-<;
lmza: lmrei:
lsim:
--; : start O > - f • ii' "'\ ~ f\ f' ~ • '' ' , ( s ::: 'C
Form 1- 13 Same as Form 1 - 11 but related with passive customers.
24
2.2.14. print form for cahier (pasive custommer)
Cl. Eile E.dit 'i_'iew froject F~mat Qebug 13.u, Qt.iery D!agram look &dd-Ins ~ tjelp
~>ii. 'III~ 1111 i 'iii!, e."', .., "' , ~ II • , "oi' c8 w-~ 61.tti, c o. o IIIIIIEI ~ j ~ II I fr FUop-inte,
(.' Normal
;i/J 9330 X 7515
•..• Pmjcct t Mkto,;ott Vi,;u,11 Rt1-sic [desfgu] [F 01n111 (l"u1111)J
,.. torm11
Aiabf L, _J
BORC,LU VEZNE BiLDiRiM FORMU
,J u u .!.l vezneye Odenecek label6 t') GI
D li'l ~' Iii~ Ii ##I
Jll !1111 Ill~ t~ till ~ ..'..J
Odeme TOrO: LallelJ Label7
8or~tu No: Label1
Adi Soyad1; Label2
Fatura No: lalle\4 Ot:iki.imAI
Tarlh: Labe15
r.: . ..'..J
r: m 11!1 ]~
Ill el _g
forms r 0. Form! (Fo,ml.frrt r-0. FormlO (Prril:Borc · -tl, Formll (PrlntBorc ~~ Forrnl2{FOfml2.f l!l. Form13 (Forml3.f 0. Forml4 {Fom11 ••. f
•• t:1, Form IS (Form15.f 0. FormZ (Form2.ftff 0, Form3 (Fo,·mJ,frrT 0. ForrM (FormS.ftn' 0, FormS (Fonn6.frrr
1-a Fonn6 (fo,m7.frrr 0. Form7 (Form8.ftrr 0. Fonr.S (Pti"ttFQfm.
~ 0. Fo,m9 (P,,,tMol<I, &a-...,
Form 1-14 ~start Q ' -' ~ ...• I ~ '< t :.
Same as Form 1-12 but related passive customers.
These F orms(l 1-14) are printing contract. I used many print codes and whenever user
press record button in the form, printing start at the same time and contracts prints
automatically from the computer. 3 copy and 1 cash form for pay-office. User and Consumer
signs these forms after consumer pay their advance payment.
25
2.2.15. module form.
Alabi
0...J r;, r.
~1§11 " .ill.I .!l
(Jg ~
"51' Iii~ Em •• , M !1111 1111'1 ~ 8; rm ~ ..'..J ....i a' li/r ['..
::' ~ t: . ..'..J ....i E: ,... ];le_
::• ~ r: M riil ~ Ill E:l
I' Public dbs, dbsl M Database • Public strq, strgl, royst.rl .ls String 'Public temp. templ ~ Recordset.
Public strc;i, strgl, myscrl, str._z, st.rg3, scri.,4, st.rgS As St.ring Public eae , d.bsl, dbs2, Cll:>93, dbs4, db:s5 As nececeee P\ll:llic t.emp, t.empl, cernp2, temp3, temp4, t.empS A.s Recordset Public ee.e M St.rinq PIJJ::tlic X, Y, say >.:, Integer
><]
fOUM 0. Form! (Fo,mt .frtr
r-0. FormlO{PrintBorc ;-tl. Formtl (Prnt:Borc i-0. Form12 (Form12.I -1!1. Form13 (Form13.f -t'l. F(l(ml'I (Form14.f -·O. Form IS {Form!S.f
I- 0. Form2 (Form2.frrr 0. Form3(Form3.frrr 0. Form4 (FormS.fm
- 0. Form5 (Fonn6.frrr i-0, Form6(Form7.fm 0. Form7 (FormB.frrr
r-· tl,. Form8(PrWor·m. tl,Fo,m9(Pf _,.., ~ _,.., (Mo<IJel
form 1-15
.. ~ stari O · -· ~ '< s ••. ~
This form shows us public variables which we used to write our codes.
26
CONCLUSION
This program is prepared for the law of (yasa 36\2005) government of discount
policy. It includes all the customers. This program is used 5 brunch office and used from
5 th of september and will continue one year. By this program the authority incomes
increases %60 . we make more than 8000 contracts. Many of the custommers applied this
law and learned their debits. Custommers are very pleasure for the law because we give
them a change to installments their debits and discount %80 for capital penalties.
27
REFERENCES
1. Microsoft Visual Basic 6.0 Programmer's Guide.
2. Law of (36\2005)
3. Exchequer and Audit Department.
28
APPENDIX
Code for FORM 1.2
Private Sub Form_Load()
End Sub
Private Sub Textl_KeyPress(KeyAscii As Integer) If Key Ascii = " 13" Then If Textl.Text = "pos459" Then
Form2.Visible = True Form7.Visible = False
Else MsgBox "Y ANUS SiFRE GiRDiNiZ", vbExclamation, "ERROR" Unload Me
End If End If End Sub
Code for FORM - 1.3
Private Sub Commandl_ Click() Forml .Visible= True Form2.Visible = False End Sub
Private Sub Command2_Click() Unload Me End End Sub
Private Sub Command3 _ Click() Form5.Visible = True Formz.Visible- = False End Sub Private Sub Command4_ Click() Form3.Visible = True Form2.Visible = False End Sub Private Sub Command5 Click() Form4.Visible = True Form4.Textl.Enabled = True Form4.Textl .SetFocus Form2.Visible = False For Index= 0 To 5
Form4.0ptionl(Index).Enabled = False Next Index
29
•
End Sub Private Sub Command6 _ Click() Form6.Visible = True Form2.Visible = False End Sub Private Sub Command?_ Click() Form12.Visible = True Form2.Visible = False End Sub Private Sub Command8 _ Click() Form13.Visible = True Form2.Visible = False End Sub Private Sub Form_Load() Imagel.Visible = False Timerl.Enabled = False Timerl .Interval = 1000 Timerl .Enabled = True Timer2.Enabled = False Timer2.Interval = 1000 End Sub Private Sub Timerl_Timer() Labell.ForeColor = &HFF& Label2.ForeColor = &HFF& Imagel .Visible= True Timer2.Enabled = True End Sub Private Sub Timer2 _ Timer() Labell .ForeColor = &H80000002 Label2.ForeColor = &H80000002 Imagel.Visible = False End Sub.
Code for FORM 1.4
Dim netk, tak, ss, mon, ay, tay, netal, takmik Dim a, b, c, d, e, f, g, h, 1, i, j, k, 1, m, n, o, p, r, s, t, u, v, Y, z, fat, w, q, X Dim cc, xt, mm, ccc Dim msg, style, title, response Private Sub Commandl_Click() Call temizle Unload Me Form2.Visible = True End Sub Private Sub tdosya() Open ("c:\aa.txt") For Append As #1
Print #1, Textl.Text; Text5.Text; Label70.Caption Close #1
30
End Sub Private Sub Command3_Click() On Error Go To cigdem msg = "KA YIT Y APMAK iSTiYORMUSUNUZ" style= vb YesNo title = "DiKKA T" response= MsgBox(msg, vbYesNo, title) If response = vb Yes Then
Data2.Recordset.AddN ew Data2.Recordset.Fields(O) = Textl.Text Data2.Recordset.Fields(l) = Text2.Text Data2.Recordset.Fields(2) = Text3.Text Data2.Recordset.Fields(3) = Text4.Text Data2.Recordset.Fields( 4) = Text5.Text Data2.Recordset.Fields(5) = Text6.Text Data2.Recordset.Fields(6) = Text7.Text Data2.Recordset.Fields(7) = Label70.Caption Data2.Recordset.Fields(8) = Labe127.Caption Data2.Recordset.Fields(9) = Label28.Caption If Option1(6).Value = True Then Data2.Recordset.Fields(l 0) = Label40.Caption
Elself Option1(5).Value = True Then Data2.Recordset.Fields(l 0) = Label3 7 .Caption Else
Data2.Recordset.Fields( 10) = Labe13 7. Caption End If
Data2.Recordset.Fields( 12) = Label67 .Caption If Optionl(O).Value = True Then
Data2.Recordset.Fields(13) = 0 Label72.Caption = 0 Elself Optionl(l).Value = True Then
Data2.Recordset.Fields(l 3) = 6 Elself Option1(2).Value = True Then
Data2.Recordset.Fields(13) = 12 Elself Option1(3).Value = True Then
Data2.Recordset.Fields(l 3) = 18 Elself Option1(4).Value = True Then
Data2.Recordset.Fields(13) = 24 Elself Option1(5).Value = True Then
Data2.Recordset.Fields(13) = Label58.Caption Elself Optionl(6).Value = True Then Data2.Recordset.Fields( 13) = Label5 8. Caption
End If Data2.Recordset.Fields(l 1) = Labe172.Caption Data2.Recordset.Fields( 14) = Label20. Caption Data2.Recordset.Fields(l 5) = Label22.Caption Data2.Recordset.Fields(16) = Label36.Caption
'"""'''''''''''''''''''''''''''''''''' If Optionl(O).Value = True Then
::-1. /
-, ~ ~Fi',,O~~_::_..,/· ~
31
•
Data2.Recordset.Fields(l 7) = "P" Else Data2.Recordset.Fields(l 7) = "Y"
End If '""""'''''''''''''''''''''''"'''''' Data2 .Recordset. Update Forrn8.Show Call temizle For Index= 0 To 6
Optionl(Index).Enabled = False Optionl(Index).Value = False
Next Index Call yeni Else
Call temizle For Index= 0 To 6
Optionl(Index).Enabled = False Optionl(Index).Value = False
Next Index Call yeni
Textl .SetFocus Command3.Enabled = False End If Exit Sub cigdem: MsgBox " Li.itfen Programdan 91k1p tekrar giris yapiruz", vbExclamation, "UY ARI" End Sub
Private Sub Form_Load() LabellO.Caption = Date Label46.Caption = Date Label47.Caption = Date Text2.Enabled = False Text3.Enabled = False Text4.Enabled = False Text5.Enabled = False Text6.Enabled = False Text7.Enabled = False Command3.Enabled = False Label70.Caption = Format(Date, "yyyymmdd") For Index= 0 To 6 Optionl(Index).Enabled = False Next Index End Sub Private Sub yeni() Text2.Enabled = False Text3.Enabled = False Text4.Enabled = False Text5.Enabled = False Text6.Enabled = False
32
..
Text7.Enabled = False For Index= 0 To 6
Optionl(lndex).Enabled = False Next Index End Sub Private Function MyLeftPad(myStr As String, iLen As Integer) As String Dim iCnt, iExLen, iCurLen As Integer Dim exStr As String iCurLen = Len(Trim(myStr)) iExLen = iLen - iCurLen If iExLen <= 0 Then
MyLeftPad = myStr Else exStr = "" For iCnt = 1 To iExLen Step 1
exStr = exStr + "O" Next iCnt MyLeftPad = exStr + myStr
End If End Function
Private Sub Label 18 _ Click() MsgBox "2004 yilma ait odenmeyen tuketim bakiyesini bakiyesini gosterir ", vbExclamation, "BiLGi" End Sub
Private Sub Label25 _ Click() MsgBox "2004 yilma ait tuketim bakiyesini gosterir ", vbExclamation, "BiLGi" End Sub
Private Sub Label26 _ Click() MsgBox "Basvuru tarihi itiban ile 31/12/04 gecmisine ait odenmeyen gecikme zammi miktanm belirtir. ", vbExclamation, "BiLGi" End Sub Private Sub kontrol() opt= Label58.Caption If opt = 6 Then
Optionl(O).Enabled = True Optionl (2).Enabled = False Option1(3).Enabled = False Option1(4).Enabled = False
End If If opt= 12 Then
Option1(3).Enabled = False Option1(4).Enabled = False
End If If opt= 18 Then
Option1(3).Enabled = False Option1(4).Enabled = False
End If
33
•
End Sub
Private Sub Optionl_Click(Index As Integer) Command3 .Enabled = True On Error GoTo cigdem If Label20.Caption <= 0 And Label22.Caption <= 0 Then
Option I (O).Enabled = False Select Case Index Case 1
Label71.Caption = FormatNumber((CDbl(Label49.Caption) * 1.105) - CDbl(Label49.Caption))
Label72.Caption = FormatNumber(CDbl(Label71.Caption) + CDbl(Label62.Caption) + CDbl(Text3.Text))
Label67.Caption = FormatNumber(CDbl(Label72.Caption) I 6) Case 2
Label71.Caption = FormatNumber((CDbl(Label49.Caption) * 1.195) - CDbl(Label49.Caption))
Label72.Caption = FormatNumber(CDbl(Label71.Caption) + CDbl(Label62.Caption) + CDbl(Text3.Text))
Label67.Caption = FormatNumber(CDbl(Label72.Caption) I 12) Case 3
Label71.Caption = FormatNumber((CDbl(Label49.Caption) * 1.285) - CDbl(Label49.Caption))
Label72.Caption = FormatNumber(CDbl(Label71.Caption) + CDbl(Label62.Caption) + CDbl(Text3.Text))
Label67.Caption = FormatNumber(CDbl(Label72.Caption) I 18) Case 4
Label71.Caption = FormatNumber((CDbl(Label49.Caption) * 1.375) - CDbl(Label49.Caption))
Label72.Caption = FormatNumber(CDbl(Label71.Caption) + CDbl(Label62.Caption) + CDbl(Text3.Text))
Label67.Caption = FormatNumber(CDbl(Label72.Caption) I 24) Case 5
Label71.Caption = FormatNumber(CDbl(Label63.Caption)) Label72.Caption = FormatNumber(CDbl(Label74.Caption) + CDbl(Text3.Text)) Label67.Caption = FormatNumber(CDbl(Label72.Caption) I Val(Label58.Caption))
Case 6 Label72.Caption = FormatNumber(CDbl(Label48.Caption) + CDbl(Text3.Text)) Label67.Caption = FormatNumber(CDbl(Label60.Caption)) Label 71. Caption = 0
End Select Else
Select Case Index Case 0
Label72.Caption = 0 Label 71. Caption = 0 Label67.Caption = 0
Case 1
34
Label71.Caption = FormatNumber((CDbl(Label49.Caption) * 1.105) - CDbl(Label49.Caption))
Label72.Caption = FormatNumber(CDbl(Label71.Caption) + CDbl(Label62.Caption))
Label67.Caption = FormatNumber(CDbl(Label72.Caption) I 6) Case 2
Label71.Caption = FormatNumber((CDbl(Label49.Caption) * 1.195) - CDbl(Label49.Caption))
Label72.Caption = FormatNumber(CDbl(Label71.Caption) + CDbl(Label62.Caption))
Label67.Caption = FormatNumber(CDbl(Label72.Caption) I 12) Case 3
Label71.Caption = FormatNumber((CDbl(Label49.Caption) * 1.285) - CDbl(Label49.Caption))
Label72.Caption = FormatNumber(CDbl(Label71.Caption) + CDbl(Label62. Caption))
Label67.Caption = FormatNumber(CDbl(Label72.Caption) I 18) Case 4
Label71.Caption = FormatNumber((CDbl(Label49.Caption) * 1.375) - CDbl(Label49.Caption))
Label72.Caption = FormatNumber(CDbl(Label71.Caption) + CDbl(Label62.Caption))
Label67.Caption = FormatNumber(CDbl(Label72.Caption) I 24) Case 5
Label71.Caption = FormatNumber(CDbl(Label63.Caption)) Label72.Caption = FormatNumber(CDbl(Label74.Caption)) Label67.Caption = FormatNumber(CDbl(Label66.Caption))
Case 6 Label72.Caption = FormatNumber(CDbl(Label48.Caption) + CDbl(Text3.Text)) Label67.Caption = FormatNumber(CDbl(Label60.Caption)) Label71.Caption = 0
End Select End If Exit Sub cigdem: MsgBox" Lutfen Programdan cikip tekrar giriniz", vbExclamation, "UY ARI" End Sub Private Sub Textl_KeyPress(KeyAscii As Integer) netk = 0 tak = 0 ss = 0 mon=O ay= 0 tay = 0 netal = 0 takmik= 0 a=O b=O c=O d=O
35
e=O f= 0 g=O h=O 1 = 0 i = 0 j=O k=O l=O m=O n=O o=O p=O r=O s=O t= 0 u=O v=O Y=O z=O fat= 0 w=O q=O X=O cc= 0 xt = 0 mm=O CCC= 0
If Key Ascii = "13" Then strg = "select * from data where tukno ="' & Textl .Text & ""' Set dbs = OpenDatabase("c:\yasa362005\esasl .mdb") Set temp= dbs.OpenRecordset(strg, dbOpenDynaset) Iftemp.EOF = True Then
MsgBox "Aranan Kayit Bulunamadi", vbExclamation, "UYARI" Textl .Text= "" Text 1. SetF ocus
Else a= temp("bakiye").Value 'anapara b = temp("gz").Value 'kapital gz c = temp("odenen").Value '2004 tahsil edilen para Label3.Caption = temp("isim").Value Label5.Caption = temp("adres").Value Label8.Caption = FormatNumber(a) Labell l.Caption = FormatNumber(b) Labell3.Caption = FormatNumber(c) Text2.Enabled = True Text2.SetFocus Textl .Enabled= False Label76.Caption = Textl .Text 'gizli tuk no
End If
36
End If
End Sub Private Sub Text2_KeyPress(KeyAscii As Integer) If Key Ase ii = "13" Then If Text2.Text =""Then MsgBox "Yanhs Islem Yapiyorsunuz'', vbExclamation, "DiKKAT" Else If Text2.Text = 0 Then
MsgBox "YASADAN FA YDALANAMAZ", vbExclamation, "UY ARI" Call temizle Else Text2.Text = FormatNumber(Text2) Text3.Enabled = True T ext3. SetF ocus
End If End If
End If End Sub Private Sub Text3_KeyPress(KeyAscii As Integer)
If Key Ase ii = " 13" Then If Text3.Text =""Then
MsgBox "Yanhs lslem Yapiyorsunuz", vbExclamation, "DiKKAT" Else Text3.Text = FormatNumber(Text3) Text4.Enabled = True Text4.SetFocus
End If End If
End Sub Private Sub Text4_KeyPress(KeyAscii As Integer) If Key Ase ii = "13" Then
If Text4.Text =""Then MsgBox "Yanhs Islem Yapiyorsunuz", vbExclamation, "DiKKAT" Else ·
Text4.Text = FormatNumber(Text4) Text5.Enabled = True Text5.SetFocus
End If End If End Sub Private Sub Text5_KeyPress(KeyAscii As Integer) If Key Ase ii = "13" Then
fs = Len(Text5.Text) If fs <> 9 Then
MsgBox "HATALI onus VAR lUTFEN TEKRAR GiRiNiZ", vbExclamation, "UY ARI"
Text5.Text = "" Else
Text6.Enabled = True
37
Text6.SetFocus End If
End If
End Sub Private Sub hesap() On Error GoTo cigdem d = CDbl(Text2.Text) 'simdiki bakiye g = CDbl(Text3.Text) 'simdiki gz h = CDbl(Text4.Text) '2005tahsilat1 If d = 0 Then
Call temizle Else j = a - b '2004 anapara - kapital gz k = h - c '2005tahsilat - 2004 tahsilat
lfk > j Then Label19.Caption = FormatNumberG) Label21.Caption = FormatNumber(k) X=k-j If CDbl(X) > b Then
Label22.Caption = 0 Else
l= b-X Label22.Caption = FormatNumber(l)
End If Label20.Caption = 0 Label44.Caption = 0 m = CDbl(l * 0.2) 'tahsil edilen %20 gz n = CDbl(l * 0.8) 'af miktan %80 p = CDbl(d -1) r = CDbl(netk * 0.1)' %10 pesin almacak miktar Label27.Caption = FormatNumber(m) Label28.Caption = FormatNumber(n) Label3 l. Caption = F ormatN umber(p) Label49.Caption = FormatNumber(p - 0) Label55.Caption = FormatNumber(CDbl(Label27.Caption) + CDbl(Label20.Caption)) If Label51.Caption = 1111 Then
Label51.Caption = 0 End If
Label33.Caption = FormatNumber(CDbl(Label49.Caption) + CDbl(Label51.Caption)) Else '''""""""""""'""'''''''"""'"""'"'"'''''"'"""""'"'"'"""'" '''11""""'''11112005 donemi hesaplan''''""'"''''''''''''''''''""''''''' ""'''''''''''''''''''''''"""'"''''''''''''""'''""''''''''''''''''''''''''''''' If k <= j Then '2005odenen<2004 tuk bak
ss = j - k '2004 yih net bakiyesi mon = Month(Date) 'ay sayisim verir ay = mon- 8 'tay = Round(((ss) * (8 * 0.026)) + ((ss) * (ay * 0.03)), 2) '7 ay 0,026 geriye kalana tay = Round(((ss) * (8 * 0.026)), 2)
38
If g <= 0 Then tay = 0 w = 0 'simdiki gz Label51.Caption = FormatNumber(g) Elself g < tay Then g=O tay = g Label51.Caption = FormatNumber(g) Else
w = g - tay 'simdiki gz - tah. gz Labe151.Caption = FormatNumber(CDbl(w))
End If v = b + tay ' toplam gz miktan z = (v * 0.2) '%20 tahsil edilecek gz q = (v * 0.8) 'af yapilacak %80 gz miktan
End If 1 = d - b ' net bakiye r = (netal * 0.1) s = (netal - r) Label19.Caption = FormatNumber(i) Label21.Caption = FormatNumber(k) Label20.Caption = FormatNumber(ss) lftay = 0 Then
Label44.Caption = 0 Else
Label44.Caption = FormatNumber(tay) End If Label22.Caption = FormatNumber(v) Label27.Caption = FormatNumber(z) Label28.Caption = FormatNumber(q) Label31.Caption = Formatl-Jumberu) If 1 < ss Then
Label49.Caption = 0 Else
Label49.Caption = FormatNumber(1 - ss) End If mm= (z + ss) Label55.Caption = FormatNumber(mm) Label33.Caption = FormatNumber(CDbl(Label49.Caption) + CDbl(Label51.Caption))
End If End If Label36.Caption = FormatNumber(CDbl(Label55.Caption) + CDbl(Label33.Caption)) Label37.Caption = FormatNumber(CDbl(Label36.Caption) * 0.1) If CDbl(Label55.Caption) < 100 Then
Label40.Caption = 0 Label48.Caption = 0
Else Label40.Caption = FormatNumber(CDbl(Label55.Caption) * 0.1) Label48.Caption = FormatNumber(CDbl(Label55.Caption) - CDbl(Label40.Caption))
End If
39
Label62.Caption = FormatNumber(CDbl(Label36.Caption) - CDbl(Label37.Caption)) Call taksit If Label58.Caption = 0 Then
Label60.Caption = 0 Else
Label60.Caption = FormatNumber(CDbl(Label48.Caption) I CDbl(Label58.Caption)) End If
If Label58.Caption = 0 Then Call taksit2005 Call faiz2005son Else Call faiz2005son
End If Label74.Caption = FormatNumber((CDbl(Label63.Caption) + CDbl(Label62.Caption))) If Label58.Caption = 0 Then
Label60.Caption = 0 Label66.Caption = 0 Else
Label66.Caption = FormatNumber(CDbl(Label74.Caption) I CDbl(Label58.Caption)) End If Exit Sub cigdem: MsgBox II Lutfen Programdan cikip tekrar giris yapmiz", vbExclamation, 11UYARI11
End Sub Private Sub temizle()
Label3.Caption = 1111
Label5.Caption = 1111
Label8.Caption = 1111
Labell l.Caption = 1111
Label13.Caption = 1111
Textl.Text = 1111
Text2.Text = 1111
Text3.Text = 1111
Text4.Text = 1111
Text5.Text = 1111
Text6.Text = 1111
Text7.Text = 1111
Label19.Caption = 1111
Label20.Caption = 1111
Labe119.Caption = 1111
Label21.Caption = 1111
Label22.Caption = 1111
Label27.Caption = 1111
Label28.Caption = 1111
Label3 l.Caption = 1111
Label33.Caption = 1111
Label44.Caption = 1111
Label51.Caption = 1111
Label55.Caption = 1111
Label40.Caption = 1111
40
Label48.Caption = "" Label60.Caption = 1111
Label58.Caption = "" Label49.Caption = "" Label36.Caption = "" Labe137.Caption = "" Label62.Caption = 1111 Label63.Caption = 1111 Label74.Caption = 1111 Label66.Caption = 1111 Label71.Caption = 1111 Label72.Caption = 1111 Label67.Caption = 1111 Textl .Enabled= True Textl .SetFocus Comrnand3.Enabled = False
End Sub
Private Sub taksit2005()
If CDbl(Label62.Caption) > 100 And CDbl(Label62.Caption) < 500 Then Label58.Caption = 11611
End If If CDbl(Label62.Caption) > 500 And CDbl(Label62.Caption) < 1000 Then
Label58.Caption = 111211
End If If CDbl(Label62.Caption) > 1000 And CDbl(Label62.Caption) < 2000 Then
Label58.Caption = "18" End If If CDbl(Label62.Caption) > 2000 And CDbl(Label62.Caption) < 5000 Then
Label58.Caption = 112411
End If If CDbl(Label62.Caption) > 5000 Then
Label58.Caption = "36" End If
End Sub Private Sub taksit() If CDbl(Label48) < 100 Then MsgBox 1136/2005 sayih yasadan faydalanamazsm1z!!!11, vbExclamation, 11UYARI11
Label58.Caption = 0 Label60.Caption = 0
End If
If CDbl(Label48.Caption) > 100 And CDbl(Label48.Caption) < 500 Then Label58.Caption = 11611
End If If CDbl(Label48.Caption) > 500 And CDbl(Label48.Caption) < 1000 Then
Label58.Caption = 1112"
End If
41
If CDbl(Label48.Caption) > 1000 And CDbl(Label48.Caption) < 2000 Then Label5 8. Caption = 11 18 11
End If If CDbl(Label48.Caption) > 2000 And CDbl(Label48.Caption) < 5000 Then
Label58.Caption = 112411
End If If CDbl(Label48.Caption) > 5000 Then
Label58.Caption = 113611
End If End Sub Private Sub faiz2005son() If Label55.Caption = 0 Then If Label58.Caption = 11611 Then Label63.Caption = FormatNumber((CDbl(Label62.Caption) * 1.105) -
CDbl(Label62.Caption))
Elself Label58.Caption = 1112" Then Label63.Caption = FormatNumber((CDbl(Label62.Caption) * 1.195) -
CDbl(Label62.Caption))
Elself Label58.Caption = 1118" Then Label63.Caption = FormatNumber((CDbl(Label62.Caption) * 1.285) -
CDbl(Label62.Caption))
Elself Label58.Caption = "24" Then Label63.Caption = FormatNumber((CDbl(Label62.Caption) * 1.375) -
CDbl(Label62.Caption))
Elself Label58.Caption = 113611 Then Label63.Caption = FormatNumber((CDbl(Label62.Caption) * 1.555) -
CDbl(Label62.Caption))
Else Label63.Caption = 0 End If Elself CDbl(Label37.Caption) <= CDbl(Label49.Caption) Then
Call faiz05 Elself CDbl(Label37.Caption) > CDbl(Label49.Caption) Then
Call faiz05 Elself (CDbl(Label37.Caption) < CDbl(Label49.Caption)) And (CDbl(Label37.Caption) >
CDbl(Label55.Caption)) Then ccc = CDbl(Label37.Caption) - CDbl(Label55.Caption) ddd = CDbl(Label49.Caption) - ccc Call faiz06
End If End Sub Private Sub faiz06() If Label58.Caption = 11611 Then
Label63.Caption = FormatNumber(ddd * 1.105)
42
Else If Label5 8. Caption = " 12" Then Label63.Caption = ForrnatNurnber(ddd * 1.195)
Elself Label58.Caption = "18" Then Label63.Caption = ForrnatNurnber(ddd * 1.285)
Elself Label58.Caption = "24" Then Label63.Caption = ForrnatNurnber(ddd * 1.375)
Elself Label58.Caption = "36" Then Label63.Caption = ForrnatNurnber(ddd * 1.555) Else Label63.Caption = 0
End If End Sub Private Sub faiz05() If Label58.Caption = "6" Then
Label63.Caption = ForrnatNurnber((CDbl(Label49.Caption) * 1.105) - CDbl(Label49.Caption))
Elself Label58.Caption = "12" Then Label63.Caption = ForrnatNurnber((CDbl(Label49.Caption) * 1.195) -
CDbl(Label49.Caption))
ElseifLabel58.Caption = "18" Then Label63.Caption = ForrnatNurnber((CDbl(Label49.Caption) * 1.285) -
CDbl(Label49.Caption))
Elself Label58.Caption = "24" Then Label63.Caption = ForrnatNurnber((CDbl(Label49.Caption) * 1.375) -
CDbl(Label49.Caption))
Elself Label58.Caption = "36" Then Label63.Caption = ForrnatNurnber((CDbl(Label49.Caption) * 1.555) -
CDbl(Label49.Caption)) Else Label63.Caption = 0
End If End Sub Private Sub Text6_KeyPress(KeyAscii As Integer) If Key Ascii = " 13" Then
If Text6.Text =""Then MsgBox "ilgili hane Doldurulrnak Zorundadir", vbExclarnation, "DiKKAT" Else Text7.Enabled = True T ext7. SetF ocus
End If End If End Sub Private Sub Text7 _KeyPress(KeyAscii As Integer)
43
If Key Ase ii = " 13" Then If Text7.Text =""Then
MsgBox "ilgili hane Doldurulmak Zorundadir", vbExclamation, "DiKKAT" Else
Call hesap For Index= 0 To 6
Optionl(Index).Enabled = True Next Index
End If End If Call kontrol End Sub
Code for FORM 1.5
Private Sub Commandl_Click() Form2.Visible = True Form4.Visible = False Textl.Text = 1111 Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Label4.Caption = "" Label5.Caption = 1111 Labell 1.Caption = "" Label13.Caption = 1111 Label15.Caption = "" Labell 7. Caption = "" Label19.Caption = "" Label21.Caption = "" Label23.Caption = "" Label25. Caption = "" Label27.Caption = "" Label28.Caption = "" Label29.Caption = ""
End Sub
Private Sub temizle() Textl .Text= "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Label4.Caption = 1111
44
•
Label5.Caption = '"' Labell 1.Caption = 1111
Label13.Caption = 1111
Label15.Caption = "" Labell 7.Caption = "" Labell 9.Caption = "" Label21.Caption = "" Label23.Caption = "" Label25.Caption = "" Label27.Caption = "" Label28.Caption = "" Label29.Caption = "" Textl .Enabled= True Textl .SetFocus Command2.Enabled = False End Sub
Private Sub Command2 _ Click() On Error GoTo cigdem msg = "KA YIT Y APMAK iSTiYORMUSUNUZ11
style= vb YesNo title = "DiKKA T" response= MsgBox(msg, vbYesNo, title) If response = vb Yes Then Data2.Recordset.AddN ew Data2.Recordset.Fields(O) = Textl.Text Data2.Recordset.Fields(l) = Label4.Caption Data2.Recordset.Fields(2) = Text4.Text Data2.Recordset.Fields(3) = Text5.Text Data2.Recordset.Fields(4) = Text6.Text Data2.Recordset.Fields(5) = CDbl(Text2.Text) Data2.Recordset.Fields(6) = CDbl(Text3.Text) Data2.Recordset.Fields(7) = CDbl(Label 13 .Caption) Data2.Recordset.Fields(8) = CDbl(Label 15 .Caption) Data2.Recordset.Fields(9) = CDbl(Labell 7.Caption) Data2.Recordset.Fields(10) = CDbl(Label19.Caption) Data2.Recordset.Fields(l 1) = CDbl(Label21.Caption) Data2.Recordset.Fields(12) = CDbl(Label28.Caption) Data2.Recordset.Fields( 13) = CDbl(Label29. Caption) If Optionl(O).Value = True Then Data2.Recordset.Fields(l 4) = 0 Elself Optionl(l).Value = True Then Data2.Recordset.Fields(14) = 6
Elself Option1(2).Value = True Then Data2.Recordset.Fields(l 4) = 12
Elself Option1(3).Value = True Then Data2.Recordset.Fields(l 4) = 18
Elself Option1(4).Value = True Then Data2.Recordset.Fields(14) = 24
Elself Option1(5).Value = True Then
45
Data2.Recordset.Fields(l4) = Label27.Caption End If
Data2.Recordset.Fields(l 6) = Label32.Caption If Optionl(O).Value = True Then
Data2.Recordset.Fields(15) = "P" Else
Data2.Recordset.Fields(l 5) = "Y" End If Data2 .Recordset. Update Form IO.Show Call ternizle
For Index= 0 To 5 Optionl(Index).Enabled = False Optionl(Index).Value = False
Next Index Call yeni Else
Call ternizle For Index= 0 To 5
Optionl(Index).Enabled = False Optionl(Index).Value = False
Next Index Call yeni
Cornrnand2.Enabled = False End If Call ternizle Textl .Enabled= True Textl .SetFocus Exit Sub cigdern: MsgBox " Lutfen Prograrndan 91k1p tekrar giris yapiruz", vbExclarnation, "UY ARI"
End Sub
Private Sub Form_Load() Label6.Caption = Date Text2.Enabled = False Text3.Enabled = False Text4.Enabled = False Text5.Enabled = False Text6.Enabled = False Label32.Caption = Forrnat(Date, "yyyyrnrndd") For Index= 0 To 5
Optionl(Index).Enabled = False Next Index Cornrnand2.Enabled = False End Sub Private Sub yeni() Text2.Enabled = False Text3.Enabled = False
46
Text4.Enabled = False Text5.Enabled = False Text6.Enabled = False For Index= 0 To 5
Optionl(Index).Enabled = False Next Index End Sub Private Sub Optionl_Click(Index As Integer) On Error Go To cigdem Command2.Enabled = True Select Case Index Case 0
Label28.Caption = FormatNumber(Label19.Caption) Label29.Caption = 0 Label28.Caption = 0
Case 1 Label28.Caption = FormatNumber(Label23.Caption) Label29.Caption = FormatNumber(CDbl(Label28.Caption) I 6)
Case2 Label28.Caption = FormatNumber(Label23.Caption) Label29.Caption = FormatNumber(CDbl(Label28.Caption) I 12)
Case 3 Label28.Caption = FormatNumber(Label23.Caption) Label29.Caption = FormatNumber(CDbl(Label28.Caption) I 18)
Case 4 Label28.Caption = FormatNumber(Label23.Caption) Label29.Caption = FormatNumber(CDbl(Label28.Caption) I 24)
Case 5 Label28.Caption = FormatNumber(Label23.Caption) Label29.Caption = FormatNumber(CDbl(Label25.Caption))
End Select Exit Sub cigdem: MsgBox " Lutfen Programdan 91k1p tekrar giris yapimz", vbExclamation, "UY ARI" End Sub Private Sub kontrol() opt= Label27.Caption If opt = 6 Then
Optionl(O).Enabled = True Optionl(l).Enabled = False Option1(2).Enabled = False Optionl(3).Enabled = False Option1(4).Enabled = False
End If If opt= 12 Then
Option1(3).Enabled = False Option1(4).Enabled = False End If
If opt = 18 Then Option1(3).Enabled = False
47
Option1(4).Enabled = False End If End Sub Private Sub Textl_KeyPress(KeyAscii As Integer)
If Key Ase ii = "13" Then fs = Len(T ext 1. Text) If fs <> 14 Then
MsgBox "HAT ALI GiRiS VAR lUTFEN TEKRAR GiRiNiZ", vbExclamation, "UY ARI"
Textl.Text = "" Else 'End If
strg ="select* from borclu where bomo ="' & Textl.Text & ""' Set dbs = OpenDatabase("c:\yasa362005\esasl.mdb") Set temp= dbs.OpenRecordset(strg, dbOpenDynaset) Iftemp.EOF = True Then
MsgBox "Aranan Kayit Bulunamadi", vbExclamation, "UY ARI" Textl.Text = "" Textl .SetFocus
Else
a= temp("kapgz").Value 'kapital gz Label4.Caption = temp("musno").Value Label5.Caption = temp("isim").Value Labell l.Caption = FormatNumber(a) Text4.Enabled = True Text4.SetFocus Label34.Caption = Textl.Text
End If End If
End If End Sub Private Sub Text2_KeyPress(KeyAscii As Integer) If Key Ase ii = " 13" Then
If Text2.Text =""Then MsgBox "ilgili Hane Doldurulmak Zorundadir", vbExclamation, "UY ARI"
Else Text2.Text = FormatNumber(Text2.Text) Text3.Enabled = True Text3.SetFocus
End If End If End Sub Private Sub Text3_KeyPress(KeyAscii As Integer) If Key Ase ii = "13" Then
IfText3.Text =""Then MsgBox "ilgili Hane Doldurulmak Zorundadir", vb Exclamation, "UY ARI"
Else Text2.Enabled = False Text3.Text = FormatNumber(Text3.Text)
48
Call hesap End If
End If End Sub Private Sub Text4_KeyPress(KeyAscii As Integer) If Key Ase ii = " 13" Then fs = Len(Text4.Text) If fs <> 9 Then
MsgBox "HATALI GiRiS VAR lUTFEN TEKRAR GiRiNiZ", vbExclamation, "UY ARI"
Text4.Text = "" Else Textl.Enabled = False Text5.Enabled = True Text5. SetF ocus
End If End If End Sub Private Sub Text5_KeyPress(KeyAscii As Integer) If Key Ascii = " 13" Then
If Text5.Text =""Then MsgBox "ilgili Hane Doldurulmak Zorundadir", vbExclamation, "UY ARI"
Else Text4.Enabled = False Text6.Enabled = True Text6.SetFocus
End If End If End Sub Private Sub Text6_KeyPress(KeyAscii As Integer) If Key Ase ii = "13" Then If Text6.Text ='"'Then
MsgBox "ilgili Hane Doldurulmak Zorundadir", vbExclamation, "UY ARI" Else Text5.Enabled = False Text2.Enabled = True Text2.SetFocus
End If End If End Sub Private Sub hesap() X = CDbl(Text3.Text) + CDbl(Labell l.Caption) 'kapital gz + simdiki gz Label13.Caption = FormatNumber(X) 'toplam gz If CDbl(Text2.Text) < CDbl(Labell l.Caption) Then Y=O Else Y = CDbl(Text2.Text) - CDbl(Labell l.Caption) 'net bakiye =simdidki bakiye -kap gz
End If z = CDbl(X * 20 I 100) '%20 gz Label15.Caption = FormatNumber(z)
49
••
t = CDbl(X * 80 I 100) '%80 gz Labell 7.Caption = FormatNumber(t) p = z + Y 'toplam alacak =%20gz + net bakiye If Y = 0 And CDbl(Labell 7.Caption) > CDbl(Text3.Text) Then Label19.Caption = 0 Else Label19.Caption = FormatNumber(p)
End If If CDbl(Label19.Caption) < 100 Then
MsgBox "36/2005 Sayih Yasadan Faydalanamazsnuz!'!", vbExclamation, "UYARI" Label21.Caption = 0 Label23.Caption = 0 Label27.Caption = "O" Label25.Caption = "O" Label28. Caption = Label 19. Caption Label29.Caption = "" For Index= 0 To 5
Optionl(Index).Enabled = True Next Index
Else s = CDbl(p * 10 / 100) '%10 alacak Label2 l. Caption = F ormatN umber( s) v = CDbl(p - s) Label23.Caption = FormatNumber(v) Call bortaksit If Label27.Caption = "O" Then
Label27.Caption = "O" Label25.Caption = "O"
Else w = CDbl(Label23.Caption) I CDbl(Label27.Caption) Label25.Caption = FormatNumber(w)
End If Label28.Caption = FormatNumber(Label23.Caption) Label29.Caption = FormatNumber(Label25.Caption) For Index= 0 To 5 Optionl (Index).Enabled = True
Next Index Call kontrol End If Exit Sub cigdem: MsgBox " Lutfen Programdan cikip tekrar giris yapmiz'', vbExclamation, "UY ARI" End Sub Private Sub bortaksit() On Error GoTo cigdem If CDbl(Label23.Caption) < 100 Then
MsgBox "36/2005 sayili yasadan faydalanamazsimz!l!", vbExclamation, "UYARI" Label27.Caption = "O" For Index= 0 To 5
Option 1 (Index ).Enabled = False
50
Next Index End If If CDbl(Label23.Caption) > 100 And CDbl(Label23.Caption) < 500 Then
Label27.Caption = "6" Elself CDbl(Label23.Caption) > 500 And CDbl(Label23.Caption) < 1000 Then
Label27.Caption = "12" Elself CDbl(Label23.Caption) > 1000 And CDbl(Label23.Caption) < 2000 Then
Label27.Caption = "18" Elself CDbl(Label23.Caption) > 2000 And CDbl(Label23.Caption) < 5000 Then Label27.Caption = "24" Elself CDbl(Label23.Caption) > 5000 Then
Label27.Caption = "36" End If cigdem: End Sub.
Code for FORM 1.6
Private Sub Commandl Click() Form2.Visible = True Unload Me End Sub
Private Sub Form_Load()
End Sub
Code for FORM 1.7
Dim tak As String Dim takl As String Dim tak2 As String Private Sub Command3 _ Click() Textl .Text="" Form2.Visible = True Form3.Visible = False End Sub Private Sub Command4 Click() strgl = "select* from aktifkayit where tarih ='" & Textl.Text & ""' Set dbsl = OpenDatabase("c:\yasa362005\esasl.mdb") Set temp 1 = dbs 1. OpenRecordset( strg 1, dbOpenDynaset) On Error Go To yalan Open ("c:\taksit\naimtaka.txt") For Output As #1 temp 1.MoveFirst Do While Not templ.EOF Label2.Caption = CStr(templ("toptah").Value)
51
•
tak = MyLeftPad(CStr(templ("toptah").Value), 14) takl = kopya(tak) tak2 = MyLeftPad(takl, 14) Print #1, templ("tukno").Value; templ("fatno").Value; templ("tarih").Value; tak2 temp l .MoveN ext Loop Close #1 MsgBox "Dosya olusturuldu! ! ! ! ", vb Exclamation, "UY ARI" Exit Sub Textl.Text = "" Text 1. SetF ocus
yalan: MsgBox "Aranan tarihli Kayit Bulunamadi, dogru tarih giriniz", vbExclamation, "UY ARI" Textl .Text='"' Textl .SetFocus Close #1 End Sub Private Sub Command5 _ Click() strgl = "select* from pasifkayit where tarih ="' & Textl.Text & ""' Set dbsl = OpenDatabase("c:\yasa362005\esasl .mdb") Set temp 1 = dbs 1. OpenRecordset( strg 1, dbOpenDynaset) On Error Go To yalan Open ("c:\taksit\naimtakb.txt") For Output As #1 temp l .MoveFirst Do While Not templ.EOF Label2.Caption = CStr(templ("toptak").Value) tak = MyLeftPad(CStr(templ("toptak").Value), 14) takl = kopya(tak) tak2 = MyLeftPad(takl, 14) Print #1, templ("borno").Value; templ("fatno").Value; templ("tarih").Value; tak2 temp 1.MoveN ext
Loop Close #1 MsgBox "Dos ya olusturuldu! ! ! ! ", vb Exclamation, "UY ARI" Exit Sub Textl.Text = "" Textl .SetFocus yalan: MsgBox "Aranan tarihli Kayrt Bulunamadi, dogru tarih giriniz", vbExclamation, "UY ARI" Textl.Text = "" Textl .SetFocus Close #1 End Sub Private Function MyLeftPad(myStr As String, iLen As Integer) As String Dim iCnt, iExLen, iCurLen As Integer Dim exStr As String iCurLen = Len(Trim(myStr)) iExLen = iLen - iCurLen If iExLen <= 0 Then MyLeftPad = myStr
52
Else exStr = "" For iCnt = 1 To iExLen Step 1
exStr = exStr + "O" Next iCnt MyLeftPad = exStr + myStr
End If End Function Private Function kopya(mystrl As String) As String Dim X, a, c As String Dimb a= mystrl b=l len4 = Len(a) C = "" For i = 1 To len4 Step 1 If i = 12 And Mid(a, 12, 1) =","Then
C = C + Right(a, 2) i = i + 1
Exit For Else c = Left(a, i) End If
Next i kopya = c End Function Private Sub bul() Dim Search, Where ' Declare variables.
' Get search string from user. Search="." Where= InStr(Textl.Text, Search) 'Find string in text. If Where Then ' If found,
Textl .SelStart = Where - 1 ' set selection start and Textl .SelLength = Len(Search) ' set selection length.
End If ara = Textl .SelText
If ara = "." Then sil = "," Textl .SelText = sil
End If End Sub Private Sub Command6 _ Click() strgl ="select* from aktifkayit"
Set dbsl = OpenDatabase("c:\yasa362005\esasl.mdb") Set temp 1 = dbs 1. OpenRecordset( strg 1, dbOpenDynaset) On Error GoTo yalan Open ("c:\taksit\naimtopa.txt") For Output As #1 temp l .MoveFirst Do While Not templ.EOF
53
Print #1, templ("tukno").Value; templ("sonbakiye").Value; templ("songz").Value; temp 1 ("sontahsilat").Value; templ("tarih").Value; templ ("y20").Value; temp l("y80").Value; temp 1 ("yl O").Value; temp l("toptah").Value; temp 1 ("aytak").Value; temp 1 ("taksay").Value; templ ("bak04").Value; temp 1 ("gz04").Value; temp 1("top0405 ").Value; temp 1 ("kod ").Value
temp 1.MoveN ext Loop Close #1 MsgBox "Dosya olusturuldu! ! ! ! ", vbExclamation, "UY ARI" Exit Sub Textl.Text = "" Textl .SetFocus
yalan: MsgBox "Aranan tarihli Kayrt Bulunarnadi, dogru tarih giriniz", vbExclamation, "UYARI"
Textl.Text = "" Text 1. SetF ocus End Sub
Private Sub Command?_ Click() strgl ="select* from pasifkayit"
Set dbsl = OpenDatabase("c:\yasa362005\esasl.mdb") Set temp 1 = dbs 1. OpenRecordset( strg 1, dbOpenDynaset) On Error Go To yalan Open ("c:\taksit\naimtopb.txt") For Append As #1 temp l .MoveFirst Do While Not templ.EOF
Print #1, templ("borno").Value; templ("tukno").Value; templ("bak05").Value; temp 1 ("gz05").Value; temp 1 ("topgz").Value; templ ("y20b").Value; temp 1 ("y80b").Value; temp 1 ("topgen").Value; temp 1 ("yl O"). Value; temp 1 ("toptak").Value; temp 1 ("aytak").Value; temp 1 ("taks").Value; templ ("kod").Value; temp 1 ("tarih").Value
temp 1.MoveN ext Loop Close #1
MsgBox "Dos ya olusturuldul ! ! ! ", vbExclamation, "UY ARI"
Exit Sub Textl .Text="" Text 1. SetF ocus
yalan: MsgBox "Aranan tarihli Kayrt Bulunamadi, dogru tarih giriniz", vbExclamation, "UY ARI"
Textl.Text = "" Textl .SetFocus Close #1
End Sub
Private Sub Form_Load()
End Sub
54
Code For FORM 1.8
Private Sub Commandl_Click() On Error GoTo mus strg ="select* from aktifkayit where tukno ="' & Textl.Text & ""' Set dbs = OpenDatabase("c:\yasa362005\esasl.mdb") Set temp= dbs.OpenRecordset(strg, dbOpenDynaset) Data2.Recordset.AddN ew Data2.Recordset.Fields(O) = temp("tukno").Value Data2.Recordset.Fields(l) = temp("sonbakiye"). Value Data2.Recordset.Fields(2) = temp("songz"). Value Data2.Recordset.Fields(3) = temp("sontahsilat").Value Data2.Recordset.Fields(4) = temp("fatno").Value Data2.Recordset.Fields( 5) = temp("kimlik").Value Data2.Recordset.Fields( 6) = temp("tel").Value Data2.Recordset.Fields(7) = temp("tarih"). Value Data2.Recordset.Fields(8) = temp("y20").Value Data2.Recordset.Fields(9) = temp("y80"). Value Data2.Recordset.Fields(l 0) = temp("y 1 O"). Value Data2.Recordset.Fields(l 1) = temp("toptah").Value Data2.Recordset.Fields(l 2) = temp("aytak"). Value Data2.Recordset.Fields(13) = temp("taksay").Value Data2.Recordset.Fields( 14) = temp("bak04 "). Value Data2.Recordset.Fields(l 5) = temp(" gz04"). Value Data2.Recordset.Fields(l 6) = temp("top0405 "). Value Data2.Recordset.Fields(l 7) = temp("kod").Value Data2.Recordset. Update dbs.Execute "delete* from aktifkayit where tukno = "' & Textl.Text & "'" dbs.Close Datal .Refresh MsgBox "KA YIT SiLiNMiSTiR", vbExclamation, "MESSAGE" Textl .SetFocus Textl .Text="" Textl .SetFocus Exit Sub mus: MsgBox "Lutfen Bilgilerinizi tekrar giriniz.Boyele bir kayrt yoktur", vb Exclamation, "MESSAGE" Textl .SetFocus Textl.Text = "" Textl .SetFocus End Sub Private Sub Command2_Click() On Error GoTo mus strg ="select* from pasifkayit where bomo ="' & Text2.Text & ""' Set dbs = OpenDatabase("c:\yasa362005\esasl.mdb") Set temp= dbs.OpenRecordset(strg, dbOpenDynaset)
55
Data4.Recordset.AddN ew Data4.Recordset.Fields(O) = temp("borno ").Value Data4.Recordset.Fields(l) = temp("tukno").Value Data4.Recordset.Fields(2) = temp("fatno").Value Data4.Recordset.Fields(3) = temp("telno "). Value Data4.Recordset.Fields(4) = temp("kirnno").Value Data4.Recordset.Fields(5) = temp("bak05").Value Data4.Recordset.Fields(6) = temp("gz05").Value Data4.Recordset.Fields(7) = temp("topgz").Value Data4.Recordset.Fields(8) = temp("y20b"). Value Data4.Recordset.Fields(9) = temp("y80b"). Value Data4.Recordset.Fields(l 0) = temp("topgen"). Value Data4.Recordset.Fields(l 1) = temp("ylO").Value Data4.Recordset.Fields(12) = temp("toptak").Value Data4.Recordset.Fields(13) = temp("aytak").Value Data4.Recordset.Fields(l 4) = temp("taks").Value Data4.Recordset.Fields(l 5) = temp("kod"). Value Data4.Recordset.Fields(l 6) = temp("tarih"). Value Data4.Recordset.Update dbs.Execute "delete* from pasifkayit where borno ="' & Text2.Text & "'" dbs.Close Data3 .Refresh MsgBox "KA YIT SiLiNMiSTiR", vbExclamation, "MESSAGE" Text2.SetFocus Text2.Text = "" Text2.SetFocus Exit Sub mus: MsgBox "Lutfen Bilgilerinizi tekrar giriniz.Boyele bir kayit yoktur", vbExclamation, "MESSAGE" Text2.SetFocus Text2.Text = "" T ext2. SetF ocus End Sub
Private Sub Command3 _ Click() Form2.Visible = True Form6.Visible = False End Sub
Private Sub Form_Load()
End Sub.
56
Code for FORM 1.9
Option Explicit
Private Sub Commandl_Click() strg2 = "select sum(ylO) from aktifkayit where tarih ="' & Textl.Text & "'and kod='Y"' strg = "select sum(top0405) from aktifkayit where tarih ="' & Textl.Text & "' and
kod='P"' strg3 ="select* from aktifkayit where tarih ="' & Textl.Text & "' " Set dbs2 = OpenDatabase("c:\yasa362005\esas 1.mdb") Datal .RecordSource = strg2 Data2.RecordSource = strg3 Data5 .RecordSource = strg Set temp3 = dbs2.0penRecordset(strg3, dbOpenDynaset) Set temp2 = dbs2.0penRecordset(strg2, dbOpenDynaset) Set temp= dbs2.0penRecordset(strg, dbOpenDynaset) Set Datal .Recordset = temp2 Set Data2.Recordset = temp3 Set Data5 .Recordset = temp
End Sub Private Sub Command2 _ Click() strg2 = "select sum(topgen) from pasifkayrt where tarih ="' & Textl.Text & "' and kod='P"' strg = "select sum(ylO) from pasifkayit where tarih ="' & Textl.Text & "'and kod='Y"' strgl ="select* from pasifkayit where tarih ="' & Textl.Text & ""' Set dbs = OpenDatabase("c:\yasa362005\esasl.mdb") Data3 .RecordSource = strg Data4.RecordSource = strgl Data6.RecordSource = strg2 Set templ = dbs.OpenRecordset(strgl, dbOpenDynaset) Set temp= dbs.OpenRecordset(strg, dbOpenDynaset) Set temp2 = dbs.OpenRecordset(strg2, dbOpenDynaset) Set Data3 .Recordset = temp Set Data4.Recordset = templ Set Data6.Recordset = temp2 End Sub
Private Sub Command3 _ Click() Form2.Visible = True Textl.Text = "" Forml2.Visible = False End Sub Private Sub Form_KeyPress(KeyAscii As Integer) If Key Ascii = " 13" Then
strg2 = "select sum(ylO) from aktifkayit where tarih ="' & Textl.Text & ""' Set dbs2 = OpenDatabase("c:\yasa362005\esasl.mdb") Datal .RecordSource = strg2 Set temp2 = dbs2.0penRecordset(strg2, dbOpenDynaset)
57
Set Datal .Recordset = temp2 End If
End Sub Code For FORM 1.10
Private Sub Form_Load() Combo l .Enabled = False Commandl.Enabled = False Command2.Enabled = False Label 10 = Date Label6.Caption = Format(Date, "yyyymmdd") Optionl(O).Enabled = False Optionl(l).Enabled = False Option1(2).Enabled = False Option1(3).Enabled = False Optionl(4).Enabled = False Option1(5).Enabled = False End Sub Private Sub temizle() Textl.Text = "" Text2.Text = "" Text3.Text = "" Text4.Text = "" Text5.Text = "" Text6.Text = "" Labe13.Caption = '"' Label5.Caption = "" Label13.Caption = "" Label 1 7. Caption = "" Labell 8.Caption = "" Label21.Caption = "" Combol.Text = "" Label22.Caption = "" Label25.Caption = "" Label26.Caption = "" Label29.Caption = "" Optionl(O).Enabled = False Optionl(l).Enabled = False Option1(2).Enabled = False Option1(3).Enabled = False Option1(4).Enabled = False Option1(5).Enabled = False End Sub Private Sub taksit() If CDbl(Label18.Caption) < 200 Then Label21. Caption = "1" Elself CDbl(Labell 8.Caption) > 200 And CDbl(Labell 8.Caption) < 400 Then
Label21.Caption = "2" Elself CDbl(Labell 8.Caption) > 400 And CDbl(Labell 8.Caption) < 600 Then
58
Label21.Caption = "3" Elself CDbl(Label18.Caption) > 600 And CDbl(Label18.Caption) < 1500 Then
Label21.Caption = "4" Elself CDbl(Label18.Caption) > 1500 And CDbl(Label18.Caption) < 3000 Then
Label21.Caption = "5" Elself CDbl(Labell 8.Caption) > 3000 Then Label21.Caption = "6"
End If
End Sub
Private Sub Optionl_Click(Index As Integer) Select Case Index Case 0 fl = CDbl(Text2.Text) - CDbl(Labell 7.Caption) Label22.Caption = FormatNumber((CDbl(fl) * 1.03) - CDbl(fl)) Label25.Caption = FormatNumber((CDbl(fl) * 1.03) + CDbl(Text3.Text)) Label26.Caption = 1 Label29.Caption = FormatNumber(CDbl(Label25.Caption) I CDbl(Label26.Caption)) Command2.Enabled = True
Case 1 fl = CDbl(Text2.Text) - CDbl(Labell 7.Caption) Label22.Caption = FormatNumber((CDbl(fl) * 1.045) - CDbl(fl)) Label25.Caption = FormatNumber((CDbl(fl) * 1.045) + CDbl(Text3.Text)) Label26.Caption = 2 Label29.Caption = FormatNumber(CDbl(Label25.Caption) I CDbl(Label26.Caption)) Command2.Enabled = True
Case 2 fl = CDbl(Text2.Text) - CDbl(Labell 7.Caption) Label22.Caption = FormatNumber((CDbl(fl) * 1.06) - CDbl(fl)) Label25.Caption = FormatNumber((CDbl(fl) * 1.06) + CDbl(Text3.Text)) Label26.Caption = 3 Label29.Caption = FormatNumber(CDbl(Label25.Caption) I CDbl(Label26.Caption)) Command2.Enabled = True
Case 3 fl = CDbl(Text2.Text) - CDbl(Labell 7.Caption) Label22.Caption = FormatNumber((CDbl(fl) * 1.075) - CDbl(fl)) Label25.Caption = FormatNumber((CDbl(fl) * 1.075) + CDbl(Text3.Text)) Label26.Caption = 4 Label29.Caption = FormatNumber(CDbl(Label25.Caption) I CDbl(Label26.Caption)) Command2.Enabled = True
Case4 fl = CDbl(Text2.Text) - CDbl(Labell 7.Caption) Label22.Caption = FormatNumber((CDbl(fl) * 1.09) - CDbl(fl)) Label25.Caption = FormatNumber((CDbl(fl) * 1.09) + CDbl(Text3.Text)) Label26.Caption = 5 Label29.Caption = FormatNumber(CDbl(Label25.Caption) I CDbl(Label26.Caption)) Command2.Enabled = True
Case 5 fl = CDbl(Text2.Text) - CDbl(Labell 7.Caption)
59
•
Label22.Caption = FormatNumber((CDbl(fl) * 1.105) - CDbl(fl)) Label25.Caption = FormatNumber((CDbl(fl) * 1.105) + CDbl(Text3.Text)) Label26.Caption = 6 Label29.Caption = FormatNumber(CDbl(Label25.Caption) I CDbl(Label26.Caption)) Command2.Enabled = True
End Select End Sub Private Sub Textl_KeyPress(KeyAscii As Integer) If Key Ascii = "13" Then
a=O b=O fs = 0 fl= 0 Command2.Enabled = False strg = "select* from 2005 where fieldl ="' & Textl.Text & "'" Set dbs = OpenDatabase("c:\yasa362005\esasl.mdb") Set temp= dbs.OpenRecordset(strg, dbOpenDynaset) lftemp.EOF = True Then
MsgBox "Aranan Kayit Bulunamadi", vbExclamation, "UYARI" Textl.Text = "" Textl .SetFocus
Else Label3.Caption = temp("field2").Value Label5.Caption = temp("field4").Value T ext2. SetF ocus Label3 l.Caption = Textl.Text 'gizli tuk no
End If End If End Sub Private Sub Text2_KeyPress(KeyAscii As Integer) If Key Ascii = "13" Then
Text2.Text = FormatNumber(Text2) Text3. SetF ocus
End If End Sub Private Sub Text3_KeyPress(KeyAscii As Integer) If Key Ascii = " 13" Then Text3.Text = FormatNumber(Text3) Text4.SetFocus
End If End Sub Private Sub Text4_KeyPress(KeyAscii As Integer) If Key Ascii = " 13" Then
fs = Len(Text4.Text) If fs <> 9 Then
MsgBox "HA TALI GiRiS VAR lUTFEN TEKRAR GiRiNiZ", vbExclamation, "UY ARI"
Text4.Text = "" Else T ext5. SetF ocus
60
End If End If End Sub Private Sub Text5_KeyPress(KeyAscii As Integer) If Key Ase ii = "13" Then
Text6.SetFocus End If End Su9 Private Sub Text6_KeyPress(KeyAscii As Integer) If Key Ase ii = " 13" Then
a= CDbl(Text2.Text) b = CDbl(Text3.Text) Label13.Caption =a+ b Label13.Caption = FormatNumber(Label13) Combo I .Enabled = True Commandl .Enabled= True If CDbl(Label13.Caption) < 600 Then
MsgBox "Pesin Oderne Y apilmahdir. ", vbExclamation, "UY ARI" Call temizle Textl .SetFocus
End If End If End Sub.
Code for FORM - 1.11
Option Explicit Dim en As New ADODB.Connection Dim rs As New ADODB.Recordset Dim rsl As New ADODB.Recordset Private Declare Function MapVirtualKey Lib "user32" Alias "MapVirtualKeyA" (ByVal wCode As Long, ByVal wMapType As Long) As Long Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtrainfo As Long) Private Const VK MENU= &H12 Private Const VK SNAPSHOT = &H2C Private Const KEYEVENTF KEYUP = &H2 Private Declare Function ClientToScreen Lib "user32" (ByVal hWnd As Long, lpPoint As POINT API) As Long Private Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long Private Type POINTAPI XAs Long Y As Long
End Type ' Print an image of the control and any ' controls on top of it. ' Be sure the form containing the control has ' the focus before you call this routine.
61
••
Private Sub PrintPictureBoxlmage(ByVal ptr As Object, ByVal pie As PictureBox, Optional ByVal fit_to_printer = False) Dim pie _parent As Form Dim parent_x As Single Dim parent_y As Single Dim pic_pt As POINTAPI Dim pic_xl As Single Dim pic_yl As Single Dim xmin As Single Dim ymin As Single Dim wid As Single Dim hgt As Single Dim aspect As Single Dim pie_ wid As Single Dim pie_ hgt As Single 'Copy the form's image to the clipboard. 'Press Alt.
keybd_event VK_MENU, 0, 0, 0 Do Events
' Press Print Scrn. 'keybd_event VK_SNAPSHOT, 1, 0, 0
keybd_event VK_SNAPSHOT, 0, 0, 0 Do Events
' Release Alt. keybd_event VK_MENU, 0, KEYEVENTF _KEYUP, 0 Do Events
' Copy the image into the hidden PictureBox. picHidden.Picture = Clipboard.GetData(vbCFBitmap)
' Get the form's location on the screen in pixels. Set pie _parent = pie.Parent parent_x = ScaleX(pic_parent.Left, vbTwips, vbPixels) parent_y = ScaleY(pic_parent.Top, vbTwips, vbPixels)
' Find the control's location on the screen in pixels. pic_pt.X = 0 pic_pt.Y = 0 ClientToScreen pic.hWnd, pic_pt
' Find the location of the control inside the parent form 'in pixels.
pie_ x 1 = pie _pt.X - parent_ x pic_yl = pic_pt.Y - parent_y
' Convert into the printer's scale mode. pic_xl = ScaleX(pic_xl, vbPixels, ptr.ScaleMode) pic_yl = ScaleY(pic_yl, vbPixels, ptr.ScaleMode)
' Get the picture's size in the printer's scale mode. pie_ wid = ScaleX(pic. Scale Width, pie. ScaleMode, ptr. ScaleMode) pie_ hgt = Scale Y (pie. ScaleHeight, pie. ScaleMode, ptr. ScaleMode)
' Print the image. If Not fit_to_printer Then
' Center the image. wid = pie_ wid
62
hgt = pie_ hgt xmin = (ptr.ScaleWidth - wid) / 3 ymin = (ptr.ScaleHeight - hgt)/ 3
Else ' Make the image as large as possible ' without distortion.
aspect = pie_ hgt I pie_ wid wid = ptr.ScaleWidth hgt= ptr.ScaleHeight If hgt I wid > aspect Then hgt = aspect * wid xmin = ptr.ScaleLeft ymin = (ptr.ScaleHeight - hgt) I 3
Else wid = hgt I aspect xmin = (ptr.ScaleWidth - wid) / 3 ymin = ptr.ScaleTop
End If End If
'Print. ptr.PaintPicture picHidden.Picture, _
xmin, ymin, wid, hgt, _ pic_xl, pic_yl, pic_ wid, pic_hgt
End Sub Private Sub CmdMakbuz _ Click() Form9.Show End Sub Private Sub CmdPrint_ Click() Label7.Caption = Forml.Label76.Caption MousePointer = vbHourglass Do Events optFitToPrinter.Visible = False optNormal.Visible = False CmdPrint.Visible = False CmdMakbuz.Visible = False
'Picture2.Visible = False ' Display a preview. 'Form2.AutoRedraw = True 'PrintPictureBoximage Form2, Picturel, optFitToPrinter.Value 'Form2.Show 'Print. Printer.Orientation= vbPRORPortrait For say= 1 To 3 PrintPictureBoximage Printer, Picture2 Printer.EndDoc
Next say CmdPrint.Visible = True MousePointer = vbDefault
Form9.Show End Sub
63
Private Sub Form_Load() On Error Resume Next
cn.ConnectionString = "provider=Microsoft.Jet.OLEDB.4.0;data source=C:\yasa362005\esasl.mdb;"
en.Open Debug.Print "Connection Object Created" rs.Open "Select* from data", en, adOpenDynamic, adLockOptimistic Debug.Print "Recordset Object Created" rsl .Open "Select* from aktifkayit", en, adOpenDynamic, adLockOptimistic Debug.Print "Recordset Object Created"
1 Call Clear strg3 =" Select* from aktifkayit where tukno = 111 & Forml .Label76.Caption & " 1
"
Set dbs3 = OpenDatabase("C:\yasa362005\esasl.mdb") Set temp3 = dbs3.0penRecordset(strg3, dbOpenDynaset) Iftemp3.EOF = True Then
1 MsgBox "BU KA YIT BULUNAMAMISTIR", vbExclamation, "HATA!" 1 Forml.Label76.Caption = "" 1 Forml.Lab Else
1 Label7.Caption = temp3("tukno").Value Label7.Caption = Forml .Label76.Caption Labell 1.Caption = temp3("kimlik").Value Label12.Caption = temp3("tel").Value LabellO.Caption = temp3("tarih").Value
1 Label51.Caption = temp3("kod").Value Label25.Caption = temp3("sonbakiye").Value Label27.Caption = temp3("songz").Value Label28.Caption = temp3("gz04").Value Label29.Caption = temp3("bak04").Value Label30.Caption = temp3("y80").Value Label31.Caption = temp3("y20").Value Label32.Caption = temp3("top0405").Value Label33.Caption = temp3("y10").Value Label34.Caption = temp3("toptah").Value Label35.Caption = temp3("taksay").Value taksit.Caption = temp3("aytak").Value
End If
strg2 =" Select* from data where tukno = 111 & Forml.Label76.Caption & "1"
Set dbs2 = OpenDatabase("C:\yasa362005\esasl.mdb") Set temp2 = dbs2.0penRecordset(strg2, dbOpenDynaset) Iftemp2.EOF = True Then
1MsgBox "BU KAYIT BULUNAMAMISTIR", vbExclamation, "HATA!" 'Textl.Text = "" 1Forml .Textl .SetFocus Else Label8.Caption = temp2("isim").Value Label9.Caption = temp2("adres").Value Label26.Caption = temp2("gz").Value
End If
64
End Sub
Private Sub Picture2 _ Click()
End Sub.
Code for FORM - 1.12
Option Explicit Dim en As New ADODB.Connection Dim rs As New ADODB.Recordset Dim rsl As New ADODB.Recordset
Private Declare Function MapVirtualKey Lib "user32" Alias "MapVirtualKeyA" (ByVal wCode As Long, ByVal wMapType As Long) As Long
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtralnfo As Long) Private Const VK MENU= &H12 Private Const VK SNAPSHOT = &H2C Private Const KEYEVENTF KEYUP = &H2
Private Declare Function ClientToScreen Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long Private Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long Private Type POINTAPI XAs Long Y As Long
End Type ' Print an image of the control and any ' controls on top of it. 'Be sure the form containing the control has ' the focus before you call this routine. Private Sub PrintPictureBoxlmage(ByVal ptr As Object, ByVal pie As PictureBox, Optional ByVal fit_to_printer = False) Dim pie _parent As Form Dim parent_ x As Single Dim parent_y As Single Dim pie _pt As POINT API Dim pie_ x 1 As Single Dim pic_yl As Single Dim xmin As Single Dim ymin As Single Dim wid As Single Dim hgt As Single Dim aspect As Single Dim pie_ wid As Single
65
•
Dim pic_hgt As Single 'Copy the form's image to the clipboard. 'Press Alt. keybd_event VK_MENU, 0, 0, 0 Do Events ' Press Print Scm. 'keybd_event VK_SNAPSHOT, 1, 0, 0 keybd_event VK_SNAPSHOT, 0, 0, 0 Do Events
'Release Alt. keybd_event VK_MENU, 0, KEYEVENTF _KEYUP, 0 Do Events
' Copy the image into the hidden PictureBox. picHidden.Picture = Clipboard.GetData(vbCFBitmap)
' Get the form's location on the screen in pixels. Set pie _parent = pie.Parent parent_ x = ScaleX(pic _parent.Left, vbTwips, vb Pixels) parent_y = ScaleY(pic_parent.Top, vbTwips, vbPixels)
' Find the control's location on the screen in pixels. pic_pt.X = 0 pic_pt.Y = 0 ClientToScreen pic.hWnd, pic_pt
' Find the location of the control inside the parent form 'in pixels. pie_ x 1 = pie _pt.X - parent_ x pic_yl = pic_pt.Y - parent_y
' Convert into the printer's scale mode. pic_xl = ScaleX(pic_xl, vbPixels, ptr.ScaleMode) pic_yl = ScaleY(pic_yl, vbPixels, ptr.ScaleMode)
' Get the picture's size in the printer's scale mode. pie_ wid = ScaleX(pic. Scale Width, pie. ScaleMode, ptr. ScaleMode) pie_ hgt = Scale Y (pie. ScaleHeight, pie. ScaleMode, ptr. ScaleMode)
' Print the image. If Not fit_to_printer Then
' Center the image. wid = pie_ wid hgt = pie_ hgt xmin = (ptr.ScaleWidth - wid) I 3 ymin = (ptr.ScaleHeight - hgt) I 8
Else ' Make the image as large as possible ' without distortion.
66
••
aspect = pie_ hgt I pie_ wid wid = ptr.ScaleWidth hgt= ptr.ScaleHeight If hgt I wid > aspect Then
hgt = aspect * wid xmin = ptr.ScaleLeft ymin = (ptr.ScaleHeight - hgt) I 8
Else wid = hgt I aspect xmin = (ptr.ScaleWidth - wid) I 3 ymin = ptr.ScaleTop
End If End If
'Print. ptr.PaintPicture picHidden.Picture, _
xmin, ymin, wid, hgt, _ pic_xl, pic_yl, pic_ wid, pic_hgt
End Sub Private Sub CmdPrint_ Click() Labell.Caption = Form8.Label7.Caption MousePointer = vbHourglass Do Events optFitToPrinter.Visible = False optNormal.Visible = False CmdPrint.Visible = False Label7.Visible = False
'Picture2.Visible = False 'Display a preview. 'Form2.AutoRedraw = True 'PrintPictureBoxlmage F orm2, Picture 1, optFitT oPrinter. Value 'Form2.Show 'Print. Printer.Orientation= vbPRORPortrait PrintPictureBoxlmage Printer, Picture 1 Printer.EndDoc CmdPrint.Visible = True MousePointer = vbDefault
Unload Me Unload Form8 End Sub Private Sub Form_Load() On Error Resume Next cn.ConnectionString = "provider=Microsoft.Jet.OLEDB.4.0;data
source=C: \yasa3 62005\esas 1.mdb;" en.Open Debug.Print "Connection Object Created"
rs.Open "Select* from data", en, adOpenDynamic, adLockOptimistic
67
••
Debug.Print "Recordset Object Created"
rsl.Open "Select* from aktifkayrt", en, adOpenDynamic, adLockOptimistic Debug.Print "Recordset Object Created"
1 Call Clear strg3 ="Select* from aktifkayit where tukno = 111 & Form8.Label7.Caption & "1"
Set dbs3 = OpenDatabase("C:\yasa362005\esasl .mdb") Set temp3 = dbs3.0penRecordset(strg3, dbOpenDynaset) Iftemp3.EOF = True Then
1 MsgBox "BU KA YIT BULUNAMAMISTIR", vbExclamation, "HATA!" 1 Forml.Label76.Caption = ""
Else 1 Label7.Caption = temp3("tukno").Value
Label I.Caption= Form8.Label7.Caption Label5.Caption = temp3("tarih").Value Label3.Caption = temp3("kod").Value Label4.Caption = temp3("fatno").Value If Label3.Caption = "P" Then
Label6.Caption = Form8.Label32.Caption 1 Label7.Caption = ""
Elself Label3.Caption = "Y" Then Label6.Caption = Form8.Label33.Caption
1 Label7.Caption = "" End If
End If strg2 ="Select* from data where tukno = 111 & Form8.Label7.Caption & "'" Set dbs2 = OpenDatabase("C:\yasa362005\esasl.mdb") Set temp2 = dbs2.0penRecordset(strg2, dbOpenDynaset) Iftemp2.EOF = True Then
1 MsgBox "BU KA YIT BULUNAMAMISTIR", vbExclamation, "HATA!" 1 Text I .Text="" Form 1. Text 1. SetF ocus Else Label2.Caption = temp2("isim").Value
End If End Sub
Private Sub Picturel Click()
End Sub