Sei sulla pagina 1di 145

A

Project Report
On

E-Ration Card System


Submitted in partial fulfillment of the requirement for the award of degree
Bachelor of Computer Application
From

Pt. RaviShankar Shukla University Raipur (C.G)


Year: 2014

Guide
Mrs Shikha Tamrakar

Submitted By:
Mayank Gupta
Roll No:
Submitted to
Century Cement College,Baikunth
Pt.RaviShankar Shukla University Raipur (C.G)

CERTIFICATE OF APPROVAL

This is to certify that the Project work entitled E-Ration Card System is carried out by Mr Mayank
Gupta a student of BCA-III year at Century Cement College is hereby approved as a credible in the
discipline of Computer Science & Information Techology for the award OF the degree of Bachelor
Of Computer Application during the year 2013-2014 from Pt. Ravishankar Shukla
University,Raipur(C.G).

CERTIFICATE
This is to certify that the Project entitled E-Ration Card System Submitted to the Century Cement
College Baikunth by Mr. Mayank Gupta Roll No in partial fulfillment for the
requirementrelating to nature and standard of the of Bachelor Of Computer Application
Degree by Pt. Ravishankar Shukla University,Raipur (CG) for the academic year2013-2014.

The project work has been carried out under my guidance.


Mrs. Shikha Tamrakar

CERTIFICATE OF EVALUTION
This is to certify that the Project work entitled E-Ration Card System is carried out by Mr. Mayank
Gupta a Student of BCA-III year of Century Cement College, after proper evalution and
examination, is hereby approved as a credible work in the discipline of Comaputer Science and
Information Technology and is done in satisfactory manner for its acceptance as a requisite for the
award of degree of Bachelor Of Computer Application during the year 2013-2014 from Pt.
Ravishankar Shukla University,Raipur (C.G).

Internal Examiner

External Examiner

DECLARATION
This is certify that tha Project work entitled E-Ration Card System which is submitted by me in the
partial fulfillment for the award of the degree of Bachelor of Computer Application, Century
Cement College,Baikunth comprises the original work carried out by me.
I further declare that the work reported in this project has not been submitted and will no be
submitted, either in part or infill for the award of any other degree or diploma in this Institute or any
other Institute or University.

Place :

Mayank Gupta

Date :..

Roll No.....

Index
Introduction
Objective
Existing system
Problem Definition
Requirement analysis
System analysis
H/W and S/W requirement
Database Design
E-R Diagram
Data Flow Diagram
Input Design
Output Design
Testing
Conclusion
References

Introduction
E-Ration Card System is complete end to end Online solution to cover all aspects of Ration Card
System day to day activity and Record of Each Record selling procedure for system

As the name specifies E-Ration System is a online System developed for managing various
activities in the Ration Card Department. For the past few this system are developed and uses
increasing rapidly. Thereby the numbers of Consumer card Shop are also increasing for the
accommodation of the people of city or village. And hence there is a lot of strain on the person in
this system who are manually works on it and softwares are not usually used in this context. This
particular project deals with the problems on managing all main aspects and avoids the problems
which occur when carried manually. Identification of the drawbacks of the existing system leads to
the designing of online system that will be compatible to the existing system with the system which
is more user friendly and more GUI oriented. We can improve the efficiency of the system, thus
overcome the drawbacks of the existing system.

Objective
1) This Online system to improve their services for all the Consumer Supplier Retailer and also
for the person of the admin department.
2) This also reduce the manual work of the persons in admin penal and the bundle of registers
that were search when to find the information for other record to manage, because through
this system you can store the data of those Consumer card shop product allocations of
product and card to the Consumer.
3) Through this one can check the personal profile of their and get information within few
minutes the data base of the system will help you to check a particular details
4) The system will help you to check validation of card while selling the product to that
consumer. And provide easy way to sell product with less entry
5) Supplier have not to wait for the shops Sales Details This system automatically manage the
stock of product using the record in database.
6) All user Admin, Supplier, Retailer can get details they want
7) Any record will be recognized from the ID number allocated to them. In the last this online
system will improve the management work related to Ration Card System.

Existing System

Existing system is based on manual work and all the process are done manually,
so they maintain registers and files for recording all the details of the system.
The shop Retailer maintain several registers for recording the entry of daily sales
List of card valid or Not etc.
The Supplier maintain several registers for recording the monthly Supplies and details of

Sales of Each shop And qty of product to be Supplied


Administration department maintain lot of record about all like shops card retailer suppliers

etc.
They have register for each type record.
Thus maintaining all Records such as Consumers Supplier Shop Retailer and changes in any
Record Calculation of supplies all work are done Manually.

PROBLEM DEFINITION
The phase of system analysis process deals with problems that are affecting in the current manual
system. The problems are those, which are affecting the organization in it daily routine work.
As the growing trend in InfoTech World of computers need of accuracy, perfect ness, speed and high
memory data storage is a must. Each and every problem must be solved with a least amount of time
and energy.
The problems faced by existing system are described as below:

Difficulty in Maintenance of Records.

Time Consuming.

Editing of data becomes a tedious job.

Mistakes Occurring in long Calculations [Total Qty, no of card calculations, etc.]

Proper Generation of Report (i.e. list of consumer list of Product ,Sales Bills etc.)

Lack of Efficiency

High Data Redundancy.

Data Inconsistency.
These are the problems faced during the real time execution of the existing system and this

awakened the idea of making a tool which negotiates the above drawbacks in a sophisticated yet
in a simple manner. The idea is nonetheless

REQUIREMENT ANALYSIS
Requirements Analysis is the process of understanding the customer needs and expectations from a
proposed system or application and is a well-defined stage in the Software Development Life Cycle
model. Requirements are a description of how a system should behave or a description of system
properties or attributes. It can alternatively be a statement of what an application is expected to do.
Given the multiple levels of interaction between users, business processes and devices in global
corporations today, there are simultaneous and complex requirements from a single application, from
various levels within an organization and outside it as well. The Software Requirements Analysis
Process covers the complex task of eliciting and documenting the requirements of all these users,
modeling and analyzing these requirements and documenting them as a basis for system design.
Software Requirements Analysis and Documentation Processes are critical to software project
success. Requirements engineering is an emerging field which deals with the systematic handling of
requirements.

User Requirements
User requirements are categorized by user type.

User

Able to search and view his or her own read only information.

Supplier

Able to access Sales Details of Retailers to make make monthly supply.

Generate Bills.

View and make various document and letter.

System Administrator

Add new consumer, supplier product shop Retailer etc.

assigns role and privileges.

Generate Reports

Database backup and maintenance.

Retailer

Able to access Details .

Generate Bills.

Sales product to Consumer.

Update the Received product.

Operational Requirements
The following requirements provide a high-level view of how the system will run:

A full Monthly backup is required.

Application should run in Client-Server architecture..

System Requirements
This project mainly aims to deal the operations
It consists of 2 modules.
o

User module

Administrator module

Supplier

Retailer

ADMINSTRATOR MODULE

Admin login

Master Block

Master Product

Master Card

Master Consumer

Master Supplier

Master Retailer and shop

Allocation

Report

SUPPLIER MODULE

login

Master Sales

Master search

Report

RETAILER MODULE

login

Master purchase

Master Sales

Report and bills

Master Sales

CONSIST OF

CONSIST OF

CONSIST OF

SYSTEM REQUIREMENT

Hardware requirement:This software requires following minimum hardware configuration:


Processor: Pentium-V
RAM: 512MB
Hard Disk: 100 GB
CD Drive
Monitor-15 Color Monitor
Keyboard
Mouse

Software Requirement:This software requires following minimum Software configuration:

Front End:
Microsoft Visual Basic 6.0
For fast development, easy to deployment and maintain.

Back End:
Ms Access 2007

Visual Basic 6.0


Visual Basic 6 is built on the Windows Server System to take major advantage of the OS and
which comes with a host of different servers which allows for building, deploying, managing
and maintaining Windows Based solutions. The Windows Server System is designed with
performance as priority and it provides scalability, reliability.
VISUAL BASIC is a high level programming language that provides users a powerful
graphical interface incorporating a lot of statements, functions, keywords and other features.
Besides, a very useful tool of learning programming skills for the novice, the professionals
assumes it as a grand platform for software development. This has predefined components and
controls. And these components n controls can be direct pasted on the form and the coding is
given inside the controls after double clicking on it.
It has many features such as it is Object Oriented, Event Driven, Debug Window, Tool Bars,
and Templates etc. In Visual Basic, the form is the basic entity that works as a container for all
the controls that make up the user interface. When a Visual Basic application is executing, each
window it displays is actually a form. Forms have a built-in functionality that is always
available without any programming effort on your part.
The advantage of VB 6 includes

Rapid Application Development (RAD) Support.

Powerful Windows-based Applications

Simplified Deployment

Powerful, Flexible, Simplified Data Access

Improved Coding

Direct Access to the OS Platform

Object-Oriented Constructs

COM Interoperability

MS Access 2007 : Microsoft Access 2007 is an object-relational database management system (ORDBMS) which
obeys all 12 Cods rules.This combines the relational Microsoft Jet Database Engine into Graphical
User Interface & Software Development tools. We have used Ms-Access as a back end for our
software. All the data are stored in the access in tables in the form of records. The connectivity is
provided between the front end (Visual Basic) and the back end (Ms-Access Relational Database).
This is a backend tool widely used for personal computer as a database. The relational database is
a well defined theoretical model of working with and managing a set of data that attends to three
specifying things.
- Data structures
- Data integrity
- Data manipulation.

Block:-

Card:-

Card Allotment

Consumer

Product

Product Allotment

Retailer

Shop

Login

Product supply

Product supplied

Consumer Sales

Con_Product

E-R Diagram
Code

Blockno

Conname

Blockname

Fathername
Lives

Consumer

Block

Conaddress

DOB

Has

retname

shopname

retcode
DOB
Holds

Retailer
Has

retaddre
ss

Shop

Fathername

Blockno

retcode

Belong/sale

Cardnamee
ss
Cardsr

sadd

ShopCode

Pur/sold

pname
Color

pcode

Unit
msr

Cardno

Card

Cardnor

Product
Sold
Cardtype

shopcode

Sent to
Supply

consumer

pcode
city
Entity
Attributes
Relationship

Supplier

suppcode
name

address

DATA FLOW DIAGRAM :


A data flow diagram is graphical tool used to describe and analyze movement of data through
a system. These are the central tool and the basis from which the other components are developed.
The transformation of data from input to output, through processed, may be described logically and
independently of physical components associated with the system. These are known as the logical
data flow diagrams. The physical data flow diagrams show the actual implements and movement of
data between people, departments and workstations. A full description of a system actually consists
of a set of data flow diagrams. Using two familiar notations Yourdon, Gane and Sarson notation
develops the data flow diagrams. Each component in a DFD is labeled with a descriptive name.
Process is further identified with a number that will be used for identification purpose.

The

development of DFDs is done in several levels. Each process in lower level diagrams can be broken
down into a more detailed DFD in the next level. The lop-level diagram is often called context
diagram. It consists a single process bit, which plays vital role in studying the current system. The
process in the context level diagram is exploded into other process at the first level DFD.
The idea behind the explosion of a process into more process is that understanding at one
level of detail is exploded into greater detail at the next level. This is done until further explosion is
necessary and an adequate amount of detail is described for analyst to understand the process.
A DFD is also known as a bubble Chart has the purpose of clarifying system
requirements and identifying major transformations that will become programs in system design. So
it is the starting point of the design to the lowest level of detail. A DFD consists of a series of
bubbles joined by data flows in the system.

DFD SYMBOLS :
In the DFD, there are four symbols
1. A square defines a source(originator) or destination of system data
2. An arrow identifies data flow. It is the pipeline through which the information flows
3. A circle or a bubble represents a process that transforms incoming data flow into outgoing data
flows.
4. An open rectangle is a data store, data at rest or a temporary repository of data

Process

Source or Destination of data


Data Flow

Data Flow Diagram

USER

Request

E-Ration
Card system

Response

USER

Context Diagram

/Customer/Card details
Supplies

Sales details

Login
User login
Admin
Verification

Menu
Selection

supplier

Menu

Retailer

Supplier
Shop

Product
Product supply
Shop Code Code ,qty and amt
Master Supply

Supplier

Receive
Supply

Payment
Retailer
Payment

Level 1 DFD Master sales

Consumer Sales: -

Card
Product

Consumer

Master Sales
Bill
Payment

Retailer

Consumer

Level 2 DFD Consumer Sales

Splash : -

Block : -

Card : -

Menu : -

Master Card : -

Consumer : -

Master Sales : -

Master Supplier : -

Master supply :-

Master Shop : -

Product Master : -

Splash Form

Description

Block Form

Description

Cards

Card Allotment :-

Master Product :-

Master Sales :=

\Consumer

Master Supply

Search : -

Product allotment ;_

Home Page :-

Users Form :-

Block with No of Consumer in Block;-

Supplier List :-

Consumer list ;-

Consumer Details :-

Cards Details :-

SYSTEM TESTING
System testing is the stage of implementation, which is aimed at ensuring that the system
works accurately and efficiently before live operation commences. Testing is the process of
executing the program with the intent of finding errors and missing operations and also a complete
verification to determine whether the objectives are met and the user requirements are satisfied. The
ultimate aim is quality assurance. Tests are carried out and the results are compared with the
expected document. In the case of erroneous results, debugging is done. Using detailed testing
strategies a test plan is carried out on each module. The various tests performed are unit testing,
integration testing and user acceptance testing.
Unit Testing
The software units in a system are modules and routines that are assembled and integrated to
perform a specific function. Unit testing focuses first on modules, independently of one another, to
locate errors. This enables, to detect errors in coding and logic that are contained within each
module. This testing includes entering data and ascertaining if the value matches to the type and size
supported by java. The various controls are tested to ensure that each performs its action as required.
Integration Testing
Data can be lost across any interface, one module can have an adverse effect on another, sub
functions when combined, may not produce the desired major functions. Integration testing is a
systematic testing to discover errors associated within the interface. The objective is to take unit
tested modules and build a program structure. All the modules are combined and tested as a whole.
Here the Server module and Client module options are integrated and tested. This testing provides
the assurance that the application is well integrated functional unit with smooth transition of data.

User Acceptance Testing


User acceptance of a system is the key factor for the success of any system. The system under
consideration is tested for user acceptance by constantly keeping in touch with the system users at time
of developing and making changes whenever required.

Testing Reports
1) COMPILATION TEST:
It was a good idea to do our stress testing early on, because it gave us time to fix some of the
unexpected deadlocks and stability problems that only occurred when components were
exposed to very high transaction volumes.

2) EXECUTION TEST:
This program was successfully loaded and executed. Because of good programming there
was no execution error.
3) OUTPUT TEST:
The successful output screens are placed in the output screens section.

Option Explicit
Public con As New ADODB.Connection
Public cmd As New ADODB.Command
Public rs, rs1 As New ADODB.Recordset
Public strins, strsel, s As String

Public Sub connectdb()


If con.State = 0 Then
con.Open "Provider=Microsoft.ACE.OLEDB.12.0;Persist Security Info=False;Data Source=" &
App.Path & "\db\db.accdb "
con.CursorLocation = adUseClient
End If
End Sub

Public Sub setdbobject()


Set con = New ADODB.Connection
Set cmd = New ADODB.Command
Set rs = New ADODB.Recordset
connectdb
cmd.ActiveConnection = con
cmd.CommandType = adCmdText
End Sub

Code for block Form: Private Sub Command1_Click()


strins = "INSERT INTO block VALUES('" & Me.Text1.Text & "','" & Me.Text2.Text & "')"
con.Execute (strsel)
getblock
End Sub
Private Sub Command2_Click()
If Command4.Visible = True Then
clear
getblock
End If
End Sub
Private Sub Command3_Click()
setdata
Command7.Visible = True
Command1.Visible = False
End Sub
Private Sub Command5_Click()
Set drblock.DataSource = rs
drblock.Show
End Sub
Private Sub Command6_Click()
frmmenu.Show
Unload Me
End Sub

Private Sub Command7_Click()


strins = "UPDATE ((block INNER JOIN consumer ON block.Blockno = consumer.blockno)" & _
" INNER JOIN retailer ON block.Blockno = retailer.blockno) " & _
" INNER JOIN shop ON (retailer.retcode = shop.retcode) " & _
" AND (block.Blockno = shop.blockno) SET block.Blockno = '" & Me.Text1.Text & "'," & _
" blockname = '" & Me.Text2.Text & "' " & _
" WHERE block.Blockno= '" & Text5.Text & "'"
con.Execute (strsel)
strins = "UPDATE (block INNER JOIN consumer ON block.Blockno = consumer.blockno) " & _
" INNER JOIN retailer ON block.Blockno = retailer.blockno " & _
" SET block.Blockno = '" & Text1.Text & "', " & _
" blockname = '" & Me.Text2.Text & "' " & _
" WHERE block.Blockno = '" & Text5.Text & "'"
con.Execute (strsel)
strins = "UPDATE block INNER JOIN consumer ON block.Blockno = consumer.blockno " & _
" SET block.Blockno = '" & Me.Text1.Text & "', " & _
" blockname = '" & Me.Text2.Text & "' " & _
" WHERE block.Blockno='" & Text5.Text & "'"
con.Execute (strsel)
strins = "UPDATE block INNER JOIN retailer ON block.Blockno = retailer.blockno " & _
" SET block.Blockno = '" & Me.Text1.Text & "', " & _
" blockname = '" & Me.Text2.Text & "' " & _
" WHERE block.Blockno='" & Text5.Text & "'"
con.Execute (strsel)
clear
Command7.Visible = False
Command1.Visible = True
End Sub

Private Sub Form_Load()


Form1.Show
main.Hide
Me.Top = 2000
Me.Left = 4000
'called to connect to database
setdbobject
getblock

'called to sets database object


'called to gets All block to grid

Combo1.Text = "----------Select----------"
Combo1.AddItem "Block no"
Combo1.AddItem "Block Name"
Combo1.ListIndex = 0
End Sub
Private Sub Label10_Click()
If rs.BOF = True Then
Else
rs.MovePrevious
End If
End Sub
Private Sub Label10_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label10.BorderStyle = 1
End Sub
Private Sub Label10_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label10.BorderStyle = 0
End Sub

Private Sub Label11_Click()


If rs.EOF = False Then
Else
rs.MoveNext
End If
End Sub
Private Sub Label11_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label11.BorderStyle = 1
End Sub
Private Sub Label11_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label11.BorderStyle = 0
End Sub
Private Sub Label12_Click()
rs.MoveLast
End Sub
Private Sub Label12_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label12.BorderStyle = 1
End Sub
Private Sub Label12_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label12.BorderStyle = 0
End Sub
Private Sub Label9_Click()
rs.MoveFirst
End Sub

Private Sub Label9_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)


Label9.BorderStyle = 1
End Sub
Private Sub Label9_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label12.BorderStyle = 0
End Sub
Private Sub Text5_Change()
search
setgrid
End Sub
Private Sub getblock()
strsel = "SELECT block.*, tc.Total as Consumers " & _
"FROM block LEFT JOIN tc ON block.Blockno = tc.Blockno"
Set rs = con.Execute(strsel)
Set dg.DataSource = rs
setgrid
End Sub
Private Sub search()
If Combo1.ListIndex = 0 Then
s = "SELECT * FROM block WHERE Blockno LIKE '%" & Me.Text5.Text & "%'"
ElseIf Combo1.ListIndex = 1 Then
s = "SELECT * FROM block WHERE Blockname LIKE '%" & Me.Text5.Text & "%'"
End If
Set rs = con.Execute(strsel)
Set dg.DataSource = rs
setgrid
End Sub

Private Sub setdata()


With rs
Text1.Text = !blockno
Text2.Text = !blockname
Text5.Text = !blockno
End With
Command4.Visible = True
Command1.Visible = False
End Sub
Private Sub setgrid()
If rs.BOF = True Or rs.EOF = True Then
Else
dg.Columns(0).DataField = rs!blockno
dg.Columns(1).DataField = rs!blockname
dg.Columns(0).Width = 1000
dg.Columns(1).Width = 2000
dg.Columns(0).Caption = "Block No"
dg.Columns(1).Caption = "Block Name"
End If
End Sub
Private Sub clear()
Text1.Text = ""
Text2.Text = ""
getblock
End Sub

Private Sub Timer1_Timer()


Label3.ForeColor = vbRed
Timer1.Enabled = False
Timer2.Enabled = True
End Sub
Private Sub Timer2_Timer()
Label3.ForeColor = vbBlue
Timer1.Enabled = True
Timer2.Enabled = False
End Sub

Code for consumer Form :=


Private Sub Command1_Click()
strins = "INSERT INTO consumer VALUES('" & Me.Text1.Text & "','" & Me.Text2.Text & "', " & _
" '" & Me.Text3.Text & "'," & Me.DTPicker1.Value & ", " & _
" '" & Me.Text4.Text & "','" & Me.Combo1.Text & "', " & _
" ' " & Val(Me.Text7.Text) & " ','" & Me.Text6.Text & "', " & _
" '" & Me.Text1.Text & "','" & Me.Combo3.Text & "'," & _
" '" & Me.Text9.Text & "','" & s & "'," & _
" '" & Me.Combo4.Text & "','" & Me.Text9.Text & "'," & _
" '" & Text10.Text & "')"
con.Execute (strins)
clear
End Sub
Private Sub Command3_Click()
setval
End Sub
Private Sub Command6_Click()
main.Show
End Sub
Private Sub Command7_Click()
CommonDialog1.DialogTitle = "Select Image"
CommonDialog1.ShowOpen
Label21.Caption = CommonDialog1.FileName
s = CommonDialog1.FileTitle
Image1.Picture = LoadPicture(CommonDialog1.FileName)
FileCopy CStr(Label21.Caption), "" & App.Path & "\dbpic\" & CommonDialog1.FileTitle & ""
End Sub

Private Sub Label10_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)


Label10.BorderStyle = 1
End Sub
Private Sub Label10_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label10.BorderStyle = 0
End Sub
Private Sub Label11_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label11.BorderStyle = 1
End Sub
Private Sub Label11_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label11.BorderStyle = 0
End Sub
Private Sub Label12_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label12.BorderStyle = 1
End Sub
Private Sub Label12_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label12.BorderStyle = 0
End Sub
Private Sub Label13_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label13.BorderStyle = 1
End Sub

Private Sub Label13_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)


Label13.BorderStyle = 0
End Sub
Private Sub Text5_Change()
search
End Sub
Private Sub Command2_Click()
clear
End Sub
Private Sub Form_Load()
Form1.Show
main.Hide
Unload main
Me.Top = 1500
Me.Left = 1500
setdbobject
With Combo2
.Text = "----------Select----------"
.AddItem "ID"
.AddItem "Name"
.AddItem "Block No"
End With
With Combo3
.Text = "----Select-----"
.AddItem "Male"
.AddItem "Female"
End With

With Combo4
.Text = "----Select-----"
.AddItem "Gen"
.AddItem "OBC"
.AddItem "ST/SC"
End With
Combo2.ListIndex = 0
Command4.Visible = False
clear
End Sub
Private Sub conlist()
strsel = "Select * from consumer"
Set rs = con.Execute(strsel)
Set dg.DataSource = rs
setgrid
End Sub
Private Sub Label10_Click()
rs.MoveFirst
End Sub

Private Sub Label11_Click()


rs.MovePrevious
End Sub
Private Sub Label12_Click()
rs.MoveNext
End Sub
Private Sub Label13_Click()
rs.MoveLast
End Sub
Private Sub clear()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
dtpicker1value = Date
Text6.Text = ""
Text7.Text = ""
Combo1.clear
Combo1.Text = "----------Select----------"
Combo4.Text = "---Select----"
addblock
End Sub

Private Sub addblock()


strsel = "Select * from block"
Set rs = con.Execute(strsel)
Combo1.clear
While rs.EOF = False
Combo1.AddItem rs!blockno
rs.MoveNext
Wend
conlist
End Sub
Private Sub search()
If Combo2.ListIndex = 0 Then
strsel = "Select * from Consumer where code like '%" & Text5.Text & "%'"
ElseIf Combo2.ListIndex = 1 Then
strsel = "Select * from Consumer where conname like '%" & Text5.Text & "%'"
ElseIf Combo2.ListIndex = 2 Then
strsel = "Select * from Consumer where blockno like '%" & Text5.Text & "%'"
End If
Set rs = con.Execute(strsel)
Set dg.DataSource = rs
setgrid
End Sub
Private Sub setval()
With rs
Text5.Text = !code
Text1.Text = !code
Text2.Text = !conname
Text3.Text = !fathername
Text4.Text = !conaddress

Text6.Text = !houseno
Text7.Text = !phone
Text8.Text = !occupation
Text9.Text = !annual_salary
Text10.Text = !members
dtpicker1value = !dob
Combo1.Text = !blockno
Combo3.Text = !gender
Combo4.Text = !category
s = rs!pic_path
'Image1.Picture = LoadPicture("" & App.Path & "\dbpic\" '" & s & "'.jpg ")
End With
End Sub
Private Sub setgrid()
Dim i As Integer
For i = o To 6 Step 1
dg.Columns(i).DataField = rs.Fields(i)
Next i
dg.Columns(0).Caption = "ID"
dg.Columns(0).Width = 1000
dg.Columns(1).Caption = "Name"
dg.Columns(2).Caption = "Father Name"
dg.Columns(3).Caption = "Date Of Birth"
dg.Columns(4).Caption = "Address"
dg.Columns(5).Caption = "Block No"
End Sub

Private Sub Timer1_Timer()


Label6.ForeColor = vbRed
Timer1.Enabled = False
Timer2.Enabled = True
End Sub
Private Sub Timer2_Timer()
Label6.ForeColor = vbBlue
Timer1.Enabled = True
Timer2.Enabled = fasle
End Sub

Code for Card :Private Sub Form_Load()


Form1.Show
Me.Top = 2500
Me.Left = 3500
setdbobject
Combo1.Text = "---------Select---------"
Combo1.AddItem "Card No"
Combo1.AddItem "Card Name"
Combo1.AddItem "Type "
Combo1.ListIndex = 0
cardlist
End Sub
Private Sub Command1_Click()
strins = "INSERT INTO card VALUES('" & Me.Text1.Text & "','" & Me.Text2.Text & "','" &
Me.Text3.Text & "','" & Me.Text4.Text & "')"
con.Execute (strins)
clear
End Sub
Private Sub Command3_Click()
With rs
Text1.Text = !cardsr
Text2.Text = !cardname
Text3.Text = !cardtype
Text4.Text = !cardcolor
Text5.Text = !cardsr
Command4.Visible = True
Command1.Visible = False
End With

End Sub
Private Sub Command4_Click()
strins = "UPDATE (card INNER JOIN Card_allotment ON card.cardsr = Card_allotment.Cardsr) "
&_
" INNER JOIN product_allotment ON card.cardsr = product_allotment.cardsr " & _
" SET card.cardsr = '" & Text1.Text & "', " & _
" card.cardname = '" & Text2.Text & "', " & _
" card.cardtype = '" & Text3.Text & "', " & _
" card.cardcolor = '" & Text4.Text & "' " & _
" WHERE card.cardsr='" & Text5.Text & "'"
con.Execute (strins)
strins = "UPDATE card INNER JOIN product_allotment ON card.cardsr = product_allotment.cardsr
"&_
" SET card.cardsr = '" & Text1.Text & "', " & _
" card.cardname = '" & Text2.Text & "', " & _
" card.cardtype = '" & Text3.Text & "', " & _
" card.cardcolor = '" & Text4.Text & "' " & _
" WHERE card.cardsr='" & Text5.Text & "'"
con.Execute (strins)
strins = "UPDATE card INNER JOIN card_allotment ON card.cardsr = card_allotment.cardsr " & _
" SET card.cardsr = '" & Text1.Text & "', " & _
" card.cardname = '" & Text2.Text & "', " & _
" card.cardtype = '" & Text3.Text & "', " & _
" card.cardcolor = '" & Text4.Text & "' " & _
" WHERE card.cardsr='" & Text5.Text & "'"
con.Execute (strins)
clear

Command4.Visible = False
Command1.Visible = True
End Sub
Private Sub Text5_Change()
search
End Sub
Private Sub Command5_Click()
Set drcard.DataSource = rs
drcard.Show
End Sub
Private Sub Command6_Click()
frmmenu.Show
Unload Me
End Sub
Private Sub Label9_Click()
rs.MoveFirst
End Sub
Private Sub Label9_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label10.BorderStyle = 1
End Sub
Private Sub Label9_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label10.BorderStyle = 0
End Sub
Private Sub Label10_Click()

rs.MovePrevious
End Sub
Private Sub Label10_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label10.BorderStyle = 1
End Sub
Private Sub Label10_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label10.BorderStyle = 0
End Sub

Private Sub Label11_Click()


rs.MoveNext
End Sub
Private Sub Label11_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label11.BorderStyle = 1
End Sub
Private Sub Label11_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label11.BorderStyle = 0
End Sub
Private Sub Label12_Click()
rs.MoveNext
End Sub

Private Sub Label12_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)


Label12.BorderStyle = 1
End Sub
Private Sub Label12_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label12.BorderStyle = 0
End Sub
Private Sub clear()
Text2.Text = ""
Text1.Text = ""
Text3.Text = ""
Text4.Text = ""
cardlist
End Sub
Private Sub cardlist()
strsel = "SELECT card.cardname as Name, card.Cardtype as Type, card.cardcolor as Color , " & _
" total_card.[Total Of Cardtype] as Total" & _
" FROM card LEFT JOIN total_card ON card.cardsr = total_card.cardsr"
Set rs = con.Execute(strse)
Set dg.DataSource = rs
Label16.Caption = rs.RecordCount & " Record"
setgrid
End Sub
Private Sub search()
If Combo1.ListIndex = 0 Then
strsel = "Select * from Card where cardname like '" & Text5.Text & "%'"
ElseIf Combo1.ListIndex = 1 Then
strsel = "Select * from Card where cardsr like '" & Text5.Text & "%'"

ElseIf Combo1.ListIndex = 2 Then


strsel = "Select * from Card where cardtype like '" & Text5.Text & "%'"
End If
Set rs = con.Execute(strse)
Set dg.DataSource = rs
End Sub
Private Sub setgrid()
If rs.BOF = True Or rs.EOF = True Then
Else
dg.Columns(0).Width = 1500
dg.Columns(1).Width = 1500
dg.Columns(2).Width = 1000
End If
End Sub
Private Sub Timer1_Timer()
If Label5.Height >= 375 Then
Label5.Height = 0
Else
Label5.Height = Label5.Height + 50
End If
End Sub

Private Sub Timer2_Timer()


Label16.Visible = True
Timer2.Enabled = False
Timer3.Enabled = True
End Sub
Private Sub Timer3_Timer()
Label16.Visible = False
Timer2.Enabled = True
Timer3.Enabled = False
End Sub

Code for Retailer ;Private Sub search()


If Combo2.ListIndex = 0 Then
strsel = "Select * from retailer where retcode like '%" & Text5.Text & "%'"
ElseIf Combo2.ListIndex = 1 Then
strsel = "Select * from retailer where retname like '%" & Text5.Text & "%'"
ElseIf Combo2.ListIndex = 2 Then
strsel = "Select * from retailer where blockno like '%" & Text5.Text & "%'"
End If
Set rs = con.Execute(strsel)
Set dg.DataSource = rs
setgrid
End Sub
Private Sub Command1_Click()
strins = "INSERT INTO retailer VALUES('" & Me.Text1.Text & "','" & Me.Text2.Text & "','" &
Me.Text3.Text & "'," & Me.DTPicker1.Value & ",'" & Me.Text4.Text & "','" & Me.Combo1.Text &
"','" & Text7.Text & "','" & Text6.Text & "','" & Text1.Text & "','" & Combo3.Text & "','" &
CommonDialog1.FileTitle & "')"
con.Execute (strsel)
clear
End Sub
Private Sub Command2_Click()
clear
End Sub
Private Sub Command3_Click()
setval
End Sub

Private Sub Command6_Click()


frmmenu.Show
Unload Me
End Sub
Private Sub Command7_Click()
CommonDialog1.DialogTitle = "Select Image"
CommonDialog1.ShowOpen
Label21.Caption = CommonDialog1.FileName
s = CommonDialog1.FileTitle
Image1.Picture = LoadPicture(CommonDialog1.FileName)
FileCopy CStr(Label21.Caption), "" & App.Path & "\dbpic\" & CommonDialog1.FileTitle & ""
End Sub
Private Sub Form_Load()
Form1.Show
Me.Top = 1500
Me.Left = 3000
setdbobject
clear
Combo2.ListIndex = 0
End Sub
Private Sub Timer1_Timer()
Label6.ForeColor = vbRed
Timer1.Enabled = False
Timer2.Enabled = True
End Sub
Private Sub Timer2_Timer()
Label6.ForeColor = vbBlue
Timer1.Enabled = True

Timer2.Enabled = fasle
End Sub
Private Sub Label10_Click()
rs.MovePrevious
End Sub
Private Sub Label11_Click()
rs.MoveNext
End Sub
Private Sub Label12_Click()
If rs.EOF Then rs.MoveLast
End Sub
Private Sub Label9_Click()
If rs.BOF Then rs.MoveFirst
End Sub
Private Sub clear()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text7.Text = ""
Text6.Text = ""
Combo2.AddItem "ID "
Combo2.AddItem "Retailer Name"
Combo2.AddItem "Phone "
Combo2.AddItem "Address "
dtpicker1value = Date
addblock

retailerlist
Combo1.clear
Combo1.Text = "----------Select----------"
setgrid
End Sub
Private Sub addblock()
strsel = "Select blockno ,blockname FROM block"
Set rs = con.Execute(strsel)
Combo1.clear
While rs.EOF = False
Combo1.AddItem rs!blockno
rs.MoveNext
Wend
End Sub
Private Sub Text5_Change()
search
End Sub
Private Sub setval()
Command4.Enabled = True
Command1.Enabled = False
Command4.Visible = True
Command1.Visible = False
End Sub

Private Sub retailerlist()


strsel = "select * from retailer"
Set rs = con.Execute(strsel)
Set dg.DataSource = rs
End Sub
Private Sub setgrid()
Dim i As Integer
For i = o To 6 Step 1
dg.Columns(i).DataField = rs.Fields(i)
Next i
dg.Columns(0).Caption = "ID"
dg.Columns(1).Caption = "Name"
dg.Columns(2).Caption = "Father Name"
dg.Columns(3).Caption = "Date Of Birth"
dg.Columns(4).Caption = "Address"
End Sub

Code for Master Card ;Private Sub Combo3_LostFocus()


If Combo3.Text = "---------Select---------" Then
Else
strsel = "select * from consumer where code ='" & Combo3.Text & "'"
Set rs = con.Execute(strse)
s1 = rs!blockno
strsel = "select * from shop where blockno ='" & s1 & "'"
Set rs = con.Execute(strse)
Text3.Text = rs!shopcode
cardlist
End If
End Sub
Private Sub Command1_Click()
If Text1.Text = "" Or Text2.Text = "" Then
Label14.Caption = "Fill All Details"
Else
strsel = "select cardsr from card where cardname ='" & Combo1.Text & "'"
Set rs = con.Execute(strse)
s = rs!cardsr
strins = "INSERT INTO card_allotment VALUES('" & Me.Text1.Text & "'," & _
"'" & Me.Text2.Text & "'" & _
",'" & s & "'," & _
"'" & Me.Combo3.Text & "'," & _
"'" & Me.Text3.Text & "'," & _
"'" & Me.DTPicker1.Value & "')"
con.Execute (strins)
clear
End If
Text1.SetFocus

End Sub
Private Sub Command3_Click()
With rs
Text1.Text = !allotmentno
Text2.Text = !cardno
dtpicker1value = !allotdate
Combo3.Text = !code
Text3.Text = !shopcode
Combo1.Text = !cardname
Text5.Text = Text1.Text
End With
Command4.Visible = True
Command1.Visible = False
End Sub
Private Sub Command6_Click()
frmmenu.Show
Unload Me
End Sub
Private Sub Form_Load()
Form1.Show
Me.Top = 2000
Me.Left = 3000
setdbobject
clear
End Sub
Private Sub Label10_Click()
rs.MovePrevious
End Sub

Private Sub Label11_Click()


rs.MoveNext
End Sub
Private Sub Label12_Click()
If rs.EOF Then
Else
rs.MoveLast
End If
End Sub
Private Sub Label9_Click()
If rs.BOF Then
Else
rs.MoveFirst
End If
End Sub
Private Sub addconsumer()
strsel = "Select * from consumer"
Set rs = con.Execute(strse)
Combo3.clear
While rs.EOF = False
Combo3.AddItem rs!code
rs.MoveNext
Wend
End Sub
Private Sub addcard()
strsel = "Select * from card"
Set rs = con.Execute(strse)
Combo1.clear

While rs.EOF = False


Combo1.AddItem rs!cardname
rs.MoveNext
Wend
End Sub
Private Sub clear()
Combo4.AddItem "Allotment NN"
Combo4.AddItem "Consumer name"
Combo4.AddItem "Card Type"
Command4.Visible = False
Command1.Visible = True
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label14.Caption = ""
addcard
addconsumer
cardlist
Combo1.Text = "---------Select---------"
Combo3.Text = "---------Select---------"
Combo4.ListIndex = 0
End Sub
Private Sub cardlist()
strsel = "SELECT Card_allotment.Allotmentno, Card_allotment.Cardno,
consumer.conname,card.cardname,
Card_allotment.Allotdate,card.cardsr,consumer.code,Card_allotment.shopcode " & _
"FROM consumer INNER JOIN (card INNER JOIN Card_allotment ON card.cardsr =
Card_allotment.Cardsr) ON consumer.code = Card_allotment.code"
Set rs = con.Execute(strse)

Set dg.DataSource = rs
setgrid
End Sub
Private Sub setgrid()
dg.Columns(0).Width = 2000
dg.Columns(1).Width = 2000
dg.Columns(2).Width = 2000
dg.Columns(3).Width = 2000
dg.Columns(4).Width = 2000
dg.Columns(0).Caption = "Allotment No"
dg.Columns(1).Caption = "Card No"
dg.Columns(2).Caption = "Consumer "
dg.Columns(3).Caption = "Card Name"
dg.Columns(4).Caption = "Alloted Date"
If rs.BOF = True Or rs.EOF = True Then
Label13.Caption = "Record Not Found"
Else
Label13.Caption = rs.RecordCount & " Record Found"
dg.Columns(0).DataField = rs!allotmentno
dg.Columns(1).DataField = rs!cardno
dg.Columns(2).DataField = rs!conname
dg.Columns(3).DataField = rs!cardname
dg.Columns(4).DataField = rs!allotdate
End If
dg.Caption = "Card Alloted Details"
End Sub

Private Sub search()


strsel = "SELECT Card_allotment.Allotmentno, Card_allotment.Cardno, consumer.conname,
card.cardname, Card_allotment.Allotdate, Card_allotment.shopcode, Card_allotment.Cardsr,
Card_allotment.code" & _
" FROM consumer INNER JOIN (card INNER JOIN Card_allotment ON card.cardsr =
Card_allotment.Cardsr) ON consumer.code = Card_allotment.code where allotmentno like '" &
Text5.Text & "%'"
Set rs = con.Execute(strse)
Set dg.DataSource = rs
Label13.Caption = rs.RecordCount & " Record Found"
End Sub
Private Sub Text1_Change()
Text2.Text = Text1.Text
End Sub
Private Sub Text5_Change()
search
setgrid
End Sub

Code for master Supply:Private Sub clear()


DTPicker1.Value = Date
Text1.Text = ""
Text2.Text = ""
new_invoice
addshop
End Sub
Private Sub new_invoice()
strsel = "SELECT * FROM product_supply"
Set rs = con.Execute(strsel)
If rs.EOF = False Then
rs.MoveLast
Text3.Text = Val(rs!Invoiceno) + 1
Else
Text3.Text = "1"
End If
End Sub
Private Sub addshop()
strsel = "SELECT shopcode FROM shop"
Set rs = con.Execute(strsel)
While rs.EOF = False
Combo1.AddItem rs!shopcode
rs.MoveNext
Wend
End Sub
Private Sub showlist()
strsel = "select * form bill_details where invoiceno like '" & Val(Text3.Text) & "'"
Set rs = con.Execute(strsel)
Set dg.DataSource = rs
End Sub

Private Sub Combo1_Click()


strsel = "SELECT shopcode as Shop,pname as Product,total as Qty,total_amt as Amt from
shop_total_qty_amt where shopcode like '" & Combo1.Text & "'"
Set rs = con.Execute(strsel)
Set dg.DataSource = rs
dg.Caption = "Shop : " & Combo1.Text
add_product
End Sub
Private Sub Combo2_Click()
strsel = "Select * from check_supplied where status like 'Pending' and shopcode like '" &
Combo1.Text & "' and pname like '" & Combo2.Text & "'"
Set rs = con.Execute(strsel)
If rs.RecordCount = 0 Then
strsel = "SELECT shopcode as Shop,pname as Product,total as Qty,total_amt as Amt from
shop_total_qty_amt where shopcode like '" & Combo1.Text & "' and pname like '" & Combo2.Text
& "'"
Set rs = con.Execute(strsel)
Text1.Text = rs!qty
Text2.Text = rs!amt
Text4.Text = Val(Text4.Text) + Val(Text2.Text)
Else
MsgBox "Product has been supplied"
End If
End Sub
Private Sub Command2_Click()
strsel = "Select invoiceno,supp_date from product_supply where invoiceno like '" & Val(Text3.Text)
& "'"
Set rs = con.Execute(strsel)
If rs.RecordCount = 0 Then
strins = "insert into product_supply(invoiceno,supp_date,shopcode,status) values " & _

" ( '" & Val(Text3.Text) & "', " & _


" '" & DTPicker1.Value & "', " & _
" '" & Combo1.Text & "', " & _
" 'Pending') "
con.Execute (strins)
End If
strsel = "select pcode from product where '" & Combo2.Text & "'"
Set rs = con.Execute(strsel)
s = rs!pcode
Set rs = con.Execute(strsel)
strins = "insert into supplied_product values " & _
" ( '" & Val(Text3.Text) & "', " & _
" '" & s & "', " & _
" '" & Text1.Text & "', " & _
" '" & Text2.Text & "') "
con.Execute (strins)
Combo2.SetFocus
Text1.Text = ""
Text2.Text = ""
End Sub
Private Sub Command3_Click()
Command2_Click
clear
new_invoice
details
End Sub
Private Sub Command4_Click()
frmmenu.Show
Unload Me

End Sub
Private Sub Form_Load()
Form1.Show
Me.Top = 2500
Me.Left = 2500
setdbobject
clear
details
End Sub
Private Sub Timer1_Timer()
Label9.ForeColor = vbRed
Timer1.Enabled = False
Timer2.Enabled = True
End Sub
Private Sub Timer2_Timer()
Label9.ForeColor = vbBlue
Timer1.Enabled = True
Timer2.Enabled = False
End Sub
Private Sub details()
strsel = "SELECT shopcode as Shop,pname as Product,total as Qty,total_amt as Amt from
shop_total_qty_amt "
Set rs = con.Execute(strsel)
Set dg.DataSource = rs
End Sub

Private Sub add_product()


Combo2.clear
While rs.EOF = False
Combo2.AddItem rs!product
rs.MoveNext
Wend
End Sub

Code for Sales:Private Sub Combo1_Click()


addproduct
End Sub
Private Sub new_invoice()
strsel = "SELECT * FROM consumer_sales"
Set rs = con.Execute(strsel)
If rs.EOF = False Then
rs.MoveLast
Text4.Text = Val(rs!bill_no) + 1
Else
Text4.Text = "1"
End If
End Sub
Private Sub Timer1_Timer()
Label9.ForeColor = vbRed
Timer1.Enabled = False
Timer2.Enabled = True
End Sub
Private Sub Timer2_Timer()
Label9.ForeColor = vbBlue
Timer1.Enabled = True
Timer2.Enabled = False
End Sub
Private Sub Combo2_Click()
strsel = "select pname as Product,qty as Qty ,amt as Amt from query8 " & _
" where username like '" & frmmenu.Label3.Caption & "' and cardno like '" & Combo1.Text & "'
and pname like '" & Combo2.Text & "'"

Set rs = con.Execute(strsel)
Text1.Text = rs!qty
Text2.Text = rs!amt
Text3.Text = Val(Text3.Text) + Val(Text2.Text)
End Sub
Private Sub Command2_Click()
strsel = "select bill_no from consumer_sales where bill_no like '" & Text4.Text & "'"
Set rs = con.Execute(strsel)
If rs.RecordCount = 0 Then
strins = "insert into consumer_sales values " & _
" ( '" & Val(Text4.Text) & "', " & _
" '" & DTPicker1.Value & "', " & _
" '" & s & "', " & _
" '" & Combo1.Text & "','0')"
con.Execute (strins)
Else
End If
strsel = "Select pcode from product where pname like '" & Combo2.Text & "'"
Set rs = con.Execute(strsel)
s = rs!pcode
strsel = "select * from con_product where bill_no like '" & Text4.Text & "' and pcode like '" & s &
"'"
Set rs = con.Execute(strsel)
If rs.RecordCount = 0 Then
strins = "insert into con_product values" & _
" ( '" & Val(Text4.Text) & "', " & _
" '" & s & "', " & _
" '" & Text1.Text & "', " & _
" '" & Text2.Text & "') "

con.Execute (strins)
Else
MsgBox "Product has been sold", vbInformation, "ERS"
End If
Combo2.SetFocus
Text1.Text = ""
Text2.Text = ""
Combo2.Text = "------Select---------"
End Sub
Private Sub Command3_Click()
strins = "UPDATE Consumer_sales INNER JOIN con_product ON Consumer_sales.bill_no =
con_product.bill_no SET " & _
" total_amt='" & Val(Text3.Text) & "' where Consumer_sales.bill_no like '" & Val(Text4.Text) & "'"
con.Execute (strins)
Combo1.SetFocus
Text1.Text = ""
Text2.Text = ""
Text3.Text = 0
Combo1.Text = "------Select---------"
End Sub
Private Sub Command4_Click()
frmmenu.Show
Unload Me
End Sub

Private Sub Form_Load()


Form1.Show
setdbobject
clear
Me.Top = 2500
Me.Left = 2500
End Sub
Private Sub addcard()
strsel = "select distinct cardno as Card from query8 where username like 'retailer3'" 'like '" &
frmmenu.Label3.Caption & "'"
Set rs = con.Execute(strsel)
Combo1.clear
While rs.EOF = False
Combo1.AddItem rs!card
rs.MoveNext
Wend
End Sub
Private Sub addproduct()
strsel = "select retcode,pname as Product,qty as Qty ,amt as Amt from query8 " & _
" where username like 'retailer3' and cardno like '" & Combo1.Text & "'"
Set rs = con.Execute(strsel)
s = rs!Retcode
Combo2.clear
While rs.EOF = False
Combo2.AddItem rs!product
rs.MoveNext
Wend
End Sub

Private Sub clear()


DTPicker1.Value = Date
Combo1.Text = "------Select------"
Combo2.Text = "------Select------"
addcard
Text1.Text = ""
Text2.Text = ""
new_invoice
End Sub

Code for supplier:Private Sub Command10_Click()


Set supp_list.DataSource = rs
supp_list.Show
End Sub
Private Sub Command11_Click()
Set suppsingle.DataSource = rs
suppsingle.Show
End Sub
Private Sub Command5_Click()
strins = "INSERT INTO supplier VALUES('" & Me.Text1.Text & "'," & _
"'" & Me.Text2.Text & "'," & _
"'" & Me.Text3.Text & "'," & _
"'" & Me.Text5.Text & "'," & _
"'" & Me.Text4.Text & "'," & _
"'" & Me.Text7.Text & "'," & _
"'" & Me.Text1.Text & "')"
con.Execute (strins)
For i = 0 To List2.ListCount - 1
strsel = "SELECT * FROM Product WHERE pname LIKE '" & List2.List(i) & "'"
Set rs = con.Execute(strse)
s = rs!pcode
strins = "INSERT INTO supp_product VALUES('" & Me.Text1.Text & "'," & _
" '" & s & "') "
con.Execute (strins)
Next i
clear
End Sub

Private Sub Command7_Click()


Combo1.ListIndex = 0
With rs
Text6.Text = !suppcode
Text1.Text = !suppcode
Text2.Text = !suppname
Text3.Text = !company
Text4.Text = !suppcity
Text5.Text = !suppadd
Text7.Text = !contact
End With
List1.clear
strsel = "SELECT supp_product.suppcode, product.pname" & _
" FROM product INNER JOIN supp_product ON product.pcode = supp_product.pcode WHERE
suppcode='" & Text1.Text & "'"
Set rs = con.Execute(strsel)
While rs.EOF = False
List1.AddItem CStr(rs!pname)
rs.MoveNext
Wend
Command5.Visible = False
Command8.Visible = True
End Sub
Private Sub Command8_Click()
s = Text1.Text
strins = "UPDATE supplier INNER JOIN supp_product ON supplier.suppcode =
supp_product.suppcode SET " & _
"supplier.suppcode='" & Text1.Text & "'," & _
"suppname= '" & Me.Text2.Text & "'," & _
"suppadd= '" & Me.Text5.Text & "'," & _

"company= '" & Me.Text3.Text & "'," & _


"suppcity= '" & Me.Text4.Text & "'," & _
"contact= '" & Me.Text7.Text & "'," & _
"username= '" & Me.Text1.Text & "'" & _
" WHERE supplier.suppcode='" & Me.Text6.Text & "'"
con.Execute (strins)
clear
Command8.Visible = False
Command5.Visible = True
End Sub
Private Sub Command9_Click()
frmmenu.Show
Unload Me
End Sub
Private Sub Form_Load()
Form1.Show
Me.Top = 1500
Me.Left = 3000
setdbobject
clear
Combo1.Text = "--------Select----------"
Combo1.AddItem "Code"
Combo1.AddItem "Name"
Combo1.AddItem "City"
Combo1.AddItem "Address"
Combo1.ListIndex = 0
End Sub

Private Sub Command1_Click()


List2.AddItem CStr(List1.List(List1.ListIndex))
List1.RemoveItem (List1.ListIndex)
End Sub
Private Sub Command2_Click()
Dim i As Integer
For i = 0 To List1.ListCount - 1
List2.AddItem CStr(List1.List(i))
Next i
List1.clear
End Sub
Private Sub Command3_Click()
List1.AddItem CStr(List2.List(List2.ListIndex))
List2.RemoveItem (List2.ListIndex)
End Sub
Private Sub Command4_Click()
For i = 0 To List1.ListCount - 1
List1.AddItem CStr(List2.List(i))
Next i
List2.clear
End Sub
Private Sub Command6_Click()
clear
End Sub

Private Sub Label10_Click()


If Not rs.BOF Then
rs.MovePrevious
Else
End If
End Sub
Private Sub Label10_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label10.BorderStyle = 1
End Sub
Private Sub Label10_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label10.BorderStyle = 0
End Sub
Private Sub Label11_Click()
If Not rs.EOF Then
rs.MoveNext
Else
End If
End Sub
Private Sub Label11_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label11.BorderStyle = 1
End Sub
Private Sub Label11_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label11.BorderStyle = 0
End Sub

Private Sub Label12_Click()


rs.MoveLast
End Sub
Private Sub Label12_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label12.BorderStyle = 1
End Sub
Private Sub Label12_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label12.BorderStyle = 0
End Sub
Private Sub Label9_Click()
rs.MoveFirst
End Sub
Private Sub Label9_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label9.BorderStyle = 1
End Sub
Private Sub Label9_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label9.BorderStyle = 0
End Sub
Private Sub Text6_Change()
search
End Sub

Private Sub addproduct()


strsel = "SELECT * FROM product"
Set rs = con.Execute(strsel)
List1.clear
While rs.EOF = False
List1.AddItem CStr(rs!pname)
rs.MoveNext
Wend
End Sub
Private Sub clear()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
addproduct
supplist
End Sub
Private Sub supplist()
strsel = "SELECT * FROM supplier "
Set rs = con.Execute(strsel)
Set dg.DataSource = rs
setgrid
End Sub
Private Sub setgrid()
lbl.Caption = rs.RecordCount & " Record Found"

Dim i As Integer
For i = 0 To 5 Step 1
dg.Columns(i).DataField = rs.Fields(i)
Next i
dg.Columns(0).Caption = "Code"
dg.Columns(1).Caption = "Name"
dg.Columns(2).Caption = "Company"
dg.Columns(3).Caption = "Address"
dg.Columns(4).Caption = "City"
dg.Columns(5).Caption = "Contact"
End Sub
Private Sub search()
If Combo1.ListIndex = 0 Then
strsel = "select * from supplier where suppcode like '" & Text6.Text & "%'"
ElseIf Combo1.ListIndex = 1 Then
strsel = "select * from supplier where suppname like '" & Text6.Text & "%'"
ElseIf Combo1.ListIndex = 2 Then
strsel = "select * from supplier where suppcity like '" & Text6.Text & "%'"
ElseIf Combo1.ListIndex = 3 Then
strsel = "select * from supplier where suppadd like '" & Text6.Text & "%'"
ElseIf Combo1.ListIndex = 4 Then
strsel = "select * from supplier where contact like '" & Text6.Text & "%'"
End If
Set rs = con.Execute(strsel)
Set dg.DataSource = rs
If Not rs.RecordCount = 0 Then setgrid
End Sub

Private Sub Timer1_Timer()


If Label17.Height >= 375 Then
Label17.Height = 0
Else
Label17.Height = Label17.Height + 50
End If
End Sub
Private Sub Timer2_Timer()
lbl.Visible = True
Timer2.Enabled = False
Timer3.Enabled = True
End Sub
Private Sub Timer3_Timer()
lbl.Visible = False
Timer2.Enabled = True
Timer3.Enabled = False
End Sub

Code for Splash :Dim i As Integer


Private Sub Form_Load()
Load masterpage
masterpage.Show
Me.Top = 2500
Me.Left = 5500
For i = 0 To 14 Step 1
Shape2(i).BackColor = &HFF8080
Shape2(i).BorderColor = &HFF8080
Next i
Timer1.Enabled = True
i=0
End Sub
Private Sub Timer1_Timer()
If i = 15 Then
Timer1.Enabled = False
Unload Me
main.Show
Else
Shape2(CInt(i)).BackStyle = 1
Shape2(CInt(i)).BackColor = &H8000000F
i=i+1
End If
End Sub

Code for Main:Private Sub Command1_Click()


logon
End Sub
Private Sub Command2_Click()
clear
End Sub
Private Sub Form_Activate()
Me.Hide
End Sub
Private Sub clear()
Text1.Text = ""
Text2.Text = ""
Combo1.clear
Combo1.Text = "--------Select--------"
With Combo1
.AddItem "Admin"
.AddItem "Supplier"
.AddItem "Retailer"
.AddItem "User"
End With
Label5.Left = 15250
Image1.Height = 1335
Timer2.Enabled = True
End Sub

Private Sub Form_Load()


Me.Top = (Screen.Height - Me.Height) / 2
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = 0
Me.Left = 0
setdbobject
Label4.Caption = Now
clear
End Sub

Private Sub logon()


strsel = "SELECT * FROM userlogin WHERE Status LIKE '" & Combo1.Text & "' AND username
LIKE '" & Text1.Text & "' AND password LIKE '" & Text2.Text & "'"
Set rs = con.Execute(strsel)
On Error GoTo l
If rs!UserName = Text1.Text And rs!Password = Text2.Text Then
frmmenu.Label1.Caption = rs!Status & " :

"

frmmenu.Label3.Caption = rs!UserName
frmmenu.Show
showform
Me.Hide
Else
Label6.Caption = "Incorrect Username Or Password"
End If
l:
End Sub

Private Sub Timer1_Timer()


If Label5.Left = 0 Then
Timer1.Enabled = False
lbl
End If
Label5.Left = Label5.Left - 50
End Sub
Private Sub lbl()
Timer1.Enabled = True
Label5.Left = 18720
End Sub

'Private Sub Timer2_Timer()


'If Image1.Height >= 1330 Then
'Image1.Height = 0
'Else
'Image1.Height = Image1.Height + 50
'End If
'End Sub
Private Sub showform()
Select Case Combo1.ListIndex
Case 0
frmmenu.Frame1.Visible = True
frmmenu.Frame1.Top = 1800
frmmenu.Frame2.Visible = False
frmmenu.Frame3.Visible = fslse
Case 1
frmmenu.Frame1.Visible = False
frmmenu.Frame2.Visible = True

frmmenu.Frame2.Top = 1800
frmmenu.Frame3.Visible = False
Case 2
frmmenu.Frame1.Visible = False
frmmenu.Frame2.Visible = False
frmmenu.Frame3.Visible = True
frmmenu.Frame3.Top = 1800
End Select
End Sub

Code for shop :Private Sub Command4_Click()


Command4.Visible = False
Command1.Visible = True
clear
End Sub
Private Sub Command1_Click()
strins = "INSERT INTO shop VALUES('" & Me.Text1.Text & "','" & Me.Text2.Text & "','" &
Me.Text3.Text & "','" & Me.Combo1.Text & "','" & Me.Combo2.Text & "')"
con.Execute (strins)
clear
End Sub
Private Sub Command2_Click()
clear
End Sub
Private Sub Command3_Click()
Command4.Visible = True
Command1.Visible = False
With rs
Text1.Text = rs!shopcode
Text2.Text = rs!shopname
Text3.Text = rs!sadd
Combo1.Text = rs!blockno
Combo2.Text = rs!Retcode
Text5.Text = rs!shopcode
End With
End Sub
Private Sub Command6_Click()

frmmenu.Show
End Sub
Private Sub Form_Load()
Form1.Show
Me.Top = 2000
Me.Left = 3000
setdbobject
Combo3.Text = "---------Select---------"
Combo3.AddItem "Shop code"
Combo3.AddItem "Shop Name"
Combo3.AddItem "Block no"
Combo3.AddItem "Retailer Name"
Combo3.AddItem "Address"
Combo3.ListIndex = 0
clear
Command4.Visible = False
End Sub

Private Sub Text5_Change()


If Combo3.ListIndex = 0 Then
strsel = "Select * from shop retailer where shopcode like '%" & Text5.Text & "%' "
ElseIf Combo3.ListIndex = 1 Then
strsel = "Select * from shop where shopname like '%" & Text5.Text & "%' "
ElseIf Combo3.ListIndex = 2 Then
strsel = "Select * from shop where blockno like '%" & Text5.Text & "%' "
End If
Set rs = con.Execute(strse)
Set dg.DataSource = rs
setgrid

End Sub
Private Sub clear()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
addproduct
addretailer
shoplist
End Sub
Private Sub addproduct()
strsel = "select * from block"
Set rs = con.Execute(strse)
Combo1.clear
While rs.EOF = False
Combo1.AddItem rs!blockno
rs.MoveNext
Wend
Combo1.Text = "---------Select--------"
End Sub
Private Sub addretailer()
strsel = "select * from Retailer"
Set rs = con.Execute(strse)
Combo2.clear
While rs.EOF = False
Combo2.AddItem rs!Retcode
rs.MoveNext
Wend
Combo2.Text = "---------Select--------"
End Sub
Private Sub shoplist()

strsel = "Select * from shop"


Set rs = con.Execute(strse)
Set dg.DataSource = rs
setgrid
End Sub
Private Sub Label10_Click()
rs.MoveFirst
End Sub
Private Sub Label11_Click()
rs.MovePrevious
End Sub
Private Sub Label12_Click()
rs.MoveNext
End Sub
Private Sub Label13_Click()
rs.MoveLast
End Sub

Private Sub setgrid()


'dg.Columns(0).Width = 1300
'dg.Columns(1).Width = 1500
'dg.Columns(2).Width = 1100
'dg.Columns(3).Width = 1000
If rs.BOF = True Or rs.EOF = True Then
Label13.Caption = "Record Not Found"
Else
Label13.Caption = rs.RecordCount & " Record Found"
dg.Columns(0).DataField = rs!shopcode
dg.Columns(1).DataField = rs!shopname
dg.Columns(2).DataField = rs!blockno
dg.Columns(3).DataField = rs!Retcode
dg.Columns(4).DataField = rs!sadd
dg.Columns(0).Caption = "Code"
dg.Columns(1).Caption = "Name"
dg.Columns(2).Caption = "Retailer"
dg.Columns(3).Caption = "Block"
dg.Columns(4).Caption = "Address"
End If
dg.Caption = "Shop"
End Sub

Code For Master Product :Private Sub Combo1_Click()


strsel = " SELECT product.pname As Product , product_allotment.qty as Qty ,
product_allotment.amt as Amt " & _
" FROM card INNER JOIN (product INNER JOIN product_allotment ON product.pcode =
product_allotment.pcode) " & _
" ON card.cardsr = product_allotment.cardsr" & _
" Where card.cardname='" & Combo1.Text & "'"
Set rs = con.Execute(strsel)
Set dg.DataSource = rs
dg.Caption = Combo1.Text
End Sub
Private Sub Combo4_Click()
details
End Sub
Private Sub Command1_Click()
newproduct
clear1
End Sub
Private Sub Command2_Click()
clear1
End Sub
Private Sub Command3_Click()
If rs.State = 1 Then rs.Close
rs.Open "Select * from product where pname='" & Combo2.Text & "'", con, adOpenKeyset,
adLockOptimistic

strins = "INSERT INTO product_allotment VALUES('" & Me.Combo1.Text & "','" & rs!pcode &
"'," & Me.Text4.Text & "," & Me.Text5.Text & ")"
con.Execute (strsel)
Text4.Text = ""
Text5.Text = ""
Combo1.SetFocus
clear
End Sub

Private Sub Combo3_Click()


If Combo3.ListIndex = 0 Then
strsel = "Select * from card"
Set rs = con.Execute(strse)
Combo4.clear
While rs.EOF = False
Combo4.AddItem rs!cardname
rs.MoveNext
Wend
ElseIf Combo3.ListIndex = 1 Then
strsel = "Select * from product"
Set rs = con.Execute(strse)
Combo4.clear
While rs.EOF = False
Combo4.AddItem rs!pname
rs.MoveNext
Wend
Else
End If
Combo4.Text = "-----Select-------"
End Sub

Private Sub Command4_Click()


clear
End Sub
Private Sub Command5_Click()
Unload Me
End Sub
Private Sub Command6_Click()
frmmenu.Show
Unload Me
End Sub
Private Sub Form_Load()
Form1.Show
Me.Top = 2000
Me.Left = 3000
setdbobject
clear
Combo3.AddItem "Card"
Combo3.AddItem "Product"
Combo3.AddItem "Card Type"
Combo3.ListIndex = 0
End Sub

Private Sub newproduct()


strins = "INSERT INTO product VALUES('" & Me.Text1.Text & "','" & Me.Text2.Text & "','" &
Me.Text3.Text & "')"
con.Execute (strins)
End Sub

Private Sub addcard()


strsel = "Select * from card"
Set rs = con.Execute(strsel)
Combo1.clear
Combo1.Text = "-----Select------"
While rs.EOF = False
Combo1.AddItem rs!cardname
rs.MoveNext
Wend
End Sub
Private Sub clear()
addcard
addproduct
Text4.Text = ""
Text5.Text = ""
Combo1.Text = "-------Select--------"
Combo2.Text = "-------Select--------"
End Sub

Private Sub addproduct()


strsel = "Select * from product"
Set rs = con.Execute(strsel)
Combo2.clear
While rs.EOF = False
Combo2.AddItem rs!pname
rs.MoveNext
Wend
End Sub

Private Sub clear1()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
Private Sub Timer1_Timer()
If Label8.Width >= 2775 Then
Label8.Width = 0
Else
Label8.Width = Label8.Width + 50
End If
End Sub

Private Sub details()


If Combo3.ListIndex = 0 Then
strsel = " SELECT product.pname, product_allotment.qty, product_allotment.amt" & _
" FROM card INNER JOIN (product INNER JOIN product_allotment ON product.pcode =
product_allotment.pcode) " & _
" ON card.cardsr = product_allotment.cardsr" & _
" Where card.cardname='" & Combo4.Text & "'"
End If
If Combo3.ListIndex = 1 Then
strsel = " SELECT card.cardname as Name, card.Cardtype as Type, product_allotment.qty As Qty,
product_allotment.amt as Amt " & _
" FROM product INNER JOIN (card INNER JOIN product_allotment ON card.cardsr =
product_allotment.cardsr) " & _
" ON product.pcode = product_allotment.pcode " & _
" Where product.pname like '" & Combo4.Text & "'"
End If
If Combo3.ListIndex = 2 Then
strsel = " SELECT product.pname, product_allotment.qty, product_allotment.amt" & _
" FROM card INNER JOIN (product INNER JOIN product_allotment ON product.pcode =
product_allotment.pcode) " & _
" ON card.cardsr = product_allotment.cardsr" & _
" Where card.cardtype like '" & Combo4.Text & "'"
End If
Set rs = con.Execute(strsel)
Set dg.DataSource = rs
dg.Caption = Combo4.Text
dg.Caption = Combo4.Text
dg.Columns(1).Width = 1000
End Sub

Form menu :Private Sub Form_Load()


Me.Left = 0
Me.Top = 0
setcolor
Label4.Caption = Now
WindowsMediaPlayer1.URL = ("C:\Users\Welcome\Desktop\ers\img\movie.mp4")
WindowsMediaPlayer1.Controls.Play
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
setcolor
End Sub
Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
setcolor
End Sub
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
setcolor
End Sub
Private Sub Label2_Click(index As Integer)
selectform index
End Sub
Private Sub Label2_MouseMove(index As Integer, Button As Integer, Shift As Integer, X As Single,
Y As Single)
setcolor
changecolor index
End Sub

Private Sub setcolor()


Dim i As Integer
For i = 0 To Label2.Count - 1
Label2(i).BackColor = vbBlue
Label2(i).ForeColor = vbWhite
Label2(i).FontBold = True
Next i
End Sub
Private Sub changecolor(index As Integer)
Label2(index).BackColor = vbWhite
Label2(index).ForeColor = vbBlue
End Sub
Private Sub selectform(index As Integer)
Form1.Show
Select Case index
Case 0: block.Show
Case 1: frmconsumer.Show
Case 2: masterproduct.Show
Case 3: mastercard.Show
Case 4: masterretailer.Show
Case 5: supplier.Show
Case 6: frmshop.Show
Case 7: frmSearch.Show
Case 8: block.Show
Case 9: change.Show
Case 10: main.Show
Case 11: mastersupply.Show
Case 12: main.Show
Case 13: frmSearch.Show
Case 14: change.Show
Case 15: main.Show

Case 16: Form3.Show


Case 17: sales.Show
Case 18: Form4.Show
Case 19: Form5.Show
Case 20: frmSearch.Show
Case 21: change.Show
Case 22: main.Show
End Select
Me.Hide
masterpage.Show
End Sub
Private Sub Timer1_Timer()
Dim i As Integer
For i = 1 To 7 Step 1
'Image2.Picture = LoadPicture(" & App.Path & " \ img \ 1.jpg")
Next i
End Sub

CONCLUSION

The project has been appreciated by all the users in the organization.

It is easy to use, since it uses the GUI provided in the user dialog.

User friendly screens are provided.

The usage of software increases the efficiency, decreases the effort.

It has been efficiently employed as a Site management mechanism.

It has been thoroughly tested and implemented.

References
Websites

http://www.google.com

http://www.microsoft.com

http://www.programmer2programmer.net

http://www.codeproject.com

http://www.msdn.com.

http://www.vb123.com

http://www.vbcode.com

Books

Visual Basic Black Book

Murach Visual Basic 6.0

Concept of DBMS

Office 2007 Made Easy

Potrebbero piacerti anche