Gas Agency Management System
-
Upload
manish-sharma -
Category
Documents
-
view
72 -
download
5
Transcript of Gas Agency Management System
![Page 1: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/1.jpg)
Karuna YadavPGDCA-IIIrd Sem.Roll No.-
![Page 2: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/2.jpg)
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 ) ( Institute supervisor )Dept. of Computer Science Sri Guru Singh Sabha Institute of A.N.D.C. Information Technology.University of Delhi Jangpura Ext., New DelhiDelhi-110018
Principal ( HOD )A.N.D.C. Dept. of Computer ScienceUniversity of Delhi A.N.D.C.Delhi-110019 University of Delhi Delhi-110018
![Page 3: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/3.jpg)
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 Ms.Sharanjeet 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 YadavPGDCA-IIIrd Sem.Roll No.-
![Page 4: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/4.jpg)
Table of Content
1. Introduction
About Company About Project
2. Objective
3. Data Structure
4. Hardware/Software Specification
5. Context Free Diagram
6. DFDs
7. Structure of the program
8. Program Listing/Coding
9. Output/Report Generation
10. Validation Checks
11. Screen Shots
12. Working of the Project/User Manual
13. Conclusion
![Page 5: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/5.jpg)
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.
![Page 6: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/6.jpg)
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.
![Page 7: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/7.jpg)
About Project
![Page 8: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/8.jpg)
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.
![Page 9: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/9.jpg)
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.
![Page 10: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/10.jpg)
Data Structure
Five tables have been used in this project to store data:
1. tblConsumer : Keeps record of consumer.
ConsumerNo : Unique code allotted to every consumer.
Name : Name of the consumer.
Address : Address of the consumer.
Pin : Pin code of the location.
Phone : Phone no. of the consumer.
DoC : Date of connection.
Cylinders : No. of cylinders consumer have.
CylinderType : Type of cylinder – Domestic/Commercial
2. tblConsumerTrans : Keeps record of gas booking and release.
Slno : Serial no.
ConsumerNo : Unique code allotted to every consumer.
DateofBooking : Date of gas booking.
DateofRelease : Date of releasing the gas to consumer.
IsReleased : Flag variable containing value yes or no.
Remarks : Any remarks for the booking.
![Page 11: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/11.jpg)
3. tblPrice : Keeps record of cylinder price.
CylinderType : Type of cylinder – Domestic/Consumer
Price : Price of the cylinder.
4. tblStock : Keeps record of Stock.
CurrCommercial : Current stock for commercial cylinders
CurrDomestic : Current stock for domestic cylinders
DefectsCommercial : Stock for defective commercial cylinders
DefectsDomestic : Stock for defective domestic cylinders
5. tblStockTrans : Keeps record Stock arrival.
DoA : Date of stock arrival.
Domestic : No. of Domestic cylinders added in stock
Commercial : No. of Commercial cylinder added in stock
![Page 12: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/12.jpg)
Hardware/Software Specifications
Hardware Requirements
There are very few hardware requirements of this Gas Agency Management
System (GAMS), let’s take a glimpse on these requirements
Machine Requirements
These machine requirements are to obtain the best output of this project
i. A Computer with at least Pentium III requirements and Printer portii. Graphic card with minimum 24 bit True/High colors
iii. Minimum 128 MB RAM iv. A Printer (colored or black and white)
![Page 13: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/13.jpg)
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. Visual Basic 6.0ii. Windows Platform (Windows 9X, ME, 2000, XP)
iii. Microsoft Office (With MS-Access)iv. 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
![Page 14: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/14.jpg)
Context Free Diagram
GasAgencySystem
Booking Status Report
Getting Consumer Details
Getting Stock Details Current Stock
Report
![Page 15: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/15.jpg)
DFDs
![Page 16: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/16.jpg)
First Level DFD
Details of Consumer
Stock Transaction File1
Processing & calculating
current Stock
2
Updating Stock master
file.
Updated Stock Master File
3
Getting Current stock
status
Temporary storage of File
Display current stock
status
![Page 17: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/17.jpg)
Third Level DFD
Booking details
1
Validating Consumer No.
and date of booking
Consumer Transaction File
2
Updating Consumer Master file
Updated Consumer Master File
Gas Release Details
3
Validating Consumer No.
and date of Release
6
Updating Stock master
file
5
Updating Consumer Master file
4
Updating Consumer
Transaction file
Updated Stock Master File
Updated Consumer Master File
Updated Consumer Transaction File
3
Booking Status &
release Details
Temporary storage of File
Formatted booking
status report
![Page 18: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/18.jpg)
Structure of the Program
FORMS IN THE PROJECT:
frmAddConsumer : To add new consumer records in the file.
frmAddStock : To add new stock of cylinders in the file.
frmBooking : To book gas to the consumer.
frmChangePassword : To change password for the project.
FrmDaily : To display daily booking report.
frmDelConsumer : To delete the existing record of the
consumer.
frmMain : It is the first form displayed in the
starting, asks for the password to enter.
frmMenu : This form displays the menu and calls all
other forms.
frmModConsumer : To modify consumer record.
frmMonthly : To display monthly booking status
report.
frmPriceEntry : To add/change price of the cylinder.
frmPrintBill : To print bill for the released gas.
frmRelease : To release the booked gas.
frmViewConsumer : To display record of consumer.
frmViewStock : To display current status of the stock.
![Page 19: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/19.jpg)
![Page 20: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/20.jpg)
![Page 21: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/21.jpg)
Coding
frmAddConsumer
Private Sub cmdExit_Click()Unload MeEnd Sub
Private Sub cmdSave_Click()If Me.txtConsumerNo.Text = "" Then MsgBox "Please input Consumer No." Me.txtConsumerNo.SetFocus Exit SubEnd IfIf Not IsNumeric(Me.txtConsumerNo.Text) Then MsgBox "Please input Numeric value." Me.txtConsumerNo.SetFocus Exit SubEnd IfDim rsDuplicate As New ADODB.RecordsetrsDuplicate.Open "select ConsumerNo from tblConsumer where ConsumerNo=" & Me.txtConsumerNo.Text, con, adOpenDynamicIf Not rsDuplicate.EOF Then MsgBox "Consumer No. already exists." Me.txtConsumerNo.SetFocus Exit SubEnd IfrsDuplicate.CloseSet rsDuplicate = NothingIf Me.txtDoC.Text = "" Then MsgBox "Please input Date of Connection." Me.txtDoC.SetFocus Exit SubEnd IfIf Not IsDate(Me.txtDoC.Text) Then
![Page 22: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/22.jpg)
MsgBox "Please input valid Date." Me.txtDoC.SetFocus Exit SubEnd IfIf Me.txtName.Text = "" Then MsgBox "Please input Name" Me.txtName.SetFocus Exit SubEnd IfIf Me.txtAddress1.Text = "" Then MsgBox "Please input Address." Me.txtAddress1.SetFocus Exit SubEnd IfIf Me.txtCylinders.Text = "" Then MsgBox "Please input No. of Cylinders." Me.txtCylinders.SetFocus Exit SubEnd IfIf Not IsNumeric(Me.txtCylinders.Text) Then MsgBox "Please input Numeric value." Me.txtCylinders.SetFocus Exit SubEnd IfIf Me.txtCylinders.Text < 0 Or Me.txtCylinders.Text > 2 Then MsgBox "Please input between 0..2" Me.txtCylinders.SetFocus Exit SubEnd IfIf Me.opDomestic.Value = True Then ctype = "D"Else ctype = "C"End If
con.Execute "insert into tblConsumer(ConsumerNo,Name,Address1,Address2,Address3,Pin,Phone,DoC,Cylinders,CylinderType) values(" & Me.txtConsumerNo.Text & ",'" & Me.txtName.Text & "','" & Me.txtAddress1.Text & "','" & Me.txtAddress2.Text & "','" & Me.txtAddress3.Text & "','" &
![Page 23: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/23.jpg)
Me.txtPin.Text & "','" & Me.txtPhone.Text & "','" & Me.txtDoC.Text & "'," & Me.txtCylinders.Text & ",'" & ctype & "')"
MsgBox "Record Saved."End SubPrivate Sub Form_Load()Me.txtDoC.Text = DateEnd Sub
frmAddStock
Private Sub cmdExit_Click()Unload MeEnd Sub
Private Sub cmdNew_Click()If Me.cmdNew.Caption = "New Stock" Then Me.cmdNew.Caption = "Update" Me.txtArrival.Enabled = True Me.txtRecCommercial.Enabled = True Me.txtRecDomestic.Enabled = True Me.txtDefCommercial.Enabled = True Me.txtDefDomestic.Enabled = True Me.txtArrival.Text = Date Me.txtRecCommercial.Text = "0" Me.txtRecDomestic.Text = "0" Dim rsfill As New ADODB.Recordset rsfill.Open "select * from tblStock", con, adOpenDynamic If rsfill.EOF Then Me.txtOldCommercial.Text = "0" Me.txtOldDomestic.Text = "0" Me.txtCurrCommercial.Text = "0" Me.txtCurrDomestic.Text = "0" Me.txtDefCommercial.Text = "0" Me.txtDefDomestic.Text = "0" Else
![Page 24: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/24.jpg)
Me.txtOldCommercial.Text = rsfill("CurrCommercial") Me.txtOldDomestic.Text = rsfill("CurrDomestic") Me.txtCurrCommercial.Text = rsfill("CurrCommercial") Me.txtCurrDomestic.Text = rsfill("CurrDomestic") Me.txtDefCommercial.Text = rsfill("DefectsCommercial") Me.txtDefDomestic.Text = rsfill("DefectsDomestic") End If rsfill.Close Set rsfill = Nothing Me.txtArrival.SetFocusElse If Me.txtArrival.Text = "" Then MsgBox "Please input Arrival Date" Me.txtArrival.SetFocus Exit Sub End If If Not IsDate(Me.txtArrival.Text) Then MsgBox "Please input valid Date" Me.txtArrival.SetFocus Exit Sub End If If Me.txtRecCommercial.Text = "" Then MsgBox "Please input Required Field" Me.txtRecCommercial.SetFocus Exit Sub End If If Not IsNumeric(Me.txtRecCommercial.Text) Then MsgBox "Please input numeric data" Me.txtRecCommercial.SetFocus Exit Sub End If If Me.txtRecDomestic.Text = "" Then MsgBox "Please input Required Field" Me.txtRecDomestic.SetFocus Exit Sub End If If Not IsNumeric(Me.txtRecDomestic.Text) Then MsgBox "Please input numeric data" Me.txtRecDomestic.SetFocus Exit Sub
![Page 25: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/25.jpg)
End If If Me.txtDefCommercial.Text = "" Then MsgBox "Please input Required Field" Me.txtDefCommercial.SetFocus Exit Sub End If If Not IsNumeric(Me.txtDefCommercial.Text) Then MsgBox "Please input numeric data" Me.txtDefCommercial.SetFocus Exit Sub End If If Me.txtDefDomestic.Text = "" Then MsgBox "Please input Required Field" Me.txtDefDomestic.SetFocus Exit Sub End If If Not IsNumeric(Me.txtDefDomestic.Text) Then MsgBox "Please input numeric data" Me.txtDefDomestic.SetFocus Exit Sub End If con.Execute "delete from tblStock" con.Execute "insert into tblStock(CurrCommercial,CurrDomestic,DefectsCommercial,DefectsDomestic) values(" & Me.txtCurrCommercial.Text & "," & Me.txtCurrDomestic.Text & "," & Me.txtDefCommercial.Text & "," & Me.txtDefDomestic.Text & ")" con.Execute "insert into tblStockTrans(DoA,Commercial,Domestic) values('" & Me.txtArrival.Text & "'," & Me.txtRecCommercial.Text & "," & Me.txtRecDomestic.Text & ")" MsgBox "Record Saved" Me.txtArrival.Text = "" Me.txtRecCommercial.Text = "" Me.txtRecDomestic.Text = "" Me.txtDefCommercial.Text = "" Me.txtDefDomestic.Text = "" Me.txtArrival.Enabled = False Me.txtRecCommercial.Enabled = False Me.txtRecDomestic.Enabled = False Me.txtDefCommercial.Enabled = False Me.txtDefDomestic.Enabled = False
![Page 26: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/26.jpg)
Me.cmdNew.Caption = "New Stock"End IfEnd Sub
Private Sub Form_Load()Me.txtArrival.Enabled = FalseMe.txtRecCommercial.Enabled = FalseMe.txtRecDomestic.Enabled = FalseMe.txtDefCommercial.Enabled = FalseMe.txtDefDomestic.Enabled = FalseEnd Sub
Private Sub txtRecCommercial_Change()Me.txtCurrCommercial.Text = Val(Me.txtRecCommercial.Text) + Val(Me.txtOldCommercial.Text)End Sub
Private Sub txtRecDomestic_Change()Me.txtCurrDomestic.Text = Val(Me.txtRecDomestic.Text) + Val(Me.txtOldDomestic.Text)End Sub
![Page 27: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/27.jpg)
frmBooking
Dim ctype As StringPrivate Sub cmbConsumerNo_Click()
Me.txtLSlno.Text = ""Me.txtLType.Text = ""Me.txtLDoB.Text = ""Me.txtLReleased.Text = ""Me.txtLDoR.Text = ""Me.txtLRemarks.Text = ""
Dim rsfill As New ADODB.Recordsetrsfill.Open "select * from tblConsumer where ConsumerNo = " & Me.cmbConsumerNo.Text, con, adOpenDynamicIf Not rsfill.EOF Then Me.txtName.Text = rsfill("Name") Me.txtAddress1.Text = rsfill("Address1") Me.txtAddress2.Text = rsfill("Address2") Me.txtAddress3.Text = rsfill("Address3") Me.txtPin.Text = rsfill("Pin") Me.txtPhone.Text = rsfill("Phone") Me.txtCylinders.Text = rsfill("Cylinders") If UCase(rsfill("CylinderType")) = "D" Then ctype = "Domestic" Else ctype = "Commercial" End IfEnd Ifrsfill.Close
Me.cmdBook.Enabled = FalseMe.lblStatus.Caption = ""
Dim rsStock As New ADODB.RecordsetrsStock.Open "select * from tblStock", con, adOpenDynamicIf rsStock.EOF Then Me.cmdBook.Enabled = False Me.lblStatus.Caption = "Cannot book Gas. Stock Not Available"
![Page 28: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/28.jpg)
Exit SubElse If (ctype = "Domestic" And rsStock("CurrDomestic") <= 0) Or (ctype = "Commercial" And rsStock("CurrCommercial") <= 0) Then Me.cmdBook.Enabled = False Me.lblStatus.Caption = "Cannot book Gas. Stock Not Available" Exit Sub End IfEnd IfrsStock.CloseSet rsStock = Nothing
rsfill.Open "select * from tblConsumerTrans where ConsumerNo = " & Me.cmbConsumerNo.Text & " order by DateofBooking desc", con, adOpenDynamicIf Not rsfill.EOF Then Me.txtLSlno.Text = rsfill("Slno") Me.txtLType.Text = ctype Me.txtLDoB.Text = rsfill("DateofBooking") If rsfill("IsReleased") = 1 Then Me.txtLReleased.Text = "Yes" Else Me.txtLReleased.Text = "No" End If If IsNull(rsfill("DateofRelease")) Then Me.txtLDoR.Text = "" Else Me.txtLDoR.Text = rsfill("DateofRelease") End If If IsNull(rsfill("remarks")) Then Me.txtLRemarks.Text = "" Else Me.txtLRemarks.Text = rsfill("Remarks") End If If Me.txtLReleased.Text = "No" Then Me.lblStatus.Caption = "Cannot Book Gas. Previous Booking is not released." Me.cmdBook.Enabled = False Else Me.cmdBook.Enabled = True
![Page 29: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/29.jpg)
End IfElse Me.txtLSlno.Text = "" Me.txtLType.Text = "" Me.txtLDoB.Text = "" Me.txtLReleased.Text = "" Me.txtLDoR.Text = "" Me.txtLRemarks.Text = "" Me.cmdBook.Enabled = TrueEnd If
rsfill.CloseSet rsfill = NothingEnd Sub
Private Sub cmdBook_Click()If Me.cmbConsumerNo.Text = "" Then MsgBox "Please input Consumer No." Me.cmbConsumerNo.SetFocus Exit SubEnd IfIf Not IsNumeric(Me.cmbConsumerNo.Text) Then MsgBox "Please input Numeric value." Me.cmbConsumerNo.SetFocus Exit SubEnd IfDim rsDuplicate As New ADODB.RecordsetrsDuplicate.Open "select ConsumerNo from tblConsumer where ConsumerNo=" & Me.cmbConsumerNo.Text, con, adOpenDynamicIf rsDuplicate.EOF Then MsgBox "Consumer No. does not exist." Me.cmbConsumerNo.SetFocus Exit SubEnd IfrsDuplicate.CloseSet rsDuplicate = NothingIf Me.txtDoB.Text = "" Then MsgBox "Please input date of booking" Me.txtDoB.SetFocus Exit Sub
![Page 30: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/30.jpg)
End IfIf Not IsDate(Me.txtDoB.Text) Then MsgBox "Please input valid date" Me.txtDoB.SetFocus Exit SubEnd IfIf Me.txtLReleased.Text = "Yes" Then d = DateDiff("d", Me.txtLDoR.Text, Me.txtDoB.Text) If d <= 21 Then MsgBox "Cannot Book gas. Booking could be done after 21 days of previous booking." Me.txtDoB.SetFocus Exit Sub End IfEnd If
Dim tSlno As IntegerDim rsSlno As New ADODB.RecordsetrsSlno.Open "select Slno from tblConsumerTrans order by Slno desc", con, adOpenDynamicIf rsSlno.EOF Then tSlno = 1Else tSlno = rsSlno("Slno") + 1End IfrsSlno.CloseSet rsSlno = Nothing
con.Execute "insert into tblConsumerTrans(Slno,ConsumerNo,DateofBooking,IsReleased,Remarks) values(" & tSlno & "," & Me.cmbConsumerNo.Text & ",'" & Me.txtDoB.Text & "',0,'" & Me.txtRemarks.Text & "')"MsgBox "Gas Booked"Me.cmbConsumerNo.ListIndex = 0End Sub
Private Sub cmdExit_Click()Unload MeEnd Sub
![Page 31: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/31.jpg)
Private Sub Form_Load()Dim rsfill As New ADODB.Recordsetrsfill.Open "select ConsumerNo from tblConsumer order by ConsumerNo", con, adOpenDynamicDo While Not rsfill.EOF Me.cmbConsumerNo.AddItem rsfill("ConsumerNo") rsfill.MoveNextLoopIf Me.cmbConsumerNo.ListCount <> 0 Then Me.cmbConsumerNo.ListIndex = 0End Ifrsfill.CloseSet rsfill = Nothing'Me.cmdBook.Enabled = FalseMe.txtDoB.Text = DateEnd Sub
![Page 32: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/32.jpg)
frmChangePassword
Private Sub cmdExit_Click()Unload MeEnd Sub
Private Sub cmdOk_Click()Dim rsPass As New ADODB.RecordsetrsPass.Open "select Password from Pass", con, adOpenDynamicIf rsPass("Password") <> Me.txtOld.Text Then MsgBox "Invalid Password." Me.txtOld.SetFocus Exit SubElseIf Me.txtNew.Text <> Me.txtConfirm.Text Then MsgBox "Invalid Password." Me.txtConfirm.SetFocus Exit SubElse con.Execute "update Pass set Password = '" & Me.txtNew.Text & "'" MsgBox "Password Changed" Unload MeEnd If
End Sub
Private Sub Form_Load()
End Sub
![Page 33: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/33.jpg)
frmDaily
Private Sub cmdExit_Click()Unload MeEnd Sub
Private Sub cmdPreview_Click()If Not IsDate(Me.txtDate.Text) Then MsgBox "Please input valid date" Me.txtDate.SetFocus Exit SubEnd IfDim rsfill As New ADODB.Recordsetrsfill.Open "select count(*) as bdomestic from qryBill where CylinderType='D' and DateofBooking=cdate('" & Me.txtDate.Text & "')", con, adOpenDynamicbdomestic = rsfill("bdomestic")rsfill.Closersfill.Open "select count(*) as bcommercial from qryBill where CylinderType='C' and DateofBooking=cdate('" & Me.txtDate.Text & "')", con, adOpenDynamicbcommercial = rsfill("bcommercial")rsfill.Closersfill.Open "select count(*) as rdomestic from qryBill where CylinderType='D' and IsReleased=1 and DateofBooking=cdate('" & Me.txtDate.Text & "')", con, adOpenDynamicrdomestic = rsfill("rdomestic")rsfill.Closersfill.Open "select count(*) as rcommercial from qryBill where CylinderType='C' and IsReleased=1 and DateofBooking=cdate('" & Me.txtDate.Text & "')", con, adOpenDynamicrcommercial = rsfill("rcommercial")rsfill.CloseSet rsfill = Nothingcon.Execute "delete from count"con.Execute "insert into count(bdomestic,bcommercial,rdomestic,rcommercial) values(" & bdomestic & "," & bcommercial & "," & rdomestic & "," & rcommercial & ")"
![Page 34: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/34.jpg)
MsgBox "Preview Report"
Dim acApp As Access.ApplicationSet acApp = New Access.ApplicationacApp.OpenCurrentDatabase App.Path & "\gas.mdb"acApp.DoCmd.OpenReport "repDaily", acViewPreview, "select * from qrybill where Dateofbooking=cdate('" & Me.txtDate.Text & "')"acApp.DoCmd.MaximizeacApp.Visible = True
End Sub
Private Sub Form_Load()Me.txtDate.Text = DateEnd Sub
![Page 35: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/35.jpg)
frmDelConsumer
Private Sub cmbConsumerNo_Click()Dim rsfill As New ADODB.Recordsetrsfill.Open "select * from tblConsumer where ConsumerNo = " & Me.cmbConsumerNo.Text, con, adOpenDynamicIf Not rsfill.EOF ThenMe.txtName.Text = rsfill("Name")Me.txtDoC.Text = rsfill("DoC")Me.txtAddress1.Text = rsfill("Address1")Me.txtAddress2.Text = rsfill("Address2")Me.txtAddress3.Text = rsfill("Address3")Me.txtPin.Text = rsfill("Pin")Me.txtPhone.Text = rsfill("Phone")Me.txtCylinders.Text = rsfill("Cylinders")If UCase(rsfill("CylinderType")) = "D" Then Me.opDomestic = TrueElse Me.opCommercial = TrueEnd If
End Ifrsfill.CloseSet rsfill = NothingEnd Sub
Private Sub cmdExit_Click()Unload MeEnd Sub
Private Sub cmddelete_Click()If Me.cmbConsumerNo.Text = "" Then MsgBox "Please input Consumer No." Me.cmbConsumerNo.SetFocus Exit SubEnd IfIf Not IsNumeric(Me.cmbConsumerNo.Text) Then MsgBox "Please input Numeric value." Me.cmbConsumerNo.SetFocus
![Page 36: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/36.jpg)
Exit SubEnd IfDim rsDuplicate As New ADODB.RecordsetrsDuplicate.Open "select ConsumerNo from tblConsumer where ConsumerNo=" & Me.cmbConsumerNo.Text, con, adOpenDynamicIf rsDuplicate.EOF Then MsgBox "Consumer No. does not exist." Me.cmbConsumerNo.SetFocus Exit SubEnd IfrsDuplicate.CloseSet rsDuplicate = Nothingcon.Execute "delete from tblConsumer where ConsumerNo=" & Me.cmbConsumerNo.TextMe.cmbConsumerNo.ClearDim rsfill As New ADODB.Recordsetrsfill.Open "select ConsumerNo from tblConsumer order by ConsumerNo", con, adOpenDynamicDo While Not rsfill.EOF Me.cmbConsumerNo.AddItem rsfill("ConsumerNo") rsfill.MoveNextLoopIf Me.cmbConsumerNo.ListCount <> 0 Then Me.cmbConsumerNo.ListIndex = 0End Ifrsfill.CloseSet rsfill = Nothing
MsgBox "Record Deleted."End Sub
Private Sub Form_Load()Dim rsfill As New ADODB.Recordsetrsfill.Open "select ConsumerNo from tblConsumer order by ConsumerNo", con, adOpenDynamicDo While Not rsfill.EOF Me.cmbConsumerNo.AddItem rsfill("ConsumerNo") rsfill.MoveNextLoopIf Me.cmbConsumerNo.ListCount <> 0 Then
![Page 37: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/37.jpg)
Me.cmbConsumerNo.ListIndex = 0End Ifrsfill.CloseSet rsfill = Nothing
End SubfrmMain
Private Sub cmdOk_Click()Dim rsPass As New ADODB.RecordsetrsPass.Open "select Password from Pass", con, adOpenDynamicIf Not rsPass.EOF Then If (txtPassword.Text = "" And IsNull(rsPass("Password"))) Or (rsPass("Password") = txtPassword.Text) Then Unload Me frmMenu.Show vbModal Else MsgBox "Invalid Password" End IfElse Unload Me frmMenu.Show vbModalEnd If
rsPass.CloseSet rsPass = Nothing
End Sub
Private Sub cmdExit_Click()Unload MeEnd SubPrivate Sub Form_Load()con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" + App.Path + "\gas.mdb"con.OpenEnd Sub
![Page 38: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/38.jpg)
frmMenu
Private Sub menuAddNew_Click()frmAddConsumer.Show vbModal
End Sub
Private Sub mnuAddStock_Click()frmAddStock.Show vbModalEnd Sub
Private Sub mnuBooking_Click()frmBooking.Show vbModalEnd Sub
Private Sub mnuCP_Click()frmChangePassword.Show vbModalEnd Sub
Private Sub mnuDaily_Click()frmDaily.Show vbModalEnd Sub
Private Sub mnuDelete_Click()frmDelConsumer.Show vbModalEnd Sub
Private Sub mnuModify_Click()frmModConsumer.Show vbModalEnd Sub
Private Sub mnuMonthly_Click()frmMonthly.Show vbModalEnd Sub
Private Sub mnuPriceEntry_Click()frmPriceEntry.Show vbModalEnd Sub
![Page 39: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/39.jpg)
Private Sub mnuPrintBill_Click()frmPrintBill.Show vbModalEnd Sub
Private Sub mnuQuit_Click()Unload MeEnd Sub
Private Sub mnuRelease_Click()frmRelease.Show vbModalEnd Sub
Private Sub mnuView_Click()frmViewConsumer.Show vbModalEnd Sub
Private Sub mnuViewStock_Click()frmViewStock.Show vbModalEnd Sub
![Page 40: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/40.jpg)
frmModConsumer
Private Sub cmbConsumerNo_Click()Dim rsfill As New ADODB.Recordsetrsfill.Open "select * from tblConsumer where ConsumerNo = " & Me.cmbConsumerNo.Text, con, adOpenDynamicIf Not rsfill.EOF ThenMe.txtName.Text = rsfill("Name")Me.txtDoC.Text = rsfill("DoC")Me.txtAddress1.Text = rsfill("Address1")Me.txtAddress2.Text = rsfill("Address2")Me.txtAddress3.Text = rsfill("Address3")Me.txtPin.Text = rsfill("Pin")Me.txtPhone.Text = rsfill("Phone")Me.txtCylinders.Text = rsfill("Cylinders")If UCase(rsfill("CylinderType")) = "D" Then Me.opDomestic = TrueElse Me.opCommercial = TrueEnd If
End Ifrsfill.CloseSet rsfill = NothingEnd Sub
Private Sub cmdExit_Click()Unload MeEnd Sub
Private Sub cmdupdate_Click()If Me.cmbConsumerNo.Text = "" Then MsgBox "Please input Consumer No." Me.cmbConsumerNo.SetFocus Exit SubEnd IfIf Not IsNumeric(Me.cmbConsumerNo.Text) Then MsgBox "Please input Numeric value." Me.cmbConsumerNo.SetFocus
![Page 41: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/41.jpg)
Exit SubEnd IfDim rsDuplicate As New ADODB.RecordsetrsDuplicate.Open "select ConsumerNo from tblConsumer where ConsumerNo=" & Me.cmbConsumerNo.Text, con, adOpenDynamicIf rsDuplicate.EOF Then MsgBox "Consumer No. does not exist." Me.cmbConsumerNo.SetFocus Exit SubEnd IfrsDuplicate.CloseSet rsDuplicate = NothingIf Me.txtDoC.Text = "" Then MsgBox "Please input Date of Connection." Me.txtDoC.SetFocus Exit SubEnd IfIf Not IsDate(Me.txtDoC.Text) Then MsgBox "Please input valid Date." Me.txtDoC.SetFocus Exit SubEnd IfIf Me.txtName.Text = "" Then MsgBox "Please input Name" Me.txtName.SetFocus Exit SubEnd IfIf Me.txtAddress1.Text = "" Then MsgBox "Please input Address." Me.txtAddress1.SetFocus Exit SubEnd IfIf Me.txtCylinders.Text = "" Then MsgBox "Please input No. of Cylinders." Me.txtCylinders.SetFocus Exit SubEnd IfIf Not IsNumeric(Me.txtCylinders.Text) Then MsgBox "Please input Numeric value." Me.txtCylinders.SetFocus
![Page 42: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/42.jpg)
Exit SubEnd IfIf Me.txtCylinders.Text < 0 Or Me.txtCylinders.Text > 2 Then MsgBox "Please input between 0..2" Me.txtCylinders.SetFocus Exit SubEnd IfIf Me.opDomestic.Value = True Then ctype = "D"Else ctype = "C"End If
con.Execute "delete from tblConsumer where ConsumerNo=" & Me.cmbConsumerNo.Textcon.Execute "insert into tblConsumer(ConsumerNo,Name,Address1,Address2,Address3,Pin,Phone,DoC,Cylinders,CylinderType) values(" & Me.cmbConsumerNo.Text & ",'" & Me.txtName.Text & "','" & Me.txtAddress1.Text & "','" & Me.txtAddress2.Text & "','" & Me.txtAddress3.Text & "','" & Me.txtPin.Text & "','" & Me.txtPhone.Text & "','" & Me.txtDoC.Text & "'," & Me.txtCylinders.Text & ",'" & ctype & "')"
MsgBox "Record Updated."End Sub
Private Sub Form_Load()Dim rsfill As New ADODB.Recordsetrsfill.Open "select ConsumerNo from tblConsumer order by ConsumerNo", con, adOpenDynamicDo While Not rsfill.EOF Me.cmbConsumerNo.AddItem rsfill("ConsumerNo") rsfill.MoveNextLoopIf Me.cmbConsumerNo.ListCount <> 0 Then Me.cmbConsumerNo.ListIndex = 0End Ifrsfill.CloseSet rsfill = Nothing
![Page 43: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/43.jpg)
End Sub
frmMonthly
Private Sub cmdExit_Click()Unload MeEnd Sub
Private Sub cmdPreview_Click()
Dim rsfill As New ADODB.Recordsetrsfill.Open "select count(*) as bdomestic from qryBill where CylinderType='D' and month(DateofBooking)=" & Me.cmbMonth.ItemData(Me.cmbMonth.ListIndex) & " and year(DateofBooking)=" & Me.cmbYear.Text, con, adOpenDynamicbdomestic = rsfill("bdomestic")rsfill.Closersfill.Open "select count(*) as bcommercial from qryBill where CylinderType='C' and month(DateofBooking)=" & Me.cmbMonth.ItemData(Me.cmbMonth.ListIndex) & " and year(DateofBooking)=" & Me.cmbYear.Text, con, adOpenDynamicbcommercial = rsfill("bcommercial")rsfill.Closersfill.Open "select count(*) as rdomestic from qryBill where CylinderType='D' and IsReleased=1 and month(DateofBooking)=" & Me.cmbMonth.ItemData(Me.cmbMonth.ListIndex) & " and year(DateofBooking)=" & Me.cmbYear.Text, con, adOpenDynamicrdomestic = rsfill("rdomestic")rsfill.Closersfill.Open "select count(*) as rcommercial from qryBill where CylinderType='C' and IsReleased=1 and month(DateofBooking)=" & Me.cmbMonth.ItemData(Me.cmbMonth.ListIndex) & " and year(DateofBooking)=" & Me.cmbYear.Text, con, adOpenDynamicrcommercial = rsfill("rcommercial")rsfill.CloseSet rsfill = Nothingcon.Execute "delete from count"
![Page 44: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/44.jpg)
con.Execute "insert into count(bdomestic,bcommercial,rdomestic,rcommercial) values(" & bdomestic & "," & bcommercial & "," & rdomestic & "," & rcommercial & ")"MsgBox "Preview Report"
Dim acApp As Access.ApplicationSet acApp = New Access.ApplicationacApp.OpenCurrentDatabase App.Path & "\gas.mdb"acApp.DoCmd.OpenReport "repMonthly", acViewPreview, "select * from qrybill where month(DateofBooking)=" & Me.cmbMonth.ItemData(Me.cmbMonth.ListIndex) & " and year(DateofBooking)=" & Me.cmbYear.TextacApp.DoCmd.MaximizeacApp.Visible = True
End Sub
Private Sub Form_Load()For i = 0 To 11 Me.cmbMonth.AddItem MonthName(i + 1) Me.cmbMonth.ItemData(i) = i + 1Next
For i = 2000 To Year(Date) + 10 Me.cmbYear.AddItem i NextMe.cmbMonth.ListIndex = Month(Date) - 1Me.cmbYear.ListIndex = Year(Date) - 2000End Sub
![Page 45: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/45.jpg)
frmPriceEntry
Private Sub cmdExit_Click()Unload MeEnd Sub
Private Sub cmdupdate_Click()If Me.txtCommercial.Text = "" Then MsgBox "Please input Price" Me.txtCommercial.SetFocus Exit SubEnd IfIf Not IsNumeric(Me.txtCommercial.Text) Then MsgBox "Please input numeric data" Me.txtCommercial.SetFocus Exit SubEnd IfIf Me.txtDomestic.Text = "" Then MsgBox "Please input Price" Me.txtDomestic.SetFocus Exit SubEnd IfIf Not IsNumeric(Me.txtDomestic.Text) Then MsgBox "Please input numeric data" Me.txtDomestic.SetFocus Exit SubEnd Ifcon.Execute "delete from tblPrice"con.Execute "insert into tblPrice(CylinderType,Price) values('C'," & Me.txtCommercial.Text & ")"con.Execute "insert into tblPrice(CylinderType,Price) values('D'," & Me.txtDomestic.Text & ")"MsgBox "Record Updated"End Sub
Private Sub Form_Load() Dim rsfill As New ADODB.Recordset rsfill.Open "select * from tblPrice", con, adOpenDynamic If rsfill.EOF Then
![Page 46: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/46.jpg)
Me.txtCommercial.Text = "0" Me.txtDomestic.Text = "0" Else Do While Not rsfill.EOF If UCase(rsfill("CylinderType")) = "C" Then Me.txtCommercial.Text = rsfill("Price") Else Me.txtDomestic.Text = rsfill("Price") End If rsfill.MoveNext Loop End If rsfill.Close Set rsfill = Nothing
End Sub
frmPrintBill
Dim ctype As StringPrivate Sub cmbConsumerNo_Click()
Me.txtLSlno.Text = ""Me.txtLType.Text = ""Me.txtLDoB.Text = ""Me.txtLReleased.Text = ""Me.txtLDoR.Text = ""Me.txtLRemarks.Text = ""
Dim rsfill As New ADODB.Recordsetrsfill.Open "select * from tblConsumer where ConsumerNo = " & Me.cmbConsumerNo.Text, con, adOpenDynamicIf Not rsfill.EOF Then Me.txtName.Text = rsfill("Name") Me.txtAddress1.Text = rsfill("Address1") Me.txtAddress2.Text = rsfill("Address2") Me.txtAddress3.Text = rsfill("Address3")
![Page 47: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/47.jpg)
Me.txtPin.Text = rsfill("Pin") Me.txtPhone.Text = rsfill("Phone") Me.txtCylinders.Text = rsfill("Cylinders") If UCase(rsfill("CylinderType")) = "D" Then ctype = "Domestic" Else ctype = "Commercial" End IfEnd Ifrsfill.Close
rsfill.Open "select * from tblConsumerTrans where ConsumerNo = " & Me.cmbConsumerNo.Text & " order by DateofBooking desc", con, adOpenDynamicIf Not rsfill.EOF Then Me.txtLSlno.Text = rsfill("Slno") Me.txtLType.Text = ctype Me.txtLDoB.Text = rsfill("DateofBooking") If IsNull(rsfill("remarks")) Then Me.txtLRemarks.Text = "" Else Me.txtLRemarks.Text = rsfill("Remarks") End If If IsNull(rsfill("DateofRelease")) Then Me.txtLDoR.Text = "" Else Me.txtLDoR.Text = rsfill("DateofRelease") End If If rsfill("IsReleased") = 1 Then Me.txtLReleased.Text = "Yes" Me.cmdPrint.Enabled = True Else Me.txtLReleased.Text = "No" Me.cmdPrint.Enabled = False End IfElse Me.txtLSlno.Text = "" Me.txtLType.Text = "" Me.txtLDoB.Text = "" Me.txtLReleased.Text = ""
![Page 48: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/48.jpg)
Me.txtLDoR.Text = "" Me.txtLRemarks.Text = "" Me.cmdPrint.Enabled = FalseEnd If
rsfill.CloseSet rsfill = NothingEnd Sub
Private Sub cmdprint_Click()If Me.cmbConsumerNo.Text = "" Then MsgBox "Please input Consumer No." Me.cmbConsumerNo.SetFocus Exit SubEnd IfIf Not IsNumeric(Me.cmbConsumerNo.Text) Then MsgBox "Please input Numeric value." Me.cmbConsumerNo.SetFocus Exit SubEnd IfDim rsDuplicate As New ADODB.RecordsetrsDuplicate.Open "select ConsumerNo from tblConsumer where ConsumerNo=" & Me.cmbConsumerNo.Text, con, adOpenDynamicIf rsDuplicate.EOF Then MsgBox "Consumer No. does not exist." Me.cmbConsumerNo.SetFocus Exit SubEnd IfrsDuplicate.CloseSet rsDuplicate = Nothing
Dim acApp As Access.ApplicationSet acApp = New Access.ApplicationacApp.OpenCurrentDatabase App.Path & "\gas.mdb"acApp.DoCmd.OpenReport "repBill", acViewPreview, "select * from qryBill where ConsumerNo=" & Me.cmbConsumerNo.Text & " and DateofBooking=cdate('" & Me.txtLDoB.Text & "')"acApp.DoCmd.MaximizeacApp.Visible = True
![Page 49: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/49.jpg)
End Sub
Private Sub cmdExit_Click()Unload MeEnd Sub
Private Sub Form_Load()Dim rsfill As New ADODB.Recordsetrsfill.Open "select ConsumerNo from tblConsumer order by ConsumerNo", con, adOpenDynamicDo While Not rsfill.EOF Me.cmbConsumerNo.AddItem rsfill("ConsumerNo") rsfill.MoveNextLoopIf Me.cmbConsumerNo.ListCount <> 0 Then Me.cmbConsumerNo.ListIndex = 0End Ifrsfill.CloseSet rsfill = Nothing
End Sub
frmRelease
Dim ctype As StringPrivate Sub cmbConsumerNo_Click()
Me.txtLSlno.Text = ""Me.txtLType.Text = ""Me.txtLDoB.Text = ""Me.txtLReleased.Text = ""Me.txtLDoR.Text = ""Me.txtLRemarks.Text = ""'Me.txtLDoR.Enabled = False'Me.txtLRemarks.Enabled = False
![Page 50: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/50.jpg)
Dim rsfill As New ADODB.Recordsetrsfill.Open "select * from tblConsumer where ConsumerNo = " & Me.cmbConsumerNo.Text, con, adOpenDynamicIf Not rsfill.EOF Then Me.txtName.Text = rsfill("Name") Me.txtAddress1.Text = rsfill("Address1") Me.txtAddress2.Text = rsfill("Address2") Me.txtAddress3.Text = rsfill("Address3") Me.txtPin.Text = rsfill("Pin") Me.txtPhone.Text = rsfill("Phone") Me.txtCylinders.Text = rsfill("Cylinders") If UCase(rsfill("CylinderType")) = "D" Then ctype = "Domestic" Else ctype = "Commercial" End IfEnd Ifrsfill.Close
Me.cmdBook.Enabled = FalseMe.lblStatus.Caption = ""
rsfill.Open "select * from tblConsumerTrans where ConsumerNo = " & Me.cmbConsumerNo.Text & " order by DateofBooking desc", con, adOpenDynamicIf Not rsfill.EOF Then Me.txtLSlno.Text = rsfill("Slno") Me.txtLType.Text = ctype Me.txtLDoB.Text = rsfill("DateofBooking") If IsNull(rsfill("remarks")) Then Me.txtLRemarks.Text = "" Else Me.txtLRemarks.Text = rsfill("Remarks") End If If IsNull(rsfill("DateofRelease")) Then Me.txtLDoR.Text = "" Else Me.txtLDoR.Text = rsfill("DateofRelease") End If If rsfill("IsReleased") = 1 Then
![Page 51: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/51.jpg)
Me.txtLReleased.Text = "Yes" Me.cmdBook.Enabled = False Me.txtLRemarks.Enabled = False Me.txtLDoR.Enabled = False Else Me.txtLReleased.Text = "No" Me.cmdBook.Enabled = True Me.txtLRemarks.Enabled = True Me.txtLDoR.Enabled = True Me.txtLDoR.Text = Date End If Dim rsStock As New ADODB.Recordset rsStock.Open "select * from tblStock", con, adOpenDynamic If rsStock.EOF Then Me.cmdBook.Enabled = False Me.lblStatus.Caption = "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 Me.cmdBook.Enabled = False Me.lblStatus.Caption = "Cannot Release booked Gas. Stock Not Available" Exit Sub End If End If rsStock.Close Set rsStock = Nothing
Else Me.txtLSlno.Text = "" Me.txtLType.Text = "" Me.txtLDoB.Text = "" Me.txtLReleased.Text = "" Me.txtLDoR.Text = "" Me.txtLRemarks.Text = "" Me.txtLReleased.Enabled = False Me.txtLDoR.Enabled = False
![Page 52: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/52.jpg)
Me.cmdBook.Enabled = FalseEnd If
rsfill.CloseSet rsfill = NothingEnd Sub
Private Sub cmdBook_Click()If Me.cmbConsumerNo.Text = "" Then MsgBox "Please input Consumer No." Me.cmbConsumerNo.SetFocus Exit SubEnd IfIf Not IsNumeric(Me.cmbConsumerNo.Text) Then MsgBox "Please input Numeric value." Me.cmbConsumerNo.SetFocus Exit SubEnd IfDim rsDuplicate As New ADODB.RecordsetrsDuplicate.Open "select ConsumerNo from tblConsumer where ConsumerNo=" & Me.cmbConsumerNo.Text, con, adOpenDynamicIf rsDuplicate.EOF Then MsgBox "Consumer No. does not exist." Me.cmbConsumerNo.SetFocus Exit SubEnd IfrsDuplicate.CloseSet rsDuplicate = NothingIf Me.txtLDoR.Text = "" Then MsgBox "Please input date of release" Me.txtLDoR.SetFocus Exit SubEnd IfIf Not IsDate(Me.txtLDoR.Text) Then MsgBox "Please input valid date" Me.txtLDoR.SetFocus Exit SubEnd IfIf Me.txtLReleased.Text = "No" Then If CDate(Me.txtLDoR.Text) < CDate(Me.txtLDoB.Text) Then
![Page 53: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/53.jpg)
MsgBox "Date of Release should not be less that date of booking" Me.txtLDoR.SetFocus Exit Sub End IfEnd If
con.Execute "update tblConsumerTrans set DateofRelease='" & Me.txtLDoR.Text & "', IsReleased=1 where ConsumerNo=" & Me.cmbConsumerNo.Text & " and DateofBooking=cdate('" & Me.txtLDoB.Text & "')"If ctype = "Commercial" Then con.Execute "update tblStock set CurrCommercial=CurrCommercial-1"Else con.Execute "update tblStock set CurrDomestic=CurrDomestic-1"End IfMsgBox "Gas Released"Me.cmbConsumerNo.ListIndex = 0
Dim acApp As Access.ApplicationSet acApp = New Access.ApplicationacApp.OpenCurrentDatabase App.Path & "\gas.mdb"acApp.DoCmd.OpenReport "repBill", acViewPreview, "select * from qryBill where ConsumerNo=" & Me.cmbConsumerNo.Text & " and DateofBooking=cdate('" & Me.txtLDoB.Text & "')"acApp.DoCmd.MaximizeacApp.Visible = True
End Sub
Private Sub cmdExit_Click()Unload MeEnd Sub
Private Sub Form_Load()Dim rsfill As New ADODB.Recordsetrsfill.Open "select ConsumerNo from tblConsumer order by ConsumerNo", con, adOpenDynamicDo While Not rsfill.EOF Me.cmbConsumerNo.AddItem rsfill("ConsumerNo") rsfill.MoveNext
![Page 54: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/54.jpg)
LoopIf Me.cmbConsumerNo.ListCount <> 0 Then Me.cmbConsumerNo.ListIndex = 0End Ifrsfill.CloseSet rsfill = Nothing'Me.cmdBook.Enabled = False'Me.txtLDoR.Enabled = False'Me.txtLRemarks.Enabled = False
End Sub
frmViewConsumer
Private Sub cmbConsumerNo_Click()Dim rsfill As New ADODB.Recordsetrsfill.Open "select * from tblConsumer where ConsumerNo = " & Me.cmbConsumerNo.Text, con, adOpenDynamicIf Not rsfill.EOF ThenMe.txtName.Text = rsfill("Name")Me.txtDoC.Text = rsfill("DoC")Me.txtAddress1.Text = rsfill("Address1")Me.txtAddress2.Text = rsfill("Address2")Me.txtAddress3.Text = rsfill("Address3")Me.txtPin.Text = rsfill("Pin")Me.txtPhone.Text = rsfill("Phone")Me.txtCylinders.Text = rsfill("Cylinders")If UCase(rsfill("CylinderType")) = "D" Then Me.opDomestic = TrueElse Me.opCommercial = TrueEnd If
End Ifrsfill.CloseSet rsfill = NothingEnd Sub
![Page 55: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/55.jpg)
Private Sub cmdExit_Click()Unload MeEnd Sub
Private Sub Form_Load()Dim rsfill As New ADODB.Recordsetrsfill.Open "select ConsumerNo from tblConsumer order by ConsumerNo", con, adOpenDynamicDo While Not rsfill.EOF Me.cmbConsumerNo.AddItem rsfill("ConsumerNo") rsfill.MoveNextLoopIf Me.cmbConsumerNo.ListCount <> 0 Then Me.cmbConsumerNo.ListIndex = 0End Ifrsfill.CloseSet rsfill = Nothing
End Sub
![Page 56: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/56.jpg)
frmViewStock
Private Sub cmdExit_Click()Unload MeEnd Sub
Private Sub Form_Load() Dim rsfill As New ADODB.Recordset rsfill.Open "select * from tblStock", con, adOpenDynamic If rsfill.EOF Then Me.txtCurrCommercial.Text = "0" Me.txtCurrDomestic.Text = "0" Me.txtDefCommercial.Text = "0" Me.txtDefDomestic.Text = "0" Else Me.txtCurrCommercial.Text = rsfill("CurrCommercial") Me.txtCurrDomestic.Text = rsfill("CurrDomestic") Me.txtDefCommercial.Text = rsfill("DefectsCommercial") Me.txtDefDomestic.Text = rsfill("DefectsDomestic") End If rsfill.Close Set rsfill = Nothing
End
![Page 57: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/57.jpg)
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.
![Page 58: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/58.jpg)
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.
![Page 59: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/59.jpg)
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.
![Page 60: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/60.jpg)
![Page 61: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/61.jpg)
frmMain
![Page 62: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/62.jpg)
frmMenu
![Page 63: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/63.jpg)
frmAddConsumer
![Page 64: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/64.jpg)
frmModConsumer
![Page 65: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/65.jpg)
frmDelConsumer
![Page 66: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/66.jpg)
frmViewConsumer
![Page 67: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/67.jpg)
frmAddStock
![Page 68: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/68.jpg)
frmViewStock
![Page 69: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/69.jpg)
frmPriceEntry
![Page 70: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/70.jpg)
frmChangePassword
![Page 71: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/71.jpg)
frmBooking
![Page 72: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/72.jpg)
frmRelease
![Page 73: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/73.jpg)
frmPrintBill
![Page 74: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/74.jpg)
Customer Bill
![Page 75: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/75.jpg)
frmDaily
![Page 76: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/76.jpg)
frmMonthly
![Page 77: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/77.jpg)
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
![Page 78: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/78.jpg)
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.
![Page 79: Gas Agency Management System](https://reader033.fdocuments.in/reader033/viewer/2022061113/545dbe8db1af9fd40a8b4976/html5/thumbnails/79.jpg)
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.