Sunteți pe pagina 1din 32

Form1

Imports
Imports
Imports
Imports
Imports
Imports
Imports

System.Collections.Generic
System.ComponentModel
System.Data
System.Drawing
System.Linq
System.Text
System.Windows.Forms

Public Partial Class Form1


Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub button1_Click(sender As Object, e As EventArgs)
If (textBox1.Text.Length = 0) AndAlso (textBox2.Text.Length = 0) Then
MessageBox.Show("plese Enter your Identity ! try Again...", "Login Error",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
ElseIf (textBox1.Text = "admin") AndAlso (textBox2.Text = "citm") Then
progressBar1.Visible = True
label3.Visible = True
progressBar1.Value = 0

Else

timer1.Enabled = True

MessageBox.Show("Wrong User Name or Password ! try Again...", "Login


Error", MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If
textBox1.Text = ""
textBox2.Text = ""
textBox1.Focus()

End Sub
Private Sub timer1_Tick(sender As Object, e As EventArgs)
progressBar1.Value = progressBar1.Value + 10
If progressBar1.Value >= 100 Then
timer1.Enabled = False
progressBar1.Visible = True

End If
End Sub

Me.Hide()
Dim obj As New MDI_Main_Form()
obj.Show()

Private Sub button2_Click(sender As Object, e As EventArgs)


Me.Close()
End Sub
Private Sub progressBar1_Click(sender As Object, e As EventArgs)
End Sub
End Class

Mdi form
Imports
Imports
Imports
Imports
Imports
Imports
Imports

System.Collections.Generic
System.ComponentModel
System.Data
System.Drawing
System.Linq
System.Text
System.Windows.Forms

Public Partial Class MDI_Main_Form


Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub registrationNewStudentToolStripMenuItem_Click(sender As Object, e As
EventArgs)
Dim str As New Student_Registration()
str.MdiParent = Me
str.Show()
End Sub
Private Sub exitToolStripMenuItem_Click(sender As Object, e As EventArgs)
Dim vasr As New ViewAllStudentRecord()
vasr.MdiParent = Me
vasr.Show()
End Sub
Private Sub searchStudentRecordToolStripMenuItem_Click(sender As Object, e As
EventArgs)
Dim ssr As New SearchStudentRecord()
ssr.MdiParent = Me
ssr.Show()
End Sub
Private Sub MDI_Main_Form_Load(sender As Object, e As EventArgs)
End Sub
Private Sub updateStudentRecordToolStripMenuItem_Click(sender As Object, e As
EventArgs)
Dim ssr As New SearchStudentRecord()
ssr.MdiParent = Me
ssr.Show()
End Sub
Private Sub deleteStudentRecordToolStripMenuItem_Click(sender As Object, e As
EventArgs)
Dim ssr As New SearchStudentRecord()
ssr.MdiParent = Me
ssr.Show()
End Sub

Private Sub addToolStripMenuItem_Click(sender As Object, e As EventArgs)


Dim acd As New AcademicDetails()
acd.MdiParent = Me
acd.Show()
End Sub
Private Sub addToolStripMenuItem1_Click(sender As Object, e As EventArgs)
Dim tm As New Transport_Management()
tm.MdiParent = Me
tm.Show()
End Sub
Private Sub addToolStripMenuItem2_Click(sender As Object, e As EventArgs)
Dim hm As New HostalManagement()
hm.MdiParent = Me
hm.Show()
End Sub
Private Sub admissionFeeToolStripMenuItem_Click(sender As Object, e As EventArgs)
Dim af As New Admissionfee()
af.MdiParent = Me
af.Show()
End Sub
Private Sub exitToolStripMenuItem1_Click(sender As Object, e As EventArgs)
Application.[Exit]()
End Sub
Private Sub searchToolStripMenuItem_Click(sender As Object, e As EventArgs)
Dim acs As New AcademicSearch()
acs.MdiParent = Me
acs.Show()
End Sub
Private Sub modifyToolStripMenuItem_Click(sender As Object, e As EventArgs)
Dim acs As New AcademicSearch()
acs.MdiParent = Me
acs.Show()
End Sub
Private Sub deleteToolStripMenuItem_Click(sender As Object, e As EventArgs)
Dim acs As New AcademicSearch()
acs.MdiParent = Me
acs.Show()
End Sub
Private Sub searchToolStripMenuItem1_Click(sender As Object, e As EventArgs)
Dim tm As New Transport_Management()
tm.MdiParent = Me
tm.Show()
End Sub
Private Sub modifyToolStripMenuItem1_Click(sender As Object, e As EventArgs)
Dim tm As New Transport_Management()
tm.MdiParent = Me
tm.Show()
End Sub

Private Sub deleteToolStripMenuItem1_Click(sender As Object, e As EventArgs)


Dim tm As New Transport_Management()
tm.MdiParent = Me
tm.Show()
End Sub
Private Sub searchToolStripMenuItem2_Click(sender As Object, e As EventArgs)
Dim sh As New SearchHotel()
sh.MdiParent = Me
sh.Show()
End Sub
Private Sub modifyToolStripMenuItem2_Click(sender As Object, e As EventArgs)
Dim hm As New HostalManagement()
hm.MdiParent = Me
hm.Show()
End Sub
Private Sub deleteToolStripMenuItem2_Click(sender As Object, e As EventArgs)
Dim hm As New HostalManagement()
hm.MdiParent = Me
hm.Show()
End Sub
Private Sub feeDetailsToolStripMenuItem1_Click(sender As Object, e As EventArgs)
Dim fd As New Fees_Details()
fd.MdiParent = Me
fd.Show()
End Sub
Private Sub viewAllRecordToolStripMenuItem_Click(sender As Object, e As EventArgs)
Dim ar As New AcademicRecord()
ar.MdiParent = Me
ar.Show()
End Sub
Private Sub viewAllRecordToolStripMenuItem2_Click(sender As Object, e As EventArgs)
Dim tr As New TransportRecord()
tr.MdiParent = Me
tr.Show()
End Sub
Private Sub viewAllRecordToolStripMenuItem3_Click(sender As Object, e As EventArgs)
Dim hr As New HostalRecord()
hr.MdiParent = Me
hr.Show()
End Sub
End Class

fee

Imports
Imports
Imports
Imports
Imports
Imports
Imports
Imports

System.Collections.Generic
System.ComponentModel
System.Data
System.Drawing
System.Linq
System.Text
System.Windows.Forms
System.Data.OleDb

Public Partial Class Fees_Details


Inherits Form
Private con As OleDbConnection
Public Sub New()
InitializeComponent()
End Sub
Private Sub button2_Click(sender As Object, e As EventArgs)
Try
Dim com As New OleDbCommand("insert into fee(sid,
name, sem, APaid, bal,
BName,
LDues, lFine, dis,
aPBy, Total) values('" & txtsid.Text & "','" &
txtName.Text & "','" & txtsem.Text & "'," & txtAmt.Text & "," & txtbal.Text & ",'" & txtBranch.Text &
"'," & txtLD.Text & "," & txtLFine.Text & "," & txtDis.Text & ",'" & cmbAMode.Text & "'," &
Convert.ToString(txtTot.Text) & ")", con)
com.ExecuteNonQuery()
MessageBox.Show("Save Seccessfully!")
Catch ex As OleDbException
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub Fees_Details_Load(sender As Object, e As EventArgs)
Try
con = New OleDbConnection(db.dbo())
con.Open()
Catch ex As OleDbException
MessageBox.Show(ex.Message)
End Try
End Sub
End Class

Student registration

Imports
Imports
Imports
Imports
Imports
Imports
Imports
Imports

System.Collections.Generic
System.ComponentModel
System.Data
System.Drawing
System.Linq
System.Text
System.Windows.Forms
System.Data.OleDb

Partial Public Class Student_Registration


Inherits Form
Private con As OleDbConnection
Private rid As Integer
Private gen As String
Public Sub New()
InitializeComponent()
End Sub

Private Sub Student_Registration_Load(sender As Object, e As EventArgs)


con = New OleDbConnection(db.dbo())
con.Open()
comCategary.Text = "Select.."
comCriteria.Text = "Select.."
GetId()
' MessageBox.Show("connection completed successfully!");
End Sub
Private Sub GetId()
Try
Dim a As Integer = 1
Dim cmd As New OleDbCommand("select max(id)+1 from StudentRegi", con)
Dim dr As OleDbDataReader = cmd.ExecuteReader()
If dr.Read() Then
If dr.IsDBNull(0) = False Then
a = Integer.Parse(dr.GetValue(0).ToString())
End If
txtSID.Text = "S00" & a
End If
Catch ex As OleDbException
'throw;
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub textBox5_TextChanged(sender As Object, e As EventArgs)
End Sub
Private Sub panel3_Paint(sender As Object, e As PaintEventArgs)

End Sub

Private Sub btnSubmit_Click_1(sender As Object, e As EventArgs)


If True Then
If radioButton1.Checked = True Then
gen = radioButton1.Text
End If
If radioButton2.Checked = True Then
gen = radioButton2.Text
End If
If txtFName.Text = "" OrElse txtLName.Text = "" OrElse dateTimePicker1.Text = "" OrElse
txtPAdd.Text = "" OrElse txtCAdd.Text = "" OrElse txtRNum.Text = "" OrElse txtFName.Text = ""
OrElse txtSNum.Text = "" OrElse txtSID.Text = "" OrElse txtFatherName.Text = "" OrElse
txtMotherName.Text = "" OrElse txtFatherOccu.Text = "" OrElse txtMotherOccu.Text = "" OrElse
dateTimePicker2.Text = "" OrElse txtEmail.Text = "" OrElse comCategary.Text = "" OrElse
comCriteria.Text = "" Then
MessageBox.Show("Please Fill All Fields !", "Student Details", MessageBoxButtons.OK,
MessageBoxIcon.Information)
Return
End If
Try
Dim cmd1 As New OleDbCommand()
cmd1.Connection = con
Dim dr As OleDbDataReader
cmd1.CommandText = "select max(id)+1 from StudentRegi"
dr = cmd1.ExecuteReader()
If dr.Read() Then
If dr.IsDBNull(0) = False Then
rid = Integer.Parse(dr.GetValue(0).ToString())
Else
rid = 1
End If
End If
dr.Close()
Dim cmd As New OleDbCommand("insert into studentRegi(
firstName,
LastName,
Gender,
DOB, RealAddress , CurentAddress ,
ResiNumber,
FatherNumber,SelfNumber, StudentID,
FatherName, MothersName, FatherOccu,
MotherOCcu, DateOfAdmission,
EmailID,
Categary,
AdmissionCraiteria)
values('" & txtFName.Text & "','" & txtLName.Text & "','" & gen & "', '" & dateTimePicker1.Text &
"','" & txtPAdd.Text & "','" & txtCAdd.Text & "','" & txtRNum.Text & "','" & TxtFNum.Text & "','" &
txtSNum.Text & "','" & txtSID.Text & "','" & txtFatherName.Text & "','" & txtMotherName.Text & "','"
& txtFatherOccu.Text & "','" & txtMotherOccu.Text & "','" & dateTimePicker2.Text & "','" &
txtEmail.Text & "','" & comCategary.Text & "','" & comCriteria.Text & "')", con)
cmd.ExecuteNonQuery()
MessageBox.Show("Data saved successfully!", "Student Registration",
MessageBoxButtons.OKCancel, MessageBoxIcon.Question)
txtFName.Text = ""
txtLName.Text = ""
dateTimePicker1.Text = ""
txtPAdd.Text = ""
txtCAdd.Text = ""
txtRNum.Text = ""
txtFName.Text = ""

txtSNum.Text = ""
txtSID.Text = ""
txtFatherName.Text = ""
txtMotherName.Text = ""
txtFatherOccu.Text = ""
txtMotherOccu.Text = ""
dateTimePicker2.Text = ""
txtEmail.Text = ""
comCategary.Text = ""
comCriteria.Text = ""
txtFName.Focus()
GetId()
Catch generatedExceptionName As Exception
MessageBox.Show("sql exception")
End Try
End If
End Sub
Private Sub btnCencel_Click(sender As Object, e As EventArgs)
Me.Close()
End Sub
Private Sub txtFName_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = True AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txtLName_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = True AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txtRNum_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub TxtFNum_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txtSNum_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub

Private Sub txtRNum_TextChanged(sender As Object, e As EventArgs)


Dim var As Integer = 9
' var=8;
If txtRNum.Text.Length.Equals(var) Then
MessageBox.Show("Residence No should be 8 !")
Return
End If
End Sub
Private Sub txtFatherName_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = True AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txtMotherName_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = True AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txtFatherOccu_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = True AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txtMotherOccu_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = True AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub comCategary_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = True AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub comCriteria_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = True AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub

End Class

Transport

Imports
Imports
Imports
Imports
Imports
Imports
Imports
Imports

System.Collections.Generic
System.ComponentModel
System.Data
System.Drawing
System.Linq
System.Text
System.Windows.Forms
System.Data.OleDb

Public Partial Class Transport_Management


Inherits Form
Private con As OleDbConnection
Private gen As String
Private gender1 As String
Public Sub New()
InitializeComponent()
End Sub
Private Sub textBox4_TextChanged(sender As Object, e As EventArgs)
End Sub
Private Sub label8_Click(sender As Object, e As EventArgs)
End Sub
Private Sub label9_Click(sender As Object, e As EventArgs)
End Sub
Private Sub txt_TextChanged(sender As Object, e As EventArgs)
End Sub
Private Sub textBox2_TextChanged(sender As Object, e As EventArgs)
End Sub
Private Sub groupBox1_Enter(sender As Object, e As EventArgs)
End Sub
Private Sub button2_Click(sender As Object, e As EventArgs)
If rdoFMale.Checked = True Then
gen = "Male"
End If
If rdoFFemale.Checked = True Then
gen = "Female"
End If
If txtStuID.Text = "" OrElse txtFFirstName.Text = "" OrElse txtFLastName.Text = ""
OrElse txtadress.Text = "" OrElse txtArea.Text = "" OrElse txtbusNo.Text = "" OrElse
txtroutNo.Text = "" OrElse txtbuspass.Text = "" OrElse txtbuspassNo.Text = "" OrElse
txtBusFee.Text = "" OrElse txtpicuppoint.Text = "" OrElse txtStopNo.Text = "" OrElse
comamount.Text = "" Then

MessageBox.Show("Please Fill All Fields !")


Return
End If
Try
Dim cmd As New OleDbCommand("insert into transport values('" & txtStuID.Text & "','" &
txtFFirstName.Text & "','" & txtFLastName.Text & "','" & txtadress.Text & "','" & gen & "','" &
txtArea.Text & "','" & txtbusNo.Text & "','" & txtroutNo.Text & "','" & txtbuspass.Text & "','" &
txtbuspassNo.Text & "','" & txtBusFee.Text & "','" & txtpicuppoint.Text & "','" & txtStopNo.Text &
"','" & comamount.Text & "')", con)
cmd.ExecuteNonQuery()
MessageBox.Show("Data submited successfully")
txtStuID.Text = ""
txtFFirstName.Text = ""
txtFLastName.Text = ""
txtadress.Text = ""
txtArea.Text = ""
txtbusNo.Text = ""
txtroutNo.Text = ""
txtbuspass.Text = ""
txtbuspassNo.Text = ""
txtBusFee.Text = ""
txtpicuppoint.Text = ""
txtStopNo.Text = ""
comamount.Text = "select.."
txtStuID.Focus()
Catch generatedExceptionName As Exception
MessageBox.Show("Student ID is invalid")
End Try

End Sub
Private Sub Transport_Management_Load(sender As Object, e As EventArgs)
con = New OleDbConnection(db.dbo())
con.Open()
End Sub
Private Sub button1_Click(sender As Object, e As EventArgs)
End Sub
Private Sub button3_Click(sender As Object, e As EventArgs)
If rdoFMale.Checked = True Then
gen = "Male"
End If
If rdoFFemale.Checked = True Then
gen = "Female"
End If
Try
Dim cmd As New OleDbCommand("update transport set fName = '" &
txtFFirstName.Text & "', Lname = '" & txtFLastName.Text & "', address = '" & txtadress.Text & "',
Gender = '" & gen & "', Area = '" & txtArea.Text & "', busNo = '" & txtbusNo.Text & "', routeNo =
'" & txtroutNo.Text & "', buspass = '" & txtbuspass.Text & "', buspassNo = '" & txtbuspassNo.Text
& "', busfee = '" & txtBusFee.Text & "', picupPoint = '" & txtpicuppoint.Text & "', StopPoint = '" &
txtStopNo.Text & "', paidby = '" & comamount.Text & "' where studentid = '" & txtStuID.Text & "'",
con)

cmd.ExecuteNonQuery()
MessageBox.Show("updated successfully")
txtStuID.Text = ""
txtFFirstName.Text = ""
txtFLastName.Text = ""
txtadress.Text = ""
txtArea.Text = ""
txtbusNo.Text = ""
txtroutNo.Text = ""
txtbuspass.Text = ""
txtbuspassNo.Text = ""
txtBusFee.Text = ""
txtpicuppoint.Text = ""
txtStopNo.Text = ""
comamount.Text = "select.."
txtStuID.Focus()
Catch generatedExceptionName As Exception
MessageBox.Show("SQL Exception")
End Try
End Sub
Private Sub button1_Click_1(sender As Object, e As EventArgs)
Try
Dim cmd As New OleDbCommand("select * from Transport where
studentID = '" & txtStuID.Text & "'", con)
Dim dr As OleDbDataReader = cmd.ExecuteReader()
If dr.Read() Then
txtFFirstName.Text = dr("Fname").ToString()
txtFLastName.Text = dr("LName").ToString()
txtadress.Text = dr("Address").ToString()
gender1 = dr("Gender").ToString()
txtArea.Text = dr("Area").ToString()
txtbusNo.Text = dr("BusNo").ToString()
txtroutNo.Text = dr("RouteNo").ToString()
txtbuspass.Text = dr("BusPass").ToString()
txtbuspassNo.Text = dr("BusPassNo").ToString()
txtBusFee.Text = dr("BusFee").ToString()
txtpicuppoint.Text = dr("PicupPoint").ToString()
txtStopNo.Text = dr("StopPoint").ToString()
comamount.Text = dr("PaidBy").ToString()
If gender1 = "Male" Then
rdoFMale.Checked = True
End If
If gender1 = "Female" Then
rdoFFemale.Checked = True
End If
dr.Close()
End If
Catch generatedExceptionName As Exception
MessageBox.Show("record not found...")
End Try
End Sub
Private Sub button4_Click(sender As Object, e As EventArgs)
Try

Dim cmd As New OleDbCommand("delete transport where studentID = '"


& txtStuID.Text & "'", con)
cmd.ExecuteNonQuery()
MessageBox.Show("Record has deleted")
txtStuID.Text = ""
txtFFirstName.Text = ""
txtFLastName.Text = ""
txtadress.Text = ""
txtArea.Text = ""
txtbusNo.Text = ""
txtroutNo.Text = ""
txtbuspass.Text = ""
txtbuspassNo.Text = ""
txtBusFee.Text = ""
txtpicuppoint.Text = ""
txtStopNo.Text = ""
comamount.Text = "select.."
txtStuID.Focus()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub button5_Click(sender As Object, e As EventArgs)
Me.Close()
End Sub
End Class

View all student

Imports
Imports
Imports
Imports
Imports
Imports
Imports
Imports

System.Collections.Generic
System.ComponentModel
System.Data
System.Drawing
System.Linq
System.Text
System.Windows.Forms
System.Data.OleDb

Public Partial Class ViewAllStudentRecord


Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private con As OleDbConnection
Private Sub ViewAllStudentRecord_Load(sender As Object, e As EventArgs)
con = New OleDbConnection(db.dbo())
con.Open()
Dim cmd As New OleDbCommand("select * from studentRegi", con)
Dim dr As OleDbDataReader = cmd.ExecuteReader()
Dim dt As New DataTable()
dt.Load(dr)
dataGridView1.DataSource = dt
dr.Close()
End Sub
End Class

Academic

Imports
Imports
Imports
Imports
Imports
Imports
Imports
Imports

System.Collections.Generic
System.ComponentModel
System.Data
System.Drawing
System.Linq
System.Text
System.Windows.Forms
System.Data.OleDb

Public Partial Class AcademicDetails


Inherits Form
Private con As OleDbConnection
Private rid As Integer
Public Sub New()
InitializeComponent()
End Sub
Private Overloads Sub hide()
txtsid.Text = ""
txtname.Text = ""
txtSchName.Text = ""
txtaddress.Text = ""
txt10marks.Text = ""
txt10per.Text = ""
com10thYear.Text = "select.."
txt12thMarks.Text = ""
txt12per.Text = ""
com12year.Text = "select.."
txt1stsemM.Text = ""
txt1stsemMO.Text = ""
txt1stsemP.Text = ""
txt2ndsemM.Text = ""
txt2ndsemMO.Text = ""
txt2ndsemP.Text = ""
txt3rdsem.Text = ""
txt3rdsemMO.Text = ""
txt3rdsemP.Text = ""
txt4thsem.Text = ""
txt4thsemMO.Text = ""
txt4thsemPer.Text = ""
txt5thsem.Text = ""
txt5thsemMO.Text = ""
txt5thsemPer.Text = ""
txttottalPer.Text = ""
txtsid.Focus()
End Sub
Private Sub textBox4_TextChanged(sender As Object, e As EventArgs)
End Sub
Private Sub button5_Click(sender As Object, e As EventArgs)
Dim ofd As New OpenFileDialog()
ofd.Filter = "images files(*.jpg;*.jpeg;*.png;*.gif;*bmp)|*.jpg;*.jpeg;*.png;*.gif;*.bmp"
If ofd.ShowDialog() = DialogResult.OK Then
picF.Image = New Bitmap(ofd.FileName)
picF.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
lblimagepath.Text = ofd.FileName.ToString()
End If

End Sub
Private Sub textBox1_TextChanged(sender As Object, e As EventArgs)
End Sub
Private Sub pictureBox2_Click(sender As Object, e As EventArgs)
End Sub
Private Sub textBox6_TextChanged(sender As Object, e As EventArgs)
End Sub
Private Sub comboBox2_SelectedIndexChanged(sender As Object, e As EventArgs)
End Sub
Private Sub textBox11_TextChanged(sender As Object, e As EventArgs)
End Sub
Private Sub textBox15_TextChanged(sender As Object, e As EventArgs)
End Sub
Private Sub textBox19_TextChanged(sender As Object, e As EventArgs)
End Sub
Private Sub button1_Click(sender As Object, e As EventArgs)
End Sub
Private Sub groupBox2_Enter(sender As Object, e As EventArgs)
End Sub
Private Sub groupBox3_Enter(sender As Object, e As EventArgs)
End Sub
Private Sub AcademicDetails_Load(sender As Object, e As EventArgs)
con = New OleDbConnection(db.dbo())
con.Open()
com10thYear.Text = "select.."
com12year.Text = "select.."
GetId()
End Sub
Private Sub GetId()
Try
Dim a As Integer = 1
Dim cmd As New OleDbCommand("select max(id)+1 from academic", con)
Dim dr As OleDbDataReader = cmd.ExecuteReader()
If dr.Read() Then
If dr.IsDBNull(0) = False Then
a = Integer.Parse(dr.GetValue(0).ToString())

End If
txtsid.Text = "A00" & a
End If
Catch ex As OleDbException
'throw;
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub button4_Click(sender As Object, e As EventArgs)
End Sub
Private Sub button2_Click(sender As Object, e As EventArgs)
End Sub
Private Sub button3_Click(sender As Object, e As EventArgs)
End Sub
Private Sub button6_Click(sender As Object, e As EventArgs)
Me.Close()
End Sub
Private Sub textBox1_TextChanged_1(sender As Object, e As EventArgs)
End Sub
Private Sub button3_Click_1(sender As Object, e As EventArgs)
'if (txtname.Text == "" || txtSchName.Text = "")
'{
' MessageBox.Show("Please Fill All Required Fields !");
' return;
'}
Try
Dim cmd1 As New OleDbCommand()
cmd1.Connection = con
Dim dr As OleDbDataReader
'cmd1.CommandText = "select max(id)+1 from StudentRegi";
'dr = cmd1.ExecuteReader();
'if (dr.Read())
'{
' if (dr.IsDBNull(0) == false)
' {
'
rid = int.Parse(dr.GetValue(0).ToString());
' }
' else
' {
'
rid = 1;
' }
'}
'dr.Close();
Dim cmd As New OleDbCommand("insert into academic(RollNumber,
name,
schoolName, Address,
TenthMarks,
TenthPercentate,
TenthPassingYear,
TwelthMarks, TwelthPercentate,
TwelthPassingYear,
FirstSemTM, FirstSemMO,

FirstSemPer, SecondSemTM,
SecondSemMO,
SecondSemPer,
ThirdSemTM, ThirdSemMO, ThirdSemPer, ForthSemTM, ForthSemMO, ForthSemPer,
FifthSemTM, FifthSemMO, FifthSemPer, FirstToFifthPer, pics) values ('" & txtsid.Text &
"','" & txtname.Text & "','" & txtSchName.Text & "','" & txtaddress.Text & "','" & txt10marks.Text &
"','" & txt10per.Text & "','" & com10thYear.Text & "','" & txt12thMarks.Text & "','" & txt12per.Text &
"','" & com12year.Text & "','" & txt1stsemM.Text & "','" & txt1stsemMO.Text & "','" &
txt1stsemP.Text & "','" & txt2ndsemM.Text & "','" & txt2ndsemMO.Text & "','" & txt2ndsemP.Text &
"','" & txt3rdsem.Text & "','" & txt3rdsemMO.Text & "','" & txt3rdsemP.Text & "','" & txt4thsem.Text
& "','" & txt4thsemMO.Text & "','" & txt4thsemPer.Text & "','" & txt5thsem.Text & "','" &
txt5thsemMO.Text & "','" & txt5thsemPer.Text & "','" & txttottalPer.Text & "','" & lblimagepath.Text
& "')", con)
cmd.ExecuteNonQuery()
GetId()
MessageBox.Show("Data Saved succsessfully!")
hide()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub button6_Click_1(sender As Object, e As EventArgs)
Me.Close()
End Sub
Private Sub button5_Click_1(sender As Object, e As EventArgs)
Try
Dim ofd As New OpenFileDialog()
ofd.Filter = "images files(*.jpg;*.jpeg;*.png;*.gif;*bmp)|*.jpg;*.jpeg;*.png;*.gif;*.bmp"
If ofd.ShowDialog() = DialogResult.OK Then
picF.Image = New Bitmap(ofd.FileName)
picF.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
lblimagepath.Text = ofd.FileName.ToString()
End If
Catch ex As OleDbException
'throw;
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub txt1stsemMO_KeyDown(sender As Object, e As KeyEventArgs)
If e.KeyCode = Keys.[Return] Then
Dim n1 As Integer, n2 As Integer, total As Integer
n1 = Convert.ToInt32(txt1stsemM.Text)
n2 = Convert.ToInt32(txt1stsemMO.Text)
total = n2 * 100 \ n1
txt1stsemP.Text = total.ToString()
txt2ndsemM.Focus()
End If
End Sub
Private Sub txt1stsemP_TextChanged(sender As Object, e As EventArgs)
End Sub

Private Sub pictureBox2_Click_1(sender As Object, e As EventArgs)


End Sub
Private Sub txtname_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = True AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txtSchName_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = True AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt10marks_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt10per_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub com10thYear_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt12thMarks_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt12per_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub com12year_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt1stsemM_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub

Private Sub txt1stsemMO_KeyPress(sender As Object, e As KeyPressEventArgs)


If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt1stsemP_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt2ndsemM_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt2ndsemMO_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt2ndsemP_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt3rdsem_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt3rdsemMO_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt3rdsemP_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt4thsem_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt4thsemMO_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If

End Sub
Private Sub txt4thsemPer_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt5thsem_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt5thsemMO_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt5thsemPer_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txttottalPer_KeyPress(sender As Object, e As KeyPressEventArgs)
If Char.IsDigit(e.KeyChar) = False AndAlso Convert.ToInt32(e.KeyChar) <> 8 Then
e.Handled = True
End If
End Sub
Private Sub txt2ndsemMO_KeyDown(sender As Object, e As KeyEventArgs)
If e.KeyCode = Keys.[Return] Then
Dim n1 As Integer, n2 As Integer, total As Integer
n1 = Convert.ToInt32(txt2ndsemM.Text)
n2 = Convert.ToInt32(txt2ndsemMO.Text)
total = n2 * 100 \ n1
txt2ndsemP.Text = total.ToString()
End If
End Sub

txt3rdsem.Focus()

Private Sub txt3rdsemMO_KeyDown(sender As Object, e As KeyEventArgs)


If e.KeyCode = Keys.[Return] Then
Dim n1 As Integer, n2 As Integer, total As Integer
n1 = Convert.ToInt32(txt3rdsem.Text)
n2 = Convert.ToInt32(txt3rdsemMO.Text)
total = n2 * 100 \ n1
txt3rdsemP.Text = total.ToString()
End If
End Sub
Private Sub txt4thsemMO_KeyDown(sender As Object, e As KeyEventArgs)
If e.KeyCode = Keys.[Return] Then
Dim n1 As Integer, n2 As Integer, total As Integer
n1 = Convert.ToInt32(txt4thsem.Text)

End If
End Sub

n2 = Convert.ToInt32(txt4thsemMO.Text)
total = n2 * 100 \ n1
txt4thsemPer.Text = total.ToString()

Private Sub txt5thsemMO_KeyDown(sender As Object, e As KeyEventArgs)


If e.KeyCode = Keys.[Return] Then
Dim n1 As Integer, n2 As Integer, total As Integer
Dim num1 As Integer, num2 As Integer, num3 As Integer, num4 As Integer,
num5 As Integer, tol As Integer
n1 = Convert.ToInt32(txt5thsem.Text)
n2 = Convert.ToInt32(txt5thsemMO.Text)
total = n2 * 100 \ n1
txt5thsemPer.Text = total.ToString()
num1 = Convert.ToInt32(txt1stsemP.Text)
num2 = Convert.ToInt32(txt2ndsemP.Text)
num3 = Convert.ToInt32(txt3rdsemP.Text)
num4 = Convert.ToInt32(txt4thsemPer.Text)
num5 = Convert.ToInt32(txt5thsemPer.Text)
tol = (num1 + num2 + num3 + num4 + num5) \ 5
txttottalPer.Text = tol.ToString()
End If
End Sub
Private Sub txt1stsemM_KeyDown(sender As Object, e As KeyEventArgs)
If e.KeyCode = Keys.[Return] Then
txt1stsemMO.Focus()
e.Handled = True
End If
End Sub
Private Sub txt2ndsemM_KeyDown(sender As Object, e As KeyEventArgs)
If e.KeyCode = Keys.[Return] Then
txt2ndsemMO.Focus()
e.Handled = True
End If
End Sub

End Class

Student registration

Academic

Admission fee

Fee

S-ar putea să vă placă și