You are on page 1of 22

SOFTWARE DESIGN

DESCRIPTION
Code for the icon of the listview
'Dim item1, item2, item3, item4, item5 As ListItem
With lvMenu
Set .SmallIcons = ImageList1
Set .Icons = ImageList1
'For Sales
.ListItems.Add , "user", "View Users", 1, 1
.ListItems.Add , "Add Student", "Add New Student", 2, 2
.ListItems.Add , "Edit Student Information", "Edit Student Information", 3, 3
.ListItems.Add , "Result", "Result", 4, 4
.ListItems.Add , "View Student Report", "View Student Report", 5, 5
.ListItems.Add , "Result Report", "Result Report", 6, 6
.ListItems.Add , "Fees Payment", "Fees Payment", 7, 7
.ListItems.Add , "School Info", "School Info", 8, 8
End With
End Sub
Private Sub lvMenu_DblClick()
Select Case lvMenu.SelectedItem.Key
Case "user": frmSysUser.Show
Case "Add Student": frmsturegister1.Show
Case "Edit Student Information": frmStudGeneral.Show
Case "Result": frmResult.Show
Case "Fees Payment": Feespayment.Show
Case "View Student Report": Call mnurepstu_Click
Case "School Info": frmSchoolInfo.Show
Case "Result Report": frmResultRep.Show
End Select
End Sub
Code for exiting the application
Private Sub MDIForm_Unload(Cancel As Integer)
On Error GoTo handle
If SchoolMain.Label2.Caption <> "" Then
MsgBox " I N I T I A T E D A P P L I C A T I O N S H U T D O W N"

‘Code for showing the login time and session and Termination of session’
Call connect
With rs_find
If .State = adStateOpen Then .Close
.Open "select * from UserLog", con, adOpenDynamic, adLockPessimistic
.AddNew
.Fields("UserID").Value = SchoolMain.Label2.Caption
.Fields("SessionStart").Value = frmLogin.lblval.Caption
.Fields("SessionEnd").Value = Now
.Fields("Description") = "Session Successfully Terminated"
.Update
.Close
End With
MsgBox "THANK YOU FOR USING SMARTSCHOOL OFFICE" & vbCrLf & vbCrLf &
" SESSION ENDS AT : " & Now, vbInformation + vbOKOnly, "SESSION SUCCESSFULLY
TERMINATED"
End
Else
End
End If
Exit Sub
handle:

Public Sub mnulogout_Click()


Dim rep
If SchoolMain.mnulogout.Caption = "Logout" Then
rep = MsgBox("Are you sure you want to Logout ?", vbYesNo, "Confirm Logout")
If rep = vbYes Then
Call connect
With rs_find
If .State = adStateOpen Then .Close
.Open "select * from UserLog", con, adOpenDynamic, adLockPessimistic
.AddNew
.Fields("UserID").Value = SchoolMain.Label2.Caption
.Fields("SessionStart").Value = frmLogin.lblval.Caption
.Fields("SessionEnd").Value = Now
.Fields("Description") = "Session Successfully Terminated"
.Update
.Close
End With

SchoolMain.Label2.Caption = ""
SchoolMain.Label5.Caption = ""
SchoolMain.Label6.Caption = ""
SchoolMain.Label8.Caption = ""
SchoolMain.Timer1.Enabled = False
SchoolMain.StatusBar1.Panels(1).Text = SchoolMain.StatusBar1.Panels(1).Text
+""
MsgBox "THANK YOU FOR SMARTSCHOOL OFFICE" & vbCrLf & vbCrLf & "
SESSION ENDS AT : " & Now, vbInformation + vbOKOnly, "SUCCESSFULLY LOGGED
OUT"

‘code to create a new system user’

Private Sub cmdCreate_Click()


Call connect
If txtun.Text = "" Or txtPass.Text = "" Or txtrepass.Text = "" Or txtname.Text = "" Or
comAcctyp.Text = "" Or comAcctyp.Text = "<<--SELECT-->>" Then
MsgBox "all fill all fields"
Exit Sub
End If
If txtPass.Text <> txtrepass.Text Then
MsgBox " please confirm password"
txtrepass.Text = ""
Exit Sub
End If
With rs_find
If .State = adStateOpen Then .Close
.Open " select * from user_mstr where staff_id= " & Val(comstffid.Text) & "", con,
adOpenDynamic, adLockOptimistic
If .RecordCount >= 1 Then
.Close
MsgBox "current user already present"
comstffid.Text = ""
Exit Sub
End If
.Close
End With
Dim rep
rep = MsgBox("Are you sure you want to create a new User ?", vbYesNo)

If rep = vbYes Then


With rs_find
If .State = adStateOpen Then .Close
.Open "select * from user_mstr", con, adOpenDynamic, adLockPessimistic
.AddNew
.Fields("user_id") = txtun.Text
.Fields("pass") = txtPass.Text
.Fields("staff_id").Value = Val(comstffid.Text)
.Fields("Acct_typ") = comAcctyp.Text
.Update
.Close
MsgBox "User Successfully Created!”
End With
Unload Me
Else
Exit Sub
End If
End Sub

‘Code for creating new student record’


Private Sub Command3_Click()
If Texfname.Text = "" Or Texmname.Text = "" Or Texlname.Text = "" Or _
Texmotname.Text = "" Or Texfatname.Text = "" Or Texgarname.Text = "" Or _
Texaddress.Text = "" Or Texcity.Text = "" Or Texstate.Text = "" Or _
Texpin.Text = "" Or Texphone.Text = "" Or Texmobile.Text = "" Or _
Texemail.Text = "" Or ComGen.Text = "" Or TexPOB.Text = "" Or _
Texnaton.Text = "" Or Texage.Text = "" Then
MsgBox "Please Fill all the entries", vbInformation + vbOKOnly, "FIELD EMPTY"
Else
Me.Hide
frmsturegister2.Show
End If
End Sub

Private Sub Command4_Click()


Unload Me
End Sub

Private Sub cmdAdd_Click()


On Error Resume Next
cdb.Filter = "All Picture Files|*.jpg;*.gif;*.bmp;*.wmf;*.ico|JPEG
Images(*.jpg)|*.jpg|Bitmap Images (*.bmp)|*.bmp|Word Meta Files
(*.wmf)|*.wmf|GIF Images (*.gif)|*.gif"
cdb.ShowOpen
If cdb.FileName <> "" Then
pcbox.Picture = LoadPicture(cdb.FileName)
pic_name = cdb.FileName
pic_ext = Right(cdb.FileTitle, 4)
pic_changed = True
End If
End Sub

Private Sub cmdclr_Click()


On Error Resume Next
Set pcbox.Picture = Nothing
pic_name = ""
pic_changed = True

End Sub

Private Sub cmdcls_Click()


Unload Me
End Sub

Private Sub cmdnext_Click()


Dim cntrl As Control
For Each cntrl In Me
If TypeOf cntrl Is TextBox Then
If cntrl.Text = "" Then
MsgBox "Please provide value in the blank field "
Exit Sub
End If
End If
If TypeOf cntrl Is ComboBox Then
If cntrl.Text = "" Then
MsgBox "Please Select the appropriate value from the dropdown box"
Exit Sub
End If
End If
Next
Me.Hide
frmsturegister2.Show
End Sub

Private Sub dtdob_Click()


Dim a, b, c As Integer
a = Format(dtdob.Value, "yyyy")
b = Format(Date, "yyyy")
c=b-a
Texage.Text = c
End Sub

Private Sub Form_Load()


On Error Resume Next
Call connect
con.Refresh
With rs_find
.Open "select * from student_mstr", con, adOpenDynamic, adLockPessimistic
.MoveLast
If IsNull(.Fields("student_id").Value) Then
Texstu_id.Text = 1
Else
no = .Fields("student_id") + 1
Texstu_id.Text = no
End If
.Close
End With

End Sub

‘Code for creating new department’

Private Sub cmd_ok_NewDep_Click()


Unload Me
End Sub

Private Sub Command1_Click()


Call connect
With rs_dep
If .State = adStateOpen Then .Close
.Open "select * from department", con, adOpenDynamic, adLockPessimistic
.AddNew
.Fields("department_id") = Texdid.Text
.Fields("department_name") = Texdn.Text
.Fields("description") = Texdes.Text
.Update
.Close
End With
Command2.Enabled = True
Command1.Enabled = False
Dim rep
rep = MsgBox("Record Succesfully Created " & vbCrLf & "Would you like to create
new department ?", vbInformation + vbYesNo, "RECORD CREATED")
If rep = vbYes Then
Unload Me
Call SchoolMain.mnuNewDepart_Click
Else
Unload Me
End If
End Sub

Private Sub Command2_Click()


Texdn.Locked = False
Texdes.Locked = False
Texdn.Text = ""
Texdes.Text = ""
Command1.Enabled = True
Command2.Enabled = False
End Sub

‘Code for deleting student record’

Private Sub cmddel_Click()


'On Error Resume Next

If comstuid.Text = "" Then


MsgBox "please select a student"
Exit Sub
End If

Call connect
Dim rep

Dim strsql As String


strsql = "delete * from student_mstr where student_id=" & Val(comstuid.Text) & ""
rep = MsgBox("Are you sure you want to delete this record ? " & vbCrLf & "IF YOU
DELETE A RECORD THE RECORD WILL BE PERMANENTLY LOST", vbExclamation +
vbYesNo, "DELETE RECORD")

If rep = vbYes Then


con.Execute strsql
MsgBox "RECORD SUCCESSFULLY DELETED", vbInformation + vbOKOnly, "DELETE
RECORD"
comstuid.Clear
Texfn.Text = ""
Texln.Text = ""
Texmn.Text = ""
pcbox.Picture = Nothing
comRoll.RemoveItem comRoll.ListIndex
comstuid.Text = ""
Else
Exit Sub
End If

End Sub

Private Sub ComDiv_Click()


comRoll.Clear
comstuid.Clear
Call connect
With rs_find
If .State = adStateOpen Then .Close
.Open "select roll_no from student_mstr where Std='" & ComStd.Text & "' and Div
='" & ComDiv.Text & "'", con, adOpenDynamic, adLockPessimistic
Do Until .EOF
comRoll.AddItem .Fields("roll_no").Value
.MoveNext
Loop
.Close
End With

End Sub

‘Code for creating a new class’


Private Sub cmdAdd_Click()
cmdSav.Enabled = True
Command4.Enabled = True
cmdclos.Enabled = False
Texclassid.Locked = False
Texstd.Locked = False
Texdiv.Locked = False
TexPerstu.Locked = False
Texclassrec.Locked = False
sub1.Locked = False
sub2.Locked = False
sub3.Locked = False
sub4.Locked = False
sub5.Locked = False
sub6.Locked = False
sub7.Locked = False
sub8.Locked = False
sub9.Locked = False
sub10.Locked = False
sub11.Locked = False
sub12.Locked = False
Comsch.Locked = False
Comacdbehav.Locked = False
Texstd.Text = ""
Texdiv.Text = ""
TexPerstu.Text = ""
Texclassrec.Text = ""
sub1.Text = ""
sub2.Text = ""
sub3.Text = ""
sub4.Text = ""
sub5.Text = ""
sub6.Text = ""
sub7.Text = ""
sub8.Text = ""
sub9.Text = ""
sub10.Text = ""
sub11.Text = ""
sub12.Text = ""
cmdSav.Enabled = True
cmdAdd.Enabled = False
Call connect
End Sub

Private Sub cmdclos_Click()


Unload Me
End Sub

Private Sub cmdSav_Click()


'On Error Resume Next

Call connect
With rs_find
If .State = adStateOpen Then .Close
.Open "select * from class_mstr where Std = '" & Texstd.Text & "' and Div = '" &
Texdiv.Text & "'", con, adOpenStatic, adLockOptimistic
If .RecordCount >= 1 Then
.Close
MsgBox " class already present"
Texstd.Text = ""
Texdiv.Text = ""
Exit Sub
End If
.Close
End With

If Texclassid.Text = "" Or Texstd.Text = "" Or Texdiv.Text = "" Or _


TexPerstu.Text = "" Or _
Comsch.Text = "" Or Comacdbehav.Text = "" Or Texclassrec.Text = "" Then
MsgBox "All fields are Mandatory to filled", vbInformation + vbOKOnly, "Field
Empty"
ElseIf sub1.Text = "" And sub2.Text = "" And sub3.Text = "" And sub4.Text = "" And _
sub5.Text = "" And sub6.Text = "" And sub7.Text = "" And sub8.Text = "" _
And sub9.Text = "" And sub10.Text = "" And sub11.Text = "" And sub12.Text = ""
Then

MsgBox "please add at least one subject ", vbInformation + vbOKOnly, "Subject Field
Empty"
Else
Call connect

With rs_class
If .State = adStateOpen Then .Close
.Open "select * from class_mstr", con, adOpenDynamic, adLockPessimistic
.AddNew
.Fields("Class_ID") = Texclassid.Text
.Fields("Std") = Texstd.Text
.Fields("Div") = Texdiv.Text
.Fields("Student_Strength") = TexPerstu.Text
.Fields("Class_shedule") = Comsch.Text
.Fields("Academic_Behaviour") = Comacdbehav.Text
.Fields("Class_requirement") = Texclassrec.Text
.Fields("Subject1") = sub1.Text
.Fields("Subject2") = sub2.Text
.Fields("Subject3") = sub3.Text
.Fields("Subject4") = sub4.Text
.Fields("Subject5") = sub5.Text
.Fields("Subject6") = sub6.Text
.Fields("Subject7") = sub7.Text
.Fields("Subject8") = sub8.Text
.Fields("Subject9") = sub9.Text
.Fields("Subject10") = sub10.Text
.Fields("Subject11") = sub11.Text
.Fields("Subject12") = sub12.Text
.Update
.Close
End With
MsgBox "Class Successfully Created", vbInformation + vbOKOnly, "Add Class"
Unload Me
End If
End Sub

Private Sub Command4_Click()


cmdSav.Enabled = False
Command4.Enabled = False
cmdclos.Enabled = True
cmdAdd.Enabled = True
End Sub

Private Sub Form_Load()


On Error Resume Next
Call connect
con.Refresh
With rs_find
If .State = adStateOpen Then .Close
.Open "select * from class_mstr", con, adOpenDynamic, adLockPessimistic
.MoveLast
If IsNull(.Fields("Class_ID").Value) Then
Texclassid.Text = 1
Else
no = .Fields("Class_ID") + 1
Texclassid.Text = no
End If
.Close
End With

End Sub

‘Code for fees payment’

Private Sub cmd_can_Click()


Call Command3_Click
Command2.Enabled = False
cmd_can.Enabled = False
Cmd_chk.Enabled = True
End Sub
Private Sub Cmd_chk_Click()
Cmd_chk.Enabled = False
Command2.Enabled = True
cmd_can.Enabled = True
On Error Resume Next
If Text10.Text = "" Then
Text10.Text = Val(Text9.Text) - Val(txtpaid.Text)
Else
Text10.Text = Val(Text10.Text) - Val(txtpaid.Text)
End If
End Sub

Private Sub cmd_rst_Click()


TexfeepayID.Text = ""
txtpaid.Text = 0
Call Command3_Click
End Sub

Private Sub cmdFeesPayOk_Click()


Unload Me
End Sub

Private Sub Command2_Click()


Command2.Enabled = False
cmd_can.Enabled = False
Cmd_chk.Enabled = True

On Error Resume Next


If TexfeepayID.Text = "" Or TexfeepayID.Text = "" Or Text9.Text = "" Or txtpaid.Text =
0 Or Text10.Text = "" Then
MsgBox "Please fill the asterisk marked field", vbInformation + vbOKOnly, "Field
Empty"
Else
Call connect
With rs_feepay
If .State = adStateOpen Then .Close
.Open "SELECT * FROM Fees_Payment", con, adOpenDynamic, adLockPessimistic
.AddNew
.Fields("Student_ID").Value = Feespayment.TexfeepayID.Text
.Fields("Paid") = Feespayment.txtpaid.Text
.Fields("Due") = Feespayment.Text10.Text
.Fields("fees_date") = DTPfees.Value
.Fields("fees_time") = Format(Now, "hh:mm:ss")
.Fields("total") = Text9.Text
.Update
.Close
End With
MsgBox "Payment successfully accomplished", vbInformation + vbOKOnly, "Fee
Payment"
End If
Dim rep
rep = MsgBox("Would you like to perform another transaction ? ", vbQuestion +
vbYesNo, "New Transaction")
If rep = vbYes Then
txtpaid.Text = 0
Call Command3_Click
Else
Unload Me
End If
End Sub

Public Sub Command3_Click()


Cmd_chk.Enabled = True
On Error Resume Next
Clear
Call connect
With rs_sudfind
Dim c As Double
c = Val(TexfeepayID.Text)
If .State = adStateOpen Then .Close
.Open "select First_name,Middle_name,Last_name,Std,Div,roll_no from
student_mstr where student_id=" & c & "", con, adOpenDynamic, adLockPessimistic
If .RecordCount <= 0 Then
MsgBox "no record found Enter correct Student ID"
TexfeepayID.Text = ""
TexfeepayID.SetFocus
Exit Sub
End If
Do Until .EOF
txtfpfname.Text = .Fields("First_name").Value
txtfpmname.Text = .Fields("Middle_name").Value
txtfplname.Text = .Fields("Last_name").Value
txtfpstd.Text = .Fields("Std").Value
txtfpdiv.Text = .Fields("Div").Value
txtfproll.Text = .Fields("roll_no").Value
.MoveNext
Loop
.Close
End With
With rs_feesfind
If .State = adStateOpen Then .Close
.Open "select
Tution_Fees,General_Fund,Annual_Charges,Examination_Fee,Computer_Fee,Admiss
ion_Fee,Total from fees_stru where Std = '" & txtfpstd.Text & "' and Div ='" &
txtfpdiv.Text & "'", con, adOpenDynamic, adLockPessimistic
Do Until .EOF
Text3.Text = .Fields("Tution_Fees").Value
Text4.Text = .Fields("General_Fund").Value
Text5.Text = .Fields("Annual_Charges").Value
Text6.Text = .Fields("Examination_Fee").Value
Text7.Text = .Fields("Computer_Fee").Value
Text8.Text = .Fields("Admission_Fee").Value
Text9.Text = .Fields("Total").Value
.MoveNext
Loop
.Close
End With
'Dim d As Double
'd = Val()

With rs_feepay
If .State = adStateOpen Then .Close
.Open "select Due from Fees_Payment where Student_ID =" &
Val(Feespayment.TexfeepayID.Text), con, adOpenDynamic, adLockPessimistic
Do Until .EOF
Text10.Text = .Fields("Due").Value
.MoveNext
Loop
.Close
End With

a = Text10.Text
End Sub

‘Code for displaying student exam records’

Private Sub cmdshow_Click()


Call connect
If lblnm.Caption = "Student Name" Then
MsgBox "please select an student"
Exit Sub
End If

If rs_result.State = adStateOpen Then rs_result.Close


With rs_result
.Open "select distinct subject, max_marks, marks_obt, result , exam_date from
result where student_id=" & Val(stu_id.Text) & " and exam_name = '" &
comExamnm.Text & "' and exam_date= '" & Format(dtExam, "yyyy") & "'", con,
adOpenStatic, adLockPessimistic

If .RecordCount <= 0 Then


MsgBox "No Entry For This Examination !", vbExclamation, Me.Caption
Exit Sub
End If
Set ResultReport.DataSource = rs_result
ResultReport.Sections("section4").Controls("class").Caption = ComStd.Text & " " &
ComDiv.Text
ResultReport.Sections("section4").Controls("lblid").Caption = stu_id.Text
ResultReport.Sections("section4").Controls("lblname").Caption = lblnm.Caption
ResultReport.Sections("section4").Controls("lblexam_name").Caption =
comExamnm.Text
ResultReport.Sections("section4").Controls("lblroll_no").Caption = comRoll.Text
ResultReport.Sections("section4").Controls("lblyear").Caption =
Format(dtExam.Value, "yyyy")
.MoveFirst
Dim max, tot, per As Integer
max = 0
tot = 0
per = 0
Do Until .EOF
max = max + Val(.Fields("max_marks"))
tot = tot + Val(.Fields("marks_obt"))
.MoveNext
Loop
per = tot / max * 100
ResultReport.Sections("section3").Controls("lbltotal_max_marks").Caption =
max
ResultReport.Sections("section3").Controls("lbltotal_marks_obt").Caption =
tot
ResultReport.Sections("section3").Controls("lbltotal_percentage").Caption =
per
ResultReport.Show
Unload Me
End With
Unload Me
End Sub

Private Sub comRoll_Click()


On Error Resume Next
stu_id.Text = ""
lblnm.Caption = ""
Call connect
With rs_find
If .State = adStateOpen Then .Close
.Open "select First_name,Middle_name,Last_name,student_id from student_mstr
where Std='" & ComStd.Text & "' and Div ='" & ComDiv.Text & "'and roll_no='" &
comRoll.Text & "'", con, adOpenDynamic, adLockPessimistic
Do Until .EOF
stu_id.Text = .Fields("student_id").Value
lblnm.Caption = .Fields("First_name") & " " & .Fields("Middle_name") & " " &
.Fields("Last_name")
.MoveNext
Loop
.Close
End With

End Sub

Private Sub ComStd_Click()


ComDiv.Clear

Call connect
With rs_find
If .State = adStateOpen Then .Close
.Open "select Div from class_mstr where Std='" & ComStd.Text & "'", con,
adOpenDynamic, adLockPessimistic
Do Until .EOF
ComDiv.AddItem .Fields("Div").Value
.MoveNext
Loop
.Close
End With

End Sub

USER INTERFACES
Login Details
Once the user adds the user ID and password the system authenticates the user
credentials and sends a dialogue box to confirm user. It records time of login at the
name of user in a database field (For Audit trail).

The home screen is as shown above with modules and icons that are short cuts to
open different applications and modules.

File> Administration > New User

This module is used to create system users.

Several fields are available:


User Name: Name to be used by the user.
Password: User password.
Confirm password
Staff ID: Select the staff ID that the user as designated. It is contained in a list box.
Staff Name: The user associated with the ID is displayed in this field.
Account Type:
File> Administration > System User

This is used to show the user details. It also allows addition of new users
And decrypt passwords to check on user pass (Available to the administrator only)

Transaction > Student> Student Enrollment

Used to add new student records to the system. All details must me added before
clicking “Next”.
Transaction > Student > Create Result

This module is used to enter students’ Examination results. A report is generated to


show the summarized report by clicking on:
Report > Student > Results. Choose the ‘std’ and ‘division’. The roll Number is
automatically displayed. Clicking on this roll number automatically displays the
student name.

Transaction > Fee > Fee Structure

This used to create fee Amounts and also edit existing figures.
Choose the class ID and the class fee structure is displayed in the relevant text boxes.

Transaction > Class > Add Class

This modules is used to create new classes and assign subjects offered in the
relevant classes. Other details like class strength, Class schedules, Academic
behaviour and class requirement. This helps to keep a detailed and descriptive
assessment of the classes.

View > Staff Information > General info


This view is used to display a list of existing staff members and show details such
As Personal information and academic details. Staff records can also be edited.

Transaction > Staff > Salary.

This program also offers a comprehensive staff payroll system that is can be used to
pay salaries. It can also manage staff daily attendance.

Utilities

The program also offers utilities inside the program that the user may frequently use
i.e Calculator, Notepad.
It also has a backup utility to ensure data security.
References

 David l. Schneider, Computer programming concepts and visual basic,


University of Phoenix college of Information’s system and Technology,
Pearson 1999

 Microsoft, Mastering Visual Basic 6 Development: A student Guide, July 1998.

 http://www.sourcecode.com

 J.W. Moore, Software Engineering Standards : A user’s road map, IEEE


Computer Society press, 1998