NEAR EAST UNIVERSITY
FACULTY OF ECONOMIC AND
ADMINISTRATIVE SCIENCES
DEPARTMENT OF COMPUTER INFORMATION
SYSTEMS
2007 /2008 FALL
CIS 400
(GRADUATION PROJECT)
"WATER DISTRIBUTOR SYSTEM"
SUBMITTED TO : DEPT. OF CIS SUBMITTED BY : KEMAL OZKILI<:;
20000649
Lefkosa 2008
TABLE OF CONTENTS
II
ACKNOWLEDGEMENTS .ABSTRACT... 2
INTRODUCTION . . . 3
PROCESSES . . . .. . . .. 4
DESIGN OF THE SYSTEM .. . . .. 5
PROJECT IDENTIFICATION AND SELECTION .. 7
THE AIM OF THE PROJECT 7 THE PROJECT BOUND RIES .. 8
RESOURCE LIMITS .. .. 9
PROJECT INITIATION AND PLANNING 10 TECHNICAL FEASIBILITY... 10
OPERATIONAL FEASIBILITY :... 10
ECONOMICAL FEASIBILITY 10 ANALYSIS... 11
\J
DATABASE TABLES : _... 14DATA FLOW DIAGRAMS ,... 15
MENU SCHEMA 20
\J
FLOWCHARTS . . . .. . . .. . .. . . .. . . 21SCREENSHOTS... 36
SOURCE CODES . . . 43
ACKNOWLEDGEMENTS
This project will be prepared by me, with advise of Dr.Yalcin AK<;ALI and Assoc. Prof. Dr Ilham Huseynov to be submitted to Department Of Computer Information Systems.
I have to thank my family for their support in my educational life in Near East University.
Also I must tha:nk to my best friends for helping me during my project process.
ABSTRACT
Generally water distibutors have a big problem. This problem can be explained as "too much time spend in record of the orders". Most commonly feature of this project is easy order and sale processing. I achieved this purpose by a high level coding technology.
Another thing I have to focus ; I plan to sell this software to the other companies in the same sector. After the acceptance of this project the full version will be sent again and will be marketed to all the water distributors in TRNC.
Ill
•
•
•
•
•
INTRODUCTION
The field of Information Technology is an exciting and ever-changing field. If
.
you are a life-long learner and want new challenges everyday, it's always a good
idea to think of the program you want to create in terms of its solution. In order
to do this, you must have a pretty solid understanding of the programming
language that you'll be working in and what you can do with it. Then you should
sort out what exactly you're trying to accomplish: What do you want your
program to do?
What problem is it solving? Next, divide the program into its various
components. Then decide how those components will fit together to execute the
program. Once all these have sorted out, you can write each part of the program
and put them together. This is the correct way to program.
Processes
1. Purchase Process
1.1 New Supplier Registration Subprocess
1.2 New Product Registration Subprocess
1.3 Purchase Subprocess
2. Stock Process
3. Sale Process
- 3.1 Customer Subprocess
3.2 Sale Subprocess
4. Report Process
4.1 Customer Report Subprocess
4.2 Supplier Report Subprocess
4.3 Purchase Report Subprocess
4.4 Sale Report Subprocess
4.5 Product Report Subprocess
4.6 Customer Accounting Report Subprocess
4. 7 Supplier Accounting Report Subprocess
4.8 Stock Report Subprocess
'
I
I
•
I
•
I
I
The recommended requirements of the system are as follows;
./ Intel Pentium IV processor 3.0
./ 800 Mhz
./ 1
GB DDR RAM
./ 120GB HDD
./ 256 MB Graphic Card
./ 17'' Monitor
./ Microsoft Windows XP Professional
./ CD-ROM 52xmax
./ Modem
In this project I used the Borland's Delphi as programming technology
because of the Delphi's easy coding style. And I used Microsoft Access as
database. Because Access's performance is very good when used on a single
computer.
I
1) PROJECT IDENTIFICATION AND SELECTION
THE AIM OF THE PROJECT :
The aim of my project is to provide easy and quick managment of records
for water distributors.The job segment may be seen very easy but requires a
fast and powerful customer relationship managment and effective usage of
automation system.
When an order arrived to the Water World by phone it will be recorded to
the system.
if the customer is recorded before to our database then only the order is
recorded. if not recorded then the user takes the customers detailed
information(name, company, phone, address, etc ... ) and records it.
Then the user of the system will determine when the water is distibruted.
After the distribution is finished the billing details are recorded.
"iliPII_,_, rltJIIJPllfpa,tWff'M'li. p"{iii-16 J ·""FU H'i••in, •• ". ,,·v, •. :PM'II 1 ••• ]llii"lW !111'fltil\ • ••••
7
•-
THE PROJECT BOUNDRIES
1)
System can work on a single PC.
2)
System will not connect to internet so can not update itself
3)
System can not communicate with the suppliers because of being
an offline system.
4)
Microsoft Access doesn't support multiple users at the same time.
So the users of this system can not use the same tables.
8
RESOURCE LIMITS
1) System has to be able to scan bar codes for stock and purchase
processes. A bar code scanner is required but I don't have.
2) The project will have a special interface using photoshop styles and
extensions. Program will start with a prompt screen and only the
authorized user may have the right to use program.
2) PROJECT INITIATION AND PLANNING
TECHNICAL FEASIBILITY
Necessary Hardwares :
- 1 computer for the manager (necessary)
1 computer for the secretary. (suggested)
At least 1 printer
OPERATIONAL FEASIBILITY
The manager and the other employees who will use the system must have
at least low level computer using skill for being educated about the
system.
ECONOMICAL FEASIBILITY
System can replace an employee's work on like basic accounting, stock
controlling, statistical report preparing, etc
.. So the owner can save at least
one employees' salary monthly. This system will cost for the owner about
1000 at total. This cost includes a simple computer, a bar code scanner, a
printer.
5)
ANALYSIS
THE REQUIREMENT DETERMINATION :
The requirements made by the owner as follows:
- To increase the speed of operations
- To provide easy and quick Access
- Recording of the distribution daily
- Detailed customer cards
11
•
•
•
•
•
EXISTING SYSTEM'S CAPABILITIES
- The Water Distributor's existing system is based on manual.
- The Inventory is written on the ledger notebooks and the stock is being
calculated by using this notebook
- A customer card is held for Customer Relationship Management
NEW SYSTEM'S PROVIDENCES
- New system will help to the user easy and quick search of the
information about all the data.
- A worker can easily record stock and sale informations.
- All the transactions by the customers will be stored in the database.
- Stocks, customers, purchase, suppliers and sale reports will be
prepared with one click
DATABASE TABLES
T~
j)~~
V;~
1. Customers :
All the customer knowledge will be stored here.
2. Sale :
The detailed sale and order information will be stored here.
3. Purchase :
The detailed purchase information will be stored here.
4. Products
The products general information which company sells are stored here.
5. Stocks
The recorded products' quantity information are stored here.
6. Suppliers
The companies which we purchase our stocks are stored here
\JJ~ER
0
~5TR..\6\J,OR
5'l=/f2M
.\p._£_
Po~,s
(*)
1..-(v!>"\-O~V' \_ 1,.,t~
2-
~
u ff\",er
L\='-\-3--?
v r c..~se.. L,s.-\-'-\ - So.
\e.. \_:, s\·_5-
.Q,o c\ve...~ L.,s .\-&-
G.is'.\-o MH Ac...ov"~'~ ~::, \-+-
.Svtf
\.e • s: Ac.c..o..i<'-~ 1-"'-S.~t -
S-\-oc.\ ....
L\s~·IJ " l "" ' vO{C/2... ~ \) r d.o.:fo-.
1
r-oJvd-do.·h,. ..irJ
JJ
-'C) C~---1t
.::t ~ .---,;/0pur-c.r--o.~
into
I
r
rr> \J ~ f ~roo..
vc
-r ~' ,v~"?
0
0
..---1 CI<
~('01-VC,.."\ \I\' V I ~ 1">~ lf@u::.+ •
d+o
f'.XB-~ ~
~P-""~"-'--""~~~-"-~--'8
t-=:::...i....,~:::,,.__:=~:...._~---..1~'----'~~-=-"-'-'-~--
1') ....---, ,.... ~) ~ ~}
t. -0~ 9pa
{
t
~~U)
~ () U\ r-f-US~OMe, ClC.Cov'f'f, )> I \is+r
f11j
.sa \e..lls+
-p..-
-
I
\ b
..,-)
-
0
,,.. ~ ~'t
3
8
r
J;>z.
~ ~ 0 (J\ \lii
?
•
II
•
\) \d
t
11
-
Fi
~8,
C) ~ \jl11\to
J
\T)I
1~
IQ.-
-1
~r
C}I\pi!
9
1
0
1)
C (J -0 "'O--
r
r;t
-14rn
0
p
?
...,.., 1.1 Ifer
-,f\~O -0 ,,., \> JC] "'l \JI U\'p
-
<:, -TC Cr
~ 9::g
~rn
\j\ ~ ~ 0 ' :):r-
~Wi
\ 1-
1111
II
II
II
II
II_
2-
rder
,AtorfW)..+10() ~-
-·
~ _,n
~0
"" 0 ff)&
l)\\')
-·
-i
~ ~ C. C)>
1
~ IJJ,.,
e,0
loN\e_r\f\to
r
rn
0 t. IJC
~ 0 ~ 11 "'f) ~,~
\j\CJ
'n
'"1 '0
p..t
p
t
lJ\
~ )> ~r:
11)
(5""O'
-0 \)b
-") ~ () \}. ~ wo..\-e.r .s+ct....~ \l\~oe
~d
\J\~I
(j\0 vJ iu- \d froi Sa.. \e_
IJ:
r
0 11 C-
I!
.:5 0. \-'2-..cl. 0.. .\-o,.q
r
rTJ 17-
,J
-
Fi
~\~
II
•
II
6
~ ~ 'Tid
-
P-r
c, tTl ~i~
6
·~
,-
\1'7bf) i:: ...
-
§ 0 U'l o bf) ~ ~ i:: o ... 0 ;... ~-
Q) ;:I tr: ...-
0 0.. u 'Els
o ro 0 tr: ;... ...0 Q) <i::-
s
0 U'l U'l ;:I-
u
o ;:I "O 0 ;... p.. tr: ~s
~ ;:I u U'l ;... Q)s
0-
U'l ;:I u 0 NI
'
II
II
II
II
II
FLOWCHARTS
PASSWORD ENTRY
start Enter password User '\ N . Name }---( end correct y 21MAIN MENU Main menu 1.Sale 2. Purchase 3.Stocks 4.Reports 5. About 6.Exit
-
iWl•l:'I t · .. l 11', ·w 22SALE
Select Customer, Enter Price & Qantityy
Click OKy
N Click Close ...,,,, 'NIIWii ~ 23PURCHASE Select Product Enter Price & Qantity
y
Click OKN
y
Click CloseN
24••
STOCKS
Enter stock data
y
Click OKN
Click Close Doyou 'Y
want to recordN
~~-- ...~---·-·----
25REPORTS REPORTS 1. Customer Reports 2. Supplier Reports 3. Purchase Reports 4. Sale Reports 5. Product Reports 6. Customer Accounting 7. Supplier Accounting 8. Stock Reports 26
CUSTOMERS REPORT Doyou "'-
Y
Click OKN
-~•u·.-v,c r q;_ ·1 n·l:' 27~·
!v11,, • .,.,¢:.t
,:0«" -~i L/f3fVtRy -<.~
-9.,. ',)s,
'.?- ~ r ~Fi{O j ~i--~~~-
.. -·7
SUPPLIERS REPORT
y
N
28 Click OK7
\PURCHASE REPORTS
y
Click OK
N
SALE REPORTS
y
N
PRODUCTS REPORT
y
N
Click OK
CUSTOMER ACCOUNTING REPORTS
Doyou "'- y want To see Customer Accounts, Click OK N 32SUPPLIER ACCOUNTING REPORTS
Click OK
y
N
iao,ill11 ¥ __ !I I l!tL#:tlii! u· II ti ~:t- i*lt••· .. ij_., ·;~
33
1
STOCKS REPORT
y
N
Click OK
ioliol$il •• -.Pel ••.••••• ,.., & -~'i[)IAi,rlilpMp •••• ~ii ••• W - q ·4.J I iiiW1i IP•• t1•1il i _fa;ocf~U
34
want To see About
ABOUT
y
Click OK N f!!l,u,nuc · ll!Wtlf 11t1T, 35SCREENSHOTS
MAIN MENU
SALE
•· compar,y,:t,fatne· ,, :'.<
. .A:ddress
CUSTOMERS
PURCHASE
Su:pp'lierlD
Ciu:npany Name
Ccrntai;t Mame
SUPPLIERS
$tockJO q
STOCKS
Fil '.Jltlill!l'o/i7i¥i54i:Pt..1nl1 t:;r_:.:20$Crw ff'llwt atl .._._~~-' ••rd • mrt•·u,1c1-..a,rai•iie: i,.:·~ il'.i'.<'Pfz..,
Suppliers
e
Products:REPORTS
SOURCE CODES
unit Unitl ·
'
· terface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, jpeg, ExtCtrls, bsSkinData, BusinessSkinForm, bsSkinCtrls,
sSkinBoxCtrls, StdCtrls, Mask, bsMessages, DB, ADODB, bsdbctrls, sSkinGrids, bsDBGrids, frxClass, frxDBSet, OleCtrls,
ShockwaveFlashObjects _ TLB; .ype TForml = class(TForm) Image 1: Tlmage; bsBusinessSkinForml: TbsBusinessSkinForm; bsSkinDatal: TbsSkinData; bsCompressedStoredSkin 1: TbsCompressedStoredSkin; bsSkinButtonl: TbsSkinButton; bsSkinButton2: TbsSkinButton; bsSkinStdLabell: TbsSkinStdLabel; sSkinStdLabel2: TbsSkinStdLabel; sSkinEditl: TbsSkinEdit; sSkinMaskEditl: TbsSkinMaskEdit; sSkinButton3: TbsSkinButton; sSkinStdLabel3: TbsSkinStdLabel;
!IIS• tr tsli "fW#dfU .. t ·w _,',ii iiAMll? riq-·n:w •
sSkinPanel 1: TbsSkinPanel; sSkinButton4: TbsSkinButton; SkinButton5: TbsSkinButton; sSkinButton6: TbsSkinButton; ~skinButton7: TbsSkinButton; 43
bsSkinMessagel: TbsSkinMessage; bsSkinPanel2: TbsSkinPanel; ADOConnection 1: T ADOConnection; bsSkinTextLabell: TbsSkinTextLabel; bsSkinTextLabel2: TbsSkinTextLabel; bsSkinDBTextl: TbsSkinDBText; bsSkinDBEditl: TbsSkinDBEdit; bsSkinDBEdit2: TbsSkinDBEdit; bsSkinDBEdit3: TbsSkinDBEdit; bsSkinDBEdit4: TbsSkinDBEdit; bsSkinDBMemo 1:
TbsSkinDBMemo;
bsSkinDBEdit5: TbsSkinDBEdit;
bsSkinDBEdit6: TbsSkinDBEdit;
bsSkinDBNavigatorl: TbsSkinDBNavigator;
bsSkinDBGridl: TbsSkinDBGrid;
bsSkinScrollBarl: TbsSkinScrollBar;
ADOTablel: TADOTable;
DataSource 1: TDataSource;
bsSkinPanel3: TbsSkinPanel;
bsSkinTextLabel3: TbsSkinTextLabel;
bsSkinTextLabel4: TbsSkinTextLabel;
bsSkinDBText2: TbsSkinDBText;
bsS~inDBEdit7: TbsSkinDBEdit;
bsSkinDBEdit8: TbsSkinDBEdit;
bsSkinDBEdit9: TbsSkinDBEdit;
~bsSkinDBEditl 0: TbsSkinDBEdit;
bsSkinDBEditl
1:TbsSkinDBEdit;
bsSkinDBN
avigator2: TbsSkinDBN
a
vi
gator;
sSkinDBGrid2: TbsSkinDBGrid;
sSkinScrollBar2: TbsSkinScrollBar;
DataSource2: TDataSource;
;''ifti _1,~r- -~ ·.-....-111,··1 o "'¥Nh::'lf(l"la~_..,..,.,.., · P
ADOTable2: TADOTable; bsSkinPanel4: TbsSkinPanel; bsSkinTextLabel5: TbsSkinTextLabel; bsSkinTextLabel6: TbsSkinTextLabel; bsSkinDBText3: TbsSkinDBText; bsSkinDBEdit 12: TbsSkinDBEdit;
bsSkinDBN avigator3: TbsSkinDBN a vi gator; bsSkinDBGrid3: TbsSkinDBGrid; bsSkinScro11Bar3: TbsSkinScrollBar; bsSkinDBLookupComboBoxl: TbsSkinDBLookupComboBox; ADOTable3: T ADOTable; DataSource3: TDataSource; bsSkinDBEdit13: TbsSkinDBEdit; bsSkinDBCurrencyEditl: TbsSkinDBCurrencyEdit; bsSkinDBCurrencyEdit2: TbsSkinDBCurrencyEdit; ADOQuery 1: TADOQuery; bsSkinDBText4: TbsSkinDBText; DataSource4: TDataSource; bsSkinPanel5: TbsSkinPanel; bsSkinTextLabe17: TbsSkinTextLabel; bsSkinDBGrid4: TbsSkinDBGrid; bsSkinScrollBar4: TbsSkinScrollBar; bsSkinDBLookupComboBox2: TbsSkinDBLookupComboBox; sSkinDBText5: TbsSkinDBText; bsSkinStdLabel4: TbsSkinStdLabel; sSkinStdLabel5: TbsSkinStdLabel; sSkinCurrencyEditl: TbsSkinCurrencyEdit; sSkinSpinEditl: TbsSkinSpinEdit; sSkinButtonl 1: TbsSkinButton; ADOTable4: TADOTable; DataSource5: TDataSource; 45
ADOQuery2: T ADOQuery; bsSkinButton12: TbsSkinButton; bsSkinPanel6: TbsSkinPanel; bsSkinTextLabel8: TbsSkinTextLabel; bsSkinDBText6: TbsSkinDBText; bsSkinStdLabel6: TbsSkinStdLabel; bsSkinStdLabel7: TbsSkinStdLabel; bsSkinDBGrid5: TbsSkinDBGrid; bsSkinScrollBar5: TbsSkinScrollBar; bsSkinDBLookupComboBox3: TbsSkinDBLookupComboBox; bsSkinCurrencyEdit2: TbsSkinCurrencyEdit; bsSkinSpinEdit2: TbsSkinSpinEdit; bsSkinButton 13: TbsSkinButton; bsSkinButton 14: TbsSkinButton; bsSkinTextLabel9: TbsSkinTextLabel; bsSkinDBLookupComboBox4: TbsSkinDBLookupComboBox; bsSkinButtonl 5: TbsSkinButton; bsSkinStdLabel8: TbsSkinStdLabel; bsSkinEdit2: TbsSkinEdit; bsSkinButton16: TbsSkinButton; ADOTable5: TADOTable; DataSource6: TDataSource; ADOQuery3: TADOQuery; DataSource7: TDataSource; DataSource8: TDataSource; - .._, -
AD0Query4: TADOQuery;
sSkinPanel
7: TbsSkinPanel;
sSkinGroupBoxl: TbsSkinGroupBox;
sSkinCheckRadioBox 1: TbsSkinCheckRadioBox;
sSkinCheckRadioBox2: TbsSkinCheckRadioBox;
sSkinCheckRadioBox3: TbsSkinCheckRadioBox;
46bsSkinCheckRadioBox4: TbsSkinCheckRadioBox; bsSkinPanel8: TbsSkinPanel; bsSkinDateEditl: TbsSkinDateEdit; bsSkinDateEdit2: TbsSkinDateEdit; bsSkinStdLabel9: TbsSkinStdLabel; bsSkinStdLabel 10: TbsSkinStdLabel; bsSkinButtonl 7: TbsSkinButton; bsSkinDBLookupComboBox5: TbsSkinDBLookupComboBox; bsSkinStdLabel 11: TbsSkinStdLabel; bsSkinStdLabel 12: TbsSkinStdLabel; baSkinl'Bl.ookupf'ombolsoxo: TbsSkinDBLookupComboBox; AD0Query5: T AD0Query; DataSource9: TDataSource; bsSkinDBGrid6: TbsSkinDBGrid; bsSkinStdLabel 13: TbsSkinStdLabel; frxReport 1 : TfrxReport; frxDBDatasetl: TfrxDBDataset; bsSkinButtonl 8: TbsSkinButton; frxReport2: TfrxReport; bsSkinGroupBox2: TbsSkinGroupBox; bsSkinCheckRadioBox5: TbsSkinCheckRadioBox; sSkinCheckRadioBox6: TbsSkinCheckRadioBox; bsSkinCheckRadioBox7: TbsSkinCheckRadioBox; sSkinCheckRadioBox8: TbsSkinCheckRadioBox; bsSkinButtonl 9: TbsSkinButton; -
.
sSkinButton8: TbsSkinButton;
sSkinButton9: TbsSkinButton;
wfl: TShockwaveFlash;
sSkinPanel9: TbsSkinPanel;
sSkinTextLabel 10: TbsSkinTextLabel;
rocedure bsSkinSpeedButtonl Click(Sender: TObject);
47procedure bsSkinSpeedButton2Click(Sender: TObject); procedure bsSkinButtonl Click(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject); procedure allinv;
rocedure bsSkinButtonl OClick(Sender: TObject); procedure bsSkinButton6Click(Sender: TObject); procedure AD0Table3AfterPost(DataSet: TDataSet);
procedure DataSource3DataChange(Sender: TObject; Field: TField); rocedure bsSkinButton5Click(Sender: TObject);
rocedure bsSkinButtonl lClick(Sender: TObject); rocedure bsSkinButton12Click(Sender: TObject); rocedure bsSkinButton4Click(Sender: TObject); procedure bsSkinEdit2Change(Sender: TObject); procedure bsSkinButtonl 6Click(Sender: TObject); procedure bsSkinButton15Click(Sender: TObject); procedure bsSkinButton13Click(Sender: TObject);
rocedure AD0Table4AfterPost(DataSet: TDataSet); rocedure AD0Query3After0pen(DataSet: TDataSet); rocedure AD0Query4After0pen(DataSet: TDataSet); rocedure bsSkinButton14Click(Sender: TObject); rocedure AD0Table5AfterPost(DataSet: TDataSet); rocedure bsSkinButton7Click(Sender: TObject);
rocedure bsSkinCheck.RadioBox3Click(Sender: TObject ); rocedure bsSkinButtonl 7Click(Sender: TObject);
rocedure bsSkinCheck.RadioBox4Click(Sender: TObject ); rocedure bsSkinCheckRadioBoxl Click(Sender: TObject); rocedure bsSkinCheck.RadioBox2Click(Sender: TObject); rocedure bsSkinButton18Click(Sender: TObject);
procedure bsSkinCheckRadioBox5Click(Sender: TObject ); procedure bsSkinCheckRadioBox8Click(Sender: TObject); procedure bsSkinCheckRadioBox6Click(Sender: TObject); procedure bsSkinCheckRadioBox7Click(Sender: TObject); procedure bsSkinButton19Click(Sender: TObject);
procedure bsSkinButton8Click(Sender: TObject); private { Private declarations } ublic { Public declarations } end: ' ar Forml: TForml; plementation str: string; ,..R *.dfm}
edure TForml .bsSkinSpeedButtonl Click(Sender: TObject);
gm
edure TF orm 1. bsSkinSpeedButton2Click(Sender: TObj ect );
lication.Minimize;
edure TForml .bsSkinButtonl Click(Sender: TObject); 49
gm
plication.Minimize; d·
ocedure TForml .bsSkinButton2Click(Sender: TObject); gm
- , sskinmessage l .MessageD lg(' Are you sure' ,mtconfirmation, [ mbyes,mbno], 0 )=mryes en
pplication.Terminate; end:
'
rocedure TForml .bsSkinButton3Click(Sender: TObject);
gm
: ( bsskineditl.Text=") and (bsskinmaskeditl.Text=") then begin sskinpanel l .Enabled:=true;
sskinstdlabel.i.Caption.=Login Successful! Now You Can Use Menu For Processes'; end
e begin
sskinmessagel.MessageDlg('Invalid Usemame Or Password !',mterror,[mbok],O);
d·
d·
ocedure TForml .FormCreate(Sender: TObject);
eegm TmpStr:=ExtractFileDir(ParamStr(O));
t-=
""-""TmpStr[Length(TmpStr)]<>'\' Then TmpStr:=TmpStr+'\'; - . rfl .Movie:=tmpstr+'clock.swf; ~· .. -fl.Play;sskintextlabel 10 .Lines. Clear;
,_ sskintextlabel 10 .Lines.LoadFromFile( tmpstr+'programmer. txt'); oconnectionl .Connected:=false;
sdoccnnectionl .ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;Data ource='+tmpstr+'db.mdb;Persist Security Info=False';
oconnectionl .Connected:=true; otable l .Active:=true;
_ sskindbgrid 1. Columns [O]. Visible:=false; _sskindbgridl .Columns[ 4]. Visible:=false; csskindbgridl .Columns[5].Visible:=false; _ sskindbgrid 1. Columns [ 6]. Visible:=false;
otable2 .Active:=true;
_sskindbgrid2.Columns[O].Visible:=false; sskindbgridz. Columns [3]. Visible:=false; sskindbgrid2. Columns[ 4]. Visible:=false;
otable3 .Active:=true; otable4.Active:=true; otable5 .Active:=true;
query3.0pen; query4. Open;
edure TForml .bsSkinButton9Click(Sender: TObject);
: -;... r- skinmessage l .MessageD lg(' Are you sure' ,mtconfirmation, [ mbyes,mbno], 0 )=mryes
~ ication.Terminate;
edure TForml .allinv;
1.bsskinpanel2.Visible:=false; 1. bsskinpanel3. Visible:=false; l .bsskinpanel4.Visible:=false;
~ orm 1. bsskinpanel5. Visible:=false; Forml .bsskinpanel6.Visible:=false;
orm 1. bsskinpanel 7. Visible:=false; orm 1. bsskinpanel9 .Visible:=false; aid;
rrocedure TForml .bsSkinButtonl OClick(Sender: TObject); __ gm
v;
-sskinstdlabcls.Caption.=Suppliers'; sskinpanel
I.
Visible:=true;rocedure TF orm 1. bsSkinButton6Click(Sender: TObj ect );
sskinstdlabel.l .Caption:='Stocks'; panel4.Visible:=true;
edure TForml .AD0Table3AfterPost(DataSet: TDataSet);
·-i. adoqueryl do begin
-~~-Clear;
- .Addr'select
*
from Stocks whereuct_ID='+adotable3.FieldByName('Product_ID').AsString);
oqueryl .RecordCount=O then begin ery I .Append;
eryl.FieldByName('Product_ID').AsString:=adotable3.FieldByName('Product_ID'). sStnng;
-·~,iueryl .FieldByName('Quantity').Aslnteger:=O; uery I .Post;
edure TForml .DataSource3DataChange(Sender: TObject; Field: TField); gm
-· sskindbtext.lCaption<>" then
~-i- adoquery 1 do begin
-- .Clear;
cl.Addf'select
*
from Stocks whereduct_ID='+adotable3.FieldByName('Product_ID').AsString);
en;
d· d·
ocedure TForml .bsSkinButton5Click(Sender: TObject);
cegm
v;
~sskinstdlabel3.Caption:='Purchase'; sskinpanel S. Visible:=true;
end;
ocedure TForml.bsSkinButtonl lClick(Sender: TObject);
.b.integer; egin
ith adoquery2 do begin
- ose; sql.Clear;
sql.Addr'Select * from Stocks where
Product , ID='+adotable3 .fieldbyname('Product_ID').AsString); en;
-= ·=adoquery2 .F ieldB y N ame('Quantity').Aslnteger;
· th adotable4 do begin zppend;
-eldbyname('Product_ID').AsString:=adotable3.fieldbyname('Product_ID').AsString; - eldbyname('Quantity').AsString:=bsskinspinedit 1. Text;
- eldbynamet'U ni(_ Price').AsString:=floattostr(bsskincurrencyedit 1. value);
- ;:,ldbyname('Total_Price').AsString:=floattostr(bsskincurrencyeditl .value*bsskinspineditl 'alue); - eldbyname('Purchase _Date').AsDateTime:=now; :~st; _ :=a+strtoint(bsskinspinedit 1. text); adoqueryz.Edit;
adoqueryZ .F ieldBy N ame('Quantity').Aslnteger:=b; zdoqueryz .Post;
:-sskinmessagel.MessageDlg('Purchase Complete !',mtconfirmation,[mbok],O); d·
. rocedure TForml .bsSkinButton12Click(Sender: TObject);
:integer; __ gm adoquery2 do begin .ose; scl.Clear; 54
sql.Addt'Selcct
*
from Stocks where oduct_ID='+adoquery3 .fieldbyname('Product_ID').AsString); en; d; -·=adoquery2.FieldByName('Quantity').Asinteger; :=a-adoquery3.fieldbyname('Quantity').Aslnteger; .• (1 oquery2 .Edit; _,.,.oquery2.FieldByName('Quantity').Aslnteger:=b; _ .... oquery2.Post;sskinmessage l .MessageDlg('Cancel Complete ! ',mtconfirmation, [ mbok] ,0 );
"otable4.Locate('Product_ID;Purchase_Date',vararrayof([adoquery3.fieldbyname('Produc ~_ID').AsString,adoquery3.fieldbyname('Purchase_Date').AsString]),[lopartialkey]);
·otable4.Delete; -oquery3 .Close; - .... query3.0pen;
edure TForml .bsSkinButton4Click(Sender: TObject);
sskinstdlabel.l .Caption:='Sale'; panel6. Visible:=true;
_ ocedure TF orm 1. bsSkinEdit2Change(Sender: TObject );
.c.d.e.f.string;
sskineditz.Text<>" then begin - Contact_ Name like ';
r-=·
Contact_Name like';-:=' Contact_Sumame like'; -:=' GSM like';
.,.-=' Business Phone like'· - ' .:._'%'+bsskinedit2.Text+'%'; -otable l .Filtered:=false; -otablel .Filter:=a+#39+f+#39+' or '+b+#39+f+#39+' or '+c+#39+f+#39+' or -#39+[+#39+' or '+e+#39+f+#39; dotablc l .Filtered:=true; zcotable l .Filtered:=false; ~r1·
_ rocedure TForml .bsSkinButton16Click(Sender: TObject);
v;
sskinstdlabel Lf.aptionr=Sale'; _ sskin panel 6. Visible:=true;
rocedure TForml.bsSkinButton15Click(Sender: TObject); __ gm
v;
-sskinstdlabels.Captlorr=Customers'; _ sskinpanelz. Visible:=true;
edure TForml.bsSkinButton13Click(Sender: TObject);
-~ :integer;
ith adoquery2 do begin se;
scl.Clear;
sql.Addt'Select * from Stocks where
.~duct_ID='+adotable3.fieldbyname('Product_ID').AsString); en;
.,....
....•.=adoquery2 .F ieldBy N ame('Quantity').Aslnteger; :-=a-strtoint(bsskinspinedit2.text);
.: b>=O then begin · th adotable5 do begin
end·
.
'-;ildbyname('Product_ID').AsString:=adotable3.fieldbyname('Product_ID').AsString;
- eldbynamer'Customer _ ID').AsString:=adotable l .fieldbyname('Customer _ID').AsString; - "'ldbyname('Quantity').AsString:=bsskinspinedit2. Text;
- "'ldbyname('Unit_Price').AsString:=floattostr(bsskincurrencyedit2.value );
- "'1 dbyname('T otal _ Price').AsS tring:=floattostr(bsskincurrencyedit2. value*bsskinspinedit2
- Iue
);
- .:>cl dbyname('Sale _ Date').AsDateTime:=now; cost: "'oquery2.Edit; "'"'query2.FieldByName('Quantity').Aslnteger:=b; oquery2 .Post;sskinmessage l .MessageDlg('Sale Complete ! ',mtconfirmation, [ mbok ],O );
z-sskinmessage l.Mcssagelflgt'You have not enought stock',mtwaming,[mbok],O);
rocedure TForml .AD0Table4AfterPost(DataSet: TDataSet); cegm
adoquery.l .Close; adoquery.l. Open; end;
crocedure TF orm 1.AD0Query3After0pen(DataSet: TDataSet ); __ gm _ sskindbgrid4.Columns[O]. Visible:=false; sskindbgrid-l.Columns] 1]. Width:= 100; sskindbgrid4.Columns[2].Width:=100; sskindbgrid4.Columns[3].Width:=60; sskindbgrid-l.Columns] 4]. Width:=70; _ sskindbgrid4.Columns[5].Width:=70;
edure TF orm l .AD0Query4 AfterOpen(DataSet: TDataSet );
dbgrid5.Columns[O].Visible:=false; sskindbgridf .Columns[ 1]. Width:= 100; sskindbgridf .Columns[2]. Width:= 100; s,l{indbgrid5.Columns[3].Width:=60; sskindbgridf .Columns[ 4].Width:=70; _.smidbgrid5.Columns[5].Width:=70;
edure TForml .bsSkinButton14Click(Sender: TObject);
-- adoquery2 do begin
lose; sql.Clear;
sol.Add('Select
*
from Stocks whereoduct_ ID='+adoquery4. fieldbyname('Product_ ID').AsS tring); en;
d;
~ ·=adoquery2 .F ieldBy N ame('Quantity').Aslnteger; :=a+adoquery4.fieldbyname('Quantity').Aslnteger; adoqueryz .Edit;
adoqueryz .F ieldB y N ame('Quantity').Aslnteger:=b; adcqueryz.Post;
_ sskinmessage l .MessageDlg('Cc:1ncel Complete ! ',mtconfirmation,[ mbok] ,0 );
•· lotableS .Locate('Product_ ID; Sale_ Date', vararrayof([ adoquery4 .fieldbyname('Product_ ID' AsString,adoquery4.fieldbyname('Sale _ Date').AsString]), [lopartialkey ]);
otable5.Delete; coquery-t.Close; oquery4.0pen;
rocedure TForml .AD0Table5AfterPost(DataSet: TDataSet);
gm
coquery-l.Close; query4.0pen;
edure TForml .bsSkinButton7Click(Sender: TObject);
.. ,,,.,",, ,stdlabel3 .Caption:='Reports'; panel 7. Visible:=true;
edure TForml .bsSkinCheckRadioBox3Click(Sender: TObject); gm
-· sskincheckradiobox3.Checked=true then begin sskinstdlabel 11. Visible:=true; sskindblookupcombobox5.Visible:=true; sskinstdlabel 12. Visible:=false; sskindblookupcombobox6.Visible:=false; se begin sskinstdlabel l 1.Visible:=false;
sskindblookupcombo box5. Visible :=false;
edure TForml .bsSkinButtonl 7Click(Sender: TObject);
tar2:string;
-·:...sskincheckradioboxl .Checked=true then
:=formatdatetime('dd-mm-yyyy' ,bsskindateedit I .Date); -~, :=formatdatetime('dd-mm-yyyy',bsskindateedit2.Date ); nn adoquery5 do begin
y; urn: 10 ••~• 1t1'"10:.._.. "'· t:.~"'~l :.-·'ill;'
:.1.Clear;
.Add('SELECT Products.Product_ ID, Products.Product_ Name,
_..,pliers.Company_Name, Purchase.Quantity, Purchase.Unit_Price, Purchase.Total_Price, hase.Purchase _ Date');
.,.,,_Add('FROM (Suppliers INNER JOIN Products ON Suppliers.[Supplier_ID] = r
ducts.[Supplier_ID]) INNER JOIN Purchase ON Products.[Product_ID] = chase. [Product_ ID]');
sql.Addf'where Purchase.Purchase_Date between #'+tarl +'#·and #'+tar2+'#');
"1 .Add('Order By Purchase.Purchase_ Date DESC');
skincheckradio box2. Checked=true then
: =formatdatetime(' dd-mm-yyyy', bsskindateedit I .Date);
r .!. : =formatdatetime(' dd-mm-yyyy', bsskindateedit2 .Date);
· · adoquery5 do begin
ql.Clear;
.Add('SELECT Products.Product_ ID, Products.Product_ Name,
storners.Company _Name, Sale.Quantity, Sale. Unit_ Price, Sale. Total_ Price, e.Sale _ Date');
.Add('FROM Products INNER JOIN ( customers INNER JOIN Sale ON omers.[Customer_ID] = Sale.[Customer_ID]) ON Products.[Product_ID] = e.[Product_ ID]');
.Add('Where Sale.Sale_ Date between #'+tarl +'# and #'+tar2+'#'); ~-\dd('Order By Sale.Sale_Date DESC');
sskincheckradio box4. Checked=true then
:=formatdatetime('dd-mm-yyyy',bsskindateeditl .Date); _:=formatdatetime('dd-mm-yyyy',bsskindateedit2.Date); - · adoquery5 do begin
-:_ -\dd('SELECT Products.Product_ ID, Products.Product_ Name,
_;)pliers.Company_ Name, Purchase. Quantity, Purchase.Unit_ Price, Purchase. Total_ Price, ~ .... hase.Purchase _ Date');
,._!\dd('FROM (Suppliers INNER JOIN Products ON Suppliers.[Supplier_ID] = ducts.[Supplier_ID]) INNER JOIN Purchase ON Products.[Product_ID] =
hase.[Product_ID]');
- ... Addt'where Suppliers.Company_Name='+#39+bsskindblookupcombobox6.Text+#39+' Purchase.Purchase_Date between #'+tarl +'# and #'+tar2+'#)');
.Addi'Order By Purchase.Purchase _Date DESC'); oen;
skincheckradiobox3.Checked=true then begin
~' : =formatdatetime(' dd-mm-yyyy', bsskindateedit I .Date); r.1.:=formatdatetime('dd-mm-yyyy',bsskindateedit2.Date); ith adoquery5 do begin
se; scl.Clear;
-~1.Add('SELECT Products.Product_ID, Products.Product_ Name,
stomers.Company _Name, Sale.Quantity, Sale.Unit_ Price, Sale.Total_ Price,
ale.SaleDate');
s.ql.Add('FROM Products INNER JOIN ( customers INNER JOIN Sale ON stomers.K'ustomer Tlj] = Sale.[Customer_ID]) ON Products.[Product_ID] =
....
..:...;..,;,,- ..·~-
..•...••.-
.. ·--- -·-···-·-··~--:~
.•..•...e. [Product_ ID]'); 5-01.Add('Where
stomers. Company_ N ame='+#39+bsskindblookupcombobox5. Text+#3 9+' and Je.Sale_Date between #'+tarl +'# and #'+tar2+'#)');
sql.Addt'Order By Sale.Sale_Date DESC'); en;
rocedure TForml .bsSkinCheckRadioBox4Click(Sender: TObject);
:bsskincheckradiobox4.Checked=true then begin sskinstdlabel 12.Visible:=true; sskindblookupcombobox6.Visible:=true; sskinstdlabel 11. Visible:=false; _ sskindblookupcombobox.S. Visible:=false; d .se begin sskinstdlabel 12. Visible.=false; sskindblookupcombobox6.Visible:=false; d· ' d· '
ocedure TF orm 1. bsSkinCheckRadioBox 1 Click(Sender: TObject );
gm _ sskinstdlabel 12. Visible:=false; sskindblookupcombobox6.Visible:=false; sskinstdlabel 11.Visible:=false; sskindblookupcomboboxfi. Visible:=false; d· '
ocedure TForml .bsSkinCheckRadioBox2Click(Sender: TObject); egm
-skinstdlabel12.Visible:=false;
"'skindblookupcombobox6.Visible:=false; sskinstdlabel 11. Visible:=false;
sskindblookupcombobox5. Visible:=false; end:
'
rocedure TForml .bsSkinButtonl 8Click(Sender: TObject); egin
· ~ (bsskincheckradioboxl .Checked=true) or (bsskincheckradiobox4.Checked=true) then frxreportl .ShowReport;
· .~ (bsskincheckradiobox2.Checked=true) or (bsskincheckradiobox3.Checked=true) then frxreport2. Show Report;
rod;
_ ocedure TForml .bsSkinCheckRadioBoxSClick(Sender: TObject); cegin
ith adoquery5 do begin ose;
sql.Clear;
sol.Add('SELECT
*
From Customers'); en;end; d;
ocedure TF orm 1. bsSkinCheckRadioBox8Click(Sender: TObject );
gm
"th adoquery5 do begin ose;
sql.Clear;
_ .Add('SELECT
*
From Suppliers');edure TForml .bsSkinCheckRadioBox6Click(Sender: TObject);
· · adoquery5 do begin ose;
.s-01. Clear;
501.Add('SELECT
*
From Products INNER JOIN Stocks ON Products.Product_ ID=Stocks.Product_ ID)');en; end; end;
ocedure TF orm 1. bsSkinCheckRadioBox7Click(Sender: TObject ); cegin
ith adoquery5 do begin ose;
sql.Clear;
5{]1.Add('SELECT
*
From Products INNER JOIN Suppliers on Products.Supplier_ ID=Suppliers.Supplier _ ID)');en;
d;
d;
ocedure TF orm 1. bsSkinButtonl 9Click(Sender: TObject ); gm allinv; ~skinstdlabe13.Caption:='Suppliers'; sskinpanelf. Visible:=true; end· '
•rocedure TForml .bsSkinButton8Click(Sender: TObject); gm
allinv; bsskinstdlabel3. Caption:='Reports'; bsskinpanel9. Visible:=true; end· ' end. 66
REFERENCES