SYSTEM DESIGN SPECIFICATION
System Overview
Nowadays, the very basic requirement of a school is to upgrade its technology where almost every school has made to support their abilities to make the best out of those resources. In this manner, the teacher needs to corporate it through keeping the records from which the school builds up on their record section. However, managing and securing the student records during enrollment is quite difficult task considering the ratio of the teachers to the total number of students. It really follows a large scope of responsibility because they need to retrieve the data immediately that were kept on place. To make these things possible, schools must follow a Computerized Enrollment System that helps to organized data and other information of the students. Automation exists in the different areas of works, it become an essential component in reducing workload. A Computerized System is therefore more orderly because file system reduces time in scanning the files to locate specific target. This is why a Computerized Enrollment System is preferred in most universities throughout the world.
System Input/Output Form
This system is capable of generating reports such as students’ class schedule, faculty lists, student lists, student grades, student accounts, student receipts and assigned rooms. Encoding data to the system is the only requirement for the system to have comprehensive reports.
Input Forms
Registration Form This form is the Registration Form for the new and old student of Tagum Doctors College which they need to fill up for the information of the students.
Output Forms
Report (Subject Scheduled of the Student) This report is the subject scheduled of the student.
System Interface
Log-in Form
Protect from any unauthorized person to access.
Registrar Form
Select or click one of the buttons in the left side that you want to view the data of the student.
Cashiering Form
Allow the user to transact the student with their payments.
Uploader Form
Allow the user to make the subject schedule of the student.
Student Form
Allow the student to view their grades and subject enrolled..
USER’S MANUAL
Log-in Form
1
2
3
5 4
1. Select what department you assigned.
2. Enter the user name
3. Enter the correct password
4. Click Log in button to operate the system
5. Click Log out button to exit department
Registrar form
6 5 4 3 2 1 7 8
1. Click Student Profile button to view the profile of the student. 2. Click Student Grades button to view the grade of the student. 3. Click Student Subject to view the scheduled subject of the student. 4. Click Encode Grade button to encode the current grade of the student.
5. Click Student List button to view class list. 6. Click User button to create a new user of this form. 7. Click Switch user button to switch the user to another form. 8. Click Close the Program to exit the program.
Students Profile Form
1
2
3
4
1. Click delete button to erase data. 2. Click edit button to change the data. 3. Click search button to find the data. 4. Click update button to the data changes.
Encode Student Grade form
1 2 5 4 3 6
1. Click new button to search another subject. 2. Click search button to search the subject. 3. Click grade button to input the grade of the student. 4. Click OK button to save the grade encoded. 5. Click cancel button if you cannot encode the grade of the student. 6. Click Print button to print the grade or SPR.
Subject List form
1 2 3 4 5
1. Click Add button to add a subject. 2. Click Delete button to delete the subject. 3. Click Search button to search a subject. 4. Click Refresh button to view the subject list. 5. Click View Class list button to view the class list.
Users Account form
1 2
1. Click cancel button if you cannot make a new account or change the password. 2. Click save button to save the new account or the changes.
Cashiering form
5 4 3 2 1 6 7
1. Click Ok button to set the school year and semester. 2. Click Cancel button if the use want to exit. 3. Click Payment button if the student wants to pay. 4. Click Student account button to view the account of the student.
5. Click Reports button to view report. 6. Click Switch user button to switch the user to another form. 7. Click Close the Program to exit the program.
Payment form
4 3 2 1
1. Click Refresh button to view the transaction. 2. Click Payments button if the student wants to pay. 3. Click Add button to add a miscellaneous fee of the student. 4. Click Remove button to remove the miscellaneous fee.
Uploader form
1 2 3 4 5
1. Click Delete button to delete the subject encoded. 2. Click Add button to add scheduled subject. 3. Click Print button to print the scheduled subject. 4. Click Switch user button to switch the user to another form. 5. Click Close the Program to exit the program.
Student form
1. 2
1. Click Ok button to view the data of the student. 2. Click Switch user button to switch the user.
File Specification
A. Student Information Table
B. Subject Information Table
C. Student account table
REFERENCES
Books
Norton, Peter, International Edition: “Introduction to Computers” Fifth Edition (2004): McGraw-Hill Companies Inc. 1221 Avenue. (www.orton.glencoe.com)
Mary land State, Department of Education Local School System Information Retrieval July 22, 2007, Nanacy S. Grasmick web site: http://nces.ed.gov/pubs2000/2002/200324.pdf
Newsome, Bryan and Thearon Willis, (2006). Beginning Visual Basic 2005. Wiley Publiching , Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256.
Internet http://www.primeconsulting.com.au/documents/Remoteconnections.pdf APPENDIX A Source code
Log-in form
------------------------------------------------------------------------------------------------------------
Imports System.Data
Imports System.Data.SqlClient
Public Class login Dim conn As New SqlConnection("server=RYAN\sqlexpress;Initial Catalog=enrollment;Integrated Security=True") Dim ad As New SqlDataAdapter("Select * from tab_user_info", conn)
Dim dset As DataSet Dim dv, dv2 As New DataView() Dim cm As CurrencyManager
Dim intpos As Object
Private Sub btnlog_out_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlog_out.Click End End Sub Private Sub ok() Dim intpos As String Dim arr(2) As Object
If txtlog_user.Text = "" Or txtlog_pass.Text = "" Then MsgBox("Incomplete Data", MsgBoxStyle.Exclamation + MsgBoxStyle.OkOnly, "Log In Info") Else dset = New DataSet() ad.Fill(dset, "tab_user_info") dv = New DataView(dset.Tables("tab_user_info")) cm = CType(Me.BindingContext(dv), CurrencyManager)
dv.Sort = "type,Username,Pass" arr(0) = cboxlog_type.Text arr(1) = txtlog_user.Text arr(2) = txtlog_pass.Text intpos = dv.Find(arr)
If intpos >= 0 Then If cboxlog_type.Text = "registrar" Or cboxlog_type.Text = "REGISTRAR" Then
MsgBox("An Account Number: " & txtlog_user.Text & " is Log in", MsgBoxStyle.OkOnly + MsgBoxStyle.Information, "Log In Info") registrar.Show() txtlog_user.Text = "" txtlog_pass.Text = "" cboxlog_type.Text = "" Me.Hide() ElseIf cboxlog_type.Text = "uploader" Or cboxlog_type.Text = "UPLOADER" Then
MsgBox("An Account Number: " & txtlog_user.Text & " is Log in", MsgBoxStyle.OkOnly + MsgBoxStyle.Information, "Log In Info") uploader.Show() uploader.grpup_sched.Show() uploader.txtup_sched_id.Focus() sy2.ShowDialog() txtlog_user.Text = "" txtlog_pass.Text = "" cboxlog_type.Text = "" Me.Hide() ElseIf cboxlog_type.Text = "cashier" Or cboxlog_type.Text = "CASHIER" Then
MsgBox("An Account Number: " & txtlog_user.Text & " is Log in", MsgBoxStyle.OkOnly + MsgBoxStyle.Information, "Log In Info") cashier.Show() txtlog_user.Text = "" txtlog_pass.Text = "" cboxlog_type.Text = "" Me.Hide()
ElseIf cboxlog_type.Text = "student" Or cboxlog_type.Text = "STUDENT" Then
MsgBox("An Account Number: " & txtlog_user.Text & " is Log in", MsgBoxStyle.OkOnly + MsgBoxStyle.Information, "Log In Info") student.Show() student.grpstudgrade_setsy.Show() txtlog_user.Text = "" txtlog_pass.Text = "" cboxlog_type.Text = "" student.cmbstudgrade_sy.Focus() student.tbstudent.Hide() Me.Hide()
End If
Else MsgBox("Access Denied", MsgBoxStyle.Critical, "Log In Info") txtlog_user.Text = "" txtlog_pass.Text = "" cboxlog_type.Focus() End If End If End Sub Private Sub btnlog_in_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlog_in.Click Call ok() End Sub
Private Sub cboxlog_type_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cboxlog_type.KeyPress If e.KeyChar = Chr(13) Then txtlog_user.Focus() End If End Sub
Private Sub txtlog_user_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtlog_user.KeyPress If e.KeyChar = Chr(13) Then txtlog_pass.Focus() End If End Sub
Private Sub txtlog_pass_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtlog_pass.KeyPress If e.KeyChar = Chr(13) Then ok() ElseIf e.KeyChar = Chr(27) Then Me.Close() End If End Sub
End Class
Registrar form
------------------------------------------------------------------------------------------------------------
Imports System.Data
Imports System.Data.SqlClient
Public Class registrar Dim conn As New SqlConnection("server=RYAN\sqlexpress;Initial Catalog=enrollment;Integrated Security=True") Dim ad As New SqlDataAdapter("Select * from student_info", conn) Dim ad2 As New SqlDataAdapter("Select * from tbl_subject_info", conn) Dim ad3 As New SqlDataAdapter("Select * from tbl_sched_subject", conn) Dim ad4 As New SqlDataAdapter("Select * from tbl_student_grade", conn) Dim dv As New DataView() Dim cm As CurrencyManager Dim intpos As Object
Private Sub bindfields() txtreg_prof_lname.DataBindings.Clear() txtreg_prof_fname.DataBindings.Clear() txtencode_mname.DataBindings.Clear() txtencode_age.DataBindings.Clear() txtencode_bdate.DataBindings.Clear() txtencode_bplace.DataBindings.Clear() cmbencode_gender.DataBindings.Clear() txtencode_address.DataBindings.Clear() txtencode_zip.DataBindings.Clear() txtencode_fader.DataBindings.Clear() txtencode_fadercontact.DataBindings.Clear() txtencode_faderoccp.DataBindings.Clear() txtencode_faderincome.DataBindings.Clear() txtencode_faderadd.DataBindings.Clear() txtencode_madername.DataBindings.Clear() txtencode_madercontact.DataBindings.Clear() txtencode_maderoccp.DataBindings.Clear() txtencode_maderincome.DataBindings.Clear() txtencode_maderaddress.DataBindings.Clear() txtencode_lastatend.DataBindings.Clear() cmbencode_colsem.DataBindings.Clear() txtencode_colcov.DataBindings.Clear() txtencode_secschoolname.DataBindings.Clear() txtencode_seconcov.DataBindings.Clear() txtencode_elemschool.DataBindings.Clear() txtencode_elemcov.DataBindings.Clear() txtreg_prof_type.DataBindings.Clear() txtreg_prof_yer.DataBindings.Clear() txtreg_prof_corz.DataBindings.Clear() txtreg_prof_id.DataBindings.Clear()
txtreg_prof_lname.DataBindings.Add("text", dv, "Lname") txtreg_prof_fname.DataBindings.Add("text", dv, "Fname") txtencode_mname.DataBindings.Add("text", dv, "midname") txtencode_age.DataBindings.Add("text", dv, "Age") txtencode_bdate.DataBindings.Add("text", dv, "bdate") txtencode_bplace.DataBindings.Add("text", dv, "bplace") cmbencode_gender.DataBindings.Add("text", dv, "gender") txtencode_address.DataBindings.Add("text", dv, "adress") txtencode_zip.DataBindings.Add("text", dv, "zip") txtencode_fader.DataBindings.Add("text", dv, "fadername") txtencode_fadercontact.DataBindings.Add("text", dv, "contact") txtencode_faderoccp.DataBindings.Add("text", dv, "occupation") txtencode_faderincome.DataBindings.Add("text", dv, "anualincom") txtencode_faderadd.DataBindings.Add("text", dv, "adress1") txtencode_madername.DataBindings.Add("text", dv, "madername") txtencode_madercontact.DataBindings.Add("text", dv, "contact1") txtencode_maderoccp.DataBindings.Add("text", dv, "maderoccp") txtencode_maderincome.DataBindings.Add("text", dv, "anualincom1") txtencode_maderaddress.DataBindings.Add("text", dv, "adress2") txtencode_lastatend.DataBindings.Add("text", dv, "last") cmbencode_colsem.DataBindings.Add("text", dv, "sem") txtencode_colcov.DataBindings.Add("text", dv, "yercov1") txtencode_secschoolname.DataBindings.Add("text", dv, "secname") txtencode_seconcov.DataBindings.Add("text", dv, "yercov2") txtencode_elemschool.DataBindings.Add("text", dv, "elemname") txtencode_elemcov.DataBindings.Add("text", dv, "yercov3") txtreg_prof_type.DataBindings.Add("text", dv, "type") txtreg_prof_corz.DataBindings.Add("text", dv, "corz") txtreg_prof_yer.DataBindings.Add("text", dv, "yer") txtreg_prof_id.DataBindings.Add("text", dv, "idnum") End Sub Public Sub grdsubject_encode() Dim datset1 As New DataSet Dim adap As New SqlDataAdapter("SELECT tbl_subject_info.Code,Title,Desp,Prereq,TimeFrom,Sem,Unit,Room,Prof,Lab,Yerle,Sy,TimeTo,day FROM tbl_subject_info " & _ "WHERE sy= '" & lblset_sy.Text & " ' And sem= '" & lblset_sem.Text & " '" & _ "ORDER BY code", conn) With adap .SelectCommand = New SqlCommand() .SelectCommand.Connection = conn .SelectCommand.CommandText = "SELECT tbl_subject_info.Code, Title, Desp, prereq, lab, timeFrom, TimeTo, day,yerle, sem, sy, unit, room, prof FROM tbl_subject_info " & _ "WHERE sy= '" & lblset_sy.Text & " ' And sem= '" & lblset_sem.Text & " '" & _ "ORDER BY code" End With conn.Open() adap.Fill(datset1, "tbl_subject_info") conn.Close() With datgrdencode_subject .AutoGenerateColumns = True .DataSource = datset1 .DataMember = "tbl_subject_info" .RowHeadersWidth = 25
End With Dim OARCS As New DataGridViewCellStyle OARCS.Alignment = DataGridViewContentAlignment.MiddleCenter Dim OACS As New DataGridViewCellStyle OACS.BackColor = Color.WhiteSmoke datgrdencode_subject.AlternatingRowsDefaultCellStyle = OACS
With datgrdencode_subject .Columns(0).HeaderText = "Code" .Columns(0).Width = 55 .Columns(1).HeaderText = "Title" .Columns(1).Width = 75 .Columns(2).HeaderText = "DesCription" .Columns(2).Width = 200 .Columns(3).HeaderText = "Pre-Requisite" .Columns(3).Width = 75 .Columns(4).HeaderText = "Laboratory" .Columns(4).Width = 60 .Columns(5).HeaderText = "Time From" .Columns(5).Width = 100 .Columns(6).HeaderText = "Time To" .Columns(6).Width = 100 .Columns(7).HeaderText = "Day" .Columns(7).Width = 60 .Columns(8).HeaderText = "Year Level" .Columns(8).Width = 60 .Columns(9).HeaderText = "Semester" .Columns(9).Width = 75 .Columns(10).HeaderText = "School Year" .Columns(10).Width = 100 .Columns(11).HeaderText = "Unit" .Columns(11).Width = 55 .Columns(12).HeaderText = "Room" .Columns(12).Width = 55 .Columns(13).HeaderText = "Professor" .Columns(13).Width = 150
End With
datset1 = Nothing End Sub Private Sub search_ok() Dim datset1, datset As New DataSet If txtreg_search_name.Text = "" Then
MessageBox.Show("Incomplete data") Else Try
datset = New DataSet() datset1 = New DataSet() ad.Fill(datset, "Student_info") dv = New DataView(datset.Tables("Student_info")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "Idnum"
intpos = dv.Find(txtreg_search_name.Text) If intpos = -1 Then MessageBox.Show("No Data found!") Else
intpos = dv.Find(txtreg_search_name.Text) cm.Position = intpos PictureBox1.ImageLocation = "D:\picz\my pics\" & txtreg_search_name.Text & ".jpg" bindfields()
grpreg_search_prof.Hide() grpprof_buttons.Enabled = True btnreg_edit.Enabled = True
grpstudeprof_per.Enabled = True grpstudprof_fader.Enabled = True grpstudprof_mader.Enabled = True grpstudprof_acad.Enabled = True End If
Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try
datset = Nothing datset1 = Nothing txtreg_search_name.Text = "" End If End Sub
Private Sub btnprof_update_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnprof_update.Click Dim cmd As New SqlCommand
cmd.Connection = conn Try cmd.CommandText = "UPDATE student_info " & _ "SET Lname=@Lname,Fname=@Fname,midname=@midname,age=@Age,bdate=@bdate,bplace=@bplace,gender=@gender,adress=@adress,zip=@zip,fadername=@fadername,contact=@contact,occupation=@occupation,anualincom=@anualincom,adress1=@adress1,madername=@madername,maderoccp=@maderoccp,contact1=@contact1,anualincom1=@anualincom1,adress2=@adress2,last=@last,sem=@sem,yercov1=@yercov1,secname=@secname,yercov2=@yercov2,elemname=@elemname,yercov3=@yercov3,corz=@corz,yer=@yer,type=@type WHERE idnum= '" & txtreg_prof_id.Text & " '" cmd.CommandType = CommandType.Text With cmd.Parameters .AddWithValue("@Lname", txtreg_prof_lname.Text) .AddWithValue("@Fname", txtreg_prof_fname.Text) .AddWithValue("@midname", txtencode_mname.Text) .AddWithValue("@Age", txtencode_age.Text) .AddWithValue("@bdate", txtencode_bdate.Text) .AddWithValue("@bplace", txtencode_bplace.Text) .AddWithValue("@gender", cmbencode_gender.Text) .AddWithValue("@adress", txtencode_address.Text) .AddWithValue("@zip", txtencode_zip.Text) .AddWithValue("@fadername", txtencode_fader.Text) .AddWithValue("@contact", txtencode_fadercontact.Text) .AddWithValue("@occupation", txtencode_faderoccp.Text) .AddWithValue("@anualincom", txtencode_faderincome.Text) .AddWithValue("@adress1", txtencode_faderadd.Text) .AddWithValue("@madername", txtencode_madername.Text) .AddWithValue("@maderoccp", txtencode_madercontact.Text) .AddWithValue("@contact1", txtencode_maderoccp.Text) .AddWithValue("@anualincom1", txtencode_maderincome.Text) .AddWithValue("@adress2", txtencode_maderaddress.Text) .AddWithValue("@last", txtencode_lastatend.Text) .AddWithValue("@sem", cmbencode_colsem.Text) .AddWithValue("@yercov1", txtencode_colcov.Text) .AddWithValue("@secname", txtencode_secschoolname.Text) .AddWithValue("@yercov2", txtencode_seconcov.Text) .AddWithValue("@elemname", txtencode_elemschool.Text) .AddWithValue("@yercov3", txtencode_elemcov.Text) .AddWithValue("@corz", txtreg_prof_corz.Text) .AddWithValue("@yer", txtreg_prof_yer.Text) .AddWithValue("@type", txtreg_prof_type.Text) .AddWithValue("@idnum", txtreg_prof_id.Text) End With
MessageBox.Show("The data has been update.", "Updating...", MessageBoxButtons.OK) profile_disabled()
conn.Open() cmd.ExecuteNonQuery() conn.Close() cmd.Parameters.Clear() Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try End Sub
Private Sub txtreg_search_name_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtreg_search_name.KeyPress If e.KeyChar = Chr(13) Then search_ok() ElseIf e.KeyChar = Chr(27) Then grpencode_studprof.Hide() End If End Sub Private Sub btnreg_delete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnreg_delete.Click
Dim cmd As SqlCommand = New SqlCommand() Dim intposition As Integer Dim datset As New DataSet
If txtreg_prof_id.Text = "" Then MessageBox.Show("Incomplete data") Else datset = New DataSet() ad.Fill(datset, "Student_info") dv = New DataView(datset.Tables("Student_info")) cm = CType(Me.BindingContext(dv), CurrencyManager)
dv.Sort = "Idnum" intposition = dv.Find(txtreg_prof_id.Text) cmd.Connection = conn
If MsgBox("Are you sure you want to delete this data?? '" & txtreg_prof_id.Text & " '", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Student_info") = MsgBoxResult.Yes Then Try
cmd.CommandText = "DELETE from student_info WHERE idnum= '" & Trim(txtreg_prof_id.Text) & " '" conn.Open() cmd.ExecuteNonQuery() datset = New DataSet() ad.Fill(datset, "Student_info") dv = New DataView(datset.Tables("Student_info")) cm = CType(Me.BindingContext(dv), CurrencyManager)
MsgBox("The data has been deleted.") clear() profile_disabled() grpprof_buttons.Enabled = False conn.Close() Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try Else End If End If
End Sub
Private Sub btnreg_search_cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnreg_search_cancel.Click grpencode_studprof.Hide() box.Show() End Sub
Private Sub btnencode_sub_add_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnencode_sub_add.Click Me.Enabled = False add_subject.Show() add_subject.grpencode_subject.Show() add_subject.btnencode_sub_edit.Hide() add_subject.txtencode_scode.Focus() grdsubject_encode() End Sub
Private Sub btnreg_refresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnreg_refresh.Click grdsubject_encode() End Sub
Private Sub btnencode_sub_delete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnencode_sub_delete.Click
Dim datset As New DataSet Dim check As Integer Dim cmdSubject As New SqlCommand Dim adap As New SqlDataAdapter("SELECT tbl_subject_info.Code,Title,Desp,Prereq,TimeFrom,Sem,Unit,Room,Prof,Lab,Yerle,Sy,TimeTo,day FROM tbl_subject_info " & _ "ORDER BY code", conn) datset = New DataSet() adap.Fill(datset, "tbl_subject_info") dv = New DataView(datset.Tables("tbl_subject_info")) cm = CType(Me.BindingContext(dv), CurrencyManager)
dv.Sort = "code" intpos = dv.Find(lblpass.Text)
Try
conn.Open() cmdSubject = conn.CreateCommand cmdSubject.CommandText = "DELETE FROM tbl_subject_info WHERE code = '" & Trim(lblpass.Text) & " '" datgrdencode_subject.Rows.Remove(datgrdencode_subject.CurrentRow) check = cmdSubject.ExecuteReader.RecordsAffected conn.Close()
Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error or Data not Found!!") End Try datset = Nothing End Sub Private Sub datgrdencode_subject_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles datgrdencode_subject.Click Dim ds As New DataSet
Dim adap As New SqlDataAdapter("SELECT tbl_subject_info.Code,Title,Desp,Prereq,TimeFrom,Sem,Unit,Room,Prof,Lab,Yerle,Sy,TimeTo,day FROM tbl_subject_info " & _ "ORDER BY code", conn) Try Dim pos As Integer pos = datgrdencode_subject.CurrentRow.Index Try ds = New DataSet() adap.Fill(ds, "tbl_subject_info") dv = New DataView(ds.Tables("tbl_subject_info")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "code"
cm.Position = pos
lblpass.DataBindings.Clear() lblpass.DataBindings.Add("text", dv, "code")
Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try Catch ex As Exception MsgBox("Subject Database is Empty", MsgBoxStyle.Information, "tbl_subject_info")
End Try ds = Nothing ad2 = Nothing
End Sub
Private Sub studsub_view_ok() Dim datset1, datset As New DataSet
If txtview_sub_id.Text = "" Then
MessageBox.Show("Incomplete data") Else Try
datset = New DataSet() datset1 = New DataSet() ad3.Fill(datset, "tbl_sched_subject") dv = New DataView(datset.Tables("tbl_sched_subject")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "Idnum"
intpos = dv.Find(txtview_sub_id.Text)
If intpos = -1 Then MessageBox.Show("No Data found!") Else
intpos = dv.Find(txtview_sub_id.Text) cm.Position = intpos binds() grpview_sub.Hide() Call grdsubject_view()
End If
Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try
datset = Nothing datset1 = Nothing txtview_sub_id.Text = "" End If
End Sub Public Sub grdsubject_view() Dim datset1 As New DataSet Dim adap As New SqlDataAdapter("SELECT tbl_sched_subject.Code, Title, Desp, prereq, lab, timeFrom, TimeTo, day, sem, sy,unit, room FROM tbl_sched_subject " & _ "WHERE sy= '" & lblsub_yer.Text & " ' And sem= '" & lblsub_sem.Text & " 'And idnum= '" & txtview_sub_id.Text & " '" & _ "ORDER BY idnum", conn) With adap .SelectCommand = New SqlCommand() .SelectCommand.Connection = conn .SelectCommand.CommandText = "SELECT tbl_sched_subject.Code, Title, Desp, prereq, lab, timeFrom, TimeTo, day,unit,Room FROM tbl_sched_subject " & _ "WHERE sy= '" & lblsub_yer.Text & " ' And sem= '" & lblsub_sem.Text & " 'And idnum= '" & txtview_sub_id.Text & " '" & _ "ORDER BY idnum" End With conn.Open() adap.Fill(datset1, "tbl_sched_subject") conn.Close() With datgrdview_subject .AutoGenerateColumns = True .DataSource = datset1 .DataMember = "tbl_sched_subject" .RowHeadersWidth = 25 If .RowCount 0 Then .CurrentRow.Selected = 1 End If End With Dim OARCS As New DataGridViewCellStyle OARCS.Alignment = DataGridViewContentAlignment.MiddleCenter Dim OACS As New DataGridViewCellStyle OACS.BackColor = Color.WhiteSmoke datgrdview_subject.AlternatingRowsDefaultCellStyle = OACS With datgrdview_subject .Columns(0).HeaderText = "Code" .Columns(0).Width = 55 .Columns(1).HeaderText = "Title" .Columns(1).Width = 75 .Columns(2).HeaderText = "Description" .Columns(2).Width = 200 .Columns(3).HeaderText = "Pre-Requisite" .Columns(3).Visible = False .Columns(4).HeaderText = "Laboratory" .Columns(4).Visible = False .Columns(5).HeaderText = "Time From" .Columns(5).Width = 100 .Columns(6).HeaderText = "Time To" .Columns(6).Width = 100 .Columns(7).HeaderText = "day" .Columns(7).Width = 100 .Columns(8).HeaderText = "Unit" .Columns(8).Width = 55 .Columns(9).HeaderText = "Room" .Columns(9).Width = 55 End With datset1 = Nothing End Sub
Private Sub btnview_sub_ok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnview_sub_ok.Click Call studsub_view_ok() End Sub
Private Sub btnreg_studgrade_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnreg_studgrade.Click txtstudgrade_id.Enabled = False txtstudgrade_lname.Enabled = False txtstudgrade_fname.Enabled = False txtstudgrade_corz.Enabled = False txtstudgrade_yer.Enabled = False grpreg_studentgrade.Show() grpview_studsub.Hide() grpreg_encode_grade.Hide() grpencode_studsub.Hide() grpencode_studprof.Hide() grpstudgrade_setsy.Show() txtstudgrade_sy.Focus() box.Hide() clear() End Sub
Private Sub txtview_sub_id_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtview_sub_id.KeyPress If e.KeyChar = Chr(13) Then Call studsub_view_ok() ElseIf e.KeyChar = Chr(27) Then grpview_studsub.Hide() box.Show() End If
End Sub
Private Sub set1() btnencode_sub_add.Enabled = True btnencode_sub_delete.Enabled = True btnencode_sub_search.Enabled = True datgrdencode_subject.Enabled = True btnreg_refresh.Enabled = True lblset_sy.Text = txtreg_subset_sy.Text lblset_sem.Text = cmreg_subset_sem.Text grpreg_sub_set.Hide() End Sub Private Sub btnreg_subset_ok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnreg_subset_ok.Click If txtreg_subset_sy.Text = "" Or cmreg_subset_sem.Text = "" Then MsgBox("Incomplete data.") txtreg_subset_sy.Focus() Else Call set1() End If
End Sub
Private Sub btnreg_subset_can_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnreg_subset_can.Click grpencode_studsub.Hide() box.Show() End Sub
Private Sub txtreg_subset_sy_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) If e.KeyChar = Chr(13) Then cmreg_subset_sem.Focus() ElseIf e.KeyChar = Chr(27) Then grpencode_studsub.Hide() box.Show() End If End Sub
Private Sub cmreg_subset_sem_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmreg_subset_sem.KeyPress If e.KeyChar = Chr(13) Then If txtreg_subset_sy.Text = "" Or cmreg_subset_sem.Text = "" Then MsgBox("Incomplete data.") txtreg_subset_sy.Focus() Else Call set1() End If ElseIf e.KeyChar = Chr(27) Then grpencode_studsub.Hide() box.Show() End If End Sub
Private Sub txtgradeset_sy_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) If e.KeyChar = Chr(13) Then cmbgradeset_sem.Focus() ElseIf e.KeyChar = Chr(27) Then grpreg_encode_grade.Hide() box.Show() End If End Sub Public Sub grdgrade_view() Dim datset1 As New DataSet Dim adap2 As New SqlDataAdapter("SELECT tbl_sched_subject.idnum,lname,fname,corz,yer,Code,Title,Desp,Prereq,Lab,TimeFrom,TimeTo,day,Sem,Sy,Unit,Room,Prof FROM tbl_sched_subject " & _ "WHERE sy= '" & lblgrade_sy.Text & " ' And sem= '" & lblgrade_sem.Text & " 'And code= '" & txtencode_grade_code.Text & " '" & _ "ORDER BY idnum", conn) With adap2 .SelectCommand = New SqlCommand() .SelectCommand.Connection = conn .SelectCommand.CommandText = "SELECT tbl_sched_subject.idnum,lname,fname,corz,yer,Code,Title,Desp,Prereq,Lab,TimeFrom,TimeTo,day,Sem,Sy,Unit,Room,Prof FROM tbl_sched_subject " & _ "WHERE sy= '" & lblgrade_sy.Text & " ' And sem= '" & lblgrade_sem.Text & " 'And code= '" & txtencode_grade_code.Text & " '" & _ "ORDER BY idnum" End With conn.Open() adap2.Fill(datset1, "tbl_sched_subject") conn.Close() With datgrd_encode_grade .AutoGenerateColumns = True .DataSource = datset1 .DataMember = "tbl_sched_subject" .RowHeadersWidth = 25 End With
Dim OARCS As New DataGridViewCellStyle OARCS.Alignment = DataGridViewContentAlignment.MiddleCenter Dim OACS As New DataGridViewCellStyle OACS.BackColor = Color.WhiteSmoke datgrd_encode_grade.AlternatingRowsDefaultCellStyle = OACS With datgrd_encode_grade .Columns(0).HeaderText = "ID num" .Columns(0).Width = 75 .Columns(1).HeaderText = "Last Name" .Columns(1).Width = 150 .Columns(2).HeaderText = "Fname" .Columns(2).Width = 150 .Columns(3).HeaderText = "Corz" .Columns(3).Width = 150 .Columns(4).HeaderText = "Yer" .Columns(4).Width = 55 .Columns(5).HeaderText = "Code" .Columns(5).Visible = False .Columns(6).HeaderText = "Title" .Columns(6).Visible = False .Columns(7).HeaderText = "Description" .Columns(7).Visible = False .Columns(8).HeaderText = "Pre-Requisite" .Columns(8).Visible = False .Columns(9).HeaderText = "Laboratory" .Columns(9).Visible = False .Columns(10).HeaderText = "Time From" .Columns(10).Visible = False .Columns(11).HeaderText = "Time To" .Columns(11).Visible = False .Columns(12).HeaderText = "day" .Columns(12).Visible = False .Columns(13).HeaderText = "Year Level" .Columns(13).Visible = False .Columns(14).HeaderText = "Semester" .Columns(14).Visible = False .Columns(15).HeaderText = "School year" .Columns(15).Visible = False .Columns(16).HeaderText = "Unit" .Columns(16).Visible = False .Columns(17).HeaderText = "Room" .Columns(17).Visible = False
End With datset1 = Nothing End Sub
Private Sub datgrd_encode_grade_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles datgrd_encode_grade.Click Dim ds As New DataSet Dim adap As New SqlDataAdapter("SELECT tbl_sched_subject.idnum,lname,fname,corz,yer,Code,Title,Desp,Prereq,TimeFrom,Sem,Unit,Room,Prof,Lab,Sy,TimeTo,day FROM tbl_sched_subject " & _ "ORDER BY code", conn) Try Dim pos As Integer pos = datgrd_encode_grade.CurrentRow.Index Try ds = New DataSet() adap.Fill(ds, "tbl_sched_subject") dv = New DataView(ds.Tables("tbl_sched_subject")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "code"
cm.Position = pos
binds_grade()
grpstudgrade_grade.Show() txtstudgrade_grade.Focus()
Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try Catch ex As Exception MsgBox("Subject Database is Empty", MsgBoxStyle.Information, "tbl_subject_info")
End Try ds = Nothing ad2 = Nothing End Sub Private Sub btngrade_ok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btngrade_ok.Click Dim ds1 As New DataSet() Dim ds2 As New DataSet() Dim cmd As New SqlCommand Dim cmd2 As New SqlCommand Dim arr(1) As Object
ds1 = New DataSet() ad4.Fill(ds1, "tbl_student_grade") dv = New DataView(ds1.Tables("tbl_student_grade")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "idnum,Code" arr(0) = txtgrade_id.Text arr(1) = txtencode_grade_code.Text intpos = dv.Find(arr)
If intpos >= 0 Then MsgBox("The data is already exist", MsgBoxStyle.Critical, "tbl_student_grade") Else
With cmd .Connection = conn .CommandText = "INSERT INTO tbl_student_grade(Idnum,lname,fname,corz,yer,code,title,desp,unit,grade,sem,sy)" & _ "values(@Idnum,@lname,@fname,@corz,@yer,@code,@title,@desp,@unit,@grade,@sem,@sy)" End With
With cmd.Parameters .AddWithValue("@Idnum", txtgrade_id.Text) .AddWithValue("@Lname", txtgrade_lname.Text) .AddWithValue("@Fname", txtgrade_fname.Text) .AddWithValue("@corz", txtgrade_corz.Text) .AddWithValue("@Yer", txtgrade_yer.Text) .AddWithValue("@Code", txtencode_grade_code.Text) .AddWithValue("@Title", txtencode_grade_title.Text) .AddWithValue("@desp", txtencode_grade_desc.Text) .AddWithValue("@unit", txtencode_grade_unit.Text) .AddWithValue("@grade", txtstudgrade_grade.Text) .AddWithValue("@sem", lblgrade_sem.Text) .AddWithValue("@sy", lblgrade_sy.Text) grpstudgrade_grade.Hide() End With MessageBox.Show("The data has been save.", "Saving...", MessageBoxButtons.OK)
End If
conn.Open()
Try cmd.ExecuteNonQuery() Catch ex As Exception MessageBox.Show(ex.Message) End Try conn.Close() End Sub
txtstud_id.Focus() End If End Sub Public Sub grdstudent_grade() Dim datset1 As New DataSet Dim adap As New SqlDataAdapter("SELECT tbl_student_grade.Code,Title,Desp,Unit,Grade,Idnum,Lname,Fname,corz,yer,sem,sy FROM tbl_student_grade " & _ "WHERE sy= '" & lblstudgrade_sy.Text & " ' And sem= '" & lblstudgrade_sem.Text & " 'And idnum= '" & txtstud_id.Text & " '" & _ "ORDER BY code", conn) With adap .SelectCommand = New SqlCommand() .SelectCommand.Connection = conn .SelectCommand.CommandText = "SELECT tbl_student_grade.Code,Title,Desp,Unit,Grade,Idnum,Lname,Fname,corz,yer,sem,sy FROM tbl_student_grade " & _ "WHERE sy= '" & lblstudgrade_sy.Text & " ' And sem= '" & lblstudgrade_sem.Text & " 'And idnum= '" & txtstud_id.Text & " '" & _ "ORDER BY code" End With conn.Open() adap.Fill(datset1, "tbl_student_grade") conn.Close() With dtgrdreg_student_grade .AutoGenerateColumns = True .DataSource = datset1 .DataMember = "tbl_student_grade" .RowHeadersWidth = 25
End With
Dim OARCS As New DataGridViewCellStyle OARCS.Alignment = DataGridViewContentAlignment.MiddleCenter Dim OACS As New DataGridViewCellStyle OACS.BackColor = Color.WhiteSmoke dtgrdreg_student_grade.AlternatingRowsDefaultCellStyle = OACS With dtgrdreg_student_grade .Columns(0).HeaderText = "Code" .Columns(0).Width = 100 .Columns(1).HeaderText = "Title" .Columns(1).Width = 150 .Columns(2).HeaderText = "Description" .Columns(2).Width = 300 .Columns(3).HeaderText = "Unit" .Columns(3).Width = 75 .Columns(4).HeaderText = "Grade" .Columns(4).Width = 100 .Columns(5).HeaderText = "Idnum" .Columns(5).Visible = False .Columns(6).HeaderText = "Lname" .Columns(6).Visible = False .Columns(7).HeaderText = "Fname" .Columns(7).Visible = False .Columns(8).HeaderText = "Corz" .Columns(8).Visible = False .Columns(9).HeaderText = "Yer" .Columns(9).Visible = False .Columns(10).HeaderText = "Sem" .Columns(10).Visible = False .Columns(11).HeaderText = "sy" .Columns(11).Visible = False End With datset1 = Nothing End Sub Private Sub stud_grade() Dim datset1, datset As New DataSet
If txtstud_id.Text = "" Then
MessageBox.Show("Incomplete data") Else Try
datset = New DataSet() datset1 = New DataSet() ad4.Fill(datset, "tbl_student_grade") dv = New DataView(datset.Tables("tbl_student_grade")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "Idnum"
intpos = dv.Find(txtstud_id.Text)
If intpos = -1 Then MessageBox.Show("No Data found!") Else
intpos = dv.Find(txtstud_id.Text) cm.Position = intpos
txtstudgrade_id.DataBindings.Clear() txtstudgrade_lname.DataBindings.Clear() txtstudgrade_fname.DataBindings.Clear() txtstudgrade_corz.DataBindings.Clear() txtstudgrade_yer.DataBindings.Clear()
txtstudgrade_id.DataBindings.Add("text", dv, "idnum") txtstudgrade_lname.DataBindings.Add("text", dv, "lname") txtstudgrade_fname.DataBindings.Add("text", dv, "fname") txtstudgrade_corz.DataBindings.Add("text", dv, "corz") txtstudgrade_yer.DataBindings.Add("text", dv, "yer")
grpview_sub.Hide() grdstudent_grade() grpstud_grade_search.Hide() End If Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try datset = Nothing datset1 = Nothing txtview_sub_id.Text = "" End If End Sub Private Sub btnreg_encodegrade_viewlist_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnreg_encodegrade_viewlist.Click Dim datset1, datset As New DataSet If lblpass.Text = "--" Then
MessageBox.Show("Incomplete data") Else Try
datset = New DataSet() datset1 = New DataSet() ad3.Fill(datset, "tbl_sched_subject") dv = New DataView(datset.Tables("tbl_sched_subject")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "Code"
intpos = dv.Find(lblpass.Text)
If intpos = -1 Then MessageBox.Show("Please select the SUBJECT first.") Else grpencode_subject.Show() intpos = dv.Find(lblpass.Text) cm.Position = intpos
lblviewlist_code.DataBindings.Clear() lblviewlist_desp.DataBindings.Clear() lblviewlist_title.DataBindings.Clear() lblviewlist_prof.DataBindings.Clear()
lblviewlist_code.DataBindings.Add("text", dv, "code") lblviewlist_desp.DataBindings.Add("text", dv, "desp") lblviewlist_title.DataBindings.Add("text", dv, "title") lblviewlist_prof.DataBindings.Add("text", dv, "prof")
class_list()
End If
Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try
datset = Nothing datset1 = Nothing
End If End Sub Private Sub class_list() Dim datset1 As New DataSet Dim adap2 As New SqlDataAdapter("SELECT tbl_sched_subject.idnum,lname,fname,corz,yer,Code,Title,Desp,Prereq,Lab,TimeFrom,TimeTo,day,Sem,Sy,Unit,Room,Prof FROM tbl_sched_subject " & _ "WHERE sy= '" & lblset_sy.Text & " ' And sem= '" & lblset_sem.Text & " 'And code= '" & lblviewlist_code.Text & " '" & _ "ORDER BY idnum", conn) With adap2 .SelectCommand = New SqlCommand() .SelectCommand.Connection = conn .SelectCommand.CommandText = "SELECT tbl_sched_subject.idnum,lname,fname,corz,yer,Code,Title,Desp,Prereq,Lab,TimeFrom,TimeTo,day,Sem,Sy,Unit,Room,Prof FROM tbl_sched_subject " & _ "WHERE sy= '" & lblset_sy.Text & " ' And sem= '" & lblset_sem.Text & " 'And code= '" & lblviewlist_code.Text & " '" & _ "ORDER BY idnum" End With conn.Open() adap2.Fill(datset1, "tbl_sched_subject") conn.Close() With dtgrdview_list .AutoGenerateColumns = True .DataSource = datset1 .DataMember = "tbl_sched_subject" .RowHeadersWidth = 10 End With
Dim OARCS As New DataGridViewCellStyle OARCS.Alignment = DataGridViewContentAlignment.MiddleCenter Dim OACS As New DataGridViewCellStyle OACS.BackColor = Color.WhiteSmoke dtgrdview_list.AlternatingRowsDefaultCellStyle = OACS With dtgrdview_list .Columns(0).HeaderText = "ID num" .Columns(0).Width = 75 .Columns(1).HeaderText = "Last Name" .Columns(1).Width = 90 .Columns(2).HeaderText = "First Name" .Columns(2).Width = 90 .Columns(3).HeaderText = "Course" .Columns(3).Width = 90 .Columns(4).HeaderText = "Year" .Columns(4).Width = 41 .Columns(5).HeaderText = "Code" .Columns(5).Visible = False .Columns(6).HeaderText = "Title" .Columns(6).Visible = False .Columns(7).HeaderText = "Description" .Columns(7).Visible = False .Columns(8).HeaderText = "Pre-Requisite" .Columns(8).Visible = False .Columns(9).HeaderText = "Laboratory" .Columns(9).Visible = False .Columns(10).HeaderText = "Time From" .Columns(10).Visible = False .Columns(11).HeaderText = "Time To" .Columns(11).Visible = False .Columns(12).HeaderText = "day" .Columns(12).Visible = False .Columns(13).HeaderText = "Year Level" .Columns(13).Visible = False .Columns(14).HeaderText = "Semester" .Columns(14).Visible = False .Columns(15).HeaderText = "School year" .Columns(15).Visible = False .Columns(16).HeaderText = "Unit" .Columns(16).Visible = False .Columns(17).HeaderText = "Room" .Columns(17).Visible = False End With datset1 = Nothing End Sub Private Sub cmbstudgrade_sem_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbstudgrade_sem.KeyPress If e.KeyChar = Chr(13) Then If txtstudgrade_sy.Text = "" Or cmbstudgrade_sem.Text = "" Then MsgBox("Incomplete data.") txtstudgrade_sy.Focus() Else txtstudgrade_id.Enabled = True txtstudgrade_lname.Enabled = True txtstudgrade_fname.Enabled = True txtstudgrade_corz.Enabled = True txtstudgrade_yer.Enabled = True lblstudgrade_sy.Text = txtstudgrade_sy.Text lblstudgrade_sem.Text = cmbstudgrade_sem.Text grpstudgrade_setsy.Hide() grpstud_grade_search.Show() txtstud_id.Focus() End If End If End Sub
Private Sub btnencode_grade_search_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnencode_grade_search.Click Dim datset As New DataSet
If txtencode_grade_code.Text = "" Then MessageBox.Show("Incomplete data") txtencode_grade_code.Focus() Else Try
datset = New DataSet()
ad3.Fill(datset, "tbl_sched_subject") dv = New DataView(datset.Tables("tbl_sched_subject")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "code"
intpos = dv.Find(txtencode_grade_code.Text)
If intpos = -1 Then MessageBox.Show("No Data found!") txtencode_grade_code.Focus() Else
intpos = dv.Find(txtencode_grade_code.Text) cm.Position = intpos binds2() grdgrade_view() txtencode_grade_code.Enabled = False End If
Catch ex As Exception
End Try
datset = Nothing
End If End Sub
End Class
Cashiering form
------------------------------------------------------------------------------------------------------------
Imports System.Data
Imports System.Data.SqlClient
Public Class cashier Dim conn As New SqlConnection("server=RYAN\sqlexpress;Initial Catalog=enrollment;Integrated Security=True") Dim ad As New SqlDataAdapter("Select * from student_info", conn) Dim ad2 As New SqlDataAdapter("Select * from tbl_stud_ass", conn) Dim ad3 As New SqlDataAdapter("Select * from tbl_totalunits", conn) Dim ad4 As New SqlDataAdapter("Select * from tbl_balance", conn) Dim ad5 As New SqlDataAdapter("Select * from tbl_stud_misc", conn) Dim ad6 As New SqlDataAdapter("Select * from tbl_totalacc", conn)
Dim dv As New DataView() Dim cm As CurrencyManager Dim intpos As Object
Private Sub fillds() Dim ds As New DataSet() ds = New DataSet() ad.Fill(ds, "student_info") dv = New DataView(ds.Tables("Student info")) cm = CType(Me.BindingContext(dv), CurrencyManager)
End Sub Private Sub bindfield() txtcash_id.DataBindings.Clear() txtcash_lname.DataBindings.Clear() txtcash_fname.DataBindings.Clear() txtcash_course.DataBindings.Clear() txtcash_year.DataBindings.Clear() txtcash_type.DataBindings.Clear()
txtcash_id.DataBindings.Add("text", dv, "Idnum") txtcash_lname.DataBindings.Add("text", dv, "lname") txtcash_fname.DataBindings.Add("text", dv, "fname") txtcash_course.DataBindings.Add("text", dv, "corz") txtcash_year.DataBindings.Add("text", dv, "Yer") txtcash_type.DataBindings.Add("text", dv, "type") End Sub Private Sub bindfield2() lblpunit.DataBindings.Clear() lblreg.DataBindings.Clear() lbllib.DataBindings.Clear() lblmed.DataBindings.Clear() lblath.DataBindings.Clear() lblguid.DataBindings.Clear() lbltext.DataBindings.Clear() lblaud.DataBindings.Clear() lblacc.DataBindings.Clear() lblid.DataBindings.Clear() lblhand.DataBindings.Clear() lblbkik.DataBindings.Clear() lblnat.DataBindings.Clear() lblprisaa.DataBindings.Clear() lblinet.DataBindings.Clear() lblsso.DataBindings.Clear() lblener.DataBindings.Clear() lbldept.DataBindings.Clear() lblcap.DataBindings.Clear() lblpin.DataBindings.Clear()
txtcash_id.DataBindings.Add("text", dv, "Idnum") txtcash_lname.DataBindings.Add("text", dv, "lname") txtcash_fname.DataBindings.Add("text", dv, "fname") txtcash_course.DataBindings.Add("text", dv, "corz") txtcash_year.DataBindings.Add("text", dv, "Yer") txtcash_type.DataBindings.Add("text", dv, "type") End Sub Private Sub clear() txtcash_id.Text = "" txtcash_lname.Text = "" txtcash_fname.Text = "" txtcash_course.Text = "" txtcash_year.Text = "" txtcash_type.Text = "" txtcash_totalass.Text = "" txtcash_downpay.Text = "" txtcash_totalbal.Text = "" txtcash_payperex.Text = ""
End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
login.Show() Me.Close()
End Sub
Private Sub btncash_payment_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncash_payment.Click grpcash_down.Visible = True grpcash_studacc.Visible = False grpcash_report.Visible = False If txtcash_id.Text = "" Then clear()
grpcash_down.Enabled = False grpcash_buttons.Enabled = False btncash_ref.Enabled = False oldstudent.ShowDialog() Else grpcash_down.Enabled = False v = txtcash_id.Text
clear() btncash_ref.Enabled = False grpcash_buttons.Enabled = False oldstudent.ShowDialog() End If End Sub Private Sub search_acc() Dim ds As New DataSet() Dim arr(2) As Object Try ad2.Fill(ds, "tbl_stud_ass") dv = New DataView(ds.Tables("tbl_stud_ass")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "idnum,sem,sy" arr(0) = lblpass_id.Text arr(1) = lblcash_sem.Text arr(2) = lblcash_sy.Text intpos = dv.Find(arr)
If intpos = -1 Then btncash_downpay.Enabled = True Else intpos = dv.Find(arr) cm.Position = intpos
txtcash_downpay.DataBindings.Clear() txtcash_downpay.DataBindings.Add("text", dv, "amount")
End If
Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try
End Sub
Private Sub search_acc3() Dim ds As New DataSet() Dim arr(2) As Object Try ad4.Fill(ds, "tbl_balance") dv = New DataView(ds.Tables("tbl_balance")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "idnum,sem,sy" arr(0) = lblpass_id.Text arr(1) = lblcash_sem.Text arr(2) = lblcash_sy.Text intpos = dv.Find(arr)
If intpos = -1 Then txtcash_totalbal.Text = Val(txtcash_totalass.Text) - Val(txtcash_downpay.Text) txtcash_totalbal.Text = Format(CType(txtcash_totalbal.Text, Decimal), "####0.00") Else intpos = dv.Find(arr) cm.Position = intpos
txtcash_totalbal.DataBindings.Clear() txtcash_totalbal.DataBindings.Add("text", dv, "bal")
txtcash_totalbal.Text = Format(CType(txtcash_totalbal.Text, Decimal), "####0.00") End If
Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try
End Sub
Private Sub search_acc2() Dim ds As New DataSet() Dim arr(2) As Object Try ad3.Fill(ds, "tbl_totalunits") dv = New DataView(ds.Tables("tbl_totalunits")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "idnum,sem,sy" arr(0) = lblpass_id.Text arr(1) = lblcash_sem.Text arr(2) = lblcash_sy.Text intpos = dv.Find(arr) If intpos = -1 Then btncash_downpay.Enabled = True Else intpos = dv.Find(arr) cm.Position = intpos
lblunit.DataBindings.Clear() lblunit.DataBindings.Add("text", dv, "tots") End If
Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try
End Sub Private Sub search_acc4() Dim ds As New DataSet() Dim arr(2) As Object Try ad6.Fill(ds, "tbl_totalacc") dv = New DataView(ds.Tables("tbl_totalacc")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "idnum,sem,sy" arr(0) = lblpass_id.Text arr(1) = lblcash_sem.Text arr(2) = lblcash_sy.Text intpos = dv.Find(arr) If intpos = -1 Then txtcash_totalass.Text = Val(lbltuit.Text) + Val(lblpunit.Text) + Val(lblreg.Text) + Val(lbllib.Text) + Val(lblmed.Text) + Val(lblath.Text) + Val(lblguid.Text) + Val(lbltext.Text) + Val(lblaud.Text) + Val(lblacc.Text) + Val(lblid.Text) + Val(lblhand.Text) + Val(lblbkik.Text) + Val(lblnat.Text) + Val(lblprisaa.Text) + Val(lblinet.Text) + Val(lblsso.Text) + Val(lblener.Text) + Val(lbldept.Text) + Val(lblcap.Text) + Val(lblpin.Text) txtcash_totalass.Text = Format(CType(txtcash_totalass.Text, Decimal), "####0.00") Else intpos = dv.Find(arr) cm.Position = intpos
txtcash_totalass.DataBindings.Clear() txtcash_totalass.DataBindings.Add("text", dv, "totalacc") End If
Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try
End Sub Private Sub compute()
lbltuit.Text = (lblunit.Text * lblpunit.Text) lbltuit.Text = Format(CType(lbltuit.Text, Decimal), "####0.00")
txtcash_totalbal.Text = Val(txtcash_totalass.Text) - Val(txtcash_downpay.Text) txtcash_totalbal.Text = Format(CType(txtcash_totalbal.Text, Decimal), "####0.00")
txtcash_payperex.Text = Val(txtcash_totalass.Text) / 4 txtcash_payperex.Text = Format(CType(txtcash_payperex.Text, Decimal), "####0.00") End Sub Private Sub btnsearch_cash_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsearch_cash.Click Dim ds As New DataSet() Try ad.Fill(ds, "Student_info") dv = New DataView(ds.Tables("Student_info")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "idnum"
intpos = dv.Find(lblpass_id.Text) If intpos = -1 Then MessageBox.Show("No Data Found", "Search", MessageBoxButtons.OK, _ MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) Else
intpos = dv.Find(lblpass_id.Text) cm.Position = intpos Call bindfield() Call search_acc() If txtcash_downpay.Text = "" Then
Else Call search_acc4() Call search_acc2() Call compute() Call search_acc3() Call grdpaysum_view() Call grdmisc_view()
End If If txtcash_totalass.Text = "" Then btncash_add.Enabled = False Else btncash_add.Enabled = True End If grpcash_buttons.Enabled = True btncash_ref.Enabled = True grpcash_down.Enabled = True grpcash_search.Hide() End If
Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try
End Sub
Private Sub btncash_downpay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncash_downpay.Click downpayment.ShowDialog() End Sub Public Sub grdpaysum_view() Dim datset1 As New DataSet Dim adap As New SqlDataAdapter("SELECT tbl_stud_ass.idnum, lname, fname, corz, yer, sem, sy, date, ptype, amount, month FROM tbl_stud_ass " & _ "WHERE IdNum= '" & lblpass_id.Text & " 'And sem= '" & lblcash_sem.Text & " 'And sy= '" & lblcash_sy.Text & " '" & _ "ORDER BY idnum", conn) With adap .SelectCommand = New SqlCommand() .SelectCommand.Connection = conn .SelectCommand.CommandText = "SELECT tbl_stud_ass.idnum, lname, fname, corz, yer, sem, sy, date, ptype, amount, month FROM tbl_stud_ass " & _ "WHERE IdNum= '" & lblpass_id.Text & " 'And sem= '" & lblcash_sem.Text & " 'And sy= '" & lblcash_sy.Text & " '" & _ "ORDER BY idnum" End With conn.Open() adap.Fill(datset1, "tbl_stud_ass") conn.Close() With dtgrdcash_paysum .AutoGenerateColumns = True .DataSource = datset1 .DataMember = "tbl_stud_ass" .RowHeadersWidth = 25 If .RowCount 0 Then .CurrentRow.Selected = 1 End If End With Dim OARCS As New DataGridViewCellStyle OARCS.Alignment = DataGridViewContentAlignment.MiddleCenter Dim OACS As New DataGridViewCellStyle OACS.BackColor = Color.WhiteSmoke dtgrdcash_paysum.AlternatingRowsDefaultCellStyle = OACS With dtgrdcash_paysum .Columns(0).HeaderText = "idnum" .Columns(0).Visible = False .Columns(1).HeaderText = "Lname" .Columns(1).Visible = False .Columns(2).HeaderText = "Fname" .Columns(2).Visible = False .Columns(3).HeaderText = "Corz" .Columns(3).Visible = False .Columns(4).HeaderText = "Yer" .Columns(4).Visible = False .Columns(5).HeaderText = "sem" .Columns(5).Visible = False .Columns(6).HeaderText = "sy" .Columns(6).Visible = False .Columns(7).HeaderText = "Date" .Columns(7).Width = 90 .Columns(8).HeaderText = "Transaction type" .Columns(8).Width = 130 .Columns(9).HeaderText = "Amount" .Columns(9).Width = 90 .Columns(10).HeaderText = "month" .Columns(10).Visible = False
End With
datset1 = Nothing End Sub
Private Sub btncash_ref_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncash_ref.Click grdpaysum_view() grdmisc_view() End Sub Public Sub grdmisc_view() Dim datset1 As New DataSet Dim adap As New SqlDataAdapter("SELECT tbl_stud_misc.Idnum,lname,fname,corz,yer,MiscName,amount FROM tbl_stud_misc " & _ "WHERE IdNum= '" & lblpass_id.Text & " 'And sem= '" & lblcash_sem.Text & " 'And sy= '" & lblcash_sy.Text & " '" & _ "ORDER BY Idnum", conn) With adap .SelectCommand = New SqlCommand() .SelectCommand.Connection = conn .SelectCommand.CommandText = "SELECT tbl_stud_misc.Idnum,lname,fname,corz,yer,MisName,amount,sem,sy FROM tbl_stud_misc " & _ "WHERE IdNum= '" & lblpass_id.Text & " 'And sem= '" & lblcash_sem.Text & " 'And sy= '" & lblcash_sy.Text & " '" & _ "ORDER BY Idnum" End With conn.Open() adap.Fill(datset1, "tbl_stud_misc") conn.Close() With dtgrdcash_other .AutoGenerateColumns = True .DataSource = datset1 .DataMember = "tbl_stud_misc" .RowHeadersWidth = 25 If .RowCount 0 Then .CurrentRow.Selected = 1 End If End With Dim OARCS As New DataGridViewCellStyle OARCS.Alignment = DataGridViewContentAlignment.MiddleCenter Dim OACS As New DataGridViewCellStyle OACS.BackColor = Color.WhiteSmoke dtgrdcash_other.AlternatingRowsDefaultCellStyle = OACS With dtgrdcash_other .Columns(0).HeaderText = "idnum" .Columns(0).Visible = False .Columns(1).HeaderText = "Lname" .Columns(1).Visible = False .Columns(2).HeaderText = "Fname" .Columns(2).Visible = False .Columns(3).HeaderText = "Corz" .Columns(3).Visible = False .Columns(4).HeaderText = "Yer" .Columns(4).Visible = False .Columns(5).HeaderText = "Miscellaneous Name" .Columns(5).Width = 170 .Columns(6).HeaderText = "Amount" .Columns(6).Width = 75 .Columns(7).HeaderText = "sem" .Columns(7).Visible = False .Columns(8).HeaderText = "sy" .Columns(8).Visible = False
End With
datset1 = Nothing End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncash_add.Click misc_list.ShowDialog() End Sub
Private Sub txtkey_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtkey.KeyPress If e.KeyChar = Chr(13) Then Dim ds As New DataSet() Try ad.Fill(ds, "Student_info") dv = New DataView(ds.Tables("Student_info")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "idnum"
intpos = dv.Find(lblpass_id.Text) If intpos = -1 Then MessageBox.Show("No Data Found", "Search", MessageBoxButtons.OK, _ MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) Else
intpos = dv.Find(lblpass_id.Text) cm.Position = intpos Call bindfield() Call search_acc() If txtcash_downpay.Text = "" Then
Else Call search_acc4() Call search_acc2() Call compute() Call search_acc3() Call grdpaysum_view() Call grdmisc_view()
End If If txtcash_totalass.Text = "" Then btncash_add.Enabled = False Else btncash_add.Enabled = True End If grpcash_buttons.Enabled = True btncash_ref.Enabled = True grpcash_down.Enabled = True grpcash_search.Hide() End If
Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try Else End If End Sub
Private Sub txtkeypass_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtkey.TextChanged If x = 1 Then txtkey.Focus() End If End Sub
Private Sub btncash_studacc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncash_studacc.Click grpcash_studacc.Visible = True grpcash_down.Visible = False grpcash_report.Visible = False idnum.ShowDialog() End Sub Public Sub grdstudsum_view() Dim datset1 As New DataSet Dim adap As New SqlDataAdapter("SELECT tbl_stud_ass.idnum, lname, fname, corz, yer, sem, sy, date, ptype, amount, month FROM tbl_stud_ass " & _ "WHERE IdNum= '" & lblpass_id.Text & " 'And sem= '" & lblcash_sem.Text & " 'And sy= '" & lblcash_sy.Text & " '" & _ "ORDER BY idnum", conn) With adap .SelectCommand = New SqlCommand() .SelectCommand.Connection = conn .SelectCommand.CommandText = "SELECT tbl_stud_ass.idnum, lname, fname, corz, yer, sem, sy, date, ptype, amount, month FROM tbl_stud_ass " & _ "WHERE IdNum= '" & lblpass_id.Text & " 'And sem= '" & lblcash_sem.Text & " 'And sy= '" & lblcash_sy.Text & " '" & _ "ORDER BY idnum" End With conn.Open() adap.Fill(datset1, "tbl_stud_ass") conn.Close() With dtgrd_studacc_sum .AutoGenerateColumns = True .DataSource = datset1 .DataMember = "tbl_stud_ass" .RowHeadersWidth = 25 If .RowCount 0 Then .CurrentRow.Selected = 1 End If End With Dim OARCS As New DataGridViewCellStyle OARCS.Alignment = DataGridViewContentAlignment.MiddleCenter Dim OACS As New DataGridViewCellStyle OACS.BackColor = Color.WhiteSmoke dtgrd_studacc_sum.AlternatingRowsDefaultCellStyle = OACS With dtgrd_studacc_sum .Columns(0).HeaderText = "idnum" .Columns(0).Visible = False .Columns(1).HeaderText = "Lname" .Columns(1).Visible = False .Columns(2).HeaderText = "Fname" .Columns(2).Visible = False .Columns(3).HeaderText = "Corz" .Columns(3).Visible = False .Columns(4).HeaderText = "Yer" .Columns(4).Visible = False .Columns(5).HeaderText = "sem" .Columns(5).Visible = False .Columns(6).HeaderText = "sy" .Columns(6).Visible = False .Columns(7).HeaderText = "Date" .Columns(7).Width = 90 .Columns(8).HeaderText = "Transaction type" .Columns(8).Width = 130 .Columns(9).HeaderText = "Amount" .Columns(9).Width = 90 .Columns(10).HeaderText = "month" .Columns(10).Visible = False
End With
datset1 = Nothing End Sub
Public Sub grdsubject_view() Dim datset1 As New DataSet Dim adap As New SqlDataAdapter("SELECT tbl_sched_subject.Code, Title, Desp, prereq, lab, timeFrom, TimeTo, day, sem, sy,unit, room FROM tbl_sched_subject " & _ "WHERE IdNum= '" & lblpass_id.Text & " 'And sem= '" & lblcash_sem.Text & " 'And sy= '" & lblcash_sy.Text & " '" & _ "ORDER BY code", conn) With adap .SelectCommand = New SqlCommand() .SelectCommand.Connection = conn .SelectCommand.CommandText = "SELECT tbl_sched_subject.Code, Title, Desp, prereq, lab, timeFrom, TimeTo, day,unit,Room,sem,sy FROM tbl_sched_subject " & _ "WHERE IdNum= '" & lblpass_id.Text & " 'And sem= '" & lblcash_sem.Text & " 'And sy= '" & lblcash_sy.Text & " '" & _ "ORDER BY code" End With conn.Open() adap.Fill(datset1, "tbl_sched_subject") conn.Close() With dtgrdstudacc_subj .AutoGenerateColumns = True .DataSource = datset1 .DataMember = "tbl_sched_subject" .RowHeadersWidth = 25 If .RowCount 0 Then .CurrentRow.Selected = 1 End If End With
Dim OARCS As New DataGridViewCellStyle OARCS.Alignment = DataGridViewContentAlignment.MiddleCenter Dim OACS As New DataGridViewCellStyle OACS.BackColor = Color.WhiteSmoke dtgrdstudacc_subj.AlternatingRowsDefaultCellStyle = OACS With dtgrdstudacc_subj .Columns(0).HeaderText = "Code" .Columns(0).Width = 55 .Columns(1).HeaderText = "Title" .Columns(1).Width = 75 .Columns(2).HeaderText = "Description" .Columns(2).Width = 150 .Columns(3).HeaderText = "Pre-Requisite" .Columns(3).Visible = False .Columns(4).HeaderText = "Laboratory" .Columns(4).Visible = False .Columns(5).HeaderText = "Time From" .Columns(5).Visible = False .Columns(6).HeaderText = "Time To" .Columns(6).Visible = False .Columns(7).HeaderText = "day" .Columns(7).Visible = False .Columns(8).HeaderText = "Unit" .Columns(8).Width = 55 .Columns(9).HeaderText = "Room" .Columns(9).Visible = False .Columns(10).HeaderText = "Unit" .Columns(10).Visible = False .Columns(11).HeaderText = "Room" .Columns(11).Visible = False End With datset1 = Nothing End Sub
Uploader Form
------------------------------------------------------------------------------------------------------------
Imports System.Data
Imports System.Data.SqlClient
Public Class uploader Dim conn As New SqlConnection("server=RYAN\sqlexpress;Initial Catalog=enrollment;Integrated Security=True") Dim ad As New SqlDataAdapter("Select * from student_info", conn) Dim ad2 As New SqlDataAdapter("Select * from tbl_subject_info", conn) Dim ad3 As New SqlDataAdapter("Select * from tbl_totalunits", conn) Dim dv As New DataView() Dim cm As CurrencyManager Dim intpos As Object Private Sub binds() txtup_id.DataBindings.Clear() txtup_lname.DataBindings.Clear() txtup_fname.DataBindings.Clear() txtup_corz.DataBindings.Clear() txtup_yer.DataBindings.Clear() txtup_id.DataBindings.Add("text", dv, "idnum") txtup_lname.DataBindings.Add("text", dv, "lname") txtup_fname.DataBindings.Add("text", dv, "fname") txtup_corz.DataBindings.Add("text", dv, "corz") txtup_yer.DataBindings.Add("text", dv, "yer") End Sub Private Sub sched_ok() Dim datset1, datset As New DataSet
If txtup_sched_id.Text = "" Then
MessageBox.Show("Incomplete data") Else Try
datset = New DataSet() datset1 = New DataSet() ad.Fill(datset, "Student_info") dv = New DataView(datset.Tables("Student_info")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "Idnum"
intpos = dv.Find(txtup_sched_id.Text) If intpos = -1 Then MessageBox.Show("No Data found!") Else
intpos = dv.Find(txtup_sched_id.Text) cm.Position = intpos binds() grdsubject_upload() Call bindUnits() grpup_sched.Hide()
End If
Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try
datset = Nothing datset1 = Nothing txtup_sched_id.Text = "" End If End Sub Private Sub bindUnits() Dim datset As New DataSet datset = New DataSet() ad3.Fill(datset, "tbl_totalunits") dv = New DataView(datset.Tables("tbl_totalunits")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "Idnum"
intpos = dv.Find(txtup_sched_id.Text)
lblpassunit.DataBindings.Clear() lblpassunit.DataBindings.Add("text", dv, "Tots") End Sub Private Sub btnup_sched_ok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnup_sched_ok.Click Call sched_ok() End Sub Public Sub grdsubject_upload() Dim datset1 As New DataSet Dim adap As New SqlDataAdapter("SELECT tbl_sched_subject.Code,Title,Desp,Prereq,TimeFrom,Sem,Unit,Room,Prof,Lab,Yer,Sy,TimeTo,day FROM tbl_sched_subject " & _ "WHERE IdNum= '" & txtup_id.Text & " '" & _ "ORDER BY code", conn) With adap .SelectCommand = New SqlCommand() .SelectCommand.Connection = conn .SelectCommand.CommandText = "SELECT tbl_sched_subject.Code, Title, Desp, prereq, lab, timeFrom, TimeTo, day,yer, sem, sy, unit, room, prof FROM tbl_sched_subject " & _ "WHERE IdNum= '" & txtup_id.Text & " '" & _ "ORDER BY code" End With conn.Open() adap.Fill(datset1, "tbl_sched_subject") conn.Close() With datgrdup_subject .AutoGenerateColumns = True .DataSource = datset1 .DataMember = "tbl_sched_subject" .RowHeadersWidth = 25 End With Dim OARCS As New DataGridViewCellStyle OARCS.Alignment = DataGridViewContentAlignment.MiddleCenter Dim OACS As New DataGridViewCellStyle OACS.BackColor = Color.WhiteSmoke datgrdup_subject.AlternatingRowsDefaultCellStyle = OACS With datgrdup_subject .Columns(0).HeaderText = "Code" .Columns(0).Width = 55 .Columns(1).HeaderText = "Title" .Columns(1).Width = 75 .Columns(2).HeaderText = "Description" .Columns(2).Width = 200 .Columns(3).HeaderText = "Pre-Requisite" .Columns(3).Visible = False .Columns(4).HeaderText = "Laboratory" .Columns(4).Visible = False .Columns(5).HeaderText = "Time From" .Columns(5).Width = 100 .Columns(6).HeaderText = "Time To" .Columns(6).Width = 100 .Columns(7).HeaderText = "day" .Columns(7).Width = 60 .Columns(8).HeaderText = "Year Level" .Columns(8).Visible = False .Columns(9).HeaderText = "Semester" .Columns(9).Visible = False .Columns(10).HeaderText = "School year" .Columns(10).Visible = False .Columns(11).HeaderText = "Unit" .Columns(11).Width = 55 .Columns(12).HeaderText = "Room" .Columns(12).Width = 55 .Columns(13).HeaderText = "Professor" .Columns(13).Visible = False End With datset1 = Nothing End Sub Private Sub uploader_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub btnup_del_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnup_del.Click Dim datset As New DataSet Dim check As Integer Dim pos As Integer Dim cmdSubject As New SqlCommand Dim adap As New SqlDataAdapter("SELECT tbl_sched_subject.Code,Title,Desp,Prereq,TimeFrom,Sem,Unit,Room,Prof,Lab,Yer,Sy,TimeTo,day FROM tbl_sched_subject " & _ "WHERE IdNum= '" & txtup_id.Text & " '" & _ "ORDER BY code", conn) datset = New DataSet() adap.Fill(datset, "tbl_sched_subject") dv = New DataView(datset.Tables("tbl_sched_subject")) cm = CType(Me.BindingContext(dv), CurrencyManager)
dv.Sort = "code" pos = dv.Find(lblgrid_num.Text)
Try conn.Open() cmdSubject = conn.CreateCommand cmdSubject.CommandText = "DELETE FROM tbl_sched_subject WHERE code = '" & Trim(lblgrid_num.Text) & " '" datgrdup_subject.Rows.Remove(datgrdup_subject.CurrentRow) check = cmdSubject.ExecuteReader.RecordsAffected
conn.Close() lblpassunit.Text = lblpassunit.Text - txtminus.Text Call updates2() Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error or Data not Found!!") End Try
datset = Nothing End Sub Private Sub updates2() Dim cmd As New SqlCommand
cmd.Connection = conn Try
cmd.CommandText = "UPDATE tbl_totalunits " & _ "SET Lname=@Lname,Fname=@Fname,tots=@tots WHERE idnum=@idnum" cmd.CommandType = CommandType.Text With cmd.Parameters .AddWithValue("@idnum", txtup_id.Text) .AddWithValue("@Lname", txtup_lname.Text) .AddWithValue("@fname", txtup_fname.Text) .AddWithValue("@tots", lblpassunit.Text) End With conn.Open() cmd.ExecuteNonQuery() cmd.Parameters.Clear() conn.Close() Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try conn.Close() End Sub
Private Sub datgrdup_subject_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles datgrdup_subject.Click Dim ds As New DataSet Dim adap As New SqlDataAdapter("SELECT tbl_sched_subject.Code,Title,Desp,Prereq,TimeFrom,Sem,Unit,Room,Prof,Lab,Yer,Sy,TimeTo,day FROM tbl_sched_subject " & _ "ORDER BY code", conn) Try Dim pos As Integer pos = datgrdup_subject.CurrentRow.Index Try ds = New DataSet() adap.Fill(ds, "tbl_sched_subject") dv = New DataView(ds.Tables("tbl_sched_subject")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "code" cm.Position = pos lblgrid_num.DataBindings.Clear() txtminus.DataBindings.Clear() lblgrid_num.DataBindings.Add("text", dv, "code") txtminus.DataBindings.Add("text", dv, "Unit") Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try Catch ex As Exception MsgBox("Subject Database is Empty", MsgBoxStyle.Information, "tbl_subject_info")
End Try ds = Nothing ad2 = Nothing End Sub
Student Form
------------------------------------------------------------------------------------------------------------
Imports System.Data
Imports System.Data.SqlClient
Public Class student Dim conn As New SqlConnection("server=RYAN\sqlexpress;Initial Catalog=enrollment;Integrated Security=True") Dim ad3 As New SqlDataAdapter("Select * from tbl_sched_subject", conn) Dim ad4 As New SqlDataAdapter("Select * from tbl_student_grade", conn) Dim ad5 As New SqlDataAdapter("Select * from tbl_stud_access", conn) Dim dv As New DataView() Dim cm As CurrencyManager Dim intpos As Object
Private Sub txtstudgrade_sy_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) If e.KeyChar = Chr(13) Then cmbstudgrade_sem.Focus() ElseIf e.KeyChar = Chr(27) Then login.Show() Me.Close() End If End Sub
Private Sub set_ok() grpreg_studentgrade.Enabled = False lblstudgrade_sy.Text = cmbstudgrade_sy.Text lblstudgrade_sem.Text = cmbstudgrade_sem.Text
grpstudgrade_setsy.Hide()
End Sub Private Sub btnstudgrade_ok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnstudgrade_ok.Click lblstudgrade_sem.Text = cmbstudgrade_sem.Text() lblstudgrade_sy.Text = cmbstudgrade_sy.Text() stud_access.ShowDialog() End Sub Private Sub cmbstudgrade_sem_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbstudgrade_sem.KeyPress If e.KeyChar = Chr(13) Then stud_access.ShowDialog() ElseIf e.KeyChar = Chr(27) Then login.Show() Me.Close() End If End Sub Public Sub grdstudent_grade() Dim datset1 As New DataSet Dim adap As New SqlDataAdapter("SELECT tbl_student_grade.Code,Title,Desp,Unit,Grade,Idnum,Lname,Fname,corz,yer,sem,sy FROM tbl_student_grade " & _ "WHERE sy= '" & lblstudgrade_sy.Text & " ' And sem= '" & lblstudgrade_sem.Text & " 'And idnum= '" & stud_access.txtstudac_idname.Text & " '" & _ "ORDER BY code", conn) With adap .SelectCommand = New SqlCommand() .SelectCommand.Connection = conn .SelectCommand.CommandText = "SELECT tbl_student_grade.Code,Title,Desp,Unit,Grade,Idnum,Lname,Fname,corz,yer,sem,sy FROM tbl_student_grade " & _ "WHERE sy= '" & lblstudgrade_sy.Text & " ' And sem= '" & lblstudgrade_sem.Text & " 'And idnum= '" & stud_access.txtstudac_idname.Text & " '" & _ "ORDER BY code" End With conn.Open() adap.Fill(datset1, "tbl_student_grade") conn.Close() With dtgrdreg_student_grade .AutoGenerateColumns = True .DataSource = datset1 .DataMember = "tbl_student_grade" .RowHeadersWidth = 25 End With
Dim OARCS As New DataGridViewCellStyle OARCS.Alignment = DataGridViewContentAlignment.MiddleCenter Dim OACS As New DataGridViewCellStyle OACS.BackColor = Color.WhiteSmoke dtgrdreg_student_grade.AlternatingRowsDefaultCellStyle = OACS With dtgrdreg_student_grade .Columns(0).HeaderText = "Code" .Columns(0).Width = 55 .Columns(1).HeaderText = "Title" .Columns(1).Width = 75 .Columns(2).HeaderText = "Description" .Columns(2).Width = 200 .Columns(3).HeaderText = "Unit" .Columns(3).Width = 55 .Columns(4).HeaderText = "Grade" .Columns(4).Width = 55 .Columns(5).HeaderText = "Idnum" .Columns(5).Visible = False .Columns(6).HeaderText = "Lname" .Columns(6).Visible = False .Columns(7).HeaderText = "Fname" .Columns(7).Visible = False .Columns(8).HeaderText = "Corz" .Columns(8).Visible = False .Columns(9).HeaderText = "Yer" .Columns(9).Visible = False .Columns(10).HeaderText = "Sem" .Columns(10).Visible = False .Columns(11).HeaderText = "sy" .Columns(11).Visible = False End With datset1 = Nothing End Sub
Public Sub grdsubject_view() Dim datset1 As New DataSet Dim adap As New SqlDataAdapter("SELECT tbl_sched_subject.idnum,lname,fname,corz,yer,Code,Title,Desp,Prereq,Lab,TimeFrom,TimeTo,day,Sem,Sy,Unit,Room,Prof FROM tbl_sched_subject " & _ "WHERE IdNum= '" & txtstudgrade_id.Text & " 'And sem= '" & lblstudgrade_sem.Text & " 'And sy= '" & lblstudgrade_sy.Text & " '" & _ "ORDER BY code", conn) With adap .SelectCommand = New SqlCommand() .SelectCommand.Connection = conn .SelectCommand.CommandText = "SELECT tbl_sched_subject.idnum,lname,fname,corz,yer,Code,Title,Desp,Prereq,Lab,TimeFrom,TimeTo,day,Sem,Sy,Unit,Room,Prof FROM tbl_sched_subject " & _ "WHERE IdNum= '" & txtstudgrade_id.Text & " 'And sem= '" & lblstudgrade_sem.Text & " 'And sy= '" & lblstudgrade_sy.Text & " '" & _ "ORDER BY code" End With conn.Open() adap.Fill(datset1, "tbl_sched_subject") conn.Close() With datgrdview_subject .AutoGenerateColumns = True .DataSource = datset1 .DataMember = "tbl_sched_subject" .RowHeadersWidth = 25 If .RowCount 0 Then .CurrentRow.Selected = 1 End If End With
Dim OARCS As New DataGridViewCellStyle OARCS.Alignment = DataGridViewContentAlignment.MiddleCenter Dim OACS As New DataGridViewCellStyle OACS.BackColor = Color.WhiteSmoke datgrdview_subject.AlternatingRowsDefaultCellStyle = OACS
With datgrdview_subject .Columns(0).HeaderText = "Code" .Columns(0).Width = 55 .Columns(1).HeaderText = "Title" .Columns(1).Width = 75 .Columns(2).HeaderText = "Description" .Columns(2).Width = 200 .Columns(3).HeaderText = "Pre-Requisite" .Columns(3).Visible = False .Columns(4).HeaderText = "Laboratory" .Columns(4).Visible = False .Columns(5).HeaderText = "Time From" .Columns(5).Width = 100 .Columns(6).HeaderText = "Time To" .Columns(6).Width = 100 .Columns(7).HeaderText = "day" .Columns(7).Width = 100 .Columns(8).HeaderText = "Unit" .Columns(8).Width = 55 .Columns(9).HeaderText = "Room" .Columns(9).Width = 55 .Columns(10).HeaderText = "Pre-Requisite" .Columns(10).Visible = False .Columns(11).HeaderText = "Laboratory" .Columns(11).Visible = False .Columns(12).HeaderText = "idnum" .Columns(12).Visible = False End With datset1 = Nothing End Sub Private Sub lbl_logout_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lbl_logout.LinkClicked grpreg_studentgrade.Enabled = False Label4.Hide() txtstudgrade_id.Text = "" txtstudgrade_lname.Text = "" txtstudgrade_fname.Text = "" txtstudgrade_corz.Text = "" txtstudgrade_yer.Text = "" tbstudent.Hide() stud_access.ShowDialog() End Sub
Private Sub btnreg_user_save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnreg_user_save.Click Dim ds As New DataSet() Dim arr(1) As Object Dim adap As New SqlDataAdapter("SELECT tbl_stud_access.Idnum,password FROM tbl_stud_access " & _ "WHERE IdNum= '" & txtstud_type.Text & " 'And password= '" & txtstud_pass.Text & " '" & _ "ORDER BY idnum", conn) With adap .SelectCommand = New SqlCommand() .SelectCommand.Connection = conn .SelectCommand.CommandText = "SELECT tbl_stud_access.Idnum,password FROM tbl_stud_access " & _ "WHERE IdNum= '" & txtstud_type.Text & " 'And password= '" & txtstud_pass.Text & " '" & _ "ORDER BY idnum" End With Try adap.Fill(ds, "tbl_stud_access") dv = New DataView(ds.Tables("tbl_stud_access")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "idnum,password" arr(0) = txtstud_type.Text arr(1) = txtstud_pass.Text intpos = dv.Find(arr) If intpos = -1 Then MessageBox.Show("No Data Found", "Search", MessageBoxButtons.OK, _ MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) Else intpos = dv.Find(arr) cm.Position = intpos If txtnewpas.Text = txtstud_re.Text Or txtstud_re.Text = txtnewpas.Text Then save_bal() Else MsgBox("The New Password did not match.") Label4.Show() txtstud_pass.Text = "" txtstud_re.Text = "" txtnewpas.Text = "" txtnewpas.Focus() End If
End If Catch ex As Exception
End Try End Sub
Private Sub save_bal() Dim ds1 As New DataSet() Dim cmd As New SqlCommand Dim arr(1) As Object
ds1 = New DataSet() ad5.Fill(ds1, "tbl_stud_access") dv = New DataView(ds1.Tables("tbl_stud_access")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "idnum,password" arr(0) = txtstud_type.Text arr(1) = txtstud_pass.Text
intpos = dv.Find(arr)
If intpos >= 0 Then Call update_bal() Else
With cmd .Connection = conn .CommandText = "INSERT INTO tbl_stud_access(idnum,password)" & _ "values(@idnum,@password)" End With
With cmd.Parameters .AddWithValue("@idnum", txtstud_type.Text) .AddWithValue("@password", txtnewpas.Text)
End With Label4.Hide() txtstud_pass.Text = "" txtstud_re.Text = "" txtnewpas.Text = "" MessageBox.Show("The data has been save.", "Saving...", MessageBoxButtons.OK)
Me.Close() End If conn.Open() Try Catch ex As Exception End Try conn.Close() End Sub Private Sub update_bal() Dim cmd As New SqlCommand cmd.Connection = conn Try cmd.CommandText = "UPDATE tbl_stud_access " & _ "SET password=@password WHERE idnum=@idnum" cmd.CommandType = CommandType.Text With cmd.Parameters .AddWithValue("@idnum", txtstud_type.Text) .AddWithValue("@password", txtnewpas.Text)
End With txtstud_pass.Text = "" txtstud_re.Text = "" MessageBox.Show("The data has been update.", "Updating...", MessageBoxButtons.OK)
conn.Open() cmd.ExecuteNonQuery() conn.Close()
cmd.Parameters.Clear()
Catch ex As Exception End Try End Sub
Add subject
------------------------------------------------------------------------------------------------------------
Imports System.Data
Imports System.Data.SqlClient
Public Class add_subject Dim conn As New SqlConnection("server=RYAN\sqlexpress;Initial Catalog=enrollment;Integrated Security=True") Dim ad2 As New SqlDataAdapter("Select * from tbl_subject_info", conn) Dim dv2, dv3 As New DataView() Dim cm As CurrencyManager Dim intpos As Object Private Sub bindfield() txtencode_scode.DataBindings.Clear() txtencode_subname.DataBindings.Clear() txtencode_sdes.DataBindings.Clear() txtencode_subpre.DataBindings.Clear() cboxencode_sub_lab.DataBindings.Clear() cmbencode_addsub_timefrom.DataBindings.Clear() cmbencode_addsub_timeto.DataBindings.Clear() cmbencode_sub_yearlevel.DataBindings.Clear() cmbencode_ssem.DataBindings.Clear() txtreg_encode_sy.DataBindings.Clear() txtencode_sunit.DataBindings.Clear() txtencode_rumnum.DataBindings.Clear() txtencode_sprof.DataBindings.Clear() cmbencode_Addsub_day.DataBindings.Clear() txtencode_scode.DataBindings.Add("text", dv2, "Code") txtencode_subname.DataBindings.Add("text", dv2, "Title") txtencode_sdes.DataBindings.Add("text", dv2, "Desp") txtencode_subpre.DataBindings.Add("text", dv2, "Prereq") cboxencode_sub_lab.DataBindings.Add("text", dv2, "Lab") cmbencode_addsub_timefrom.DataBindings.Add("text", dv2, "TimeFrom") cmbencode_addsub_timeto.DataBindings.Add("text", dv2, "TimeTo") cmbencode_sub_yearlevel.DataBindings.Add("text", dv2, "Yerle") cmbencode_ssem.DataBindings.Add("text", dv2, "Sem") txtreg_encode_sy.DataBindings.Add("text", dv2, "Sy") txtencode_sunit.DataBindings.Add("text", dv2, "Unit") txtencode_rumnum.DataBindings.Add("text", dv2, "Room") txtencode_sprof.DataBindings.Add("text", dv2, "Prof") cmbencode_Addsub_day.DataBindings.Add("text", dv2, "day") End Sub Private Sub encode_sub_disabled()
txtencode_scode.Enabled = False txtencode_subname.Enabled = False txtencode_subpre.Enabled = False cmbencode_addsub_timefrom.Enabled = False cmbencode_ssem.Enabled = False txtencode_sunit.Enabled = False txtencode_rumnum.Enabled = False txtencode_sdes.Enabled = False txtencode_sprof.Enabled = False cboxencode_sub_lab.Enabled = False txtreg_encode_sy.Enabled = False cmbencode_sub_yearlevel.Enabled = False cmbencode_addsub_timeto.Enabled = False cmbencode_Addsub_day.Enabled = False
End Sub
Private Sub encode_sub_enabled()
txtencode_scode.Enabled = True txtencode_subname.Enabled = True txtencode_subpre.Enabled = True cmbencode_addsub_timefrom.Enabled = True cmbencode_ssem.Enabled = True txtencode_sunit.Enabled = True txtencode_rumnum.Enabled = True txtencode_sdes.Enabled = True txtencode_sprof.Enabled = True cboxencode_sub_lab.Enabled = True txtreg_encode_sy.Enabled = True cmbencode_sub_yearlevel.Enabled = True cmbencode_Addsub_day.Enabled = True cmbencode_addsub_timeto.Enabled = True
End Sub Private Sub clear() txtencode_scode.Text = "" txtencode_subname.Text = "" txtencode_subpre.Text = "" cmbencode_addsub_timefrom.Text = "" cmbencode_addsub_timeto.Text = "" cmbencode_ssem.Text = "" txtencode_sunit.Text = "" txtencode_rumnum.Text = "" txtencode_sdes.Text = "" txtencode_sprof.Text = "" cboxencode_sub_lab.Text = "" txtreg_encode_sy.Text = "" cmbencode_sub_yearlevel.Text = ""
End Sub Private Sub btnencode_sub_save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnencode_sub_save.Click Dim ds1 As New DataSet() Dim ds2 As New DataSet() Dim cmd As New SqlCommand Dim cmd2 As New SqlCommand
ds1 = New DataSet() ad2.Fill(ds1, "tbl_subject_info") dv2 = New DataView(ds1.Tables("tbl_subject_info")) cm = CType(Me.BindingContext(dv2), CurrencyManager) dv2.Sort = "Code" intpos = dv2.Find(txtencode_scode.Text)
If txtencode_scode.Text = "" Then MessageBox.Show("Incomplete data", "Search", MessageBoxButtons.OK, _ MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) Else If intpos >= 0 Then MsgBox("The data is already exist", MsgBoxStyle.Critical, "tbl_subject_info") Else
With cmd .Connection = conn .CommandText = "INSERT INTO tbl_subject_info(Code,Title,Desp,Prereq,TimeFrom,Sem,Unit,Room,Prof,Lab,Yerle,Sy,TimeTo,day)" & _ "values(@Code,@Title,@Desp,@Prereq,@TimeFrom,@Sem,@Unit,@Room,@Prof,@Lab,@Yerle,@Sy,@TimeTo,@day)" End With
With cmd.Parameters .AddWithValue("@Code", txtencode_scode.Text) .AddWithValue("@Title", txtencode_subname.Text) .AddWithValue("@Desp", txtencode_sdes.Text) .AddWithValue("@Prereq", txtencode_subpre.Text) .AddWithValue("@TimeFrom", cmbencode_addsub_timefrom.Text) .AddWithValue("@TimeTo", cmbencode_addsub_timeto.Text) .AddWithValue("@Sem", cmbencode_ssem.Text) .AddWithValue("@Unit", txtencode_sunit.Text) .AddWithValue("@Room", txtencode_rumnum.Text) .AddWithValue("@Prof", txtencode_sprof.Text) .AddWithValue("@Lab", cboxencode_sub_lab.Text) .AddWithValue("@Yerle", cmbencode_sub_yearlevel.Text) .AddWithValue("@Sy", txtreg_encode_sy.Text) .AddWithValue("@day", cmbencode_Addsub_day.Text)
End With MessageBox.Show("The data has been save.", "Saving...", MessageBoxButtons.OK)
registrar.Enabled = True
Me.Close() End If
conn.Open()
Try cmd.ExecuteNonQuery() Catch ex As Exception MessageBox.Show(ex.Message) End Try End If conn.Close() End Sub
Private Sub btnreg_addsub_cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnreg_addsub_cancel.Click registrar.Enabled = True Me.Close() End Sub Private Sub searching_ok() Dim datset1, datset As New DataSet
If txtreg_search_sub_name.Text = "" Then
MessageBox.Show("Incomplete data", "Search", MessageBoxButtons.OK, _ MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) Else
Try datset = New DataSet() datset1 = New DataSet() ad2.Fill(datset, "tbl_subject_info") dv2 = New DataView(datset.Tables("tbl_subject_info")) cm = CType(Me.BindingContext(dv2), CurrencyManager) dv2.Sort = "Code"
intpos = dv2.Find(txtreg_search_sub_name.Text) If intpos = -1 Then MessageBox.Show("No Data Found", "Search", MessageBoxButtons.OK, _ MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) Else
intpos = dv2.Find(txtreg_search_sub_name.Text) cm.Position = intpos bindfield() grpencode_subject.Show() grpreg_search.Hide() btnencode_sub_save.Hide() encode_sub_disabled() Me.Height = 468 End If
Catch ex As Exception MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!") End Try End If datset = Nothing datset1 = Nothing txtreg_search_sub_name.Text = "" End Sub
Private Sub btnsearch_sub_ok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsearch_sub_ok.Click Call searching_ok() End Sub
Private Sub btnencode_sub_edit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnencode_sub_edit.Click
txtencode_subpre.Enabled = True cmbencode_addsub_timefrom.Enabled = True cmbencode_ssem.Enabled = True txtencode_sunit.Enabled = True txtencode_rumnum.Enabled = True txtencode_sprof.Enabled = True cboxencode_sub_lab.Enabled = True txtreg_encode_sy.Enabled = True cmbencode_sub_yearlevel.Enabled = True cmbencode_addsub_timeto.Enabled = True End Sub
Private Sub txtencode_scode_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtencode_scode.KeyPress If e.KeyChar = Chr(13) Then txtencode_subname.Focus() End If End Sub
Private Sub txtencode_scode_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtencode_scode.TextChanged
If IsNumeric(txtencode_scode.Text) = False Then txtencode_scode.Text = "" End If End Sub
Private Sub txtencode_sdes_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtencode_sdes.KeyPress If e.KeyChar = Chr(13) Then txtencode_subpre.Focus() End If End Sub
Private Sub txtencode_sprof_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtencode_sprof.KeyPress End Sub
Private Sub txtencode_rumnum_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtencode_rumnum.KeyPress If e.KeyChar = Chr(13) Then txtencode_sprof.Focus() End If End Sub
Private Sub txtencode_sunit_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtencode_sunit.KeyPress If e.KeyChar = Chr(13) Then txtencode_rumnum.Focus() End If End Sub
Private Sub txtreg_encode_sy_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtreg_encode_sy.KeyPress If e.KeyChar = Chr(13) Then txtencode_sunit.Focus() End If End Sub
Private Sub cmbencode_ssem_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbencode_ssem.KeyPress If e.KeyChar = Chr(13) Then txtreg_encode_sy.Focus() End If End Sub
Private Sub cmbencode_addsub_timeto_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbencode_addsub_timeto.KeyPress If e.KeyChar = Chr(13) Then cmbencode_Addsub_day.Focus() End If End Sub
Private Sub cmbencode_addsub_timefrom_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbencode_addsub_timefrom.KeyPress If e.KeyChar = Chr(13) Then cmbencode_addsub_timeto.Focus() End If End Sub
Private Sub cboxencode_sub_lab_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cboxencode_sub_lab.KeyPress If e.KeyChar = Chr(13) Then cmbencode_addsub_timefrom.Focus() End If End Sub
Private Sub txtencode_subpre_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtencode_subpre.KeyPress If e.KeyChar = Chr(13) Then cboxencode_sub_lab.Focus() End If End Sub
Private Sub txtencode_subname_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtencode_subname.KeyPress If e.KeyChar = Chr(13) Then txtencode_sdes.Focus() End If End Sub
Private Sub cmbencode_sub_yearlevel_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbencode_sub_yearlevel.KeyPress If e.KeyChar = Chr(13) Then cmbencode_ssem.Focus() End If
End Sub
Private Sub txtreg_search_sub_name_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtreg_search_sub_name.KeyPress If e.KeyChar = Chr(13) Then Call searching_ok() End If End Sub
End Class
Downpayment form
------------------------------------------------------------------------------------------------------------
Imports System.Data
Imports System.Data.SqlClient
Public Class downpayment
Dim conn As New SqlConnection("server=RYAN\sqlexpress;Initial Catalog=enrollment;Integrated Security=True") Dim ad As New SqlDataAdapter("Select * from tbl_stud_ass", conn) Dim ad2 As New SqlDataAdapter("Select * from tbl_balance", conn)
Dim dv As New DataView() Dim cm As CurrencyManager Dim intpos As Object Private Sub txtdown_amount_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtdown_amount.KeyPress If e.KeyChar = Chr(13) Then txtdown_rend.Focus() txtdown_amount.Text = Format(CType(txtdown_amount.Text, Decimal), "####0.00") Else End If End Sub
Private Sub txtdown_rend_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtdown_rend.KeyPress If e.KeyChar = Chr(13) Then btndown_print.Focus() txtdown_rend.Text = Format(CType(txtdown_rend.Text, Decimal), "####0.00")
txtdown_change.Text = txtdown_rend.Text - txtdown_amount.Text txtdown_change.Text = Format(CType(txtdown_change.Text, Decimal), "####0.00")
txtbal.Text = Val(cashier.txtcash_totalbal.Text) - Val(txtdown_amount.Text) txtbal.Text = Format(CType(txtbal.Text, Decimal), "####0.00") Else End If End Sub
Private Sub downpayment_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim dtemon As Date dtemon = Now txtdown_date.Text = Date.Today txtdown_id.Text = cashier.txtcash_id.Text txtdown_lname.Text = cashier.txtcash_lname.Text txtdown_fname.Text = cashier.txtcash_fname.Text txtdown_corz.Text = cashier.txtcash_course.Text txtdown_yer.Text = cashier.txtcash_year.Text txtdown_type.Text = dtemon.ToString("MMMM")
txtdown_amount.Text = "" txtdown_rend.Text = "" txtdown_change.Text = "" End Sub
Private Sub btndown_print_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndown_print.Click Dim ds1 As New DataSet() Dim cmd As New SqlCommand Dim msg As String Dim arr(3) As Object
ds1 = New DataSet() ad.Fill(ds1, "tbl_stud_ass") dv = New DataView(ds1.Tables("tbl_stud_ass")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "idnum,ptype,sem,sy" arr(0) = txtdown_id.Text arr(1) = cmbpay_type.Text arr(2) = cashier.lblcash_sem.Text arr(3) = cashier.lblcash_sy.Text intpos = dv.Find(arr)
If txtdown_amount.Text = "" Then MessageBox.Show("Incomplete data", "Search", MessageBoxButtons.OK, _ MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) Else If intpos >= 0 Then MsgBox("The data is already exist", MsgBoxStyle.Critical, "tbl_stud_ass") Else
With cmd .Connection = conn .CommandText = "INSERT INTO tbl_stud_ass(idnum,lname,fname,corz,yer,sem,sy,ptype,amount,date,month)" & _ "values(@idnum,@lname,@fname,@corz,@yer,@sem,@sy,@ptype,@amount,@date,@month)" End With
With cmd.Parameters .AddWithValue("@idnum", txtdown_id.Text) .AddWithValue("@Lname", txtdown_lname.Text) .AddWithValue("@Fname", txtdown_fname.Text) .AddWithValue("@Corz", txtdown_corz.Text) .AddWithValue("@Yer", txtdown_yer.Text) .AddWithValue("@Sem", cashier.lblcash_sem.Text) .AddWithValue("@Sy", cashier.lblcash_sy.Text) .AddWithValue("@ptype", cmbpay_type.Text) .AddWithValue("@Amount", txtdown_amount.Text) .AddWithValue("@date", txtdown_date.Text) .AddWithValue("@Month", txtdown_type.Text)
End With msg = MessageBox.Show("The data has been save.", "Saving...", MessageBoxButtons.OK) Select Case msg Case vbOK If cmbpay_type.Text = "Downpayment" Then cashier.txtcash_downpay.Text = txtdown_amount.Text Else save_bal() End If End Select
Me.Close() End If
conn.Open()
Try cmd.ExecuteNonQuery() Catch ex As Exception MessageBox.Show(ex.Message) End Try End If conn.Close() End Sub Private Sub save_bal() Dim ds1 As New DataSet() Dim cmd As New SqlCommand Dim arr(2) As Object
ds1 = New DataSet() ad2.Fill(ds1, "tbl_balance") dv = New DataView(ds1.Tables("tbl_balance")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "idnum,sem,sy" arr(0) = txtdown_id.Text arr(1) = cashier.lblcash_sem.Text arr(2) = cashier.lblcash_sy.Text intpos = dv.Find(arr)
If txtdown_amount.Text = "" Then MessageBox.Show("Incomplete data", "Search", MessageBoxButtons.OK, _ MessageBoxIcon.Information, MessageBoxDefaultButton.Button1) Else If intpos >= 0 Then Call update_bal() Else
With cmd .Connection = conn .CommandText = "INSERT INTO tbl_balance(idnum,bal,sem,sy)" & _ "values(@idnum,@bal,@sem,@sy)" End With
With cmd.Parameters .AddWithValue("@idnum", txtdown_id.Text) .AddWithValue("@bal", txtbal.Text) .AddWithValue("@Sem", cashier.lblcash_sem.Text) .AddWithValue("@Sy", cashier.lblcash_sy.Text)
End With cashier.txtcash_totalbal.Text = txtbal.Text MessageBox.Show("The data has been save.", "Saving...", MessageBoxButtons.OK)
Me.Close() End If
conn.Open()
Try cmd.ExecuteNonQuery() Catch ex As Exception MessageBox.Show(ex.Message) End Try End If conn.Close() End Sub Private Sub update_bal() Dim cmd As New SqlCommand
cmd.Connection = conn Try
cmd.CommandText = "UPDATE tbl_balance " & _ "SET bal=@bal,sem=@sem,sy=@sy WHERE idnum=@idnum" cmd.CommandType = CommandType.Text With cmd.Parameters .AddWithValue("@idnum", txtdown_id.Text) .AddWithValue("@bal", txtbal.Text) .AddWithValue("@Sem", cashier.lblcash_sem.Text) .AddWithValue("@Sy", cashier.lblcash_sy.Text) End With conn.Open() cmd.ExecuteNonQuery() conn.Close()
cmd.Parameters.Clear() '------------------------- Catch ex As Exception End Try End Sub
Private Sub txtdown_change_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtdown_change.TextChanged
End Sub
Private Sub chkboxpay_disc_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkboxpay_disc.CheckedChanged If chkboxpay_disc.Checked Then cmbpay_disc.Enabled = True Else cmbpay_disc.Enabled = False End If End Sub
Private Sub cmbpay_type_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbpay_type.SelectedIndexChanged If cmbpay_type.Text = "Downpayment" Then txtdown_amount.ReadOnly = False chkboxpay_disc.Enabled = False cmbpay_disc.Enabled = False grppay_trans.Enabled = True txtdown_amount.Focus() ElseIf cmbpay_type.Text = "Fullpayment" Then txtdown_amount.ReadOnly = True txtdown_amount.Text = cashier.txtcash_totalbal.Text chkboxpay_disc.Enabled = True cmbpay_disc.Enabled = False grppay_trans.Enabled = True txtdown_rend.Focus() Else txtdown_amount.ReadOnly = False chkboxpay_disc.Enabled = True cmbpay_disc.Enabled = False grppay_trans.Enabled = True txtdown_amount.Focus() End If End Sub
End Class
ID number serching form
------------------------------------------------------------------------------------------------------------
Imports System.Data
Imports System.Data.SqlClient
Public Class oldstudent Dim conn As New SqlConnection("server=RYAN\sqlexpress;Initial Catalog=enrollment;Integrated Security=True") Dim ad As New SqlDataAdapter("Select * from student_info", conn) Dim dv As New DataView() Dim cm As CurrencyManager Dim intpos As Object Private Sub btnoldstud_can_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnoldstud_can.Click cashier.grpcash_buttons.Enabled = True cashier.btncash_ref.Enabled = True Me.Close() End Sub
Private Sub btnoldstud_con_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnoldstud_con.Click
Call stud_idnum() cashier.txtkey.Focus() End Sub Private Sub stud_idnum() Dim datset1, datset As New DataSet Dim arr(1) As Object
If cmbold_sort.Text = "ID Number" Then If txtold_idname.Text = "" Then MessageBox.Show("Incomplete data") Else Try datset = New DataSet() datset1 = New DataSet() ad.Fill(datset, "Student_info") dv = New DataView(datset.Tables("Student_info")) cm = CType(Me.BindingContext(dv), CurrencyManager) dv.Sort = "Idnum"
intpos = dv.Find(txtold_idname.Text)
If intpos = -1 Then
If v
References: Books Norton, Peter, International Edition: “Introduction to Computers” Fifth Edition (2004): McGraw-Hill Companies Inc Mary land State, Department of Education Local School System Information Retrieval July 22, 2007, Nanacy S. Grasmick web site: http://nces.ed.gov/pubs2000/2002/200324.pdf Newsome, Bryan and Thearon Willis, (2006). Beginning Visual Basic 2005. Wiley Publiching , Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256.
You May Also Find These Documents Helpful
-
h Large amounts of data are stored. An individual record is required for each student.…
- 1126 Words
- 5 Pages
Better Essays -
The system shall enable the users to navigate and perform operations in an intuitive and easy manner. The user interface must allow the user to search for his details in a timely manner. Also, Administrators must access the system in a secure manner and the student information. However, they should have this capability during the business day but not affect the business operations of the institution.…
- 447 Words
- 2 Pages
Good Essays -
Automated systems are totally affected by the rapidly changing technology. Neither a fad nor simply a tool, technology has become a fundamental force shaping the future. This affects the traditional ways in which people access and use information.…
- 1300 Words
- 6 Pages
Powerful Essays -
The computerized Enrollments System we are preparing is for a school named International Christian Academy. According to our research the said academy is using a computerized enrollments system as well but often encounters problems.…
- 1836 Words
- 9 Pages
Powerful Essays -
Specifically the developed system aims to provide an quick access n submitting grades and convenience to the students; the main thoughts for its adaptability were the following:…
- 342 Words
- 3 Pages
Satisfactory Essays -
Nowadays computer serves as an important role in our society, most especially in school premise. Most school uses computer to help their students deal in our modern technology. But as the population of the students continue to grow, many school face difficulties in handling their enrolment in a manual process. And one of the solutions in this problem is to make their manual enrollment into a computerized system.…
- 275 Words
- 2 Pages
Satisfactory Essays -
This project looks at an Enrollment System for a college -- which will provide the needed and storing information in a faster, more convenient way by storing file of the student enrollees in a computer system that will lessen the effort of faculty staff in storing files of each student every now and then. An enrollment system also serves as information especially for the irregular students, freshmen, transferee, and professor in able to get access in course, subject, professor, and student enrollees, but is designed for use by staff and other authorized user in the college office to enable them to easily produce information required by the different people in college.…
- 4345 Words
- 18 Pages
Powerful Essays -
Enrollment is the process of entering and verifying data of student to register on a particular school. Different interrelated processes build up enrollment procedures called Enrollment System. Enrollment Systems (ES) are used particularly in recording and retrieving student’s information. Tracking student’s information is also one feature of ES, in which the school can trace the standing of a student. Enrollment System is a good example of a computer generated process.…
- 1031 Words
- 5 Pages
Powerful Essays -
This project, the College Computerized Enrollment System helps the students of Saint Francis College in storing student enrollees file or information faster and in more convenient way in a computer system .It will also lessen the effort of faculty staff in storing files of each students every now and then. An enrollment system also serves as an information especially for the irregular, transferee and professor so that they can easily access the course, subjects, professor and student enrollees. This project is designed for the student enrollees and the admin.…
- 1293 Words
- 6 Pages
Powerful Essays -
This project looks at an Enrollment System for a college -- which will provide the needed and storing information in a faster, more convenient way by storing file of the student enrollees in a computer system that will lessen the effort of faculty staff in storing files of each student every now and then. An enrollment system also serves as information especially for the irregular students, freshmen, transferee, and professor in able to get access in course, subject, professor, and student enrollees, but is designed for use by staff and other authorized user in the college office to enable them to easily produce information required by the different people in college.…
- 272 Words
- 2 Pages
Satisfactory Essays -
It will be easily for the authorized personnel to access it. This system describes the information and components of computerized system and several strategies to develop the whole system. When we talk about the student’s record of the School, what do we usually think? Well, student’s record is one of the most important files or documents that need to give way of attention because it is one of the hidden files of the school that was the record of the student needs to secure for their privacy.…
- 1250 Words
- 5 Pages
Good Essays -
Computerize Enrollment System is the must have system in a school. It is a convenient way of storing and retrieving information of a student that provides easier way of enrolling. Masville National High School is one of the public schools that used a manual method for enrollment system. Computerized enrollment system is now used by the universities, colleges and other establishments. The group decided to create an enrollment system to lessen the workload of the registrar and staffs and provide accurate information of students when necessary. Computerized enrollment system is very useful for both the firm and students because it rather give an effective and efficient approach for both the students and schools. It is important in such a way that it benefit not only to the students but the administration as a whole.…
- 2468 Words
- 10 Pages
Good Essays -
Enrollment System is a good example of a computer generated process. The computerized enrollment system will provide the needed and storing information in a faster, more convenient way by storing file of the student enrollees in a computer system that will lessen the workload of faculty staff and provides accurate information needed of the school. As a result, it will benefit not only the student but the administration as a whole.…
- 3221 Words
- 13 Pages
Powerful Essays -
Enrollment is the process of entering and verifying data of student to register on a particular school. Enrollment System is a good example of a computer generated process. This can lessen the workload and provides accurate information needed of the school. As a result, it will benefit not only the student but also the administration as a whole.…
- 1804 Words
- 8 Pages
Better Essays -
Enrollment is the process of entering and verifying data of student to register on a particular school. Different interrelated processes build up enrollment procedures. Enrollment System is used particularly in recording and retrieving student’s information, collect usage records, collect payments and adjust students' balances. Tracking student’s information is also one feature of the system, in which the school can trace the standing of a…
- 507 Words
- 3 Pages
Good Essays