Cms Report
Cms Report
Cms Report
On
“COLLEGE MANAGEMENT SYSTEM”
Report submitted fullfilment of the
requirements For the award of the degree in
BACHELOR OF COMPUTR
APPLICATIONS BANGALORE
NORTH UNIVERSITY
.
PRESENTED BY
PADMA NEERAJ KUMAR
(R2013630)
UNDER GUIDANCE
Prof. K . Adisesha.
SJES COLLEGE OF MANAGEMENT STUDIES
BANGALORE NORTH UNIVERSITY-49
Page 1 of 96
Department of computer science – BCA-(BNU)
CERTIFICATE
Page 2 of 96
DECLARATION
Page 3 of 96
ACKNOWLEDGEMENT
1. First and foremost, we would like to thank almighty for standing by us through the
project and helping us to complete the same within the stipulated time. We would like
to express our sincere gratitude to our College Chairman Sri. Nagaraj and
Chairperson Smt. Rama Devi
2. Principal Dr. Lakshma Narsimha Reddy for providing us the best facilities & right
atmosphere for the completion of this project ,We are most grateful to HOD of BCA
Dr.K .Adiseha for his humble co-operation
3. This project work has been undertaken and completed under the excellent guidance of
Dr.K. Adisesha who with his valuable suggestions made this project work better
.Last but not the least,we would like to thank our parents, family members for their
encouragement and blessings which played a major role in the successful completion
of our Project .
Date:
Place : : Bangalore
Page 4 of 96
INDEX
SLNO CONTENTS PAGE NO.
1 Introduction 1
3 .Net 3
4 Framework 3
5 VB.Net 4
6 Features 5
7
Crystal Reports 6
8
Requirements and Specification 7
9
Abstraction 10
10
System Design 11-13
11
Data Flow 14-15
12
Diagram ER 16-29
13
Diagram Screen 30-60
14
shots Coding 61-70
15
Reports 72
16
Conclusion 73
Bibiliography
Page 5 of 96
INTRODUCTION
This project has been developed to carry out the processes easily and quickly, Which
is not possible with the manuals system, which are overcome by this Software.
This project is developed using VB.NET language. Requirements definition and management is
recognized as a necessary step in the delivery
You have to manage a contractual relationship. Organization need to effectively define and
manage requirements to ensure they are meeting needs of the customer, while proving
compliance and staying on the schedule and within budge
The impact of a poorly expressed requirement can bring a business out of compliance or even
Cause injury or death. Requirements definition and management is an activity that can
Deliver a high, fast return on investment.
Page 6 of 96
VISUAL STUDIO 2022
Visual studio is a programming language and powerful Front-End tool for developing
window Application, the name suggest, programming with Visual studio is accomplished
visually.
With inbuilt ability to create user interface quickly and easily. while wrting the programme,
you can
see how your program will look during runtime. This is the great advantage over other
programming language. In Visual studio you have available toolbox of these element.
You can create new windows called Forms. Programmer, create the (GUI) by
selecting an object ,
Setting the object properties to define the object appearance like Colour, Size and Image
etc.,And behaviour and write Code that respons to an event that occours in the interface.
These programmes work on the Text Mode using the extended character set to give the user a
feeling of Graphical Environment. Visual studio need programming under (GUI)
Environment easy and fast
2.Create the visual portion of your application(the screens and the menus that your users
will interact with).
3.Add visual studio programming language code to tie the visual elements together and
to automate the programme.
4.Test your application to locate and remove any bugs you find.
Page 7 of 96
.NET Framework
The .NET Framework is a new computing platform that simplifies application development in
the highly distributed environment of the Internet.
The .NET Framework is designed to fulfill the following objectives:
Like all other .NET languages, VB.NET has complete support for object oriented concepts.
Everything in VB.NET is an object, including all of the
primitive types (Short, Integer, Long, String, Boolean, etc.) and user-defined types, events,
and even assemblies. All objects inherits from the base class Object.
Page 8 of 96
Features of VB.NET
SQL database is a powerful database management system .It is used for creating database
editing, uploading or deleting the records from the database .we can also specify data
integrity to the database by applying constraints. Relationship can also be specified to the
database
.Hence we have used My Sql database as backing software
Page 9 of 96
Page 10 of 96
CRYSTAL REPORT
Crystal Report is a officially a member of the Visual studio.Net product. It is included in all
major editions and ships in all languages available with Visual studio .Net Crystal Reports
.Net provides developers with the fastest , most productive way to create and integrate
presentation-quality, interactive reports that scale to meet the demands of the end users.
Crystal Reports .Net is a very powerful report writer, it offers a very well defined object
model that provides flexibility when integrating reports into windows and web applications.
It also comes with highly customizable viewer component that gives developers control how
their reports are presented to users.
Crystal Reports .Net provides developers with two different report viewing components. The
first can be used for displaying reports in Windows forms. The other is a component that can
be display reports in a Web environment. The beauty of these viewers is in their simplicity.
Viewing a report is as simple as setting Report source property of the respective viewer.
Page 11 of 96
HARDWARE AND SOFTWARE REQUIREMENTS
HARDWARE REQUIREMENTS
SOFTWARE REQUIREMENTS
Page 12 of 96
ABSTRACT
The project named “ College Management System “ is written in VB.NET mainly because of
its suitability for this type of application . Its user-friendly nature and in-built documentation,
complication , error detection , binding facilities and interaction with other software packages
make it most powerful tool for software development . Moreover ,VB.NET consists of all the
technologies that help in creating and running robust , scalable and distributed package.
This project will have many different pages with an inbuilt authentication (user name and
password ). This project will contain many text boxes, label boxes and also many command
buttons etc. All the database work will be done in MY-SQL and it will be directly connected
with the database to get all the information about the user.
Assistance is provided to the user at each and every and every step so that no problem is
faced while using it. Further the details of every process and the user manuals are attached to
make the software and the report clear , simple and error free which makes it so special and
one of its kind.
Page 13 of 96
SYSTEM ANALYSIS
USE CASE:
It describes an activity the system carries out in response to an event.
ACTOR:
In UML, the person involved is called an Actor. An Actor is always outside of the
Automation Boundary of the system.
CONNECTING LINE:
The arrow is used to show which Actors participate in which Use Cases.
Use case
Automation boundary
Actor
Page 14 of 96
DESCRIPTION:
The Object Oriented approach uses the term use case to describe an activity the system
carries out in response to an event. One can think of a use case as a case or situation where
the system is used for some purpose .A use case diagram is a convenient way to document the
functions that the system must support. Sometimes a single, comprehensive diagram is used
to describe the entire system. At other times, a set of smaller use case diagrams make up the
use case model.
USE- CASE DIAGRAM
Page 15 of 96
Page 16 of 96
SYSTEM DESIGN
DEPLOYMENT DIAGRAM:
A deployment diagram in the Unified Modeling Language models the physical deployment of
artifacts on nodes.[1] To describe a web site, for example, a deployment diagram would show
what hardware components ("nodes") exist (e.g., a web server, an application server, and a
database server), what software components ("artifacts") run on each node (e.g., web
application, database), and how the different pieces are connected (e.g. JDBC, REST, RMI).
The nodes appear as boxes, and the artifacts allocated to each node appear as rectangles
within the boxes. Nodes may have sub nodes, which appear as nested boxes. A single node in
a deployment diagram may conceptually represent multiple physical nodes, such as a cluster
of database
servers.
Hardware
College Management System
System
Database
Page 17 of 96
DATA FLOW DIAGRAM
Data flow diagrams are graphical representations of workflows of stepwise activities and
actions with support for choice, iteration and concurrency. In the Unified Modelling
Language, activity diagrams can be used to describe the business and operational step-by-step
workflows of components in a system. An Data flow diagram shows the overall flow of
control.
Page 18 of 96
DATA FLOW DIAGRAM
Start
System checks
username & password
Login Screen
try
Invalid
Gives an error
Valid
Login successfully
Page 19 of 96
DATA FLOW DIAGRAM
Page 20 of 96
Page 21 of 96
ENTITY RELATIONSHIP DIAGRAM
The entity – relationship (ER) data model allows us to describe the data involved in a real
world enterprise in terms of object and their relationships and is widely used to develop an
initial database design.
The ER model is important primarily for its role in database design. It provides useful
concepts that allow us to move from an informal description of what users want from their
database to a more detailed and precise description that can be implemented in a DBMS. The
ER model is used in a phase called “Conceptual Database Design”. It should be noted that
many variations of ER diagrams are in use and no widely accepted standards prevail.
Entity:
An entity is an object in the real world that is distinguishable from other objects. Examples
include the following: The C++ language, the address of the manager of the institution. It is
often useful to identify a collection of similar entities. Such a collection is called as “Entity
set”. Note that entity set need not be disjoint.
Attributes:
An entity is described using a set of attributes. All entities in a given entity set have the same
attributes; this essentially what we mean by similar. Our choice of attributed reflects the level
of detail at which we wish to represent information in crisis.
Key:
Further, for each entity set we choose a key. A key is a minimal set of attributed whose values
uniquely identify an entity in the set. There could be more than one
Page 22 of 96
ER DIAGRAM
Page 23 of 96
Page 24 of 96
SCREEN SHOTS
Page 25 of 96
SPLASH-SCREEN
LOGIN-SCREEN
Page 26 of 96
Forgot Password
Page 27 of 96
ADMIN-DASHBOARD
USER DETAILS
Page 28 of 96
MENU BAR
Page 29 of 96
ADMIN – ADD STUDENT
Page 30 of 96
ADMIN – VIEW STUDENTS
Page 31 of 96
ADMIN – ATTENDANCE MANAGEMENT
Page 32 of 96
Page 33 of 96
ADMIN – NOTICE MANAGEMENT
Page 34 of 96
FACULTY - DASHBOARD
FACULTY - ATTENDANCE
Page 35 of 96
FACULTY - TIMETABLE
Page 36 of 96
STUDENT - DASHBOARD
STUDENT- TIMETABLE
Page 37 of 96
coding
Page 38 of 96
SPLASHSCREEN
Imports Transitions
End Class
Page 39 of 96
LOGIN
Imports MySqlConnector
Imports System.IO
da.Fill(dt)
'Check if the given user exist
If (dt.Rows.Count > 0) Then
usertype = dt.Rows(0).Item("usertype")
img = dt.Rows(0).Item("image")
username = dt.Rows(0).Item("username")
fname = dt.Rows(0).Item("firstname")
lname = dt.Rows(0).Item("lastname")
phone = dt.Rows(0).Item("contact_no")
email = dt.Rows(0).Item("email")
Dim dash As New Dashboard(usertype, img, username, fname, lname, phone, email)
dash.Show()
Me.Hide()
Else
'Check if the student exist
Dim cmd2 As New MySqlCommand("SELECT * FROM stuTbl WHERE username= @a AND password =@b AND state = 1",
con)
cmd2.Parameters.AddWithValue("@a", UserNameTextBox.Text)
cmd2.Parameters.AddWithValue("@b", PasswordTextBox.Text)
Dim da2 As New MySqlDataAdapter(cmd2)
Dim dt2 As New DataTable()
Page 40 of 96
da2.Fill(dt2)
End If
End If
Cursor = Cursors.Arrow
End Sub
End Class
Page 41 of 96
FORGOT PASSWORD
Imports MySqlConnector
Imports Transitions
Imports System.Text
Page 43 of 96
DASHBOARD
Imports Transitions
Imports MaterialSkin.Controls
Imports BunifuAnimatorNS
Imports System.IO
Imports MySqlConnector
Sub unVisibleAll()
PcMgmtButton.Visible = False
RecycleBinButton.Visible = False
NoticeButton.Visible = False
ReportsButton.Visible = False
AddRemoveButton.Visible = False
AttendanceButton.Visible = False
ResultButton.Visible = False
End Sub
Sub userChecker()
userType = utypes
If (userType = "") Then
PcMgmtButton.Visible = True
RecycleBinButton.Visible = True
NoticeButton.Visible = True
ReportsButton.Visible = True
AddRemoveButton.Visible = True
AttendanceButton.Visible = True
ResultButton.Visible = True
Else
If (userType.Equals("Student")) Then
unVisibleAll()
ResultButton.Visible = True
HamburgerButton.Dock = DockStyle.Top
HomeButton.Dock = DockStyle.Top
ResultButton.Dock = DockStyle.Top
HamburgerButton.Dock = DockStyle.Top
Page 44 of 96
HomeButton.Dock = DockStyle.Top
AddRemoveButton.Dock = DockStyle.Top
ElseIf (userType.Equals("Lecturer")) Then
unVisibleAll()
ResultButton.Visible = True
AttendanceButton.Visible = True
HamburgerButton.Dock = DockStyle.Top
HomeButton.Dock = DockStyle.Top
ResultButton.Dock = DockStyle.Top
AttendanceButton.Dock = DockStyle.Top
End If
End If
End Sub
Private Sub HamburgerButton_Click(sender As Object, e As EventArgs) Handles
HamburgerButton.Click
userDetail()
If (hamburgerPnl.Width < 250) Then
Transition.run(hamburgerPnl, "Width", 250, New
TransitionType_EaseInEaseOut(20))
Dim i As Integer = 0
Dim buttonArray() As Button = New Button() {HamburgerButton,
CloseButton, AddRemoveButton, RecycleBinButton, AttendanceButton, PcMgmtButton,
HomeButton, LogOutButton, ResultButton, NoticeButton, ReportsButton}
Dim textName As String() = {"MENU", "EXIT", "CRUD", "RECYCLER",
"ATTENDANCE", "FACULTY MGMT", "HOME", "LOG OUT", "TIMETABLE", "NOTICE",
"REPORTS"}
For Each values As Button In buttonArray
'values.Width = 250
Transition.run(values, "Width", 250, New
TransitionType_EaseInEaseOut(30))
values.Text = textName(i)
i = i + 1
Next
HamburgerButton.Width = 250
Else
Transition.run(hamburgerPnl, "Width", 45, New
TransitionType_EaseInEaseOut(20))
Dim buttonArray() As Button = New Button() {HamburgerButton,
CloseButton, AddRemoveButton, RecycleBinButton, AttendanceButton, PcMgmtButton,
HomeButton, LogOutButton, ResultButton, NoticeButton, ReportsButton}
For Each values As Button In buttonArray
'values.Width = 45
Transition.run(values, "Width", 45, New
TransitionType_EaseInEaseOut(30))
values.Text = ""
Next
End If
End Sub
Page 45 of 96
Dim rg As Region
gp = New Drawing2D.GraphicsPath
gp.AddEllipse(0, 0, pb.Width - 4, pb.Height - 4)
rg = New Region(gp)
pb.Region = rg
End Sub
Sub showRecycleBin()
Dim bin As New RecycleBin
'closeAll()
Cursor = Cursors.WaitCursor
bin.MdiParent = Me
MainPanel.Controls.Clear()
MainPanel.Controls.Add(bin)
bin.Dock = DockStyle.Fill
bin.Show()
bin.BringToFront()
MainPanel.Controls.Add(UserDetailPanel)
UserDetailPanel.BringToFront()
Cursor = Cursors.Arrow
End Sub
Sub showAddRemoveStudentUserPanel()
Dim ar As New AddRemoveStudentStaff
If (utypes = "Receptionist") Then
ar.UserStudentTabController.TabPages(0).Enabled = False
ar.UserStudentTabController.TabPages(1).Enabled = False
End If
'closeAll()
MainPanel.Controls.Clear()
ar.MdiParent = Me
MainPanel.Controls.Add(ar)
ar.Dock = DockStyle.Fill
ar.Show()
ar.BringToFront()
MainPanel.Controls.Add(UserDetailPanel)
UserDetailPanel.BringToFront()
End Sub
Sub showCourseAndSubjects()
Dim ps As New ProgramAndSubjects
'closeAll()
MainPanel.Controls.Clear()
ps.MdiParent = Me
MainPanel.Controls.Add(ps)
ps.Dock = DockStyle.Fill
ps.Show()
ps.BringToFront()
MainPanel.Controls.Add(UserDetailPanel)
UserDetailPanel.BringToFront()
End Sub
Sub showReports()
Dim ps As New Reports
'closeAll()
Page 46 of 96
MainPanel.Controls.Clear()
ps.MdiParent = Me
MainPanel.Controls.Add(ps)
ps.Dock = DockStyle.Fill
ps.Show()
ps.BringToFront()
MainPanel.Controls.Add(UserDetailPanel)
UserDetailPanel.BringToFront()
End Sub
Sub showAttendance()
Dim a As New Attendance(utypes, fnames)
'closeAll()
MainPanel.Controls.Clear()
a.MdiParent = Me
MainPanel.Controls.Add(a)
a.Dock = DockStyle.Fill
a.Show()
a.BringToFront()
MainPanel.Controls.Add(UserDetailPanel)
UserDetailPanel.BringToFront()
End Sub
Sub showSetting()
Dim setting As New Reports
'closeAll()
MainPanel.Controls.Clear()
setting.MdiParent = Me
MainPanel.Controls.Add(setting)
setting.Dock = DockStyle.Fill
setting.Show()
setting.BringToFront()
MainPanel.Controls.Add(UserDetailPanel)
UserDetailPanel.BringToFront()
End Sub
Sub showResult()
Dim result As New Result(userType, unames, fnames)
'closeAll()
MainPanel.Controls.Clear()
result.MdiParent = Me
MainPanel.Controls.Add(result)
result.Dock = DockStyle.Fill
result.Show()
result.BringToFront()
MainPanel.Controls.Add(UserDetailPanel)
UserDetailPanel.BringToFront()
End Sub
Sub showFeeMgmt()
Dim feeManager As New frmFeeManager
'closeAll()
MainPanel.Controls.Clear()
feeManager.MdiParent = Me
MainPanel.Controls.Add(feeManager)
feeManager.Dock = DockStyle.Fill
Page 47 of 96
feeManager.Show()
feeManager.BringToFront()
MainPanel.Controls.Add(UserDetailPanel)
UserDetailPanel.BringToFront()
End Sub
Sub showNotice()
Dim notice As New Notice
'closeAll()
MainPanel.Controls.Clear()
notice.MdiParent = Me
MainPanel.Controls.Add(notice)
notice.Dock = DockStyle.Fill
notice.Show()
notice.BringToFront()
MainPanel.Controls.Add(UserDetailPanel)
UserDetailPanel.BringToFront()
End Sub
Sub loadNotices()
Dim dt As New DataTable
Dim sql As String = "SELECT * FROM noticeTbl"
Dim con As MySqlConnection = su.dbConnect()
Dim cmd As New MySqlCommand(sql, con)
Dim da As New MySqlDataAdapter(cmd)
Dim dts As New DataTable()
da.Fill(dts)
If (dts.Rows.Count > 0) Then
TTgrid.DataSource = dts
Else
TTgrid.Columns.Add("NO NOTICES", "NO NOTICES")
'TTgrid.Columns.Add("NOTICE", "NOTICE")
'Dim newRow As DataGridViewRow = New DataGridViewRow()
End Sub
Sub fullScreen()
Me.Top = 0
Me.Left = 0
Me.Height = Screen.PrimaryScreen.WorkingArea.Height
Me.Width = Screen.PrimaryScreen.WorkingArea.Width
End Sub
'Dim b As String
Private Sub Dashboard_Load(sender As Object, e As EventArgs) Handles
Page 48 of 96
MyBase.Load
AllNoticeListView.Visible = False
fullScreen()
userDetail()
profileDrop()
labelCenterer(NameLabel)
labelCenterer(PhoneNoLabel)
labelCenterer(EmailLabel)
userChecker()
loadNotices()
End Sub
Sub profileDrop()
circularImage(ProfilePictureBox)
NameLabel.Text = fnames & " " & lnames
PhoneNoLabel.Text = phones
EmailLabel.Text = emails
Dim img() As Byte
img = imgs
Else
End If
End Sub
Sub userDetail()
UserDetailPanel.BackColor = Color.FromArgb(125, Color.Black)
SlideDownButton.BackColor = Color.FromArgb(125, Color.Black)
End Sub
Page 49 of 96
Private Sub AddRemoveButton_Click(sender As Object, e As EventArgs) Handles
AddRemoveButton.Click
showAddRemoveStudentUserPanel()
userDetail()
End Sub
End Sub
Page 50 of 96
End If
End Sub
End Sub
Page 51 of 96
ADD, REMOVE AND VIEW STUDENTS AND STAFF
Imports Transitions
Imports System.IO
Imports System.Data.SqlClient
Imports System.Text
Imports System.Security.Cryptography
Imports MaterialSkin.Controls
Imports MetroFramework.Controls
Imports System.Net.Mail
Imports BunifuAnimatorNS
Imports System.Text.RegularExpressions
Imports System.Drawing.Imaging
Imports MySqlConnector
End If
End If
End Sub
Page 52 of 96
Private Function passvalid(pass As String)
Dim a As Char
Dim Caplet = False
Dim smalet = False
Dim spcar = False
Dim numcar = False
If (pass.Length >= 8) Then
For Each a In pass
If (Char.IsLetter(a.ToString(), 0)) Then
If Char.IsLower(a.ToString(), 0) Then
smalet = True
ElseIf Char.IsUpper(a.ToString(), 0) Then
Caplet = True
End If
ElseIf (Char.IsDigit(a.ToString(), 0)) Then
numcar = True
ElseIf (Char.IsLetterOrDigit(a.ToString(), 0)) Then
spcar = True
End If
Next
If (Caplet = True And smalet = True And spcar = True And numcar =
True) Then
Return True
Else
Return False
End If
Else
Return False
End If
End Function
Sub loadEverything()
Dim dt As DataTable = loadUsers("Select * FROM userTbl WHERE state =
1")
Dim dt2 As DataTable = loadUsers("Select * FROM stuTbl WHERE state =
1")
'for admin
AdminUserDataGridView.DataSource = dt
AdminUserDataGridView.Columns(15).Visible = False
AdminUserDataGridView.Columns(14).Visible = False
'For other users who just views
UserDataGridView.DataSource = dt
UserDataGridView.Columns(15).Visible = False
UserDataGridView.Columns(14).Visible = False
UserDataGridView.Columns(13).Visible = False
UserDataGridView.Columns(12).Visible = False
'for admin
AdminStudentDataGridView.DataSource = dt2
AdminStudentDataGridView.Columns(22).Visible = False
AdminStudentDataGridView.Columns(21).Visible = False
AdminStudentDataGridView.Columns(20).Visible = False
'For other users who just views
StudentDataGridView.DataSource = dt2
Page 53 of 96
StudentDataGridView.Columns(22).Visible = False
StudentDataGridView.Columns(21).Visible = False
StudentDataGridView.Columns(20).Visible = False
StudentDataGridView.Columns(19).Visible = False
StudentDataGridView.Columns(18).Visible = False
StudentDataGridView.Columns(17).Visible = False
PasswordTextBox.Text = GeneratePassword()
StudentPasswordTextBoxs.Text = GeneratePassword()
loadPrograms()
SUpdateButton.Enabled = False
SDeleteButton.Enabled = False
UUpdateButton.Enabled = False
UDeleteButton.Enabled = False
End Sub
'dashboard load method
Private Sub Dashboard_Load(sender As Object, e As EventArgs) Handles
MyBase.Load
loadEverything()
'MsgBox(DobDateTimePicker.Text)
End Sub
Page 54 of 96
Sub clearAllStudent()
Dim textboxArray() As MaterialSingleLineTextField = New
MaterialSingleLineTextField() {FirstNameTextBoxs, LastNameTextBoxes,
MiddleNameTextBoxs, CurrentAddressTextBoxs, PermanentAddressTextBoxs,
DistrictTextBoxs, PhoneNoTextBoxs, EmailAddressTextBoxs, GuardianNameTextBoxs,
GuardianContactTextBoxs, ReligionTextBoxs, LanguageTextBoxs,
StudentUsernameTextBoxs, StudentPasswordTextBoxs}
For Each values As MaterialSingleLineTextField In textboxArray
values.Text = ""
Next
StudentIdTextBox.Text = ""
Dim comboboxArray() As MetroComboBox = New MetroComboBox()
{CourseComboBoxs, MaritialStatusComboBoxs, GenderComboBoxs,
ScholarshipComboBoxs}
For Each values As MetroComboBox In comboboxArray
values.SelectedIndex = -1
Next
Dobs.Value = DateTime.Today.ToString
StudentImage.Image = My.Resources.user_male2_512
StudentPasswordTextBoxs.Text = GeneratePassword()
SSubmitButton.Enabled = True
End Sub
'load users in database
Public Function loadUsers(ByVal sql As String)
Dim con As MySqlConnection = dbConnect()
Dim cmd As New MySqlCommand(sql, con)
Dim da As New MySqlDataAdapter(cmd)
Dim dt As New DataTable()
da.Fill(dt)
Return dt
End Function
Sub refreshUsers()
Dim dt As DataTable = loadUsers("SELECT * FROM userTbl WHERE state =
1")
AdminUserDataGridView.DataSource = dt
UserDataGridView.DataSource = dt
End Sub
If (MaleRadioBtn.Checked) Then
gender = "Male"
Page 55 of 96
Else
gender = "Female"
End If
Try
insertUsers(useridtxt.Text, FirstNameTextBox.Text,
MiddleNameTextBox.Text, LastNameTextBox.Text, gender, ContactNoTextBox.Text,
Address1TextBox.Text, Address2TextBox.Text, UserTypeComboBox.Text,
DobDateTimePicker.Text, EmailTextBox.Text, MaritialStatusComboBox.Text,
UserNameTextBox.Text, PasswordTextBox.Text)
Catch ex As Exception
MsgBox(ex)
End Try
If (SendEmailCheckBox.Checked) Then
sendEmail()
End If
UserImage.Image = My.Resources.user_male2_512
'PasswordTextBox.Text = GeneratePassword()
refreshUsers()
End Sub
Page 56 of 96
checkEmailFormat()
cmd.ExecuteNonQuery()
If (userType = "Cashier") Then
Dim cmd2 As New MySqlCommand("CREATE TABLE " & tableName & "(id
INT NOT NULL PRIMARY KEY IDENTITY,date NVARCHAR(50) NULL)", con)
cmd2.ExecuteNonQuery()
End If
con.Close()
clearAll()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
UFinishButton.Enabled = False
SUpdateButton.Enabled = True
SDeleteButton.Enabled = True
End Sub
'If password is not set generate random text and convert to MD5 version
Function GeneratePassword()
'Dim Bytes() As Byte
'Dim s As String =
"AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0!1@2#3$4%5^6&7*89"
Dim s As String = "ABCDEFGHIJKLMNOPQRSUVWXYZ"
Dim r As New Random
Dim sb As New StringBuilder
For i As Integer = 1 To 8
Dim idx As Integer = r.Next(0, 25)
sb.Append(s.Substring(idx, 1))
Next
'Bytes = Encoding.Default.GetBytes(sb.ToString)
'Bytes = MD5.Create().ComputeHash(Bytes)
'For x As Integer = 0 To Bytes.Length - 1
' sb.Append(Bytes(x).ToString("x2"))
'Next
Return sb.ToString()
End Function
Page 57 of 96
UserTypeComboBox.Text & "" & vbNewLine & "Username: " & UserNameTextBox.Text &
"" & vbNewLine & "Password: " & PasswordTextBox.Text
SmtpServer.Send(mail)
MsgBox("Mail has been successfully send to " & EmailTextBox.Text)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
'load users
Private Sub UserDataGridView_RowHeaderMouseClick(sender As Object, e As
DataGridViewCellMouseEventArgs) Handles UserDataGridView.RowHeaderMouseClick
Dim img() As Byte
Try
img = UserDataGridView.CurrentRow.Cells(14).Value
Dim ms As New MemoryStream(img)
OnlyViewUserPictureBox.Image = Image.FromStream(ms)
Catch ex As Exception
Console.WriteLine("Image not found")
End Try
End Sub
Page 58 of 96
UUpdateButton.Enabled = True
UDeleteButton.Enabled = True
UFinishButton.Enabled = False
userId = AdminUserDataGridView.CurrentRow.Cells(0).Value.ToString()
UserIdTextBox.Text =
AdminUserDataGridView.CurrentRow.Cells(0).Value.ToString()
FirstNameTextBox.Text =
AdminUserDataGridView.CurrentRow.Cells(1).Value.ToString()
MiddleNameTextBox.Text =
AdminUserDataGridView.CurrentRow.Cells(2).Value.ToString()
LastNameTextBox.Text =
AdminUserDataGridView.CurrentRow.Cells(3).Value.ToString()
Dim gender As String =
AdminUserDataGridView.CurrentRow.Cells(4).Value.ToString()
If (gender = "Male") Then
MaleRadioBtn.Checked = True
Else
FemaleRadioBtn.Checked = True
End If
ContactNoTextBox.Text =
AdminUserDataGridView.CurrentRow.Cells(5).Value.ToString()
Address1TextBox.Text =
AdminUserDataGridView.CurrentRow.Cells(6).Value.ToString()
Address2TextBox.Text =
AdminUserDataGridView.CurrentRow.Cells(7).Value.ToString()
UserTypeComboBox.Text =
AdminUserDataGridView.CurrentRow.Cells(8).Value.ToString()
'DobDateTimePicker.Text =
AdminUserDataGridView.CurrentRow.Cells(9).Value.ToString()
EmailTextBox.Text =
AdminUserDataGridView.CurrentRow.Cells(10).Value.ToString()
MaritialStatusComboBox.Text =
AdminUserDataGridView.CurrentRow.Cells(11).Value.ToString()
UserNameTextBox.Text =
AdminUserDataGridView.CurrentRow.Cells(12).Value.ToString()
PasswordTextBox.Text =
AdminUserDataGridView.CurrentRow.Cells(13).Value.ToString()
End Sub
Page 59 of 96
End If
If Not passvalid(PasswordTextBox.Text) Then
MsgBox("Please Enter Correct Password Format with Min 8 Chars with
atkeast 1 smallchar, 1 CapitalChar, 1 Number, 1 special Char")
Return
End If
If (MaleRadioBtn.Checked) Then
gender = "Male"
Else
gender = "Female"
End If
updateUsers(FirstNameTextBox.Text, MiddleNameTextBox.Text,
LastNameTextBox.Text, gender, ContactNoTextBox.Text, Address1TextBox.Text,
Address2TextBox.Text, UserTypeComboBox.Text, DobDateTimePicker.Text,
EmailTextBox.Text, MaritialStatusComboBox.Text, UserNameTextBox.Text,
PasswordTextBox.Text)
If (SendEmailCheckBox.Checked) Then
sendEmail()
End If
UserImage.Image = My.Resources.user_male2_512
clearAll()
PasswordTextBox.Text = GeneratePassword()
loadUsers("Select * FROM userTbl WHERE state = 1")
End Sub
Public Shared Function ImgToByteArray(img As Image) As Byte()
Dim ms As New MemoryStream()
img.Save(ms, img.RawFormat)
Dim imageBuffer As Byte() = ms.GetBuffer
Return imageBuffer
End Function
End If
Try
Dim tableName As String = fn & "_user_" & userType & "_" &
contactNo
cmd.Parameters.AddWithValue("@firstname", fn)
Page 60 of 96
cmd.Parameters.AddWithValue("@middlename", mn)
cmd.Parameters.AddWithValue("@lastname", ln)
cmd.Parameters.AddWithValue("@gender", gender)
cmd.Parameters.AddWithValue("@contact", contactNo)
cmd.Parameters.AddWithValue("@addressone", addressOne)
cmd.Parameters.AddWithValue("@addresstwo", addressTwo)
cmd.Parameters.AddWithValue("@usertype", userType)
cmd.Parameters.AddWithValue("@dob", dob)
cmd.Parameters.AddWithValue("@email", email)
cmd.Parameters.AddWithValue("@maritialstatus", maritialStatus)
cmd.Parameters.AddWithValue("@username", username)
cmd.Parameters.AddWithValue("@password", password)
Dim imgData As Byte()
imgData = ImgToByteArray(UserImage.Image)
cmd.Parameters.AddWithValue("@loadimage", imgData)
cmd.Parameters.AddWithValue("@state", state)
cmd.Parameters.AddWithValue("@userId", userId)
con.Open()
cmd.ExecuteNonQuery()
Page 61 of 96
PasswordTextBox.Text = GeneratePassword()
End Sub
End Sub
Page 62 of 96
Sub center(ByVal a As PictureBox)
a.Left = (a.Parent.Width \ 2) - (a.Width \ 2)
End Sub
Sub refreshStudents()
Dim dt As DataTable = loadUsers("SELECT * FROM stuTbl WHERE state = 1")
AdminStudentDataGridView.DataSource = dt
End Sub
End If
End Sub
Public Sub insertStudent(ByVal Id As String, ByVal fn As String, ByVal mn
As String, ByVal ln As String, ByVal cadd As String, ByVal padd As String,
ByVal dis As String, ByVal phno As String, ByVal email As String, ByVal dob As
String, ByVal gender As String, ByVal gn As String, ByVal gcno As String, ByVal
reli As String, ByVal mstatus As String, ByVal lan As String, ByVal cour As
String, ByVal scholor As String, ByVal uname As String, ByVal pass As String,
ByVal sem As String)
Dim con As MySqlConnection = dbConnect()
Try
Dim cmd As New MySqlCommand("INSERT INTO stuTbl
values(@Id,@fname,@mname,@lname,@caddress,@paddress,@district,@phoneno,@email,@
dob,@gender,@gname,@gcontactno,@religion,@mstatus,@language,@course,@scholorshi
p,@username,@password,@state,@image,@usertype,@sem)", con)
cmd.Parameters.AddWithValue("@Id", Id)
cmd.Parameters.AddWithValue("@fname", fn)
cmd.Parameters.AddWithValue("@mname", mn)
cmd.Parameters.AddWithValue("@lname", ln)
cmd.Parameters.AddWithValue("@caddress", cadd)
cmd.Parameters.AddWithValue("@paddress", padd)
Page 63 of 96
cmd.Parameters.AddWithValue("@district", dis)
cmd.Parameters.AddWithValue("@phoneno", phno)
cmd.Parameters.AddWithValue("@email", email)
cmd.Parameters.AddWithValue("@dob", dob)
cmd.Parameters.AddWithValue("@gender", gender)
cmd.Parameters.AddWithValue("@gname", gn)
cmd.Parameters.AddWithValue("@gcontactno", gcno)
cmd.Parameters.AddWithValue("@religion", reli)
cmd.Parameters.AddWithValue("@mstatus", mstatus)
cmd.Parameters.AddWithValue("@language", lan)
cmd.Parameters.AddWithValue("@course", cour)
cmd.Parameters.AddWithValue("@scholorship", scholor)
cmd.Parameters.AddWithValue("@username", uname)
cmd.Parameters.AddWithValue("@password", pass)
cmd.Parameters.AddWithValue("@state", state)
Dim imgData As Byte()
imgData = ImgToByteArray(StudentImage.Image)
cmd.Parameters.AddWithValue("@image", imgData)
cmd.Parameters.AddWithValue("@usertype", studentUserType)
cmd.Parameters.AddWithValue("@sem", sem)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
SSubmitButton.Enabled = False
SUpdateButton.Enabled = True
SDeleteButton.Enabled = True
StudentPasswordTextBoxs.Text = GeneratePassword()
refreshStudents()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Sub loadPrograms()
Dim programData As DataTable = loadUsers("SELECT * FROM tblPrograms")
CourseComboBoxs.DataSource = programData
CourseComboBoxs.DataSource = programData
CourseComboBoxs.DisplayMember = "program_name"
CourseComboBoxs.ValueMember = "Id"
End Sub
Page 64 of 96
GuardianNameTextBoxs.Text, GuardianContactTextBoxs.Text, ReligionTextBoxs.Text,
MaritialStatusComboBoxs.Text, LanguageTextBoxs.Text, CourseComboBoxs.Text,
ScholarshipComboBoxs.Text, StudentUsernameTextBoxs.Text,
StudentPasswordTextBoxs.Text, semcombo.Text)
End Sub
Public Sub updateStudent(ByVal fn As String, ByVal mn As String, ByVal ln
As String, ByVal cadd As String, ByVal padd As String, ByVal dis As String,
ByVal phno As String, ByVal email As String, ByVal dob As String, ByVal gender
As String, ByVal gn As String, ByVal gcno As String, ByVal reli As String,
ByVal mstatus As String, ByVal lan As String, ByVal cour As String, ByVal
scholor As String, ByVal uname As String, ByVal pass As String, ByVal sem As
String)
Dim con As MySqlConnection = dbConnect()
Try
Dim cmd As New MySqlCommand("UPDATE stuTbl SET fname= @fname,mname=
@mname,lname= @lname,caddress= @caddress,paddress= @paddress,district=
@district,phoneno= @phoneno,email= @email,dob= @dob,gender= @gender,gname=
@gname,gcontactno= @gcontactno,religion= @religion,mstatus= @mstatus,language=
@language,course= @course,scholorship= @scholorship,username=
@username,password= @password,image=@image,sem=@sem WHERE userId = @stuId",
con)
cmd.Parameters.AddWithValue("@fname", fn)
cmd.Parameters.AddWithValue("@mname", mn)
cmd.Parameters.AddWithValue("@lname", ln)
cmd.Parameters.AddWithValue("@caddress", cadd)
cmd.Parameters.AddWithValue("@paddress", padd)
cmd.Parameters.AddWithValue("@district", dis)
cmd.Parameters.AddWithValue("@phoneno", phno)
cmd.Parameters.AddWithValue("@email", email)
cmd.Parameters.AddWithValue("@dob", dob)
cmd.Parameters.AddWithValue("@gender", gender)
cmd.Parameters.AddWithValue("@gname", gn)
cmd.Parameters.AddWithValue("@gcontactno", gcno)
cmd.Parameters.AddWithValue("@religion", reli)
cmd.Parameters.AddWithValue("@mstatus", mstatus)
cmd.Parameters.AddWithValue("@language", lan)
cmd.Parameters.AddWithValue("@course", cour)
cmd.Parameters.AddWithValue("@scholorship", scholor)
cmd.Parameters.AddWithValue("@username", uname)
cmd.Parameters.AddWithValue("@password", pass)
cmd.Parameters.AddWithValue("@stuId", stuId)
Dim imgData As Byte()
imgData = ImgToByteArray(StudentImage.Image)
cmd.Parameters.AddWithValue("@image", imgData)
cmd.Parameters.AddWithValue("@image", imgData)
cmd.Parameters.AddWithValue("@sem", sem)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
StudentPasswordTextBoxs.Text = GeneratePassword()
refreshStudents()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Page 65 of 96
'search method call to search for students
Private Sub SearchStudentsTextBox_Click(sender As Object, e As EventArgs)
Handles SearchStudentsTextBox.TextChanged
searchData(AdminStudentDataGridView, "SELECT * FROM stuTbl WHERE
username LIKE @a AND state = 1", SearchStudentsTextBox, StudentImage,
StudentPasswordTextBoxs, "searchStudent")
End Sub
Page 66 of 96
Dim img() As Byte
img = AdminStudentDataGridView.CurrentRow.Cells(21).Value
Dim ms As New MemoryStream(img)
StudentImage.Image = Image.FromStream(ms)
Catch ex As Exception
Console.WriteLine("Image is not found")
End Try
End Sub
End Sub
Catch ex As Exception
End Try
End Sub
Page 67 of 96
DataGridViewCellEventArgs) Handles AdminUserDataGridView.CellContentClick
End Sub
Page 68 of 96
PROGRAM AND SUBJECTS
Imports MySqlConnector
End Sub
Sub loadPrograms()
Dim programData As DataTable = su.loadUsers("SELECT * FROM tblPrograms")
ProgramDataGridView.DataSource = programData
ProgramComboBox.DataSource = programData
ProgramComboBox.DisplayMember = "program_name"
ProgramComboBox.ValueMember = "Id"
End Sub
Sub Loadfaculty()
Dim prgdata As DataTable = su.loadUsers("select * from usertbl where usertype like 'Lecturer'")
facultycombo.DataSource = prgdata
facultycombo.DisplayMember = "firstname"
facultycombo.ValueMember = "userId"
End Sub
Function checkIfProgramExist() As Boolean
Dim cmd As New MySqlCommand("SELECT * FROM tblPrograms WHERE program_name=@a", con)
cmd.Parameters.AddWithValue("@a", ProgramNameTextBox.Text)
Dim da As New MySqlDataAdapter(cmd)
Dim dt As New DataTable
da.Fill(dt)
If (dt.Rows.Count > 0) Then
Return False
End If
Return True
End Function
Sub AddPrograms()
If (checkIfProgramExist() = True) Then
Dim cmd As New MySqlCommand("INSERT INTO tblPrograms VALUES(@a,@b)", con)
Dim cmd2 As New MySqlCommand("CREATE TABLE tbl" & ProgramNameTextBox.Text & "(subject_id NVARCHAR(50)
NULL,subject_name NVARCHAR(50) NOT NULL, subject_description NVARCHAR(50) NULL,facultyname NVARCHAR(50)
NULL,sem NVARCHAR(2) NOT NULL)", con)
cmd.Parameters.AddWithValue("@a", ProgramNameTextBox.Text)
cmd.Parameters.AddWithValue("@b", ProgramDetailRichTextBox.Text)
con.Open()
cmd.ExecuteNonQuery()
cmd2.ExecuteNonQuery()
con.Close()
Else
MsgBox("Given course already exist")
End If
End Sub
Page 69 of 96
End Sub
Sub loadSubjects()
Dim a As String = "SELECT * FROM tbl" & ProgramComboBox.Text
Dim cmd As New MySqlCommand(a, con)
Dim da As New MySqlDataAdapter(cmd)
Dim dt As New DataTable
da.Fill(dt)
SubjectDataGridView.DataSource = dt
End Sub
Sub addSubjects()
Dim cmd As New MySqlCommand("INSERT INTO tbl" & ProgramComboBox.Text & " VALUES(@a,@b,@c,@d,@e)", con)
cmd.Parameters.AddWithValue("@a", SubjectIdTextBox.Text)
cmd.Parameters.AddWithValue("@b", SubjectNameTextBox.Text)
cmd.Parameters.AddWithValue("@c", SubjectDetailRichTextBox.Text)
cmd.Parameters.AddWithValue("@d", facultycombo.Text)
cmd.Parameters.AddWithValue("@e", semcombo.Text)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
loadSubjects()
End Sub
End Sub
End Sub
End Sub
Page 70 of 96
ATTENDANCE
Imports MySqlConnector
End Sub
Sub loadsubs()
Dim cmd As String = "select subject_name from tbl" & AttenProgramComboBox.Text & " where facultyname ='" & fnames & "'
and sem =" & Semcombo.Text & ";"
End Sub
Sub searchID()
Dim sql As String = "SELECT * FROM attendanceTbl WHERE userId LIKE @a"
Dim con As MySqlConnection = su.dbConnect()
Dim cmd As New MySqlCommand(sql, con)
cmd.Parameters.AddWithValue("@a", AttSearchTextBox.Text)
Dim da As New MySqlDataAdapter(cmd)
Dim dts As New DataTable()
da.Fill(dts)
AttendanceDataGridView.DataSource = dts
If (AttSearchTextBox.Text = "") Then
loadUsers()
End If
End Sub
Sub loadPrograms()
Dim programData As DataTable = su.loadUsers("SELECT * FROM tblPrograms")
AttenProgramComboBox.DataSource = programData
AttenProgramComboBox.DisplayMember = "program_name"
AttenProgramComboBox.ValueMember = "Id"
End Sub
Sub loadall()
Dim con As MySqlConnection = su.dbConnect()
Dim cmd As New MySqlCommand("SELECT * FROM attendanceTbl where userId = @a AND PA = @b", con)
cmd.Parameters.AddWithValue("@a", Id)
cmd.Parameters.AddWithValue("@b", "Present")
Dim da As New MySqlDataAdapter(cmd)
Dim dts As New DataTable()
da.Fill(dts)
If (dts.Rows.Count > 0) Then
PresentDaysLabel.Text = dts.Rows.Count & " days present"
End If
Dim cmd2 As New MySqlCommand("SELECT * FROM attendanceTbl where userId = @a AND PA = @b", con)
Page 71 of 96
cmd2.Parameters.AddWithValue("@a", Id)
cmd2.Parameters.AddWithValue("@b", "Absent")
Dim da2 As New MySqlDataAdapter(cmd2)
Dim dts2 As New DataTable()
da2.Fill(dts2)
If (dts2.Rows.Count > 0) Then
AbsentDaysLabel.Text = dts2.Rows.Count & " days absent"
End If
End Sub
Sub loadUsers()
Dim con As MySqlConnection = su.dbConnect()
Dim cmd As New MySqlCommand("SELECT * FROM attendanceTbl WHERE Date = @a AND program = @b AND sem = @c
AND period = @d", con)
cmd.Parameters.AddWithValue("@a", MetroDateTime1.Text)
cmd.Parameters.AddWithValue("@b", AttenProgramComboBox.Text)
cmd.Parameters.AddWithValue("@c", Semcombo.Text)
cmd.Parameters.AddWithValue("@d", periodcombo.Text)
Dim da As New MySqlDataAdapter(cmd)
Dim dts As New DataTable()
da.Fill(dts)
If (dts.Rows.Count > 0) Then
AttendanceDataGridView.Columns(0).Visible = False
AttendanceDataGridView.DataSource = dts
updated()
Else
Dim cmd2 As New MySqlCommand("Select userId,fname FROM stuTbl WHERE state = 1 AND course = @a AND sem = @b",
con)
cmd2.Parameters.AddWithValue("@a", AttenProgramComboBox.Text)
cmd2.Parameters.AddWithValue("@b", Semcombo.Text)
Dim da2 As New MySqlDataAdapter(cmd2)
Dim dts2 As New DataTable()
da2.Fill(dts2)
AttendanceDataGridView.DataSource = dts2
End If
End Sub
Sub updated()
For Each row As DataGridViewRow In AttendanceDataGridView.Rows
If (row.Cells("PA").Value = "Present") Then
row.Cells("PACheckBoxColumn").Value = True
Else
row.Cells("PACheckBoxColumn").Value = False
End If
Next
End Sub
Sub checkedAttendance()
For i = 0 To AttendanceDataGridView.RowCount - 1
AttendanceDataGridView.Rows(i).Cells(0).Value = True
Next
End Sub
End Sub
Sub sendValue()
Page 72 of 96
Dim con As MySqlConnection = su.dbConnect()
Dim cmd As New MySqlCommand("INSERT INTO attendanceTbl VALUES(@a,@b,@c,@d,@e,@f,@g,@h)", con)
cmd.Parameters.AddWithValue("@a", row.Cells("userId").Value)
cmd.Parameters.AddWithValue("@b", row.Cells("fname").Value)
cmd.Parameters.AddWithValue("@c", "Present")
cmd.Parameters.AddWithValue("@d", MetroDateTime1.Text)
cmd.Parameters.AddWithValue("@e", AttenProgramComboBox.Text)
cmd.Parameters.AddWithValue("@f", Semcombo.Text)
cmd.Parameters.AddWithValue("@g", daycombo.Text)
cmd.Parameters.AddWithValue("@h", periodcombo.Text)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
Else
Dim con As MySqlConnection = su.dbConnect()
Dim cmd As New MySqlCommand("INSERT INTO attendanceTbl VALUES(@a,@b,@c,@d,@e,@f,@g,@h)", con)
cmd.Parameters.AddWithValue("@a", row.Cells("userId").Value)
cmd.Parameters.AddWithValue("@b", row.Cells("fname").Value)
cmd.Parameters.AddWithValue("@c", "Absent")
cmd.Parameters.AddWithValue("@d", MetroDateTime1.Text)
cmd.Parameters.AddWithValue("@e", AttenProgramComboBox.Text)
cmd.Parameters.AddWithValue("@f", Semcombo.Text)
cmd.Parameters.AddWithValue("@g", daycombo.Text)
cmd.Parameters.AddWithValue("@h", periodcombo.Text)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
End If
Next
End Sub
Sub updates()
Dim con As MySqlConnection = su.dbConnect()
Dim cmd As New MySqlCommand("UPDATE attendanceTbl SET PA = @a WHERE userId = @b AND Date = @c", con)
Dim pa As String
If (AttendanceDataGridView.CurrentRow.Cells(0).Value = True) Then
pa = "Present"
Else
pa = "Absent"
End If
cmd.Parameters.AddWithValue("@a", pa)
cmd.Parameters.AddWithValue("@b", Id)
cmd.Parameters.AddWithValue("@c", MetroDateTime1.Text)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
loadUsers()
End Sub
Page 73 of 96
If (AttenProgramComboBox.Text = "" Or Semcombo.Text = "" Or periodcombo.Text = "") Then
MsgBox("Please Select all the details!")
Else
sendValue()
loadUsers()
End If
End Sub
End If
End Sub
End Class
Page 74 of 96
TIMETABLE
Imports System.Diagnostics.Eventing.Reader
Imports System.Threading
Imports System.Windows.Forms.VisualStyles.VisualStyleElement
Imports MetroFramework.Controls
Imports MySqlConnector
End If
loadPrograms()
loadsems()
End Sub
Sub Lecturer_load()
Page 75 of 96
tblbca.subject_name = 7th)
ORDER BY FIELD(period_time, '1st', '2nd', '3rd', '4th', '5th', '6th', '7th'),
FIELD(day, 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
"
Try
conn.Open()
Dim adapter As MySqlDataAdapter = New MySqlDataAdapter(command)
Dim resultTable As DataTable = New DataTable()
adapter.Fill(resultTable)
' Assuming you have the query result stored in a DataTable named
"resultTable"
Dim days As String() = {"monday", "tuesday", "wednesday",
"thursday", "friday"}
Dim periods As String() = {"1st", "2nd", "3rd", "4th", "5th",
"6th", "7th"}
' Populate the timetable table with the data from the result set
For Each period In periods
Dim row As DataRow = timetableTable.NewRow()
row("Period") = period
For Each day In days
Dim matchingRows() As DataRow = resultTable.Select("day =
'" & day & "' AND period_time = '" & period & "'")
If matchingRows.Length > 0 Then
row(day) = matchingRows(0)("subject_details")
Else
row(day) = ""
End If
Next
timetableTable.Rows.Add(row)
Next
Catch ex As Exception
MessageBox.Show("Error: " & ex.Message)
Finally
conn.Close()
End Try
Page 76 of 96
End Sub
Sub LoadSubs()
'Dim sql As String = "SELECT subject_name from tbl" & coursetxt.Text &
" WHERE sem LIKE " & semtxt.Text
'Dim prgdata As DataTable = su.loadUsers(sql)
'cb1.DataSource = prgdata
'Dim cbs() = {cb1, cb2, cb3, cb4, cb5, cb6, cb7}
'For Each cb In cbs
' cb.DataSource = prgdata
' cb.DisplayMember = "subject_name"
'Next
Dim sql As String = "SELECT subject_name from tbl" & coursetxt.Text & "
WHERE sem LIKE " & semtxt.Text
Dim prgdata1, prgdata2, prgdata3, prgdata4, prgdata5, prgdata6,
prgdata7 As DataTable
prgdata1 = su.loadUsers(sql)
prgdata2 = su.loadUsers(sql)
prgdata3 = su.loadUsers(sql)
prgdata4 = su.loadUsers(sql)
prgdata5 = su.loadUsers(sql)
prgdata6 = su.loadUsers(sql)
prgdata7 = su.loadUsers(sql)
Dim prgs() = {prgdata1, prgdata2, prgdata3, prgdata4, prgdata5,
prgdata6, prgdata7}
Dim cbs() = {cb1, cb2, cb3, cb4, cb5, cb6, cb7}
Dim i As Integer
For i = 0 To 6
cbs(i).DataSource = prgs(i)
cbs(i).DisplayMember = "subject_name"
Next
End Sub
Private Sub Label1_Click(sender As Object, e As EventArgs) Handles
Label1.Click
End Sub
End Sub
Sub loadPrograms()
If (utypes = "Student") Then
Coursescombo.Items.Add(stucourse)
Else
Dim programData As DataTable = su.loadUsers("SELECT * FROM
tblPrograms")
Coursescombo.DataSource = programData
Coursescombo.DisplayMember = "program_name"
Coursescombo.ValueMember = "Id"
End If
Page 77 of 96
End Sub
Sub loadsems()
If (utypes = "Student") Then
Semcombo.Items.Add(stusem)
Else
Semcombo.Items.Add(1)
Semcombo.Items.Add(2)
Semcombo.Items.Add(3)
Semcombo.Items.Add(4)
Semcombo.Items.Add(5)
Semcombo.Items.Add(6)
End If
End Sub
End Sub
End Sub
Sub searchTT()
Dim days() As String = {"monday", "tuesday", "wednesday", "thursday",
"friday", "saturday"}
'Dim grids() = {Mongrid, Tuesgrid, Wedgrid, Thurgrid, Frigrid, Satgrid}
'Dim i As Integer
Dim sql As String = "SELECT UPPER(day) as
DAY,1st,2nd,3rd,4th,5th,6th,7th FROM timetable WHERE course LIKE @a and sem
LIKE @b"
Dim con As MySqlConnection = su.dbConnect()
Dim cmd As New MySqlCommand(sql, con)
cmd.Parameters.AddWithValue("@a", Coursescombo.Text)
cmd.Parameters.AddWithValue("@b", Semcombo.Text)
'cmd.Parameters.AddWithValue("@c", days(i))
Dim da As New MySqlDataAdapter(cmd)
Dim dts As New DataTable()
da.Fill(dts)
TTgrid.DataSource = dts
If (Coursescombo.Text = "") Then
loadPrograms()
End If
Page 78 of 96
End Sub
Try
coursetxt.Text = Coursescombo.Text
semtxt.Text = Semcombo.Text
daytxt.Text = TTgrid.CurrentRow.Cells(0).Value.ToString()
LoadSubs()
firsttxt.Text = TTgrid.CurrentRow.Cells(1).Value.ToString()
secondtxt.Text = TTgrid.CurrentRow.Cells(1).Value.ToString()
thirdtxt.Text = TTgrid.CurrentRow.Cells(2).Value.ToString()
fourthtxt.Text = TTgrid.CurrentRow.Cells(3).Value.ToString()
fifthtxt.Text = TTgrid.CurrentRow.Cells(4).Value.ToString()
sixthtxt.Text = TTgrid.CurrentRow.Cells(5).Value.ToString()
seventhtxt.Text = TTgrid.CurrentRow.Cells(6).Value.ToString()
Catch ex As Exception
MsgBox(ex)
End Try
End Sub
Try
coursetxt.Text = Coursescombo.Text
semtxt.Text = Semcombo.Text
daytxt.Text = TTgrid.CurrentRow.Cells(0).Value.ToString()
LoadSubs()
firsttxt.Text = TTgrid.CurrentRow.Cells(1).Value.ToString()
secondtxt.Text = TTgrid.CurrentRow.Cells(1).Value.ToString()
thirdtxt.Text = TTgrid.CurrentRow.Cells(2).Value.ToString()
fourthtxt.Text = TTgrid.CurrentRow.Cells(3).Value.ToString()
fifthtxt.Text = TTgrid.CurrentRow.Cells(4).Value.ToString()
sixthtxt.Text = TTgrid.CurrentRow.Cells(5).Value.ToString()
seventhtxt.Text = TTgrid.CurrentRow.Cells(6).Value.ToString()
Catch ex As Exception
MsgBox(ex)
End Try
Page 79 of 96
End Sub
Page 80 of 96
Private Sub cb7_SelectedIndexChanged(sender As Object, e As EventArgs)
Handles cb7.SelectedIndexChanged
Dim selectedRow As DataRowView = DirectCast(cb7.SelectedItem,
DataRowView)
seventhtxt.Text = selectedRow("subject_name").ToString()
End Sub
Page 81 of 96
' Next
' Next
' Thread.Sleep(5000)
' Next
' MsgBox("Insertion done")
'End Sub
End Class
Page 82 of 96
NOTICE
Imports MySqlConnector
MsgBox("Deleted Notice!")
loadNotices()
con.Close()
Catch ex As Exception
MsgBox("Couldnt Delete Notice Because of folloing error " & ex.Message & "")
End Try
End Sub
End Class
Page 83 of 96
RECYCLE USERS OR STUDENTS
Imports MySqlConnector
End Class
Page 85 of 96
REPORTS
Imports MySqlConnector
Imports System.Data
Imports CrystalDecisions
Imports CrystalDecisions.Windows.Forms.CrystalReportViewer
Imports System.Data.SqlClient
Imports System.IO
Public Sub reports(ByVal sql As String, ByVal rptname As String, ByVal crystalRpt As Object)
Try
con.Open()
ds = New DataSet()
da = New MySqlDataAdapter(cmd)
da.Fill(ds)
reportname = rptname
Dim reportdoc As New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim strReportPath As String
strReportPath = Application.StartupPath & "\reports\" & reportname & ".rpt"
If File.Exists(strReportPath) Then
reportdoc.Load(strReportPath)
reportdoc.SetDataSource(ds.Tables(0))
With crystalRpt
.ShowRefreshButton = False
.ShowCloseButton = False
.ShowGroupTreeButton = False
.ReportSource = reportdoc
End With
Else
MsgBox("Report file not found at path: " & strReportPath)
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
con.Close()
da.Dispose()
End Sub
fname as Student_name,
(COUNT(CASE WHEN PA='Present' THEN 1 END)/COUNT(*))*100 AS Attendance
FROM
attendancetbl
WHERE
program = '" & CourseCombo.Text & "' AND sem = '" & SemCombo.Text & "'
GROUP BY
fname;
"
reports(Sql, "ATTENDANCE", CPV)
End If
End Sub
End Sub
FROM
stutbl
WHERE
course = '" & CourseCombo.Text & "' AND sem = '" & SemCombo.Text & "'
GROUP BY
userId;
"
reports(Sql, "STUDENTDETAILS", CPV)
End If
End Sub
"
reports(Sql, "FACULTYDETAILS", CPV)
End If
Page 87 of 96
End Sub
End Class
Page 88 of 96
reports
Page 89 of 96
COURSE AND SEMESTER WISE FACULTY REPORTS
Page 90 of 96
COURSE AND SEMESTER WISE CLASS STUDENTS DETAILS REPORT
Page 91 of 96
TESTING
Testing Objectives
Testing is a process of executing a program with the intent of finding
an error or debug.
A good test case is one that has a high probability of finding yet not
discovered errors.
Unit Testing
Unit testing using white-box-testing to test each smallest unit or
component of the module like Interface, Local Data Structure, Boundary
Conditions, Independent and Error Handling Paths using appropriate test
cases.
Integration Testing
Integration Testing using Top-Down Integration to test data
and its value before and after flowing from one to another module
during and after integration of module.
Code Testing
The code testing examines the logic of the program. To
follow this testing we have developed test cases that result in
every instruction in the module; every path is specific
combination of conditions that is handled by the program.
Validation Testing
Validation testing to validate system functionalities, that they
are traceable to customer requirements.
System Testing
System testing to test efficiency with all minimum hardware
and software requirements of system after installation.
Page 92 of 96
FUTURE SCOPE
Integration with other systems: The College Management System can be integrated with other
systems like library management, hostel management, and transportation management. This will help
in creating a centralized platform for managing various aspects of the college.
Mobile application: A mobile application can be developed for the College Management System that
can be used by students, teachers, and parents to access information about the college. This will
provide a convenient and efficient way to access information on the go.
Online payment: Online payment can be integrated into the College Management System for
payment of fees, fines, and other charges. This will eliminate the need for physical payment and
provide a secure and convenient payment method.
Alumni network: A platform for alumni networking can be created within the College Management
System. This will help in connecting alumni with each other and with the college, and can be used
for mentoring and career guidance.
Analytics and reporting: The College Management System can be enhanced with analytics and
reporting capabilities to provide insights into student performance, attendance, and other metrics.
This will help in making data-driven decisions and improving the overall performance of the college.
Virtual classroom: The College Management System can be integrated with virtual classroom
software to provide online classes and lectures. This will provide flexibility in teaching and learning,
and can be used in situations where physical attendance is not possible.
Artificial intelligence: Artificial intelligence can be integrated into the College Management System
for tasks like chatbots, automated grading, and student recommendations. This will provide a
personalized and efficient experience for students and teachers.
Page 93 of 96
CONCLUSION
In conclusion, our College Management System project in VB.NET has successfully achieved its objectives
of creating a comprehensive and efficient system for managing college operations. Throughout the project,
we have developed various features and functionalities that enable easy management of student, staff, and
administrative data.
We have developed a user-friendly interface that provides easy navigation and access to relevant
information for students, teachers, and administrators. Some of the key features we have implemented
include student registration and management, attendance tracking, timetable and report generation.
Despite some challenges faced during the project, such as technical difficulties and time constraints, we
were able to overcome these obstacles through effective teamwork and collaboration. We have learned
valuable lessons in project management, software development methodologies, and communication, which
will be useful for future projects.
In the future, there are several potential areas for further development of the College Management System,
such as integration with other systems, development of a mobile application, and implementation of artificial
intelligence. We believe that the system has the potential to further improve college operations and
contribute to the success of the college.
We would like to express our gratitude to all those who supported us throughout the project, including our
HOD K.ADISESHA . It has been a fulfilling experience for all of us, and we hope that our College
Management System will continue to serve the college community for years to come.
Page 94 of 96
REFERENCES / BIBLOGRAPHY
BIBLOGRAPHY :
https://www.scribd.com/doc/92277607/COLLEGE-MANAGEMENT-SYSTEM-ON-
VISUAL-BASIC-BY-SANTOSH-KUMAR-IIMT-KARKARDOOMA#
REFERENCE :
1. Beginning with Vb.Net 2008 – Thearon Willis
2. System Analysis and Design-- Galgotia Publications.
3. Software Engineering By Roger S. Pressman, McGraw
Hill Publications.
Page 95 of 96
Page 96 of 96