Karuna Yadav PGDCA-IIIrd Sem. Roll No.
CERTIFICATE
This is to certify that the project report entitled, Gas Agency Management
System submitted by Ms. Karuna Yadav, for the partial fulfillment of the
requirements of Post Graduate Diploma in Computer Applications (P.G.D.C.A.) embodies the work done by her during semester III of this course under due supervision of the supervisior from this college.
Date :
Karuna Yadav Roll No.
( Internal Supervisor ) Dept. of Computer Science A.N.D.C. University of Delhi Delhi-110018
( Institute supervisor ) Sri Guru Singh Sabha Institute of Information Technology. Jangpura Ext., New Delhi
Principal A.N.D.C. University of Delhi Delhi-110019
( HOD ) Dept. of Computer Science A.N.D.C. University of Delhi Delhi-110018
Acknowledgement
This project is being the Ist live project made by me in the duration of this course (PGDCA) is an unforgettable experience. I would like to thank all of them who were associated with me in making this project a success. I would like to thank Mr. R. K. Sharma and Ms. Sonia Sodhi of SGSS-IIT, Jangpura Ext., New Delhi, who helped me in completion of this project. They had to answer all queries and an unconditional support that provided me without which it would have been impossible to do this project I heartily thank my faculty [Link] Kaur and Preeti Marwah who gave me the hope and inspiration to go ahead with this project. I would like to thank my friends for their innovative ideas & views and for that timely assistance which they provided during the course of this project. I would also like to thank my parents for their blessing and assistance they provided to me during the course of this project; And last but not the least I would like to thank almighty god for what ever he provided me and made this project a success.
Karuna Yadav PGDCA-IIIrd Sem. Roll No.-
Table of Content
1. Introduction
About Company About Project
2. Objective 3. Data Structure 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. Hardware/Software Specification Context Free Diagram DFDs Structure of the program Program Listing/Coding Output/Report Generation Validation Checks Screen Shots Working of the Project/User Manual Conclusion
About Company
Sri Guru Singh Sabha Institute of Information Technology (SGSS-IIT) is an Associate institute of Guru Nanak Dev University, Amritsar "GNDU is a 35 Years old UGC approved Government University" under the management of Sri Guru Singh Sabha (Regd.) Gurdwara Jangpura Extension. At the institute, it is our goal to enable under graduate and graduate to possess a strong theoretical, practical and experimental foundation in the basic discipline of IT and Management. The Institute has been paying special attention to the development of student in professional values of fairness, objectively, comparison, commitment and super coordination. They are turned to the needs and demands of business and industry not only through the state of art inputs but also through carefully designed co-curricular programmes like leadership and personality development programme. The institute is proud to have unstinted support of Sri Guru Singh Sabha (Regd.) Gurdwara Jangpura Extn., Which is the parent body, the Advisory Committee consisting of eminent leaders from academics, busines, industry, government and professionals who guide and help SGSS-IIT in the best interest of the participants and for achieving the objective of the Institute.
The institute is establised to provide higher education to the weaker section of society and it is a voluntary effort and is being run on "No Profit" motive. SGSS has always felt very strongly that in view of its mission and goals, it is in crucial position to play a significant role in providing education to young men and women. The Main objective of the institute are:
To provide the best possible professional education to ambitious young students. To give them an exposure to prevailing best environment in India and abroad. To develop a professinal min-set reflecting a secure self-image, creativeness, leadership, high commitment, sensitive and dynamic role so as to imbibe appropriate technology and mangement styles for practice of management. To develop expertise to face the emerging competitive situtation in India and abroad.
The Institute seeks to groom students to combine the use to technical skills with the understanding of the socio-cultural system to emerge as leaders in their fields and make significant contribution through excellent mangement in all sectors of the society.
About Project
The Gas Agencies and the number of gas users are seems to increasing day by day. The transactions like booking gas, releasing gas, keeping records of all customers, stock maintaining etc. when being processed manually take up a lot of time and thus add to the problems of the management. And thus to keep track of the transactions of the gas agency, a software package seems to be best way as it will speed up the work time and lessen up the complexities of the management. In simple language the project provides such user friendliness and easy understandability that even a novice user will find it easy to use the package and grasp its essence.
Objective
Objective of this software is to computerize the manual system of a Gas Agency, so that all the transactions become fast and easy. It replaces all the paper work. It works according to the need and lowers the work load of user.
Data Structure
Five tables have been used in this project to store data:
1. tblConsumer : Keeps record of consumer. ConsumerNo Name Address Pin Phone DoC Cylinders CylinderType : : : : : : : : Unique code allotted to every consumer. Name of the consumer. Address of the consumer. Pin code of the location. Phone no. of the consumer. Date of connection. No. of cylinders consumer have. Type of cylinder Domestic/Commercial
2. tblConsumerTrans : Keeps record of gas booking and release. Slno ConsumerNo DateofBooking DateofRelease IsReleased Remarks : : : : : : Serial no. Unique code allotted to every consumer. Date of gas booking. Date of releasing the gas to consumer. Flag variable containing value yes or no. Any remarks for the booking.
3. tblPrice : Keeps record of cylinder price. CylinderType Price : : Type of cylinder Domestic/Consumer Price of the cylinder.
4. tblStock : Keeps record of Stock. CurrCommercial CurrDomestic DefectsCommercial DefectsDomestic : : : : Current stock for commercial cylinders Current stock for domestic cylinders Stock for defective commercial cylinders Stock for defective domestic cylinders
5. tblStockTrans : Keeps record Stock arrival. DoA Domestic Commercial : : : Date of stock arrival. No. of Domestic cylinders added in stock No. of Commercial cylinder added in stock
Hardware/Software Specifications
Hardware Requirements
There are very few hardware requirements of this Gas Agency Management System (GAMS), lets take a glimpse on these requirements
Machine Requirements
These machine requirements are to obtain the best output of this project i. ii. iii. iv. A Computer with at least Pentium III requirements and Printer port Graphic card with minimum 24 bit True/High colors Minimum 128 MB RAM A Printer (colored or black and white)
Software Requirements
These Software requirements should be fulfilled or say these software should be installed on the computer to obtain the best output of this project
i. ii. iii. iv.
Visual Basic 6.0 Windows Platform (Windows 9X, ME, 2000, XP) Microsoft Office (With MS-Access) Printer Driver or Software
There are many points on the basis of which I decided to use Visual Basic for the development of this project, what are these points lets take a glimpse on to that
Context Free Diagram
Getting Consumer Details
Booking Status Report
Gas Agency System
Getting Stock Details Current Stock Report
DFDs
First Level DFD
Details of Consumer
Stock Transaction File
Processing & calculating current Stock Display current stock status
2
Temporary storage of File
Updating Stock master file.
Getting Current stock status
Updated Stock Master File
Third Level DFD
Booking details
1
Formatted booking status report
Validating Consumer No. and date of booking
Consumer Transaction File Temporary storage of File
2
Updating Consumer Master file
Booking Status & release Details
Updated Consumer Transaction File
Updating Consumer Transaction file
5
Updated Consumer Master File
Gas Release Details
Updated Consumer Master File
Updating Consumer Master file
Updated Stock Master File
Updating Stock master file
Validating Consumer No. and date of Release
Structure of the Program
FORMS IN THE PROJECT: frmAddConsumer frmAddStock frmBooking frmChangePassword FrmDaily frmDelConsumer : : : : : : : : : : : : : : : To add new consumer records in the file. To add new stock of cylinders in the file. To book gas to the consumer. To change password for the project. To display daily booking report. To delete the existing record of the consumer. It is the first form displayed in the starting, asks for the password to enter. This form displays the menu and calls all other forms. To modify consumer record. To display monthly booking status report. To add/change price of the cylinder. To print bill for the released gas. To release the booked gas. To display record of consumer. To display current status of the stock.
frmMain frmMenu frmModConsumer frmMonthly frmPriceEntry frmPrintBill frmRelease frmViewConsumer frmViewStock
Coding
frmAddConsumer
Private Sub cmdExit_Click() Unload Me End Sub Private Sub cmdSave_Click() If [Link] = "" Then MsgBox "Please input Consumer No." [Link] Exit Sub End If If Not IsNumeric([Link]) Then MsgBox "Please input Numeric value." [Link] Exit Sub End If Dim rsDuplicate As New [Link] [Link] "select ConsumerNo from tblConsumer where ConsumerNo=" & [Link], con, adOpenDynamic If Not [Link] Then MsgBox "Consumer No. already exists." [Link] Exit Sub End If [Link] Set rsDuplicate = Nothing If [Link] = "" Then MsgBox "Please input Date of Connection." [Link] Exit Sub End If If Not IsDate([Link]) Then
MsgBox "Please input valid Date." [Link] Exit Sub End If If [Link] = "" Then MsgBox "Please input Name" [Link] Exit Sub End If If [Link] = "" Then MsgBox "Please input Address." [Link] Exit Sub End If If [Link] = "" Then MsgBox "Please input No. of Cylinders." [Link] Exit Sub End If If Not IsNumeric([Link]) Then MsgBox "Please input Numeric value." [Link] Exit Sub End If If [Link] < 0 Or [Link] > 2 Then MsgBox "Please input between 0..2" [Link] Exit Sub End If If [Link] = True Then ctype = "D" Else ctype = "C" End If [Link] "insert into tblConsumer(ConsumerNo,Name,Address1,Address2,Address3,Pin,Phone, DoC,Cylinders,CylinderType) values(" & [Link] & ",'" & [Link] & "','" & [Link] & "','" & [Link] & "','" & [Link] & "','" &
[Link] & "','" & [Link] & "','" & [Link] & "'," & [Link] & ",'" & ctype & "')" MsgBox "Record Saved." End Sub Private Sub Form_Load() [Link] = Date End Sub
frmAddStock
Private Sub cmdExit_Click() Unload Me End Sub Private Sub cmdNew_Click() If [Link] = "New Stock" Then [Link] = "Update" [Link] = True [Link] = True [Link] = True [Link] = True [Link] = True [Link] = Date [Link] = "0" [Link] = "0" Dim rsfill As New [Link] [Link] "select * from tblStock", con, adOpenDynamic If [Link] Then [Link] = "0" [Link] = "0" [Link] = "0" [Link] = "0" [Link] = "0" [Link] = "0" Else
[Link] = rsfill("CurrCommercial") [Link] = rsfill("CurrDomestic") [Link] = rsfill("CurrCommercial") [Link] = rsfill("CurrDomestic") [Link] = rsfill("DefectsCommercial") [Link] = rsfill("DefectsDomestic") End If [Link] Set rsfill = Nothing [Link] Else If [Link] = "" Then MsgBox "Please input Arrival Date" [Link] Exit Sub End If If Not IsDate([Link]) Then MsgBox "Please input valid Date" [Link] Exit Sub End If If [Link] = "" Then MsgBox "Please input Required Field" [Link] Exit Sub End If If Not IsNumeric([Link]) Then MsgBox "Please input numeric data" [Link] Exit Sub End If If [Link] = "" Then MsgBox "Please input Required Field" [Link] Exit Sub End If If Not IsNumeric([Link]) Then MsgBox "Please input numeric data" [Link] Exit Sub
End If If [Link] = "" Then MsgBox "Please input Required Field" [Link] Exit Sub End If If Not IsNumeric([Link]) Then MsgBox "Please input numeric data" [Link] Exit Sub End If If [Link] = "" Then MsgBox "Please input Required Field" [Link] Exit Sub End If If Not IsNumeric([Link]) Then MsgBox "Please input numeric data" [Link] Exit Sub End If [Link] "delete from tblStock" [Link] "insert into tblStock(CurrCommercial,CurrDomestic,DefectsCommercial,DefectsDomes tic) values(" & [Link] & "," & [Link] & "," & [Link] & "," & [Link] & ")" [Link] "insert into tblStockTrans(DoA,Commercial,Domestic) values('" & [Link] & "'," & [Link] & "," & [Link] & ")" MsgBox "Record Saved" [Link] = "" [Link] = "" [Link] = "" [Link] = "" [Link] = "" [Link] = False [Link] = False [Link] = False [Link] = False [Link] = False
[Link] = "New Stock" End If End Sub Private Sub Form_Load() [Link] = False [Link] = False [Link] = False [Link] = False [Link] = False End Sub Private Sub txtRecCommercial_Change() [Link] = Val([Link]) + Val([Link]) End Sub Private Sub txtRecDomestic_Change() [Link] = Val([Link]) + Val([Link]) End Sub
frmBooking
Dim ctype As String Private Sub cmbConsumerNo_Click() [Link] = "" [Link] = "" [Link] = "" [Link] = "" [Link] = "" [Link] = "" Dim rsfill As New [Link] [Link] "select * from tblConsumer where ConsumerNo = " & [Link], con, adOpenDynamic If Not [Link] Then [Link] = rsfill("Name") [Link] = rsfill("Address1") [Link] = rsfill("Address2") [Link] = rsfill("Address3") [Link] = rsfill("Pin") [Link] = rsfill("Phone") [Link] = rsfill("Cylinders") If UCase(rsfill("CylinderType")) = "D" Then ctype = "Domestic" Else ctype = "Commercial" End If End If [Link] [Link] = False [Link] = "" Dim rsStock As New [Link] [Link] "select * from tblStock", con, adOpenDynamic If [Link] Then [Link] = False [Link] = "Cannot book Gas. Stock Not Available"
Exit Sub Else If (ctype = "Domestic" And rsStock("CurrDomestic") <= 0) Or (ctype = "Commercial" And rsStock("CurrCommercial") <= 0) Then [Link] = False [Link] = "Cannot book Gas. Stock Not Available" Exit Sub End If End If [Link] Set rsStock = Nothing [Link] "select * from tblConsumerTrans where ConsumerNo = " & [Link] & " order by DateofBooking desc", con, adOpenDynamic If Not [Link] Then [Link] = rsfill("Slno") [Link] = ctype [Link] = rsfill("DateofBooking") If rsfill("IsReleased") = 1 Then [Link] = "Yes" Else [Link] = "No" End If If IsNull(rsfill("DateofRelease")) Then [Link] = "" Else [Link] = rsfill("DateofRelease") End If If IsNull(rsfill("remarks")) Then [Link] = "" Else [Link] = rsfill("Remarks") End If If [Link] = "No" Then [Link] = "Cannot Book Gas. Previous Booking is not released." [Link] = False Else [Link] = True
End If Else [Link] = "" [Link] = "" [Link] = "" [Link] = "" [Link] = "" [Link] = "" [Link] = True End If [Link] Set rsfill = Nothing End Sub Private Sub cmdBook_Click() If [Link] = "" Then MsgBox "Please input Consumer No." [Link] Exit Sub End If If Not IsNumeric([Link]) Then MsgBox "Please input Numeric value." [Link] Exit Sub End If Dim rsDuplicate As New [Link] [Link] "select ConsumerNo from tblConsumer where ConsumerNo=" & [Link], con, adOpenDynamic If [Link] Then MsgBox "Consumer No. does not exist." [Link] Exit Sub End If [Link] Set rsDuplicate = Nothing If [Link] = "" Then MsgBox "Please input date of booking" [Link] Exit Sub
End If If Not IsDate([Link]) Then MsgBox "Please input valid date" [Link] Exit Sub End If If [Link] = "Yes" Then d = DateDiff("d", [Link], [Link]) If d <= 21 Then MsgBox "Cannot Book gas. Booking could be done after 21 days of previous booking." [Link] Exit Sub End If End If Dim tSlno As Integer Dim rsSlno As New [Link] [Link] "select Slno from tblConsumerTrans order by Slno desc", con, adOpenDynamic If [Link] Then tSlno = 1 Else tSlno = rsSlno("Slno") + 1 End If [Link] Set rsSlno = Nothing [Link] "insert into tblConsumerTrans(Slno,ConsumerNo,DateofBooking,IsReleased,Remarks) values(" & tSlno & "," & [Link] & ",'" & [Link] & "',0,'" & [Link] & "')" MsgBox "Gas Booked" [Link] = 0 End Sub Private Sub cmdExit_Click() Unload Me End Sub
Private Sub Form_Load() Dim rsfill As New [Link] [Link] "select ConsumerNo from tblConsumer order by ConsumerNo", con, adOpenDynamic Do While Not [Link] [Link] rsfill("ConsumerNo") [Link] Loop If [Link] <> 0 Then [Link] = 0 End If [Link] Set rsfill = Nothing '[Link] = False [Link] = Date End Sub
frmChangePassword
Private Sub cmdExit_Click() Unload Me End Sub Private Sub cmdOk_Click() Dim rsPass As New [Link] [Link] "select Password from Pass", con, adOpenDynamic If rsPass("Password") <> [Link] Then MsgBox "Invalid Password." [Link] Exit Sub ElseIf [Link] <> [Link] Then MsgBox "Invalid Password." [Link] Exit Sub Else [Link] "update Pass set Password = '" & [Link] & "'" MsgBox "Password Changed" Unload Me End If End Sub Private Sub Form_Load() End Sub
frmDaily
Private Sub cmdExit_Click() Unload Me End Sub Private Sub cmdPreview_Click() If Not IsDate([Link]) Then MsgBox "Please input valid date" [Link] Exit Sub End If Dim rsfill As New [Link] [Link] "select count(*) as bdomestic from qryBill where CylinderType='D' and DateofBooking=cdate('" & [Link] & "')", con, adOpenDynamic bdomestic = rsfill("bdomestic") [Link] [Link] "select count(*) as bcommercial from qryBill where CylinderType='C' and DateofBooking=cdate('" & [Link] & "')", con, adOpenDynamic bcommercial = rsfill("bcommercial") [Link] [Link] "select count(*) as rdomestic from qryBill where CylinderType='D' and IsReleased=1 and DateofBooking=cdate('" & [Link] & "')", con, adOpenDynamic rdomestic = rsfill("rdomestic") [Link] [Link] "select count(*) as rcommercial from qryBill where CylinderType='C' and IsReleased=1 and DateofBooking=cdate('" & [Link] & "')", con, adOpenDynamic rcommercial = rsfill("rcommercial") [Link] Set rsfill = Nothing [Link] "delete from count" [Link] "insert into count(bdomestic,bcommercial,rdomestic,rcommercial) values(" & bdomestic & "," & bcommercial & "," & rdomestic & "," & rcommercial & ")"
MsgBox "Preview Report" Dim acApp As [Link] Set acApp = New [Link] [Link] [Link] & "\[Link]" [Link] "repDaily", acViewPreview, "select * from qrybill where Dateofbooking=cdate('" & [Link] & "')" [Link] [Link] = True End Sub Private Sub Form_Load() [Link] = Date End Sub
frmDelConsumer
Private Sub cmbConsumerNo_Click() Dim rsfill As New [Link] [Link] "select * from tblConsumer where ConsumerNo = " & [Link], con, adOpenDynamic If Not [Link] Then [Link] = rsfill("Name") [Link] = rsfill("DoC") [Link] = rsfill("Address1") [Link] = rsfill("Address2") [Link] = rsfill("Address3") [Link] = rsfill("Pin") [Link] = rsfill("Phone") [Link] = rsfill("Cylinders") If UCase(rsfill("CylinderType")) = "D" Then [Link] = True Else [Link] = True End If End If [Link] Set rsfill = Nothing End Sub Private Sub cmdExit_Click() Unload Me End Sub Private Sub cmddelete_Click() If [Link] = "" Then MsgBox "Please input Consumer No." [Link] Exit Sub End If If Not IsNumeric([Link]) Then MsgBox "Please input Numeric value." [Link]
Exit Sub End If Dim rsDuplicate As New [Link] [Link] "select ConsumerNo from tblConsumer where ConsumerNo=" & [Link], con, adOpenDynamic If [Link] Then MsgBox "Consumer No. does not exist." [Link] Exit Sub End If [Link] Set rsDuplicate = Nothing [Link] "delete from tblConsumer where ConsumerNo=" & [Link] [Link] Dim rsfill As New [Link] [Link] "select ConsumerNo from tblConsumer order by ConsumerNo", con, adOpenDynamic Do While Not [Link] [Link] rsfill("ConsumerNo") [Link] Loop If [Link] <> 0 Then [Link] = 0 End If [Link] Set rsfill = Nothing MsgBox "Record Deleted." End Sub Private Sub Form_Load() Dim rsfill As New [Link] [Link] "select ConsumerNo from tblConsumer order by ConsumerNo", con, adOpenDynamic Do While Not [Link] [Link] rsfill("ConsumerNo") [Link] Loop If [Link] <> 0 Then
[Link] = 0 End If [Link] Set rsfill = Nothing End Sub
frmMain
Private Sub cmdOk_Click() Dim rsPass As New [Link] [Link] "select Password from Pass", con, adOpenDynamic If Not [Link] Then If ([Link] = "" And IsNull(rsPass("Password"))) Or (rsPass("Password") = [Link]) Then Unload Me [Link] vbModal Else MsgBox "Invalid Password" End If Else Unload Me [Link] vbModal End If [Link] Set rsPass = Nothing End Sub Private Sub cmdExit_Click() Unload Me End Sub Private Sub Form_Load() [Link] = "Provider=[Link].3.51;Persist Security Info=False;Data Source=" + [Link] + "\[Link]" [Link] End Sub
frmMenu
Private Sub menuAddNew_Click() [Link] vbModal End Sub Private Sub mnuAddStock_Click() [Link] vbModal End Sub Private Sub mnuBooking_Click() [Link] vbModal End Sub Private Sub mnuCP_Click() [Link] vbModal End Sub Private Sub mnuDaily_Click() [Link] vbModal End Sub Private Sub mnuDelete_Click() [Link] vbModal End Sub Private Sub mnuModify_Click() [Link] vbModal End Sub Private Sub mnuMonthly_Click() [Link] vbModal End Sub Private Sub mnuPriceEntry_Click() [Link] vbModal End Sub
Private Sub mnuPrintBill_Click() [Link] vbModal End Sub Private Sub mnuQuit_Click() Unload Me End Sub Private Sub mnuRelease_Click() [Link] vbModal End Sub Private Sub mnuView_Click() [Link] vbModal End Sub Private Sub mnuViewStock_Click() [Link] vbModal End Sub
frmModConsumer
Private Sub cmbConsumerNo_Click() Dim rsfill As New [Link] [Link] "select * from tblConsumer where ConsumerNo = " & [Link], con, adOpenDynamic If Not [Link] Then [Link] = rsfill("Name") [Link] = rsfill("DoC") [Link] = rsfill("Address1") [Link] = rsfill("Address2") [Link] = rsfill("Address3") [Link] = rsfill("Pin") [Link] = rsfill("Phone") [Link] = rsfill("Cylinders") If UCase(rsfill("CylinderType")) = "D" Then [Link] = True Else [Link] = True End If End If [Link] Set rsfill = Nothing End Sub Private Sub cmdExit_Click() Unload Me End Sub Private Sub cmdupdate_Click() If [Link] = "" Then MsgBox "Please input Consumer No." [Link] Exit Sub End If If Not IsNumeric([Link]) Then MsgBox "Please input Numeric value." [Link]
Exit Sub End If Dim rsDuplicate As New [Link] [Link] "select ConsumerNo from tblConsumer where ConsumerNo=" & [Link], con, adOpenDynamic If [Link] Then MsgBox "Consumer No. does not exist." [Link] Exit Sub End If [Link] Set rsDuplicate = Nothing If [Link] = "" Then MsgBox "Please input Date of Connection." [Link] Exit Sub End If If Not IsDate([Link]) Then MsgBox "Please input valid Date." [Link] Exit Sub End If If [Link] = "" Then MsgBox "Please input Name" [Link] Exit Sub End If If [Link] = "" Then MsgBox "Please input Address." [Link] Exit Sub End If If [Link] = "" Then MsgBox "Please input No. of Cylinders." [Link] Exit Sub End If If Not IsNumeric([Link]) Then MsgBox "Please input Numeric value." [Link]
Exit Sub End If If [Link] < 0 Or [Link] > 2 Then MsgBox "Please input between 0..2" [Link] Exit Sub End If If [Link] = True Then ctype = "D" Else ctype = "C" End If [Link] "delete from tblConsumer where ConsumerNo=" & [Link] [Link] "insert into tblConsumer(ConsumerNo,Name,Address1,Address2,Address3,Pin,Phone, DoC,Cylinders,CylinderType) values(" & [Link] & ",'" & [Link] & "','" & [Link] & "','" & [Link] & "','" & [Link] & "','" & [Link] & "','" & [Link] & "','" & [Link] & "'," & [Link] & ",'" & ctype & "')" MsgBox "Record Updated." End Sub Private Sub Form_Load() Dim rsfill As New [Link] [Link] "select ConsumerNo from tblConsumer order by ConsumerNo", con, adOpenDynamic Do While Not [Link] [Link] rsfill("ConsumerNo") [Link] Loop If [Link] <> 0 Then [Link] = 0 End If [Link] Set rsfill = Nothing
End Sub
frmMonthly
Private Sub cmdExit_Click() Unload Me End Sub Private Sub cmdPreview_Click() Dim rsfill As New [Link] [Link] "select count(*) as bdomestic from qryBill where CylinderType='D' and month(DateofBooking)=" & [Link]([Link]) & " and year(DateofBooking)=" & [Link], con, adOpenDynamic bdomestic = rsfill("bdomestic") [Link] [Link] "select count(*) as bcommercial from qryBill where CylinderType='C' and month(DateofBooking)=" & [Link]([Link]) & " and year(DateofBooking)=" & [Link], con, adOpenDynamic bcommercial = rsfill("bcommercial") [Link] [Link] "select count(*) as rdomestic from qryBill where CylinderType='D' and IsReleased=1 and month(DateofBooking)=" & [Link]([Link]) & " and year(DateofBooking)=" & [Link], con, adOpenDynamic rdomestic = rsfill("rdomestic") [Link] [Link] "select count(*) as rcommercial from qryBill where CylinderType='C' and IsReleased=1 and month(DateofBooking)=" & [Link]([Link]) & " and year(DateofBooking)=" & [Link], con, adOpenDynamic rcommercial = rsfill("rcommercial") [Link] Set rsfill = Nothing [Link] "delete from count"
[Link] "insert into count(bdomestic,bcommercial,rdomestic,rcommercial) values(" & bdomestic & "," & bcommercial & "," & rdomestic & "," & rcommercial & ")" MsgBox "Preview Report" Dim acApp As [Link] Set acApp = New [Link] [Link] [Link] & "\[Link]" [Link] "repMonthly", acViewPreview, "select * from qrybill where month(DateofBooking)=" & [Link]([Link]) & " and year(DateofBooking)=" & [Link] [Link] [Link] = True End Sub Private Sub Form_Load() For i = 0 To 11 [Link] MonthName(i + 1) [Link](i) = i + 1 Next For i = 2000 To Year(Date) + 10 [Link] i Next [Link] = Month(Date) - 1 [Link] = Year(Date) - 2000 End Sub
frmPriceEntry
Private Sub cmdExit_Click() Unload Me End Sub Private Sub cmdupdate_Click() If [Link] = "" Then MsgBox "Please input Price" [Link] Exit Sub End If If Not IsNumeric([Link]) Then MsgBox "Please input numeric data" [Link] Exit Sub End If If [Link] = "" Then MsgBox "Please input Price" [Link] Exit Sub End If If Not IsNumeric([Link]) Then MsgBox "Please input numeric data" [Link] Exit Sub End If [Link] "delete from tblPrice" [Link] "insert into tblPrice(CylinderType,Price) values('C'," & [Link] & ")" [Link] "insert into tblPrice(CylinderType,Price) values('D'," & [Link] & ")" MsgBox "Record Updated" End Sub Private Sub Form_Load() Dim rsfill As New [Link] [Link] "select * from tblPrice", con, adOpenDynamic If [Link] Then
[Link] = "0" [Link] = "0" Else Do While Not [Link] If UCase(rsfill("CylinderType")) = "C" Then [Link] = rsfill("Price") Else [Link] = rsfill("Price") End If [Link] Loop End If [Link] Set rsfill = Nothing End Sub
frmPrintBill
Dim ctype As String Private Sub cmbConsumerNo_Click() [Link] = "" [Link] = "" [Link] = "" [Link] = "" [Link] = "" [Link] = "" Dim rsfill As New [Link] [Link] "select * from tblConsumer where ConsumerNo = " & [Link], con, adOpenDynamic If Not [Link] Then [Link] = rsfill("Name") [Link] = rsfill("Address1") [Link] = rsfill("Address2") [Link] = rsfill("Address3")
[Link] = rsfill("Pin") [Link] = rsfill("Phone") [Link] = rsfill("Cylinders") If UCase(rsfill("CylinderType")) = "D" Then ctype = "Domestic" Else ctype = "Commercial" End If End If [Link] [Link] "select * from tblConsumerTrans where ConsumerNo = " & [Link] & " order by DateofBooking desc", con, adOpenDynamic If Not [Link] Then [Link] = rsfill("Slno") [Link] = ctype [Link] = rsfill("DateofBooking") If IsNull(rsfill("remarks")) Then [Link] = "" Else [Link] = rsfill("Remarks") End If If IsNull(rsfill("DateofRelease")) Then [Link] = "" Else [Link] = rsfill("DateofRelease") End If If rsfill("IsReleased") = 1 Then [Link] = "Yes" [Link] = True Else [Link] = "No" [Link] = False End If Else [Link] = "" [Link] = "" [Link] = "" [Link] = ""
[Link] = "" [Link] = "" [Link] = False End If [Link] Set rsfill = Nothing End Sub Private Sub cmdprint_Click() If [Link] = "" Then MsgBox "Please input Consumer No." [Link] Exit Sub End If If Not IsNumeric([Link]) Then MsgBox "Please input Numeric value." [Link] Exit Sub End If Dim rsDuplicate As New [Link] [Link] "select ConsumerNo from tblConsumer where ConsumerNo=" & [Link], con, adOpenDynamic If [Link] Then MsgBox "Consumer No. does not exist." [Link] Exit Sub End If [Link] Set rsDuplicate = Nothing Dim acApp As [Link] Set acApp = New [Link] [Link] [Link] & "\[Link]" [Link] "repBill", acViewPreview, "select * from qryBill where ConsumerNo=" & [Link] & " and DateofBooking=cdate('" & [Link] & "')" [Link] [Link] = True
End Sub Private Sub cmdExit_Click() Unload Me End Sub Private Sub Form_Load() Dim rsfill As New [Link] [Link] "select ConsumerNo from tblConsumer order by ConsumerNo", con, adOpenDynamic Do While Not [Link] [Link] rsfill("ConsumerNo") [Link] Loop If [Link] <> 0 Then [Link] = 0 End If [Link] Set rsfill = Nothing End Sub
frmRelease
Dim ctype As String Private Sub cmbConsumerNo_Click() [Link] = "" [Link] = "" [Link] = "" [Link] = "" [Link] = "" [Link] = "" '[Link] = False '[Link] = False
Dim rsfill As New [Link] [Link] "select * from tblConsumer where ConsumerNo = " & [Link], con, adOpenDynamic If Not [Link] Then [Link] = rsfill("Name") [Link] = rsfill("Address1") [Link] = rsfill("Address2") [Link] = rsfill("Address3") [Link] = rsfill("Pin") [Link] = rsfill("Phone") [Link] = rsfill("Cylinders") If UCase(rsfill("CylinderType")) = "D" Then ctype = "Domestic" Else ctype = "Commercial" End If End If [Link] [Link] = False [Link] = "" [Link] "select * from tblConsumerTrans where ConsumerNo = " & [Link] & " order by DateofBooking desc", con, adOpenDynamic If Not [Link] Then [Link] = rsfill("Slno") [Link] = ctype [Link] = rsfill("DateofBooking") If IsNull(rsfill("remarks")) Then [Link] = "" Else [Link] = rsfill("Remarks") End If If IsNull(rsfill("DateofRelease")) Then [Link] = "" Else [Link] = rsfill("DateofRelease") End If If rsfill("IsReleased") = 1 Then
[Link] = "Yes" [Link] = False [Link] = False [Link] = False Else [Link] = "No" [Link] = True [Link] = True [Link] = True [Link] = Date End If Dim rsStock As New [Link] [Link] "select * from tblStock", con, adOpenDynamic If [Link] Then [Link] = False [Link] = "Cannot Release Booked Gas. Stock Not Available" Exit Sub Else If (ctype = "Domestic" And rsStock("CurrDomestic") <= 0) Or (ctype = "Commercial" And rsStock("CurrCommercial") <= 0) Then [Link] = False [Link] = "Cannot Release booked Gas. Stock Not Available" Exit Sub End If End If [Link] Set rsStock = Nothing Else [Link] = "" [Link] = "" [Link] = "" [Link] = "" [Link] = "" [Link] = "" [Link] = False [Link] = False
[Link] = False End If [Link] Set rsfill = Nothing End Sub Private Sub cmdBook_Click() If [Link] = "" Then MsgBox "Please input Consumer No." [Link] Exit Sub End If If Not IsNumeric([Link]) Then MsgBox "Please input Numeric value." [Link] Exit Sub End If Dim rsDuplicate As New [Link] [Link] "select ConsumerNo from tblConsumer where ConsumerNo=" & [Link], con, adOpenDynamic If [Link] Then MsgBox "Consumer No. does not exist." [Link] Exit Sub End If [Link] Set rsDuplicate = Nothing If [Link] = "" Then MsgBox "Please input date of release" [Link] Exit Sub End If If Not IsDate([Link]) Then MsgBox "Please input valid date" [Link] Exit Sub End If If [Link] = "No" Then If CDate([Link]) < CDate([Link]) Then
MsgBox "Date of Release should not be less that date of booking" [Link] Exit Sub End If End If [Link] "update tblConsumerTrans set DateofRelease='" & [Link] & "', IsReleased=1 where ConsumerNo=" & [Link] & " and DateofBooking=cdate('" & [Link] & "')" If ctype = "Commercial" Then [Link] "update tblStock set CurrCommercial=CurrCommercial-1" Else [Link] "update tblStock set CurrDomestic=CurrDomestic-1" End If MsgBox "Gas Released" [Link] = 0 Dim acApp As [Link] Set acApp = New [Link] [Link] [Link] & "\[Link]" [Link] "repBill", acViewPreview, "select * from qryBill where ConsumerNo=" & [Link] & " and DateofBooking=cdate('" & [Link] & "')" [Link] [Link] = True End Sub Private Sub cmdExit_Click() Unload Me End Sub Private Sub Form_Load() Dim rsfill As New [Link] [Link] "select ConsumerNo from tblConsumer order by ConsumerNo", con, adOpenDynamic Do While Not [Link] [Link] rsfill("ConsumerNo") [Link]
Loop If [Link] <> 0 Then [Link] = 0 End If [Link] Set rsfill = Nothing '[Link] = False '[Link] = False '[Link] = False End Sub
frmViewConsumer
Private Sub cmbConsumerNo_Click() Dim rsfill As New [Link] [Link] "select * from tblConsumer where ConsumerNo = " & [Link], con, adOpenDynamic If Not [Link] Then [Link] = rsfill("Name") [Link] = rsfill("DoC") [Link] = rsfill("Address1") [Link] = rsfill("Address2") [Link] = rsfill("Address3") [Link] = rsfill("Pin") [Link] = rsfill("Phone") [Link] = rsfill("Cylinders") If UCase(rsfill("CylinderType")) = "D" Then [Link] = True Else [Link] = True End If End If [Link] Set rsfill = Nothing End Sub
Private Sub cmdExit_Click() Unload Me End Sub
Private Sub Form_Load() Dim rsfill As New [Link] [Link] "select ConsumerNo from tblConsumer order by ConsumerNo", con, adOpenDynamic Do While Not [Link] [Link] rsfill("ConsumerNo") [Link] Loop If [Link] <> 0 Then [Link] = 0 End If [Link] Set rsfill = Nothing End Sub
frmViewStock
Private Sub cmdExit_Click() Unload Me End Sub Private Sub Form_Load() Dim rsfill As New [Link] [Link] "select * from tblStock", con, adOpenDynamic If [Link] Then [Link] = "0" [Link] = "0" [Link] = "0" [Link] = "0" Else [Link] = rsfill("CurrCommercial") [Link] = rsfill("CurrDomestic") [Link] = rsfill("DefectsCommercial") [Link] = rsfill("DefectsDomestic") End If [Link] Set rsfill = Nothing End
Output/Report Generation
1. Display Consumer Record : User can traverse and view consumer records using option MASTER ENTRY CONSUMER ENTRY VIEW. 2. Display Current Stock : User can view the updated stock at any time by using option MASTER ENTRY STOCK ENTRY VIEW STOCK. 3. Printing Bill : User can print bill of the released gas to consumer by using option REPORTS PRINT BILL. 4. Daily Booking Status Report : User can view report of the daily booking using option REPORTS DAILY REPORT. 5. Monthly Booking Status Report : User can view report of the monthly booking using option REPORTS MONTHLY REPORT.
Validation Checks
While dealing with updation, we stressed on the importance of ensuring that the source data was error free. This process is called validation of the input data.
Validation checks while taking input data from the user:
1.
While inputting consumer no. from the user while adding new consumer record, it has to be checked the given consumer no. should not already exists in the consumer master table.
2.
Before making any updation, it has been checked that particular record is present in the file or not.
3.
Digit Check : It has been checked that user should not enter character instead of digits in numeric fields.
4.
While booking the gas it has been checked that the previous gas has been released. Secondly, consumer can book gas only after 21 days of booking of previous gas.
5.
It has been checked that user must enter data in required fields.
frmMain
frmMenu
frmAddConsumer
frmModConsumer
frmDelConsumer
frmViewConsumer
frmAddStock
frmViewStock
frmPriceEntry
frmChangePassword
frmBooking
frmRelease
frmPrintBill
Customer Bill
frmDaily
frmMonthly
Working of the Project/User Manual
Adding new consumer record : User can add new consumer records in table- tblConsumer from option MASTER ENTRY CONSUMER ENTRY ADD NEW. Modify consumer record : User can modify any existing consumer records using option MASTER ENTRY CONSUMER ENTRY MODIFY. Delete consumer record : User can delete any existing consumer records using option MASTER ENTRY CONSUMER ENTRY DELETE. View consumer record : User can traverse and view consumer records using option MASTER ENTRY CONSUMER ENTRY VIEW. Adding stock : User can add stock in table tblStock. Whenever new transaction done, a new record is add in stock transaction table tblStockTrans and the stock is calculated and updated in stock master file, using option MASTER ENTRY STOCK ENTRY NEW STOCK.
View Stock : User can view the updated stock at any time by using option MASTER ENTRY STOCK ENTRY VIEW STOCK. Cylinder Price : User can change the price of per cylinder using option MASTER ENTRY PRICE ENTRY. Changing Password : User can change the password if he/she knows the old password by using option MASTER ENTRY CHANGE PASSWORD. Booking Gas : User can book gas by using option TRANSACTION BOOKING. Whenever user book gas an entry has been done in transaction table tblConsumerTrans and the stock is also updated in stock master file. Releasing Gas : User can release booked gas by using option TRANSACTION RELEASE, and the bill is automatically generated. Printing Bill : User can print bill of the released gas to consumer by using option REPORTS PRINT BILL. Daily Booking Report : User can view report of the daily booking using option REPORTS DAILY REPORT. Monthly Booking Report : User can view report of the monthly booking using option REPORTS MONTHLY REPORT.
Conclusion
This project is designed to meet the requirements of a Gas Agency Automation System. It has been developed in Visual Basic and the database has been built in MS-Access only, keeping in mind the specifications of the system. Apart from MS-Access we could have also implemented other database software like Oracle or SQL.
For designing the system we have used simple data flow diagrams.
Overall the project teaches us the essential skills like:
1.
Using system analysis and design techniques like data flow diagram in designing the system.
2.
Understanding programming logic and language along with utilities like reports, forms, queries etc. in Visual Basic and MS-Access 97.