Mathias Source Code
Mathias Source Code
InteropServices
Imports System.Math
Imports System.Data.OleDb
Imports System.Management
Imports System.IO
Imports System.Configuration
Imports System.Threading
Imports System.Windows.Threading
Imports System.IO.Ports
Imports System.ComponentModel
Imports System.Net
Imports System.Threading.Tasks
Imports System.Net.Http
Imports System.Windows
Imports System.Timers
Imports System.Text
Imports Twilio
Imports Twilio.Rest.Api.V2010.Account
Imports Twilio.Types
Imports System.Data.Odbc
Dim a As String
Dim h As Integer
Dim c As Integer
Delegate Sub SetTextCallback(ByVal [text] As String) 'Added to prevent threading errors during
receiveing of data
myconnection.Close()
Login.Show()
Else
e.Cancel = True
End If
End Sub
myconnection.ConnectionString = provider
generate_student_id()
generate_staff_id()
ActiveControl = txtid
txtid.Focus()
RadioButton2.Checked = True
Timer1.Enabled = True
Button2.Dispose()
insertimagelogo()
retrieveSignout()
retrieveAbsentOut()
retrieveTime()
retrieveDpt()
Tmr.Interval = 1000
Tmr.Enabled = False
SetTarget()
activiteSms()
RetrieveToCombo1()
retrieveMessages()
staffRetrieveMessages()
retrieveSubject()
retrieveTitle()
retrieveTerm()
Me.BindGrid()
Me.BindGrid1()
refreshModerm()
If ComboBox2.Items.Count = 0 Then
End If
'Button22.Enabled = False
initilizeLogoutTime()
RetrieveChkSms()
RetrieveStaffChkSms()
DataGridView4.Hide()
dgvStaff.Hide()
Tmr1.Interval = 1000
Tmr1.Enabled = False
SetTarget1()
checkRelog()
retrieveExcludedates()
checkWeekends()
filldb()
TestSwitch()
SmsSwitch()
activateDashboard()
mainGraph()
'refreshDashboard()
dailyGraphs()
Else
dummyChartsData()
End If
rpt.Refresh()
rpt.SetParameterValue(0, Date.Now.ToString("MM /dd/ yy"))
'gtimeLeft = 180
'Timer4.Start()
update_linked_table()
check_ODBC_status()
Try
pluggedInWatcher.Start()
pluggedOutWatcher.Start()
Catch ex As Exception
MsgBox(ex.Message)
End Try
getYearAndTerm()
SetLabel30Text("Connected")
Else
SetLabel30Text("Disconnected")
End If
updateGlobalAndActive()
dbRegistryType.SelectedIndex = 0
dbRecordType.SelectedIndex = 0
dbStudentFilter.SelectedIndex = 0
ddRegistryTypeFilter.SelectedIndex = 1
ddAttendanceType.SelectedIndex = 0
RadioButton11.Checked = True
rdFilterByMnth.Checked = True
BunifuButton18_Click_2(Nothing, Nothing)
updateScanLogReset()
End Sub
' Get
' Return cp
'End Property
myconnection.Open()
While dr.Read
Cstate = dr("timeset")
End While
myconnection.Close()
Panel25.Enabled = Cstate
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Timer1.Tick
End Sub
'sql1 = "SELECT ID, Firstname, lastname, Gender,Guardiannumber1,Address, City, Parish, Age, Class,
Department FROM students"
'adapter1.Fill(dt1)
'DataGridView1.DataSource = dt1
End Sub
#Region "Constants"
#End Region
#Region "Structures"
End Structure
End Structure
#End Region
' DEV_BROADCAST_HDR)
' End If
' End If
' End If
' Try
' MyBase.WndProc(m)
' MsgBox(ex)
'End Sub
#End Region
#Region "Get Drive Letter (FUNCTION)"
Dim i As Integer
For i = 0 To 31
cnt += 1
End If
If intTemp = 0 Then
Exit For
End If
Next
Dim ii As Integer
For ii = 0 To 31
End If
iChar = (iChar > 1)
If iChar = 0 Then
Exit For
End If
Next
Return chResult
End Function
#End Region
myconnection.Open()
End Sub
TextBox22.Clear()
End Sub
TextBox3.Clear()
End Sub
Private Sub txtfirstname_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles txtsurname.TextChanged, txtmiddlename.TextChanged, txtfirstname.TextChanged,
txtaddress.TextChanged, TextBox7.TextChanged, TextBox6.TextChanged, TextBox4.TextChanged,
TextBox3.TextChanged, TextBox22.TextChanged, TextBox2.TextChanged, TextBox19.TextChanged,
TextBox18.TextChanged
txtfirstname.Select(txtfirstname.Text.Length, 0)
End If
TextBox3.Select(TextBox3.Text.Length, 0)
End If
' TextBox22.Select(TextBox22.Text.Length, 0)
'End If
txtaddress.Select(txtaddress.Text.Length, 0)
End If
txtsurname.Select(txtsurname.Text.Length, 0)
End If
txtmiddlename.Select(txtmiddlename.Text.Length, 0)
End If
TextBox2.Select(TextBox2.Text.Length, 0)
End If
TextBox4.Select(TextBox4.Text.Length, 0)
End If
TextBox6.Select(TextBox6.Text.Length, 0)
End If
TextBox7.Select(TextBox7.Text.Length, 0)
End If
TextBox18.Select(TextBox18.Text.Length, 0)
End If
TextBox19.Select(TextBox19.Text.Length, 0)
End If
End Sub
If String.IsNullOrEmpty(myconnection.ConnectionString) Then
myconnection.ConnectionString = provider
Else
Else
myconnection.Open()
End If
End If
eDS.Clear()
eDA.Fill(eDS)
eDR = eDS.Tables(0).Rows(0)
txtname.Text = eDR("Firstname")
'txtsurname.Text = eDR("lastname").ToString()
TextBox25.Text = eDR("id")
a = eDR("count")
userfound = True
insertimage()
End If
dDS.Clear()
dDA.Fill(dDS)
dDR = dDS.Tables(0).Rows(0)
Button2.Enabled = True
Button2.Text = "&Time Out"
idd = txtid.Text
insertstd() 'found
Else
End If
Else
dDS.Clear()
dDA.Fill(dDS)
dDR = dDS.Tables(0).Rows(0)
Else
Button2.Enabled = True
idd = txtid.Text
insertstd()
If RadioButton7.Checked = True Then
Else
End If
makeThemAbsent()
End If
End If
dDR = Nothing
dDS.Dispose()
dDA.Dispose()
cleartimer()
Else
'cleartimer()
'Button2.Enabled = False
'myconnection.Close()
check_info_staff()
End If
eDR = Nothing
eDS.Dispose()
eDA.Dispose()
myconnection.Close()
updateScanLog()
End Sub
If String.IsNullOrEmpty(myconnection.ConnectionString) Then
myconnection.ConnectionString = provider
Else
Else
myconnection.Open()
End If
End If
While dr.Read
userfound = True
End While
strSQ = "UPDATE studentsrecords SET flag='0' WHERE date_in = #" & Format(Now, "MM/d/yyyy")
& "# and time_in IS NULL and time_out IS NULL and Flag IS Null"
comm.ExecuteNonQuery()
myconnection.Close()
Else
myconnection.Close()
End If
End Sub
dDR = dDS.Tables(0).NewRow()
txttimein.Text = ftime
insertd(txtid.Text, datey, txtname.Text, txtsurname.Text, ftime)
Label23.Text = "Signed-In"
strSQL = "UPDATE studentsrecords SET time_in=#" & txttimein.Text & "#, flag='" & flag & "' WHERE
tag_id='" & txtid.Text & "' AND date_in=#" & datey & "#"
Try
While dr.Read
SigninMsg = dr("timeset")
End While
sValue = SigninMsg
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
While dr.Read
number = dr("Guardiannumber1")
number2 = dr("Guardiannumber2")
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
numbers.Clear()
numbers.Add(number)
'numbers.Add(number2)
b_in = 1
'c += 1
Label3.Text = c
'Label4.Text = c
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
'sendSmS(SigninMsg)
numbers.Clear()
numbers.Add(number)
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
'sendSmS(SigninMsg)
End If
End If
number = 0
End If
Else
txttimeout.Text = ftime
Label23.Text = "Signed-Out"
strSQL = "UPDATE studentsrecords SET time_out=#" & txttimeout.Text & "# WHERE tag_id='" &
txtid.Text & "' AND date_in=#" & datey & "# and time_in=#" & txttimein.Text & "#"
Try
SigninMsg1 = dr("timeset")
End While
sValue = SigninMsg1
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Try
While dr.Read
number = dr("Guardiannumber1")
number2 = dr("Guardiannumber2")
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
numbers.Clear()
numbers.Add(number)
b_in = 1
c += 1
Label3.Text = c
'Label4.Text = c
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
'sendSmS(SigninMsg1)
numbers.Clear()
numbers.Add(number)
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
'sendSmS(SigninMsg1)
End If
End If
number = 0
End If
End If
dCmd.ExecuteNonQuery()
dCmd.Dispose()
dDR = Nothing
dDS.Dispose()
dDA.Dispose()
myconnection.Close()
Button2.Enabled = False
End Sub
#End Region
' Else
' myconnection.Open()
' End If
'Else
'End If
'myconnection.Open()
eDS.Clear()
eDA.Fill(eDS)
txtname.Text = eDR("Firstname")
txtsurname.Text = eDR("lastname")
TextBox25.Text = eDR("staff_id")
a = eDR("count")
userfound = True
insertstaffimage()
End If
dDS.Clear()
dDA.Fill(dDS)
dDR = dDS.Tables(0).Rows(0)
Button2.Enabled = True
idd = txtid.Text
insertstaff() 'found
End If
Else
dDS.Clear()
dDA.Fill(dDS)
dDR = dDS.Tables(0).Rows(0)
Else
Button2.Enabled = True
idd = txtid.Text
insertstaff()
Else
End If
makeStaffAbsent()
End If
End If
dDR = Nothing
dDS.Dispose()
dDA.Dispose()
cleartimer()
Else
cleartimer()
Button2.Enabled = False
End If
eDR = Nothing
eDS.Dispose()
eDA.Dispose()
myconnection.Close()
updateScanLog()
End Sub
Else
myconnection.Open()
End If
Else
myconnection.ConnectionString = provider
End If
While dr.Read
userfound = True
End While
strSQ = "UPDATE studentsrecords SET flag='0' WHERE date_in = #" & Format(Now, "MM/d/yyyy")
& "# and time_in IS NULL and time_out IS NULL and Flag IS Null"
comm.ExecuteNonQuery()
myconnection.Close()
Else
myconnection.Close()
End If
End Sub
Else
myconnection.Open()
End If
Else
myconnection.ConnectionString = provider
End If
dDR = dDS.Tables(0).NewRow()
txttimein.Text = ftime
Label23.Text = "Signed-In"
strSQL = "UPDATE studentsrecords SET time_in=#" & txttimein.Text & "#, flag='" & flag & "' WHERE
tag_id='" & txtid.Text & "' AND date_in=#" & datey & "#"
Try
While dr.Read
SigninMsg = dr("timeset")
End While
sValue = SigninMsg
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Try
While dr.Read
number = dr("contactnumber")
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
numbers.Add(number)
'numbers.Add(number2)
b_in = 1
'c += 1
Label3.Text = c
'Label4.Text = c
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
'sendSmS(SigninMsg)
numbers.Clear()
numbers.Add(number)
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
'sendSmS(SigninMsg)
End If
End If
number = 0
End If
Else
txttimeout.Text = ftime
Label23.Text = "staff_signout"
strSQL = "UPDATE studentsrecords SET time_out=#" & txttimeout.Text & "# WHERE tag_id='" &
txtid.Text & "' AND date_in=#" & datey & "# and time_in=#" & txttimein.Text & "#"
Try
While dr.Read
SigninMsg1 = dr("timeset")
End While
sValue = SigninMsg1
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Try
While dr.Read
number = dr("contactnumber")
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
numbers.Clear()
numbers.Add(number)
b_in = 1
c += 1
Label3.Text = c
'Label4.Text = c
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
'sendSmS(SigninMsg1)
numbers.Add(number)
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
'sendSmS(SigninMsg1)
End If
End If
number = 0
End If
End If
dCmd.ExecuteNonQuery()
dCmd.Dispose()
dDR = Nothing
dDS.Dispose()
dDA.Dispose()
myconnection.Close()
Button2.Enabled = False
End Sub
#End Region
Try
While dr.Read
number = dr("Guardiannumber1")
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
Try
If SerialPort1.IsOpen() = True Then
Thread.Sleep(1000)
Thread.Sleep(1000)
Thread.Sleep(1000)
Thread.Sleep(2000)
Else
'Example()
End If
number = 0
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
cnt = 0
For b As Integer = 0 To 0
' Using HttpClient to send SMS
Try
response.EnsureSuccessStatusCode()
Catch ex As HttpRequestException
cnt += 1
If cnt = 3 Then
cnt = 0
b=1
Else
b -= 1
End If
End Try
End Using
Next
'Console.WriteLine("inBuffer " & num & " number on " & sValue)
numbers.Remove(num)
Thread.Sleep(2000)
Next
dailyGraphs()
Else
numbers.Remove(num)
Thread.Sleep(2000)
Next
aTimer.Interval = 10000
aTimer.Enabled = True
End If
Else
End If
End Sub
End Sub
c=0
End Sub
selectfailedsmsData()
aTimer.Stop()
End If
End Sub
cnt1 += 1
If cnt1 = 2 Then
bTimer.Stop()
Else
selectfailedsmsData()
End If
End Sub
Try
Return True
End Using
End Using
Catch
Return False
End Try
End Function
Await Task.CompletedTask
Try
finished = True
End Using
End Using
Catch ex As Exception
finished = False
End Try
Thread.Sleep(20000)
End While
Return finished
End Function
numbers.Clear()
For a As Integer = 1 To 4
numbers.Add(a)
Next
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
End Sub
For a As Integer = 1 To 4
Next
Next
End Sub
Public Sub sendtobuffer(ByVal num As String, ByVal sms As String, ByVal id As Integer)
numbers.Add(num)
sValue = sms
'NumWorkers = NumWorkers + 1
'ReDim Workers(NumWorkers)
'Workers(NumWorkers).WorkerReportsProgress = True
'Workers(NumWorkers).WorkerSupportsCancellation = True
'Workers(NumWorkers).RunWorkerAsync()
'deleteSmsForFailed(id)
End Sub
Try
myconnection.Open()
While dr1.Read
numbers.Add(dr1.GetString(1))
sValue = dr1.GetString(2)
deleteSmsForFailed(dr1.GetInt32(0))
End While
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
myconnection.Close()
cmd1.Dispose()
Catch ex As Exception
myconnection.Close()
End Try
End Sub
If Me.Label5.InvokeRequired Then
Else
Me.Label5.Text = [text]
sstd = [text]
End If
End Sub
If Me.Label10.InvokeRequired Then
Else
Me.Label10.Text = [text]
b_out = [text]
End If
End Sub
cnn.Open()
End If
Dim da As New OleDb.OleDbDataAdapter("SELECT * FROM students WHERE count = " & a, cnn)
da.Fill(dt)
Me.TextBoxPictureFilePath.Text = dt.Rows(0).Item("PicturePath")
Try
BunifuPictureBox3.Image = System.Drawing.Bitmap.FromFile(TextBoxPictureFilePath.Text)
cnn.Close()
Catch ex As Exception
picMessage(ex.Message)
cnn.Close()
myconnection.Close()
End Try
End Sub
cnn.Open()
End If
Dim da As New OleDb.OleDbDataAdapter("SELECT * FROM staff WHERE count = " & a, cnn)
da.Fill(dt)
Me.TextBoxPictureFilePath.Text = dt.Rows(0).Item("PicturePath")
Try
BunifuPictureBox3.Image = System.Drawing.Bitmap.FromFile(TextBoxPictureFilePath.Text)
cnn.Close()
Catch ex As Exception
picMessage(ex.Message)
cnn.Close()
myconnection.Close()
End Try
End Sub
' myconnection.Open()
' strSQL = "UPDATE studentsrecords SET time_in=#" & txttimein.Text & "#, flag='" & flag & "'
WHERE id='" & txtid.Text & "' AND date_in=#" & Format(Now, "MM/d/yyyy") & "# "
' Else
' strSQL = "UPDATE studentsrecords SET time_out=#" & txttimeout.Text & "# WHERE id='" &
txtid.Text & "' AND date_in=#" & Format(Now, "MM/d/yyyy") & "# and time_in=#" & txttimein.Text & "#"
' End If
' dCmd.Dispose()
' dDS.Dispose()
' dDA.Dispose()
' myconnection.Close()
'End Sub
' check_info()
'End Sub
txtid.Enabled = False
Button29.Enabled = False
End If
End Sub
myconnection.Open()
While dr.Read
cnt += 1
End If
Next
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Else
myconnection.Open()
While dr.Read
userfound = True
' = dr("fulname").ToString
End While
strSQ = "UPDATE studentsrecords SET date_in=#" & Format(Now, "MM/d/yyyy") & "# WHERE
date_in IS NULL and time_in IS NULL and time_out IS NULL and Flag IS Null and tag_id IS NOT NULL"
'adapter1.Fill(dt1)
'DataGridView1.DataSource = dt1
command.ExecuteNonQuery()
command2.ExecuteNonQuery()
commUpdate.ExecuteNonQuery()
myconnection.Close()
Else
strSQ = "UPDATE studentsrecords SET date_in=#" & Format(Now, "MM/d/yyyy") & "# WHERE
date_in IS NULL and time_in IS NULL and time_out IS NULL and Flag IS Null and tag_id IS NOT NULL"
'strSQStaff = "UPDATE studentsrecords SET date_in=#" & Format(Now, "MM/d/yyyy") & "#
WHERE date_in IS NULL and time_in IS NULL and time_out IS NULL and Flag IS Null and tag_id IS NOT
NULL"
command.ExecuteNonQuery()
com.ExecuteNonQuery()
comm.ExecuteNonQuery()
myconnection.Close()
End If
End If
End If
End Sub
'Me.Close()
timeLeft -= 1
Else
Timer2.[Stop]()
txtid.Clear()
txtid.ReadOnly = False
txtname.Clear()
txtsurname.Clear()
txtname.Clear()
TextBox25.Clear()
txttimein.Clear()
txttimeout.Clear()
TextBoxPictureFilePath.Clear()
txtid.Focus()
'Label12.Text = ""
'Label16.Text = ""
Label23.Text = "..."
End If
End Sub
timeLeft = 3
Timer2.Start()
End Sub
cnn.Open()
End If
Dim da As New OleDb.OleDbDataAdapter("SELECT * FROM controlsignout WHERE flag='" & pic &
"'", cnn)
da.Fill(dt)
picview = dt.Rows(0).Item("timeset")
Try
PictureBox1.Image = System.Drawing.Bitmap.FromFile(picview)
cnn.Close()
Catch ex As Exception
cnn.Close()
End Try
End Sub
If (BunifuDatePicker2.Value.DayOfWeek = DayOfWeek.Saturday) Or
(BunifuDatePicker2.Value.DayOfWeek = DayOfWeek.Sunday) Then
'
'Now just add the right amount of days to make it
Monday...........................................................................................................................................................
........................................................................................................................................................................
........................................................................................................................................................................
.......................................................................................00.02222222222222222222222222222222222222
22222222222222222222222222222222222222222222221111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111
111111111.5
'
Case DayOfWeek.Saturday
BunifuDatePicker2.Value = BunifuDatePicker2.Value.AddDays(2)
Case DayOfWeek.Sunday
BunifuDatePicker2.Value = BunifuDatePicker2.Value.AddDays(1)
End Select
MsgBox("You can not select a Saturday or Sunday. The following Monday, " &
End Sub
If (BunifuDatePicker3.Value.DayOfWeek = DayOfWeek.Saturday) Or
(BunifuDatePicker3.Value.DayOfWeek = DayOfWeek.Sunday) Then
'
'
Case DayOfWeek.Saturday
BunifuDatePicker3.Value = BunifuDatePicker3.Value.AddDays(2)
Case DayOfWeek.Sunday
BunifuDatePicker3.Value = BunifuDatePicker3.Value.AddDays(1)
End Select
MsgBox("You can not select a Saturday or Sunday. The following Monday, " &
End If
End Sub
str = BunifuDatePicker2.Value
FirstDate = strArr(0)
str1 = BunifuDatePicker3.Value
secondDate = strArr1(0)
'ElseIf rdIdRpt.Checked = False And rdDpt.Checked = False And rdClass.Checked = False And
RadioButton2.Checked = False Then
Try
adapter.Fill(dt)
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
Else
End If
If dt.Rows.Count = 0 Then
Else
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
End If
Else
End If
adapter.Fill(dt)
Dim dsd As New DataSet
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
Else
End If
Else
adapter.Fill(dt)
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
End If
adapter.Fill(dt)
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
Else
End If
ElseIf rdIdRpt.Checked = True Then
adapter.Fill(dt)
If dt.Rows.Count = 0 Then
Else
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
End If
Else
End If
adapter.Fill(dt)
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
Else
End If
Else
adapter.Fill(dt)
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
End If
adapter.Fill(dt)
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
Else
End If
adapter.Fill(dt)
If dt.Rows.Count = 0 Then
Else
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
End If
Else
End If
adapter.Fill(dt)
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
Else
End If
Else
adapter.Fill(dt)
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
End If
sql = "SELECT * FROM notsignout WHERE notsignout.date_in between #" & FirstDate &
"# AND #" & secondDate & "# AND status='" & status & "' AND userType='" &
ddAttendanceType.SelectedItem & "' AND class='" & cls & "' order by date_in DESC"
adapter.Fill(dt)
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
Else
End If
sql = "SELECT * FROM notsignout WHERE notsignout.date_in between #" & FirstDate &
"# AND #" & secondDate & "# AND status='" & status & "' AND userType='" &
ddAttendanceType.SelectedItem & "' AND id LIKE & TextBox21.Text & " ' order by date_in DESC"
adapter.Fill(dt)
If dt.Rows.Count = 0 Then
MsgBox("Student ID not found. Please try again.")
Else
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
End If
Else
End If
sql = "SELECT * FROM notsignout WHERE notsignout.date_in between #" & FirstDate &
"# AND #" & secondDate & "# AND status='" & status & "' AND userType='" &
ddAttendanceType.SelectedItem & "' AND department='" & drpt & "' order by date_in DESC"
adapter.Fill(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
Else
End If
Else
sql = " SELECT * FROM notsignout WHERE notsignout.date_in between #" & FirstDate & "#
AND #" & secondDate & "# AND status='" & status & "' AND userType='" &
ddAttendanceType.SelectedItem & "' order by date_in DESC"
adapter.Fill(dt)
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
End If
adapter.Fill(dt)
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
Else
End If
adapter.Fill(dt)
If dt.Rows.Count = 0 Then
Else
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
End If
Else
End If
adapter.Fill(dt)
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
Else
End If
Else
sql = " SELECT * FROM studentsrecords WHERE studentsrecords.date_in between #" &
FirstDate & "# AND #" & secondDate & "# AND status='" & status & "' AND userType='" &
ddAttendanceType.SelectedItem & "' AND flag IS NOT NULL order by date_in DESC"
adapter.Fill(dt)
Dim dsd As New DataSet
rpt.SetDataSource(dt)
rpt.SetParameterValue("startDate", BunifuDatePicker2.Text)
rpt.SetParameterValue("endDate", BunifuDatePicker3.Text)
rpt.SetParameterValue("option", rptoption)
rpt.SetParameterValue(3, BunifuTextBox11.Text)
rpt.SetParameterValue(4, BunifuTextBox10.Text)
CrystalReportViewer1.ReportSource = rpt
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
End If
End Sub
ComboBox1.Items.Clear()
BunifuDropdown1.Items.Clear()
ComboBox8.Items.Clear()
ComboBox12.Items.Clear()
Try
myconnection.Open()
While dr.Read
ComboBox1.Items.Add(dr.GetString(0))
BunifuDropdown1.Items.Add(dr.GetString(0))
ComboBox8.Items.Add(dr.GetString(0))
ComboBox12.Items.Add(dr.GetString(0))
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
'BunifuDropdown1.Sorted = True
End Sub
rptoption = rdEarly.Text
End Sub
Private Sub rdLate_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles rdLate.CheckedChanged
rptoption = rdLate.Text
End Sub
rptoption = rdAll.Text
rptoption = "All"
' updateAbsent()
End Sub
drpt = ComboBox9.SelectedItem
End Sub
myconnection.Open()
Try
cmd.ExecuteNonQuery()
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End Sub
rptoption = rdAbsent.Text
eDS.Clear()
eDA.Fill(dtt)
'rpt.SetDataSource(dtt)
'CrystalReportViewer1.ReportSource = rpt
End Sub
cls = ComboBox8.SelectedItem
End Sub
Else
sqlupdate = "UPDATE controls SET end_time=@end_time WHERE time_flag='" & time & "'"
Try
myconnection.Open()
If MessageBox.Show("Are you sure you want to update the School's End Time?",
"Change", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK
Then
myconnection.Close()
retrieveTime()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Else
End If
End If
End If
dialog.Dispose()
myconnection.Close()
Else
MsgBox("The End Time must be later than the current Absent Time and earlier than the current
Auto Sign-Out Time.")
End If
End Sub
Try
myconnection.Open()
Dim cmd As OleDbCommand = New OleDbCommand("SELECT signout_time FROM controls
WHERE time_flag='" & nam & "'", myconnection)
While dr.Read
scheduledTime = dr("signout_time")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
End Sub
Try
myconnection.Open()
While dr.Read
scheduledTime1 = dr("absent_time")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
End Sub
ComboBox7.Items.Clear()
ComboBox6.Items.Clear()
ComboBox13.Items.Clear()
ddStaffSms.Items.Clear()
ComboBox9.Items.Clear()
cbLevelStaff.Items.Clear()
Try
myconnection.Open()
Dim cmd1 As OleDbCommand = New OleDbCommand("SELECT DptCombo FROM controlsdpt",
myconnection)
While dr1.Read
ComboBox7.Items.Add(dr1.GetString(0))
ComboBox6.Items.Add(dr1.GetString(0))
ComboBox13.Items.Add(dr1.GetString(0))
ddStaffSms.Items.Add(dr1.GetString(0))
ComboBox9.Items.Add(dr1.GetString(0))
cbLevelStaff.Items.Add(dr1.GetString(0))
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
End Sub
cbSubjectsPreview.Items.Clear()
Try
myconnection.Open()
While dr1.Read
cbSubjectsPreview.Items.Add(dr1.GetString(0))
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
End Sub
cbTitlePreview.Items.Clear()
cbStaffType.Items.Clear()
dbTitleStaff.Items.Clear()
dbTitleStaff2.Items.Clear()
Try
myconnection.Open()
While dr1.Read
cbTitlePreview.Items.Add(dr1.GetString(0))
cbStaffType.Items.Add(dr1.GetString(0))
dbTitleStaff.Items.Add(dr1.GetString(0))
dbTitleStaff2.Items.Add(dr1.GetString(0))
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
End Sub
dpTermPreview.Items.Clear()
myconnection.Open()
While dr1.Read
stDT = dr1.GetDateTime(1).ToString("MM/dd/yyyy")
endDT = dr1.GetDateTime(2).ToString("MM/dd/yyyy")
dpTermPreview.Items.Add("Term " & dr1.GetInt32(0).ToString + " (" + stDT + " - " + endDT + ")")
End If
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
End Sub
Public Sub retrieveTime()
Try
myconnection.Open()
While dr.Read
'ComboBox2.Items.Add(dr.GetString(0))
DateTimePicker4.Value = dr("start_time")
BunifuTextBox11.Text = dr("start_time")
DateTimePicker5.Value = dr("end_time")
BunifuTextBox12.Text = dr("end_time")
DateTimePicker6.Value = dr("late_time")
BunifuTextBox10.Text = dr("late_time")
TextBox5.Text = ss
'DateTimePicker11.Value = dr("term_start")
StartTerm = dr("term_start")
'DateTimePicker12.Value = dr("term_end")
EndTerm = dr("term_end")
DateTimePicker7.Value = dr("user_logintime")
BunifuTextBox13.Text = dr("user_logintime")
hr = x.ToString("HH:mm:ss tt").Substring(0, 2)
mn = x.ToString("HH:mm:ss tt").Substring(3, 2)
se = x.ToString("HH:mm:ss tt").Substring(6, 2)
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
End Sub
' allow various time formats and attempt to parse the scheduled time: (with or without leading
zeroes, allow am/pm or 24 hour format)
Dim allowed() As String = {"h:mm", "hh:mm", "h:mm tt", "hh:mm tt", "H:mm", "HH:mm"}
' we're already past the target time, schedule it for tomorrow at the same time:
targetTime = targetTime.AddDays(1)
End If
Tmr.Start()
End If
End Sub
Tmr.Stop()
signout()
SetTarget()
Else
End If
End Sub
myconnection.Open()
Dim cmd As OleDbCommand = New OleDbCommand(" select date_in, time_out, flag from
[studentsrecords] where date_in=#" & Format(Now, "MM/d/yyyy") & "# AND time_out IS NULL AND flag
IS NOT NULL", myconnection)
While dr.Read
userfound = True
End While
If userfound = True Then
strSQ = "UPDATE studentsrecords SET time_out='" & DateTime.Now.ToString("hh:mm tt") & "',
flag='" & flag & "' WHERE date_in=#" & Format(Now, "MM/d/yyyy") & "# and time_out IS NULL and
time_in IS NOT NULL and Flag IS NOT Null "
Try
command.ExecuteNonQuery()
comm.ExecuteNonQuery()
comlast.ExecuteNonQuery()
myconnection.Close()
Button29.Enabled = False
txtid.Enabled = False
Catch ex As Exception
myconnection.Close()
End Try
' sqlrelog = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
' Try
' myconnection.Open()
' cmd.ExecuteNonQuery()
' MsgBox(ex.Message)
' Finally
' myconnection.Close()
'Else
' myconnection.Close()
'End If
Else
End If
End Sub
cls = "class"
ComboBox8.Enabled = True
ComboBox9.Enabled = False
TextBox21.Enabled = False
Else
ComboBox8.Enabled = False
ComboBox8.Text = ""
ComboBox9.Enabled = True
TextBox21.Enabled = True
End If
End Sub
drpt = "department"
If rdDpt.Checked = True Then
ComboBox9.Enabled = True
ComboBox8.Enabled = False
TextBox21.Enabled = False
Else
ComboBox9.Enabled = False
ComboBox9.Text = ""
ComboBox8.Enabled = True
TextBox21.Enabled = True
End If
End Sub
rptoption = rdAbsent.Text
' updateAbsent()
End Sub
' allow various time formats and attempt to parse the scheduled time: (with or without leading
zeroes, allow am/pm or 24 hour format)
Dim allowed() As String = {"h:mm", "hh:mm", "h:mm tt", "hh:mm tt", "H:mm", "HH:mm"}
' we're already past the target time, schedule it for tomorrow at the same time:
targetTime1 = targetTime1.AddDays(1)
End If
Tmr1.Start()
End If
End Sub
Tmr1.Stop()
sendAbsentsms()
sendStaffAbsentsms()
SetTarget1()
Else
End If
End Sub
myconnection.Open()
Dim a As Integer = 0
numbers.Clear()
While dr.Read
numbers.Add(dr("Guardiannumber1"))
sValue = TextBox9.Text
userfound = True
'Dosms(dr("Guardiannumber1"), TextBox9.Text)
'Console.WriteLine(dr("Guardiannumber1"))
End If
End While
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
myconnection.Close()
Else
End If
End If
End Sub
myconnection.Open()
Dim a As Integer = 0
numbers.Clear()
While dr.Read
numbers.Add(dr("contactnumber"))
sValue = tbAbsentMessage.Text
userfound = True
'Dosms(dr("Guardiannumber1"), tbAbsentMessage.Text)
'Console.WriteLine(dr("Guardiannumber1"))
End If
End While
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
myconnection.Close()
Else
End If
End If
End Sub
Function MessageTimeOut(ByVal sMessage As String, ByVal sTitle As String, ByVal iSeconds As Integer)
As Boolean
Dim Shell
Shell = CreateObject("WScript.Shell")
MessageTimeOut = True
End Function
Sub Example()
chk = MessageTimeOut("SMS dongle not connected", "Dongle Status", 1) 'if chk returned FALSE that
means the function was not executed successfully
End Sub
Sub Example1()
End Sub
Sub picMessage(ByVal mes)
chk = MessageTimeOut(mes, "System Notification", 1) 'if chk returned FALSE that means the
function was not executed successfully
End Sub
chk = MessageTimeOut(mess, "System Absent Notification", 1) 'if chk returned FALSE that means the
function was not executed successfully
End Sub
chk = MessageTimeOut(del, title, 1) 'if chk returned FALSE that means the function was not executed
successfully
End Sub
'ElseIf rdId.Checked = False And rdName.Checked = False And rdGaurdian.Checked = False Then
'Else
' Try
' myconnection.Open()
' TextBox12.Text = dr("address") + " " + dr("address2") + " " + dr("city") + " " + dr("parish")
' Else
' End If
' viewImage(tempid)
' myconnection.Close()
' Else
' myconnection.Close()
' End If
' MsgBox(ex.Message)
' myconnection.Close()
' Try
' myconnection.Open()
' Else
' End If
' viewImage(tempid)
' myconnection.Close()
' Else
' myconnection.Close()
' End If
' myconnection.Close()
' Try
' myconnection.Open()
' TextBox12.Text = dr("address") + " " + dr("address2") + " " + dr("city") + " " + dr("parish")
' Else
' End If
' viewImage(tempid)
' myconnection.Close()
' Else
' myconnection.Close()
' End If
' MsgBox(ex.Message)
' myconnection.Close()
' End If
'End If
End Sub
Private Sub viewImage(ByVal image As String)
cnn.Open()
End If
Dim da As New OleDb.OleDbDataAdapter("SELECT * FROM students WHERE tag_id='" & image & "'",
cnn)
da.Fill(dt)
picview = dt.Rows(0).Item("PicturePath")
cnn.Close()
BunifuPictureBox8.Image = System.Drawing.Bitmap.FromFile(picview)
End Sub
cnn.Open()
End If
Dim da As New OleDb.OleDbDataAdapter("SELECT * FROM staff WHERE tag_id='" & image & "'",
cnn)
da.Fill(dt)
picview = dt.Rows(0).Item("PicturePath")
cnn.Close()
BunifuPictureBox8.Image = System.Drawing.Bitmap.FromFile(picview)
End Sub
txtaddress.Clear()
txtage.Clear()
txtfirstname.Clear()
txtmiddlename.Clear()
txtsurname.Clear()
txtparentsname.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox8.Clear()
TextBox6.Clear()
TextBox7.Clear()
'TextBox20.Clear()
'TextBox23.Clear()
ComboBox1.Text = ""
ComboBox7.Text = ""
BunifuToggleSwitch1.Value = False
DateTimePicker1.Value = Now
RetrieveToCombo1()
BunifuPictureBox6.Image = Nothing
rdmale.Checked = False
rdfemale.Checked = False
End Sub
txtStaffID.Clear()
txtContactStaff.Clear()
txtFirstNameStaff.Clear()
txtLastNameStaff.Clear()
txtAddressStaff.Clear()
txtTagIdStaff.Clear()
txtPostOfficeStaff.Clear()
txtCityStaff.Clear()
txtParishStaff.Clear()
cbStaffType.Text = ""
cbLevelStaff.Text = ""
dbTitleStaff.Text = ""
txtAgeStaff.Clear()
dtpDobStaff.Value = Now
BunifuToggleSwitch3.Value = True
rbMaleStaff.Checked = False
rbFemaleStaff.Checked = False
End Sub
dbRegistryType.SelectedIndex = 0
dbRecordType.SelectedIndex = 0
dbStudentFilter.SelectedIndex = 0
dbStaffFilter.Text = ""
txtsearch.Text = ""
BunifuDataGridView3.DataSource = Nothing
Label25.Text = "0"
BunifuPictureBox8.Image = Nothing
End Sub
Private Sub rdmale_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles rdmale.CheckedChanged
male = "Male"
End If
End Sub
male = "Female"
End If
End Sub
If rdFemaleUpdate.Checked Then
male2 = "Female"
End If
End Sub
If rdMaleUpdate.Checked Then
male2 = "Male"
End If
End Sub
Private Sub rbFemaleStaff2_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles rbFemaleStaff2.CheckedChanged
ganderstaff = "Female"
End If
End Sub
If rbMaleStaff2.Checked Then
ganderstaff = "Male"
End If
End Sub
End Sub
q = ComboBox1.SelectedItem
End Sub
p = ComboBox7.SelectedItem
End Sub
'UpdateClearfields()
'rdId.Checked = False
'rdName.Checked = False
'rdGaurdian.Checked = False
clearfieldsrecordlookup()
End Sub
openFileDialog1.InitialDirectory = "c:\"
openFileDialog1.Filter = Nothing
openFileDialog1.FilterIndex = 2
openFileDialog1.RestoreDirectory = True
openFileDialog1.FileName = ""
If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
Try
myStream = openFileDialog1.OpenFile()
BunifuTextBox1.Text = ""
img = openFileDialog1.FileName
BunifuPictureBox6.Image = System.Drawing.Bitmap.FromFile(img)
BunifuTextBox1.Text = openFileDialog1.FileName
End If
Catch Ex As Exception
MessageBox.Show("Cannot read file from disk. Original error: " & Ex.Message)
Finally
myStream.Close()
End If
End Try
End If
End Sub
TextBox10.Clear()
TextBox11.Clear()
TextBox12.Clear()
TextBox13.Clear()
TextBox14.Clear()
txtsearch.Clear()
TextBox15.Clear()
TextBox16.Clear()
TextBox17.Clear()
TextBox24.Clear()
'TextBox20.Clear()
TextBox23.Clear()
BunifuPictureBox8.Image = Nothing
End Sub
End Sub
Else
retrieveDptUpdate()
RetrieveToComboUpdate1()
cleartxt()
Else
End If
BunifuPages1.SetPage("Editpage2")
retrieveDptUpdate()
RetrieveToComboUpdate1()
cleartxt()
Else
End If
End If
End If
End Sub
Else
cmd.Parameters.AddWithValue("@ClassCombo", TextBox18.Text)
Try
If MessageBox.Show("Are you sure you want to add this new Class to the database?",
"WARNING", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) =
Windows.Forms.DialogResult.OK Then
myconnection.Open()
End If
myconnection.Close()
RetrieveToCombo1()
TextBox18.Text = ""
dailyGraphs()
End If
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
RetrieveToCombo1()
End Try
End If
End Sub
Else
cmd.Parameters.AddWithValue("@DptCombo", TextBox19.Text)
Try
myconnection.Open()
If MessageBox.Show("Are you sure you want to add this new Level to the database?",
"WARNING", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) =
Windows.Forms.DialogResult.OK Then
End If
myconnection.Close()
retrieveDpt()
dailyGraphs()
TextBox19.Text = ""
End If
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
retrieveDpt()
End Try
End If
End Sub
Else
Dim sql As String = "DELETE * FROM controls WHERE ClassCombo='" & TextBox18.Text & "'"
If userfound = 1 Then
Try
myconnection.Open()
MsgBox("Successfully Deleted!")
TextBox18.Text = ""
BunifuDropdown1.Text = ""
End If
End If
myconnection.Close()
RetrieveToCombo1()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
RetrieveToCombo1()
End Try
End If
End If
End If
dialog.Dispose()
End If
End Sub
Else
Dim sql As String = "DELETE * FROM controlsdpt WHERE DptCombo='" & TextBox19.Text & "'"
Else
Dim userfound As Integer = LoginFunc(dialog.BunifuTextBox1.Text,
dialog.BunifuTextBox2.Text)
If userfound = 1 Then
Try
myconnection.Open()
MsgBox("Successfully Deleted!")
TextBox19.Text = ""
ComboBox6.Text = ""
End If
End If
myconnection.Close()
retrieveDpt()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
retrieveDpt()
End Try
Else
MsgBox("The Username or Password is incorrenct.")
End If
End If
End If
dialog.Dispose()
End If
End Sub
TextBox19.Text = ComboBox6.SelectedItem
End Sub
TextBox18.Text = BunifuDropdown1.SelectedItem
End Sub
TextBox21.Enabled = True
ComboBox8.Enabled = False
ComboBox9.Enabled = False
Else
TextBox21.Enabled = False
TextBox21.Text = ""
ComboBox8.Enabled = False
ComboBox9.Enabled = False
End If
End Sub
rdtoall.Checked = False
rdToSelected.Checked = True
TextBox38.Clear()
TextBox37.Clear()
'TextBox32.Clear()
End Sub
num += 1
Else
End If
Next
gridCheck = True
Else
gridCheck = False
End If
If rdToSelected.Checked = True And Not TextBox37.Text.Trim = "" And gridCheck = True Then
numbers.Clear()
btnsend.Enabled = False
numbers.Add(oRow.Cells("Guardiannumber1").Value)
'ss(oRow.Cells(0).ColumnIndex) = TextBox37.Text
sValue = TextBox37.Text
End If
Next
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
AddHandler Workers(NumWorkers).DoWork, AddressOf WorkerDoWork
Workers(NumWorkers).RunWorkerAsync()
Else
End If
btnsend.Enabled = False
'Dosms(oRow.Cells("Guardiannumber1").Value, TextBox37.Text)
Else
End If
Else
End If
btnsend.Enabled = True
clearSmsCon()
myconnection.Open()
eDS.Clear()
eDA.Fill(eDS)
btnsend.Enabled = False
eDR = eDS.Tables(0).Rows(i)
numbers.Add(eDR("Guardiannumber1"))
sValue = TextBox37.Text
Next
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
btnsend.Enabled = True
clearSmsCon()
Else
End If
myconnection.Open()
eDS.Clear()
eDA.Fill(eDS)
btnsend.Enabled = False
eDR = eDS.Tables(0).Rows(i)
Dosms(eDR("Guardiannumber1"), TextBox37.Text)
Next
btnsend.Enabled = True
clearSmsCon()
Else
End If
End If
Else
End Sub
Try
'Timer1.Enabled = True
'Timer1.Interval = 1000
'Timer1.Start()
'Thread.Sleep(1000)
' 'SerialPort1.Write(txtTX.Text)
' 'End If
' SerialPort1.Write("AT+CMGS=" & Chr(34) & number & Chr(34) & vbCr)
' 'Timer1.Start()
' 'Thread.Sleep(1000)
' Delay(5)
'End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Next
test(datain)
End Sub
If Me.TextBox26.InvokeRequired Then
Else
Me.TextBox26.Text = [text]
End If
End Sub
SetText(rcvdata)
End Sub
Private Sub ReceivedText(ByVal [text] As String)
If TextBox26.InvokeRequired Then
Else
rxd = text
MsgBox("This is a test")
End If
End If
End Sub
Else
Else
End If
End If
End Sub
' 'Timer1.Stop()
'End Sub
'From http://pastebin.com/2bSWZ16p
Now.AddSeconds(OneSec)
dblWaitTil = Now.AddSeconds(OneSec).AddSeconds(dblSecs)
Loop
End Sub
Next
Return sb.ToString.ToUpper
End Function
End While
Return sHex
End Function
myconnection.Open()
While dr.Read
TextBox39.Text = dr("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Try
myconnection.Open()
TextBox40.Text = dr1("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Try
myconnection.Open()
While dr2.Read
TextBox9.Text = dr2("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
End Sub
Try
myconnection.Open()
While dr.Read
tbStaffSignin.Text = dr("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Try
myconnection.Open()
While dr1.Read
tbStaffSignOut.Text = dr1("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Try
myconnection.Open()
While dr2.Read
tbAbsentMessage.Text = dr2("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
End Sub
Else
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & time & "'"
Try
myconnection.Open()
If MessageBox.Show("Are you sure you want to update the Sign-In message?", "Change",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
If (cmd.ExecuteNonQuery() > 0) Then
myconnection.Close()
retrieveMessages()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End If
End Sub
Else
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & time & "'"
Dim cmd As New OleDbCommand(sqlupdate, myconnection)
Try
myconnection.Open()
If MessageBox.Show("Are you sure you want to update the Sign-Out message?", "Change",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
myconnection.Close()
retrieveMessages()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End If
End Sub
Label66.Text = 0
cls1 = ComboBox12.SelectedItem
sql = "SELECT Id, Firstname, lastname, Gender, Guardiannumber1, Department, class FROM
students WHERE class='" & cls1 & "'"
adapter.Fill(dt)
DataGridView4.DataSource = dt
End If
End Sub
Label66.Text = 0
drpt1 = ComboBox13.SelectedItem
sql = "SELECT Id, Firstname, lastname, Gender, Guardiannumber1, Department, class FROM
students WHERE department='" & drpt1 & "'"
adapter.Fill(dt)
DataGridView4.DataSource = dt
End If
End Sub
Label66.Text = 0
eDS.Clear()
eDA.Fill(dtt)
DataGridView4.DataSource = dtt
DataGridView4.Show()
ComboBox13.Enabled = True
ComboBox12.Enabled = False
TextBox38.Enabled = False
Else
DataGridView4.Hide()
ComboBox13.Enabled = False
ComboBox13.Text = ""
ComboBox12.Enabled = True
TextBox38.Enabled = True
End If
End Sub
Label66.Text = 0
eDS.Clear()
eDA.Fill(dtt)
DataGridView4.DataSource = dtt
DataGridView4.Show()
ComboBox12.Enabled = True
ComboBox13.Enabled = False
TextBox38.Enabled = False
Else
DataGridView4.Hide()
ComboBox12.Enabled = False
ComboBox12.Text = ""
ComboBox13.Enabled = True
TextBox38.Enabled = True
End If
End Sub
Label66.Text = 0
eDS.Clear()
eDA.Fill(dtt)
DataGridView4.DataSource = dtt
End Sub
Try
TextBox38.Text = DataGridView4.Rows(e.RowIndex).Cells(1).Value.ToString
End If
'TextBox32.Text = DataGridView4.Rows(e.RowIndex).Cells(2).Value.ToString
Catch ex As Exception
'MsgBox(ex.Message)
End Try
End Sub
#Region "header 1 for gridview4"
cmd.CommandType = CommandType.Text
sda.Fill(dt)
DataGridView4.DataSource = dt
End Using
End Using
End Using
End Using
headerCheckBox.BackColor = Color.White
DataGridView4.Controls.Add(headerCheckBox)
checkBoxColumn.HeaderText = ""
checkBoxColumn.Width = 30
checkBoxColumn.Name = "checkBoxColumn"
DataGridView4.Columns.Insert(0, checkBoxColumn)
End Sub
DataGridView4.EndEdit()
'Loop and check and uncheck all row CheckBoxes based on Header Cell CheckBox.
checkBox.Value = headerCheckBox.Checked
Next
End Sub
isChecked = False
Exit For
End If
Next
headerCheckBox.Checked = isChecked
End If
End Sub
Sub DataGridView4_CurrentCellDirtyStateChanged(
If DataGridView4.IsCurrentCellDirty Then
DataGridView4.CommitEdit(DataGridViewDataErrorContexts.Commit)
End If
End Sub
Console.WriteLine("we involked")
count1 += 1
Else
End If
Next
Label66.Text = count1
End If
End Sub
#End Region
If SerialPort1.IsOpen Then
SerialPort1.Close()
If SerialPort1.IsOpen Then
Label13.Text = "CONNECTED"
Else
Label13.Text = "DISCONNECTED"
ActiveControl = txtid
End If
Else
Try
With SerialPort1
.PortName = "COM4"
.BaudRate = 9600
.Parity = IO.Ports.Parity.None
.DataBits = 8
.StopBits = IO.Ports.StopBits.One
.Handshake = IO.Ports.Handshake.None
.RtsEnable = True
.ReceivedBytesThreshold = 1
.NewLine = vbCr
.ReadTimeout = 1000
.Open()
End With
If SerialPort1.IsOpen Then
Label13.Text = "Connected"
ActiveControl = txtid
' Txtid.Focus()
Else
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub
Else
SerialPort1.Parity = IO.Ports.Parity.None
SerialPort1.StopBits = IO.Ports.StopBits.One
SerialPort1.ReadTimeout = 2000
SerialPort1.WriteTimeout = 2000
Try
SerialPort1.Open()
Catch ex As Exception
MsgBox("Please check that the right COM Port is selected and make sure that the modem is
powered and connected.")
End Try
If SerialPort1.IsOpen Then
Label13.Text = "Connected"
'Label90.Text = "Connected"
Button16.Enabled = False
ComboBox2.Enabled = False
Label13.ForeColor = Color.Green
'Label90.ForeColor = Color.Green
Else
'Label13.Text = "Disconnected"
'Label90.Text = "Disconnected"
End If
End If
End Sub
Try
SerialPort1.Close()
If SerialPort1.IsOpen Then
'Label13.Text = "Connected"
'Label90.Text = "Connected"
Else
Label13.Text = "Disconnected"
'Label90.Text = "Disconnected"
Button16.Enabled = True
ComboBox2.Enabled = True
ComboBox2.Text = ""
Label13.ForeColor = Color.Red
'Label90.ForeColor = Color.Red
End If
Catch ex As Exception
End Try
End Sub
Label66.Text = 0
eDS.Clear()
eDA.Fill(dtt)
DataGridView4.DataSource = dtt
DataGridView4.Show()
Else
DataGridView4.Hide()
End If
End Sub
chkDisableAuto.Checked = False
ChkEnableAll.Checked = False
chkSignin.Checked = True
chkSignout.Checked = False
CheckBox1.Checked = False
chkSignin.Enabled = True
chkSignout.Enabled = True
CheckBox1.Enabled = True
Button20.Enabled = True
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Else
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Dim cmd As New OleDbCommand(sqlupdate, myconnection)
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End If
End Sub
chkSignin.Checked = False
chkSignout.Checked = False
CheckBox1.Checked = False
ChkEnableAll.Checked = False
chkEnableAuto.Checked = False
chkSignin.Enabled = False
chkSignout.Enabled = False
CheckBox1.Enabled = False
Button20.Enabled = False
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Else
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End If
End Sub
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Else
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
chkSignin.Checked = True
Exit Sub
End If
End If
End Sub
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Else
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
chkSignout.Checked = True
Exit Sub
End If
End If
End Sub
Try
myconnection.Open()
While dr.Read
rdcheck = dr("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
'disable code
Try
myconnection.Open()
Dim cmd1 As OleDbCommand = New OleDbCommand("SELECT timeset FROM controlsignout
WHERE flag='" & nam1 & "'", myconnection)
While dr1.Read
rdcheck1 = dr1("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
'signin code
Try
myconnection.Open()
While dr2.Read
rdcheck2 = dr2("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Try
myconnection.Open()
While dr3.Read
rdcheck3 = dr3("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Try
myconnection.Open()
While dr4.Read
rdcheck4 = dr4("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Dim rdcheck5 As String = ""
Try
myconnection.Open()
While dr5.Read
rdcheck5 = dr5("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
chkEnableAuto.Checked = True
chkSignin.Checked = True
chkSignout.Checked = True
Else
chkEnableAuto.Checked = False
End If
chkDisableAuto.Checked = True
Else
chkDisableAuto.Checked = False
End If
chkSignin.Checked = True
Else
chkSignin.Checked = False
End If
chkSignout.Checked = True
Else
chkSignout.Checked = False
End If
CheckBox1.Checked = True
Else
CheckBox1.Checked = False
End If
If rdcheck5 = "True" Then
ChkEnableAll.Checked = True
Else
ChkEnableAll.Checked = False
End If
End Sub
Try
myconnection.Open()
While dr.Read
rdcheck = dr("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
'disable code
Try
myconnection.Open()
While dr1.Read
rdcheck1 = dr1("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
'signin code
Dim rdcheck2 As String = ""
Try
myconnection.Open()
While dr2.Read
rdcheck2 = dr2("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Try
myconnection.Open()
While dr3.Read
rdcheck3 = dr3("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Try
myconnection.Open()
While dr4.Read
rdcheck4 = dr4("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Try
myconnection.Open()
While dr5.Read
rdcheck5 = dr5("timeset")
End While
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
rbStaffEnableAuto.Checked = True
rbStaffSignin.Checked = True
rbStaffSignout.Checked = True
Else
rbStaffEnableAuto.Checked = False
End If
rbStaffDisableAuto.Checked = True
Else
rbStaffDisableAuto.Checked = False
End If
rbStaffSignin.Checked = True
Else
rbStaffSignin.Checked = False
End If
rbStaffSignout.Checked = True
Else
rbStaffSignout.Checked = False
End If
rbStaffAbsentSms.Checked = True
Else
rbStaffAbsentSms.Checked = False
End If
rbStaffEnableAll.Checked = True
Else
rbStaffEnableAll.Checked = False
End If
End Sub
' Else
' End If
'End Sub
'Private Sub BunifuToggleSwitch2_CheckedChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BunifuToggleSwitch1.CheckedChanged
' Else
' End If
'End Sub
pusms = "1"
Else
pusms = "o"
End If
End Sub
staffsms2 = "1"
Else
staffsms2 = "o"
End If
End Sub
psms = "1"
Else
psms = "o"
End If
End Sub
Else
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & time & "'"
Try
myconnection.Open()
If MessageBox.Show("Are you sure you want to update the Absent message?", "Change",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
myconnection.Close()
retrieveMessages()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End If
End Sub
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Dim cmd As New OleDbCommand(sqlupdate, myconnection)
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Button20.Enabled = False
Else
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Button20.Enabled = True
CheckBox1.Checked = True
Exit Sub
End If
End If
End Sub
sendAbsentsms()
End Sub
Else
If userfound = 1 Then
Try
myconnection.Open()
If MessageBox.Show("Are you sure you want to update the Auto Sign-Out Time?",
"Change", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK
Then
myconnection.Close()
retrieveSignout()
SetTarget()
retrieveTime()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Else
End If
End If
End If
dialog.Dispose()
myconnection.Close()
Else
MsgBox("The Auto Sign-Out Time must be later than the current End Time and earlier than the
current Daily Reset Time.")
End If
End Sub
Else
Dim userfound As Integer = LoginFunc(dialog.BunifuTextBox1.Text,
dialog.BunifuTextBox2.Text)
If userfound = 1 Then
Try
myconnection.Open()
If MessageBox.Show("Are you sure you want to update the School's Absent Time?",
"Change", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK
Then
myconnection.Close()
retrieveAbsentOut()
SetTarget1()
retrieveTime()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
'Else
'End If
Else
End If
End If
End If
dialog.Dispose()
myconnection.Close()
Else
MsgBox("The Absent Time must be later than the current Late Time and earlier than the current
End Time.")
End If
End Sub
rptoption = rdNotSigned.Text
End Sub
chkDisableAuto.Checked = False
chkEnableAuto.Checked = False
chkSignin.Checked = True
chkSignout.Checked = True
CheckBox1.Checked = True
chkSignin.Enabled = False
chkSignout.Enabled = False
CheckBox1.Enabled = False
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Else
' CODE INSERT
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End If
End Sub
sendAbsentsms()
myconnection.Close()
End If
End Sub
'Me.Close()
Label66.Text = 0
eDS.Clear()
eDA.Fill(dtt)
DataGridView4.DataSource = dtt
DataGridView4.Show()
TextBox38.Enabled = True
ComboBox12.Enabled = False
ComboBox13.Enabled = False
Else
DataGridView4.Hide()
TextBox38.Enabled = False
TextBox38.Text = ""
ComboBox12.Enabled = True
ComboBox13.Enabled = True
End If
End Sub
myconnection.ConnectionString = provider
' SQL Statement so our User can search for either FirstName or LastName
sqlsearch = "SELECT Id, Firstname, lastname, Gender, Guardiannumber1, Department, class FROM
students WHERE id LIKE '%" & TextBox38.Text & "%'" & ""
' Once again we execute the SQL statements against our DataBase
adapter.Fill(dt)
DataGridView4.DataSource = dt
End Sub
' Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button21.Click
' Me.Close()
'Me.Close()
Else
If userfound = 1 Then
BunifuPages1.SetPage("relog")
BunifuTextBox7.Focus()
Else
End If
End If
End If
dialog.Dispose()
myconnection.Close()
End Sub
'Me.Close()
' Me.Close()
'Me.Close()
'Me.Close()
'ComboBox4.Items.Clear()
' ComboBox4.Items.Add(ports(i))
'Next
End Sub
Try
"root\CIMV2",
modems = modems & (queryObj("AttachedTo") & " - " & queryObj("Description") & "***")
End If
Next
MessageBox.Show("An error occurred while querying for WMI data: " & err.Message)
Return ""
End Try
Return modems
End Function
Else
If userfound = 1 Then
' CODE INSERT
Try
myconnection.Open()
If MessageBox.Show("Are you sure you want to update the School's Daily Reset Time?",
"Change", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK
Then
myconnection.Close()
retrieveTime()
initilizeLogoutTime()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
End Try
Else
End If
End If
End If
dialog.Dispose()
myconnection.Close()
Else
MsgBox("The Daily Reset Time must be later than the current Auto Sign-Out Time and also the
current School Start Time.")
End If
End Sub
If MessageBox.Show("Are you sure you want to leave this page now? Changes will not be saved if
not updated", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) =
Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Dashboard")
For b As Integer = 0 To 3
YearStart.Items.Add(Date.Now.Year - b)
YearEnd.Items.Add(Date.Now.Year - b)
Next
YearStart.Sorted = True
YearEnd.Sorted = True
Me.YearEnd.SelectedIndex = 3
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Dashboard")
For b As Integer = 0 To 3
YearStart.Items.Add(Date.Now.Year - b)
YearEnd.Items.Add(Date.Now.Year - b)
Next
YearStart.Sorted = True
YearEnd.Sorted = True
Me.YearEnd.SelectedIndex = 3
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Dashboard")
For b As Integer = 0 To 3
YearStart.Items.Add(Date.Now.Year - b)
YearEnd.Items.Add(Date.Now.Year - b)
Next
YearStart.Sorted = True
YearEnd.Sorted = True
Me.YearEnd.SelectedIndex = 3
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Dashboard")
For b As Integer = 0 To 3
YearStart.Items.Add(Date.Now.Year - b)
YearEnd.Items.Add(Date.Now.Year - b)
Next
YearStart.Sorted = True
YearEnd.Sorted = True
Me.YearEnd.SelectedIndex = 3
End If
Else
BunifuPages1.SetPage("Dashboard")
For b As Integer = 0 To 3
YearStart.Items.Add(Date.Now.Year - b)
YearEnd.Items.Add(Date.Now.Year - b)
Next
YearStart.Sorted = True
YearEnd.Sorted = True
Me.YearEnd.SelectedIndex = 3
End If
End Sub
If MessageBox.Show("Are you sure you want to leave this page now? Changes will not be saved if
not updated", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) =
Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Student")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Student")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Student")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Student")
End If
Else
BunifuPages1.SetPage("Student")
End If
End Sub
If MessageBox.Show("Are you sure you want to leave this page now? Changes will not be saved if
not updated", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) =
Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("AddStudent")
End If
' If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
' BunifuPages1.SetPage("AddStudent")
' End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("AddStudent")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("AddStudent")
End If
Else
BunifuPages1.SetPage("AddStudent")
End If
End Sub
If MessageBox.Show("Are you sure you want to leave this page now? Changes will not be saved if
not updated", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) =
Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Reports")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Reports")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Reports")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Reports")
End If
Else
BunifuPages1.SetPage("Reports")
End If
End Sub
If MessageBox.Show("Are you sure you want to leave this page now? Changes will not be saved if
not updated", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) =
Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Sms")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Sms")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Sms")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Sms")
End If
Else
BunifuPages1.SetPage("Sms")
End If
End Sub
If MessageBox.Show("Are you sure you want to leave this page now? Changes will not be saved if
not updated", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) =
Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Donglesettings")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Donglesettings")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Donglesettings")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Donglesettings")
End If
Else
BunifuPages1.SetPage("Donglesettings")
End If
End Sub
If MessageBox.Show("Are you sure you want to leave this page now? Changes will not be saved if
not updated", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) =
Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Timesettings")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Timesettings")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Timesettings")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Timesettings")
End If
Else
BunifuPages1.SetPage("Timesettings")
End If
End Sub
If MessageBox.Show("Are you sure you want to leave this page now? Changes will not be saved if
not updated", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) =
Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Department")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Department")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Department")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("Department")
End If
Else
BunifuPages1.SetPage("Department")
End If
End Sub
BunifuPages1.SetPage("studentrecords")
End Sub
BunifuPages1.SetPage("Donglesettings")
End Sub
BunifuPages1.SetPage("Donglesettings")
End Sub
' MsgBox("Please fill in all required fields marked with ' * '")
' Else
' From the Forms Text fields into the Databases columns.
' sqlinsert = "INSERT INTO students(tag_id, id, firstname, lastname, middlename, gender,
Guardiannumber1,Guardiannumber2, address, address2, city, parish, birthday, age, class,
department,ReceiveSms,PicturePath )" &
' This assigns the values for our columns in the DataBase.
' To ensure the correct values are written to the correct column
' You have To open the connection, execute the commands And
' Try
' myconnection.Open()
' If MessageBox.Show("Are you sure the information has been entered correctly?", "Save",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
' myconnection.Close()
' Example1()
' clearfields()
' generate_student_id()
' dailyGraphs()
' update_linked_table()
' RefreshDGV()
' End If
' End If
' MsgBox(ex.Message)
' myconnection.Close()
' Finally
' myconnection.Close()
' End If
'End Sub
BunifuPages1.SetPage("records")
End Sub
BunifuPages1.SetPage("AddStudent")
End Sub
Else
'cmd.ExecuteNonQuery()
' BunifuPages1.SetPage("records")
If String.IsNullOrEmpty(myconnection.ConnectionString) Then
myconnection.ConnectionString = provider
Else
Else
myconnection.Open()
End If
End If
myconnection.Close()
' BunifuPages1.SetPage("records")
End If
Else
myconnection.Close()
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
' This are subs in Module1, to clear all the TextBoxes on the form
' and refresh the DataGridView on the MainFsorm to show our new records.
ClearTextBox(Me)
RefreshDGV()
End If
End Sub
BunifuPages1.SetPage("records")
UpdateClearfields()
Else
End If
End Sub
BunifuTextBox52.Clear()
BunifuTextBox51.Clear()
BunifuTextBox18.Clear()
BunifuTextBox50.Clear()
BunifuTextBox49.Clear()
BunifuTextBox48.Clear()
BunifuTextBox47.Clear()
BunifuTextBox46.Clear()
BunifuTextBox45.Clear()
BunifuTextBox44.Clear()
BunifuTextBox43.Clear()
BunifuTextBox54.Clear()
Label25.Text = 0
txtsearch.Clear()
BunifuDropdown10.Text = ""
BunifuDropdown11.Text = ""
BunifuToggleSwitch2.Value = False
DateTimePicker1.Value = Now
BunifuPictureBox15.Image = Nothing
rdFemaleUpdate.Checked = False
rdMaleUpdate.Checked = False
'BunifuRadioButton1.Checked = True
'retrieveDptUpdate()
'RetrieveToComboUpdate1()
End Sub
Public Sub UpdateClearfieldsNew()
txtStaffID2.Clear()
txtFirstNameStaff2.Clear()
txtLastNameStaff2.Clear()
txtContactStaff2.Clear()
txtAddressStaff2.Clear()
txtAgeStaff2.Clear()
dbLevelStaff.Text = ""
imgboxreplace = ""
Label25.Text = 0
txtsearch.Clear()
twSmsStaff.Value = False
dtpDobStaff2.Value = Now
pbStaffPhoto2.Image = Nothing
rbFemaleStaff2.Checked = False
rbMaleStaff2.Checked = False
End Sub
clearfields()
End Sub
Private Sub CheckBox3_CheckedChanged(sender As Object, e As
Bunifu.UI.WinForms.BunifuToggleSwitch.CheckedChangedEventArgs)
End Sub
BunifuPages1.SetPage("student")
'BunifuTextBox55.Text = ""
End Sub
check_info()
End Sub
Me.Close()
End Sub
num += 0
Else
num += 1
End If
Next
If num = 0 Then
ListBox2.Items.Add(DateTimePicker10.Value.ToShortDateString)
End If
End Sub
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End If
End Sub
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End If
End Sub
End Sub
Me.Close()
End Sub
Else
If userfound = 1 Then
Try
myconnection.Open()
If MessageBox.Show("Are you sure you want to delete the attendance data for the selected
date?", "DELETE", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) =
Windows.Forms.DialogResult.OK Then
Dcommand1.ExecuteNonQuery()
myconnection.Close()
filldb()
End If
Else
myconnection.Close()
End If
dailyGraphs()
Catch ex As Exception
myconnection.Close()
End Try
Else
End If
End If
End If
dialog.Dispose()
End Sub
check_info_relog()
End Sub
BunifuPages1.SetPage("student")
End Sub
Private Sub rdSmsapi_CheckedChanged(sender As Object, e As EventArgs)
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End If
End Sub
Private Sub rdGSM_CheckedChanged(sender As Object, e As EventArgs)
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End If
End Sub
Private Sub Button5_Click_1(sender As Object, e As EventArgs)
'BunifuPages1.SetPage("TabPage2")
End Sub
''bar 1 late
'sql1 = "SELECT TOP 6 COUNT(*) as mpn FROM studentsrecords INNER JOIN controls ON
studentsrecords.time_in >= controls.late_time WHERE YEAR(date_in) GROUP BY MONTH(date_in),
YEAR(date_in) ORDER BY MONTH(date_in), YEAR(date_in)"
'adapter1.Fill(dt1)
'data1.Add(dt1.Rows(0).Item(0).ToString)
'BunifuBarChart1.Data = data1
'data1.Add(dt1.Rows(1).Item(0).ToString)
'BunifuBarChart1.Data = data1
'data1.Add(dt1.Rows(2).Item(0).ToString)
'BunifuBarChart1.Data = data1
'data1.Add(dt1.Rows(3).Item(0).ToString)
'BunifuBarChart1.Data = data1
'data1.Add(dt1.Rows(4).Item(0).ToString)
'BunifuBarChart1.Data = data1
'data1.Add(dt1.Rows(5).Item(0).ToString)
'BunifuBarChart1.Data = data1
''bar 2 early
'sql2 = "SELECT TOP 6 COUNT(*) as mpn FROM studentsrecords INNER JOIN controls ON
studentsrecords.time_in <= controls.late_time WHERE YEAR(date_in) GROUP BY MONTH(date_in),
YEAR(date_in) ORDER BY MONTH(date_in), YEAR(date_in)"
'adapter2.Fill(dt2)
'data2.Add(dt2.Rows(0).Item(0).ToString)
'BunifuBarChart1.Data = data2
'data2.Add(dt2.Rows(1).Item(0).ToString)
'BunifuBarChart1.Data = data2
'data2.Add(dt2.Rows(2).Item(0).ToString)
'BunifuBarChart1.Data = data2
'data2.Add(dt2.Rows(3).Item(0).ToString)
'BunifuBarChart1.Data = data2
'data2.Add(dt2.Rows(4).Item(0).ToString)
'BunifuBarChart1.Data = data2
'data2.Add(dt2.Rows(5).Item(0).ToString)
'BunifuBarChart1.Data = data2
'''bar 3 absent
'sql3 = "SELECT COUNT(*) as numb FROM studentsrecords WHERE flag ='0' and YEAR(date_in)
GROUP BY MONTH(date_in), YEAR(date_in) ORDER BY MONTH(date_in), YEAR(date_in)"
'adapter3.Fill(dt3)
'data3.Add(dt3.Rows(0).Item(0).ToString)
'BunifuBarChart1.Data = data3
'data3.Add(dt3.Rows(1).Item(0).ToString)
'BunifuBarChart1.Data = data3
'data3.Add(dt3.Rows(2).Item(0).ToString)
'BunifuBarChart1.Data = data3
'data3.Add(dt3.Rows(3).Item(0).ToString)
'BunifuBarChart1.Data = data3
'data3.Add(dt3.Rows(4).Item(0).ToString)
'BunifuBarChart1.Data = data3
'data3.Add(dt3.Rows(5).Item(0).ToString)
'BunifuBarChart1.Data = data3
'adapterYear.Fill(dtYear)
'adapterYear2.Fill(dtYear2)
'BunifuLineChart1.Data = data1
'BunifuLineChart2.Data = data2
'BunifuLineChart3.Data = data3
'BunifuChartCanvas2.Update()
End Sub
'bar 1 late
adapter1.Fill(dt1)
data1.Add(dt1.Rows(0).Item(0).ToString)
BunifuBarChart1.Data = data1
data1.Add(dt1.Rows(1).Item(0).ToString)
BunifuBarChart1.Data = data1
'bar 2 early
adapter2.Fill(dt2)
data2.Add(dt2.Rows(0).Item(0).ToString())
BunifuBarChart2.Data = data2
data2.Add(dt2.Rows(1).Item(0).ToString())
BunifuBarChart2.Data = data2
'bar 3 absent
sql3 = "SELECT COUNT(*) as numb FROM studentsrecords WHERE flag ='0' and YEAR(date_in) =
YEAR(date()) GROUP BY YEAR(date_in) UNION SELECT COUNT(*) as b FROM studentsrecords WHERE
flag ='0' and YEAR(date_in) = YEAR(date())-1 GROUP BY YEAR(date_in) "
adapter3.Fill(dt3)
data3.Add(dt3.Rows(0).Item(0).ToString())
BunifuBarChart3.Data = data3
data3.Add(dt3.Rows(1).Item(0).ToString())
BunifuBarChart3.Data = data3
Dim sqlyear As String
adapterYear.Fill(dtYear)
'BunifuChartCanvas3.Update()
End Sub
BunifuPages1.SetPage("TabPage1")
End Sub
adapter1.Fill(dt1)
data1.Add(dt1.Rows(0).Item(0).ToString)
BunifuBarChart1.Data = data1
data1.Add(dt1.Rows(1).Item(0).ToString)
BunifuBarChart1.Data = data1
'bar 2 early
adapter2.Fill(dt2)
data2.Add(dt2.Rows(0).Item(0).ToString())
BunifuBarChart2.Data = data2
data2.Add(dt2.Rows(1).Item(0).ToString())
BunifuBarChart2.Data = data2
'bar 3 absent
sql3 = "SELECT COUNT(*) as numb FROM studentsrecords WHERE flag ='0' and YEAR(date_in) =
YEAR(date()) GROUP BY YEAR(date_in) UNION SELECT COUNT(*) as b FROM studentsrecords WHERE
flag ='0' and YEAR(date_in) = YEAR(date())-1 GROUP BY YEAR(date_in) "
adapter3.Fill(dt3)
data3.Add(dt3.Rows(0).Item(0).ToString())
BunifuBarChart3.Data = data3
data3.Add(dt3.Rows(1).Item(0).ToString())
BunifuBarChart3.Data = data3
adapterYear.Fill(dtYear)
'BunifuChartCanvas3.Labels = New String() {dtYear.Rows(0).Item(0).ToString(),
dtYear.Rows(1).Item(0).ToString()}
'BunifuChartCanvas3.Update()
End Sub
MonthlyDropdown.Enabled = False
MonthlyDropdown2.Enabled = False
Else
MonthlyDropdown.Enabled = True
MonthlyDropdown2.Enabled = True
End If
End Sub
DashboardDatePicker.Enabled = False
DashboardDatePicker2.Enabled = False
Else
DashboardDatePicker.Enabled = True
DashboardDatePicker2.Enabled = True
End If
End Sub
rdFilterByMnth.Checked = True
'Me.MonthlyDropdown.SelectedIndex = 1
Me.MonthlyDropdown.SelectedIndex = 0
End Sub
'rdFilterByMnth.Checked = True
'Call BunifuThinButton21_Click(sender, e)
End Sub
End Sub
YearStart.Enabled = False
YearEnd.Enabled = False
BunifuButton35.Enabled = False
monthlyGraph()
Else
End If
End Sub
'BunifuChartCanvas3.Clear()
'
'
'
' Add your data from your source - accepts double list
For i As Integer = 0 To 5 - 1
data.Add(r.[Next](0, 50))
Next
'
'
BunifuBarChart1.Data = data
'
'
'BunifuBarChart1.TargetCanvas = BunifuChartCanvas3
'
' Label count should correspond to data count for charts like Bar charts
'
'
'
Next
BunifuBarChart1.BackgroundColor = bgColors
End Sub
YearStart.Enabled = True
YearEnd.Enabled = True
BunifuButton35.Enabled = True
Else
End If
End Sub
'BunifuChartCanvas3.Clear()
'
'
'
' Add your data from your source - accepts double list
'
For i As Integer = 0 To 5 - 1
data.Add(r.NextDouble())
Next
'
'
BunifuBarChart1.Data = data
'
'
'BunifuBarChart1.TargetCanvas = BunifuChartCanvas3
'
' Label count should correspond to data count for charts like Bar charts
'
'
'
bgColors.Add(Color.Red)
bgColors.Add(Color.Blue)
bgColors.Add(Color.Green)
bgColors.Add(Color.Gray)
bgColors.Add(Color.Purple)
BunifuBarChart1.BackgroundColor = bgColors
End Sub
'monthlyGraph()
' MsgBox(a)
'Next
'BunifuDataGridView2.Rows.Clear()
''bar 3 absent
''sql3 = "SELECT COUNT(*) as numb FROM studentsrecords WHERE flag ='0' and YEAR(date_in)
YEAR(date()) GROUP BY YEAR(date_in) UNION SELECT COUNT(*) as b FROM studentsrecords WHERE
flag ='0' and YEAR(date_in) = YEAR(date())-1 GROUP BY YEAR(date_in) "
''sql3 = "SELECT COUNT(*) as numb FROM studentsrecords WHERE flag ='0' and YEAR(date_in)
BETWEEN YEAR(#" & YearStart.Text & "#) AND YEAR(#" & YearEnd.Text & "#)"
'sql3 = "SELECT COUNT(*) as numb FROM studentsrecords WHERE flag ='0' and YEAR(date_in)
BETWEEN YEAR(#" & YearStart.Text & "#) AND YEAR(#" & YearEnd.Text & "#) GROUP BY YEAR(date_in)
UNION SELECT COUNT(*) as b FROM studentsrecords WHERE flag ='0' and YEAR(date_in) BETWEEN
YEAR(#" & YearStart.Text & "#) AND YEAR(#" & YearEnd.Text & "#) GROUP BY YEAR(date_in);"
'adapter3.Fill(dt3)
' MsgBox(dt3.Rows(n).Item(0).ToString())
'Next
End Sub
End Sub
Private Sub BunifuThinButton22_Click(sender As Object, e As EventArgs)
End Sub
End Sub
YearStart.Enabled = False
YearEnd.Enabled = False
BunifuButton35.Enabled = False
ALLyearlyGraph()
Else
End If
End Sub
BunifuChartCanvas3.Clear()
BunifuDataGridView2.Rows.Clear()
adapterDepartment.Fill(dtDepartment)
dCount = dtDepartment.Rows.Count - 1
'bar 3 absent
sql3 = "SELECT COUNT(*) as numb, class FROM studentsrecords WHERE flag ='0' AND
MONTH(date_in) BETWEEN " & MonthlyDropdown.SelectedIndex + 1 & " AND " &
MonthlyDropdown2.SelectedIndex + 1 & " AND YEAR(date_in) = YEAR(DATE()) GROUP BY class"
data3.Add(0)
Next
BunifuChartCanvas3.Labels(n) = dtDepartment.Rows(n).Item(0).ToString()
BunifuDataGridView2.DataSource = Nothing
BunifuDataGridView2.AutoGenerateColumns = False
BunifuDataGridView2.ColumnCount = 5
BunifuDataGridView2.Columns(0).Name = "Name"
BunifuDataGridView2.Columns(1).Name = "Early"
BunifuDataGridView2.Columns(2).Name = "Late"
BunifuDataGridView2.Columns(3).Name = "Absent"
BunifuDataGridView2.Rows.Add(row)
Else
End If
stackedbar3.Data = data3
Next
Next
'bar 1 late
sql1 = "SELECT COUNT(*) as mpn, class FROM studentsrecords INNER JOIN controls ON
studentsrecords.time_in >= controls.late_time WHERE MONTH(date_in) BETWEEN " &
MonthlyDropdown.SelectedIndex + 1 & " AND " & MonthlyDropdown2.SelectedIndex + 1 & " AND
YEAR(date_in) = YEAR(DATE()) GROUP BY class"
adapter1.Fill(dt1)
data1.Add(0)
Next
BunifuChartCanvas3.Labels(n) = dtDepartment.Rows(n).Item(0).ToString()
data1.Insert(n, dt1.Rows(m).Item(0).ToString)
BunifuDataGridView2.Rows(n).Cells("Absent").Value = dt3.Rows(m).Item(0).ToString()
Else
End If
stackedbar1.Data = data1
Next
Next
'bar 2 early
sql2 = "SELECT COUNT(*) as mpn, class FROM studentsrecords INNER JOIN controls ON
studentsrecords.time_in <= controls.late_time WHERE MONTH(date_in) BETWEEN " &
MonthlyDropdown.SelectedIndex + 1 & " AND " & MonthlyDropdown2.SelectedIndex + 1 & " AND
YEAR(date_in) = YEAR(DATE()) GROUP BY class"
adapter2.Fill(dt2)
data2.Add(0)
Next
BunifuChartCanvas3.Labels(n) = dtDepartment.Rows(n).Item(0).ToString()
For m As Integer = 0 To dt2.Rows.Count - 1
data2.Insert(n, dt2.Rows(m).Item(0).ToString)
BunifuDataGridView2.Rows(n).Cells("Absent").Value = dt3.Rows(m).Item(0).ToString()
Else
End If
stackedbar2.Data = data2
Next
Next
BunifuChartCanvas3.XAxesLabel = MonthlyDropdown.Text & " " & Date.Now.Year & " To " &
MonthlyDropdown2.Text & " " & Date.Now.Year
adapterDepartment.Fill(dtDepartment)
dCount = dtDepartment.Rows.Count - 1
'bar 1 late
Dim sql1 As String
sql1 = "SELECT COUNT(*) as mpn, department FROM studentsrecords INNER JOIN controls ON
studentsrecords.time_in >= controls.late_time WHERE MONTH(date_in) BETWEEN " &
MonthlyDropdown.SelectedIndex + 1 & " AND " & MonthlyDropdown2.SelectedIndex + 1 & " AND
YEAR(date_in) = YEAR(DATE()) GROUP BY department"
adapter1.Fill(dt1)
data1.Add(0)
Next
BunifuChartCanvas3.Labels(n) = dtDepartment.Rows(n).Item(0).ToString()
BunifuDataGridView2.DataSource = Nothing
BunifuDataGridView2.AutoGenerateColumns = False
BunifuDataGridView2.ColumnCount = 5
BunifuDataGridView2.Columns(0).Name = "Name"
BunifuDataGridView2.Columns(1).Name = "Early"
BunifuDataGridView2.Columns(2).Name = "Late"
BunifuDataGridView2.Columns(3).Name = "Absent"
data1.Insert(n, dt1.Rows(m).Item(0).ToString)
Else
End If
stackedbar1.Data = data1
Next
Next
'bar 2 early
sql2 = "SELECT COUNT(*) as mpn, department FROM studentsrecords INNER JOIN controls ON
studentsrecords.time_in <= controls.late_time WHERE MONTH(date_in) BETWEEN " &
MonthlyDropdown.SelectedIndex + 1 & " AND " & MonthlyDropdown2.SelectedIndex + 1 & " AND
YEAR(date_in) = YEAR(DATE()) GROUP BY Department"
adapter2.Fill(dt2)
data2.Add(0)
Next
For n As Integer = 0 To dtDepartment.Rows.Count - 1
BunifuChartCanvas3.Labels(n) = dtDepartment.Rows(n).Item(0).ToString()
data2.Insert(n, dt2.Rows(m).Item(0).ToString)
Else
End If
stackedbar2.Data = data2
Next
Next
'bar 3 absent
sql3 = "SELECT COUNT(*) as numb, department FROM studentsrecords WHERE flag ='0' AND
MONTH(date_in) BETWEEN " & MonthlyDropdown.SelectedIndex + 1 & " AND " &
MonthlyDropdown2.SelectedIndex + 1 & " AND YEAR(date_in) = YEAR(DATE()) GROUP BY Department"
adapter3.Fill(dt3)
data3.Add(0)
Next
BunifuChartCanvas3.Labels(n) = dtDepartment.Rows(n).Item(0).ToString()
data3.Insert(n, dt3.Rows(m).Item(0).ToString)
Else
End If
stackedbar3.Data = data3
Next
Next
End If
BunifuChartCanvas3.XAxesLabel = MonthlyDropdown.Text & " " & Date.Now.Year & " - " &
MonthlyDropdown2.Text & " " & Date.Now.Year
adapterDepartment.Fill(dtDepartment)
dCount = dtDepartment.Rows.Count - 1
'bar 3 absent
sql3 = "SELECT COUNT(*) as numb, class FROM studentsrecords WHERE flag ='0' AND date_in
BETWEEN #" & DashboardDatePicker.Value.Date & "# AND #" & DashboardDatePicker2.Value.Date & "#
GROUP BY class"
adapter3.Fill(dt3)
data3.Add(0)
Next
BunifuChartCanvas3.Labels(n) = dtDepartment.Rows(n).Item(0).ToString()
BunifuDataGridView2.DataSource = Nothing
BunifuDataGridView2.AutoGenerateColumns = False
BunifuDataGridView2.ColumnCount = 5
BunifuDataGridView2.Columns(0).Name = "Name"
BunifuDataGridView2.Columns(1).Name = "Early"
BunifuDataGridView2.Columns(2).Name = "Late"
BunifuDataGridView2.Columns(3).Name = "Absent"
BunifuDataGridView2.Rows.Add(row)
data3.Insert(n, dt3.Rows(m).Item(0).ToString)
Else
End If
stackedbar3.Data = data3
Next
Next
'bar 1 late
sql1 = "SELECT COUNT(*) as mpn, class FROM studentsrecords INNER JOIN controls ON
studentsrecords.time_in >= controls.late_time WHERE date_in BETWEEN #" &
DashboardDatePicker.Value.Date & "# AND #" & DashboardDatePicker2.Value.Date & "# GROUP BY class"
adapter1.Fill(dt1)
For vb As Integer = 0 To dCount
data1.Add(0)
Next
BunifuChartCanvas3.Labels(n) = dtDepartment.Rows(n).Item(0).ToString()
data1.Insert(n, dt1.Rows(m).Item(0).ToString)
Else
End If
stackedbar1.Data = data1
Next
Next
'bar 2 early
sql2 = "SELECT COUNT(*) as mpn, class FROM studentsrecords INNER JOIN controls ON
studentsrecords.time_in <= controls.late_time WHERE date_in BETWEEN #" &
DashboardDatePicker.Value.Date & "# AND #" & DashboardDatePicker2.Value.Date & "# GROUP BY class"
adapter2.Fill(dt2)
For vb As Integer = 0 To dCount
data2.Add(0)
Next
BunifuChartCanvas3.Labels(n) = dtDepartment.Rows(n).Item(0).ToString()
data2.Insert(n, dt2.Rows(m).Item(0).ToString)
Else
End If
stackedbar2.Data = data2
Next
Next
adapterDepartment.Fill(dtDepartment)
dCount = dtDepartment.Rows.Count - 1
'bar 1 late
sql1 = "SELECT COUNT(*) as mpn, department FROM studentsrecords INNER JOIN controls ON
studentsrecords.time_in >= controls.late_time WHERE date_in BETWEEN #" &
DashboardDatePicker.Value.Date & "# AND #" & DashboardDatePicker2.Value.Date & "# GROUP BY
department"
adapter1.Fill(dt1)
data1.Add(0)
Next
BunifuChartCanvas3.Labels(n) = dtDepartment.Rows(n).Item(0).ToString()
BunifuDataGridView2.DataSource = Nothing
BunifuDataGridView2.AutoGenerateColumns = False
BunifuDataGridView2.ColumnCount = 5
BunifuDataGridView2.Columns(0).Name = "Name"
BunifuDataGridView2.Columns(1).Name = "Early"
BunifuDataGridView2.Columns(2).Name = "Late"
BunifuDataGridView2.Columns(3).Name = "Absent"
BunifuDataGridView2.Rows.Add(row)
data1.Insert(n, dt1.Rows(m).Item(0).ToString)
Else
End If
stackedbar1.Data = data1
Next
Next
'bar 2 early
sql2 = "SELECT COUNT(*) as mpn, department FROM studentsrecords INNER JOIN controls ON
studentsrecords.time_in <= controls.late_time WHERE date_in BETWEEN #" &
DashboardDatePicker.Value.Date & "# AND #" & DashboardDatePicker2.Value.Date & "# GROUP BY
Department"
adapter2.Fill(dt2)
For vb As Integer = 0 To dCount
data2.Add(0)
Next
BunifuChartCanvas3.Labels(n) = dtDepartment.Rows(n).Item(0).ToString()
data2.Insert(n, dt2.Rows(m).Item(0).ToString)
Else
End If
stackedbar2.Data = data2
Next
Next
'bar 3 absent
sql3 = "SELECT COUNT(*) as numb, department FROM studentsrecords WHERE flag ='0' AND
date_in BETWEEN #" & DashboardDatePicker.Value.Date & "# AND #" &
DashboardDatePicker2.Value.Date & "# GROUP BY Department"
data3.Add(0)
Next
BunifuChartCanvas3.Labels(n) = dtDepartment.Rows(n).Item(0).ToString()
data3.Insert(n, dt3.Rows(m).Item(0).ToString)
Else
End If
stackedbar3.Data = data3
Next
Next
End If
End If
stackedbar1.Data = data1
stackedbar2.Data = data2
stackedbar3.Data = data3
BunifuChartCanvas3.Update()
Dim w As Integer = 0
BunifuDataGridView2.Rows(w).Cells("Absent").Value = nb
wcnt += nb
w += 1
End If
Next
Dim x As Integer = 0
BunifuDataGridView2.Rows(x).Cells("Early").Value = nb
xcnt += nb
x += 1
End If
Next
Dim y As Integer = 0
BunifuDataGridView2.Rows(y).Cells("Late").Value = nb
tcnt += nb
y += 1
End If
Next
grandtotal = 0
grandtotal += BunifuDataGridView2.Rows(mnm).Cells(u).Value
Next
Next
data1.Clear()
data2.Clear()
data3.Clear()
End Sub
Else
yearlyGraph()
End If
End Sub
End Sub
End Sub
' BunifuChartCanvas2.Clear()
'End Sub
' BunifuChartCanvas2.Clear()
' BunifuChartCanvas2.Update()
'End Sub
'End Sub
End Sub
End Sub
' ' We use the INSERT statement which tells our program to add the information
' ' from the Forms Text fields into the Databases columns.
' sqlinsert1 = "INSERT INTO schools_schools1_register( firstname, lastname, id, created, student_id,
Class, ReceiveSms, department, tag_id)" &
' ' This assigns the values for our columns in the DataBase.
' ' To ensure the correct values are written to the correct column
' 'Try
' myconnection.Open()
' cmd1.ExecuteNonQuery()
' myconnection.Close()
' 'Finally
'End Sub
selectfailedsmsData()
'deleteSmsForFailed(2)
End Sub
Else
End If
End Sub
' ListBox2.Items.Add(DateTimePicker10.Value.ToShortDateString)
' End If
' Next
' SaveData(b)
'End Sub
'This code will be repeated till all the data[i] values inserted
str = id.Remove(id.Length - 1)
Try
myconnection.Open()
End If
End If
myconnection.Close()
retrieveExcludedates()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
Finally
End Try
End Sub
Else
' We use the INSERT statement which tells our program to add the information
' from the Forms Text fields into the Databases columns.
' This assigns the values for our columns in the DataBase.
' To ensure the correct values are written to the correct column
' You have to open the connection, execute the commands and
' We use the INSERT statement which tells our program to add the information
' from the Forms Text fields into the Databases columns.
' This assigns the values for our columns in the DataBase.
' To ensure the correct values are written to the correct column
'Try
myconnection.Open()
If MessageBox.Show("Are you sure the information has been entered correctly?", "Save",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
cmdg.ExecuteNonQuery()
myconnection.Close()
Example1()
clearfields()
generate_student_id()
dailyGraphs()
update_linked_table()
' RefreshDGV()
filldb()
End If
End If
'Catch ex As Exception
' MsgBox(ex.Message)
' myconnection.Close()
'Finally
' myconnection.Close()
'End Try
End If
End Sub
Else
yearlyGraph()
End If
End Sub
update_linked_table()
End Sub
Else
refreshRegGrid()
' Once again we execute the SQL statements against our DataBase
BunifuDataGridView3.DataSource = dt
Label25.Text = dt.Rows.Count
If dt.Rows.Count = 0 Then
End If
crystalReport1.SetDataSource(dsCustomers1)
Me.CrystalReportViewer2.ReportSource = crystalReport1
Me.CrystalReportViewer2.RefreshReport()
End If
ElseIf dbStudentFilter.SelectedItem = "Student Name" And txtsearch.Text.Trim IsNot "" Then
' Once again we execute the SQL statements against our DataBase
adapter.Fill(dt)
BunifuDataGridView3.DataSource = dt
Label25.Text = dt.Rows.Count
If dt.Rows.Count = 0 Then
End If
crystalReport1.SetDataSource(dsCustomers1)
Me.CrystalReportViewer2.ReportSource = crystalReport1
Me.CrystalReportViewer2.RefreshReport()
End If
' Once again we execute the SQL statements against our DataBase
adapter.Fill(dt)
BunifuDataGridView3.DataSource = dt
Label25.Text = dt.Rows.Count
If dt.Rows.Count = 0 Then
End If
crystalReport1.SetDataSource(dsCustomers1)
Me.CrystalReportViewer2.ReportSource = crystalReport1
Me.CrystalReportViewer2.RefreshReport()
End If
End If
refreshRegGridStaff()
' Once again we execute the SQL statements against our DataBase
adapter.Fill(dt)
BunifuDataGridView3.DataSource = dt
Label25.Text = dt.Rows.Count
If dt.Rows.Count = 0 Then
crystalReport1.SetDataSource(dsCustomers1)
Me.CrystalReportViewer2.ReportSource = crystalReport1
Me.CrystalReportViewer2.RefreshReport()
End If
' Once again we execute the SQL statements against our DataBase
adapter.Fill(dt)
BunifuDataGridView3.DataSource = dt
Label25.Text = dt.Rows.Count
If dt.Rows.Count = 0 Then
End If
Me.CrystalReportViewer2.ReportSource = crystalReport1
Me.CrystalReportViewer2.RefreshReport()
End If
' Once again we execute the SQL statements against our DataBase
adapter.Fill(dt)
BunifuDataGridView3.DataSource = dt
Label25.Text = dt.Rows.Count
If dt.Rows.Count = 0 Then
MsgBox("The entered information was not found. Please try again.")
End If
crystalReport1.SetDataSource(dsCustomers1)
Me.CrystalReportViewer2.ReportSource = crystalReport1
Me.CrystalReportViewer2.RefreshReport()
End If
End If
End If
globalRegGridStudents()
adapter.Fill(dt)
BunifuDataGridView3.DataSource = dt
Label25.Text = dt.Rows.Count
If dt.Rows.Count = 0 Then
End If
ElseIf TabControl1.SelectedTab Is tbReportView Then
crystalReport1.SetDataSource(dsCustomers1)
Me.CrystalReportViewer2.ReportSource = crystalReport1
Me.CrystalReportViewer2.RefreshReport()
End If
' Once again we execute the SQL statements against our DataBase
BunifuDataGridView3.DataSource = dt
Label25.Text = dt.Rows.Count
If dt.Rows.Count = 0 Then
End If
crystalReport1.SetDataSource(dsCustomers1)
Me.CrystalReportViewer2.ReportSource = crystalReport1
Me.CrystalReportViewer2.RefreshReport()
End If
' Once again we execute the SQL statements against our DataBase
adapter.Fill(dt)
BunifuDataGridView3.DataSource = dt
Label25.Text = dt.Rows.Count
If dt.Rows.Count = 0 Then
End If
crystalReport1.SetDataSource(dsCustomers1)
Me.CrystalReportViewer2.ReportSource = crystalReport1
Me.CrystalReportViewer2.RefreshReport()
End If
globalRegGridStaff()
' Once again we execute the SQL statements against our DataBase
adapter.Fill(dt)
BunifuDataGridView3.DataSource = dt
Label25.Text = dt.Rows.Count
If dt.Rows.Count = 0 Then
MsgBox("The entered information was not found. Please try again.")
End If
crystalReport1.SetDataSource(dsCustomers1)
Me.CrystalReportViewer2.ReportSource = crystalReport1
Me.CrystalReportViewer2.RefreshReport()
End If
adapter.Fill(dt)
BunifuDataGridView3.DataSource = dt
Label25.Text = dt.Rows.Count
If dt.Rows.Count = 0 Then
End If
crystalReport1.SetDataSource(dsCustomers1)
Me.CrystalReportViewer2.ReportSource = crystalReport1
Me.CrystalReportViewer2.RefreshReport()
End If
' Once again we execute the SQL statements against our DataBase
adapter.Fill(dt)
BunifuDataGridView3.DataSource = dt
Label25.Text = dt.Rows.Count
If dt.Rows.Count = 0 Then
crystalReport1.SetDataSource(dsCustomers1)
Me.CrystalReportViewer2.ReportSource = crystalReport1
Me.CrystalReportViewer2.RefreshReport()
End If
End If
Else
End If
End If
End If
End Sub
adapter.Fill(dt, "global_students")
Return dt
End Function
adapter.Fill(dt, "students")
Return dt
End Function
Return dt
End Function
adapter.Fill(dt, "staff")
Return dt
End Function
'retrieveExcludedates()
End Sub
' Try
' myconnection.Open()
'End If
' End If
' MsgBox(ex.Message)
' Finally
' myconnection.Close()
' Next
' test(datain)
'End Sub
'End Sub
#End Region
If SerialPort1.IsOpen Then
SerialPort1.Close()
If SerialPort1.IsOpen Then
'Label86.Text = "CONNECTED"
Else
'Label86.Text = "DISCONNECTED"
ActiveControl = txtid
End If
Else
Try
With SerialPort1
'.PortName = Label93.Text
.BaudRate = 9600
.Parity = IO.Ports.Parity.None
.DataBits = 8
.StopBits = IO.Ports.StopBits.One
.Handshake = IO.Ports.Handshake.None
.RtsEnable = True
.ReceivedBytesThreshold = 1
.NewLine = vbCr
.ReadTimeout = 1000
.Open()
End With
If SerialPort1.IsOpen Then
'Label86.Text = "CONNECTED"
ActiveControl = txtid
' txtid.Focus()
Else
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End Sub
Private Sub rdtoall_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles rdtoall.CheckedChanged
RadioButton10.Enabled = False
RadioButton9.Enabled = False
RadioButton5.Enabled = False
ComboBox13.Enabled = False
ComboBox12.Enabled = False
TextBox38.Enabled = False
Else
RadioButton10.Enabled = True
RadioButton5.Enabled = True
RadioButton9.Enabled = True
ComboBox13.Enabled = True
ComboBox12.Enabled = True
TextBox38.Enabled = True
End If
End Sub
' 'Else
' 'End If
' 'Return
'End Sub
' txtRX.Clear()
' txtRX2.Clear()
'End If
'End If
gtimeLeft -= 1
Else
Timer4.[Stop]()
Console.WriteLine("running")
BackgroundWorker1.RunWorkerAsync()
End If
End Sub
Console.WriteLine("working")
update_from_linked_table()
check_ODBC_status()
End Sub
Timer4.Start()
Console.WriteLine("done")
gtimeLeft = 60
End Sub
Try
'Connection
MyConnection.Open()
SetODBCLabel("Connected")
'dim i as integer
'Console.WriteLine(MyOdbcException.ToString)
Console.WriteLine("connetion is closed")
SetODBCLabel("Disconnected")
End Try
End Sub
If Me.Label17.InvokeRequired Then
Else
Me.Label17.Text = [text]
sstd = [text]
End If
End Sub
'myconnection.ConnectionString = provider
adapter.Fill(dt)
'BunifuLabel10.Text = dt.Rows.Count
SetLabel10(dt.Rows.Count)
Dim totalstudent As Integer = dt.Rows.Count
sql2 = "SELECT tag_id FROM studentsrecords INNER JOIN controls ON studentsrecords.time_in <=
controls.late_time WHERE studentsrecords.date_in = #" & DateTime.Now.ToString("MM/d/yyyy") & "#"
adapter2.Fill(dt2)
BunifuLabel163.Text = dt2.Rows.Count
SetLabel163(dt2.Rows.Count)
'late sql
sql3 = "SELECT tag_id FROM studentsrecords INNER JOIN controls ON studentsrecords.time_in >=
controls.late_time WHERE studentsrecords.date_in = #" & DateTime.Now.ToString("MM/d/yyyy") & "#"
adapter3.Fill(dt3)
'BunifuLabel161.Text = dt3.Rows.Count
SetLabel161(dt3.Rows.Count)
'absent
sql4 = "SELECT tag_id FROM studentsrecords WHERE flag ='0' AND studentsrecords.date_in = #" &
DateTime.Now.ToString("MM/d/yyyy") & "#"
adapter4.Fill(dt4)
'BunifuLabel159.Text = dt4.Rows.Count
SetLabel159(dt4.Rows.Count)
'boys
adapter5.Fill(dt5)
'Label7.Text = dt5.Rows.Count
SetLabel7(dt5.Rows.Count)
'girls
adapter6.Fill(dt6)
'Label8.Text = dt6.Rows.Count
SetLabel8(dt6.Rows.Count)
'BunifuCircleProgress1.Value = boy / totalstudent * 100
'BunifuCircleProgress1.Text = BunifuCircleProgress1.Value.ToString()
'BunifuCircleProgress1.Update()
'# of departments
adapter7.Fill(dt7)
'BunifuLabel156.Text = dt7.Rows.Count
'Label9.Text = dt7.Rows.Count
SetLabel9(dt7.Rows.Count)
'# of classes
'Label1.Text = dt8.Rows.Count
SetLabel1(dt8.Rows.Count)
'BunifuProgressBar1.Value = department
'BunifuProgressBar2.Value = classes
End Sub
If Me.BunifuLabel10.InvokeRequired Then
Else
Me.BunifuLabel10.Text = [text]
End If
End Sub
If Me.BunifuLabel163.InvokeRequired Then
Else
Me.BunifuLabel163.Text = [text]
End If
End Sub
MsgBox(myconnection.State.ToString)
End Sub
MonthlyDropdown2.Text = MonthlyDropdown.Text
End If
End Sub
YearEnd.Text = YearStart.Text
End If
End Sub
DashboardDatePicker2.Value = DashboardDatePicker.Value.Date
End If
End Sub
MonthlyDropdown.Text = MonthlyDropdown2.Text
End If
End Sub
DashboardDatePicker.Value = DashboardDatePicker2.Value.Date
End If
End Sub
YearStart.Text = YearEnd.Text
End If
End Sub
' txtsearch.Clear()
'Else
'End If
End Sub
adapter.Fill(dt)
BunifuDataGridView3.DataSource = dt
Label25.Text = dt.Rows.Count
crystalReport1.SetDataSource(dsCustomers1)
Me.CrystalReportViewer2.ReportSource = crystalReport1
Me.CrystalReportViewer2.RefreshReport()
End Sub
' Once again we execute the SQL statements against our DataBase
adapter.Fill(dt)
BunifuDataGridView3.DataSource = dt
Label25.Text = dt.Rows.Count
crystalReport1.SetDataSource(dsCustomers1)
Me.CrystalReportViewer2.ReportSource = crystalReport1
Me.CrystalReportViewer2.RefreshReport()
End If
End Sub
' Once again we execute the SQL statements against our DataBase
Dim adapter As New OleDbDataAdapter(sqlsearchstaff, myconnection)
adapter.Fill(dt)
BunifuDataGridView3.DataSource = dt
Label25.Text = dt.Rows.Count
crystalReport1.SetDataSource(dsCustomers1)
Me.CrystalReportViewer2.ReportSource = crystalReport1
Me.CrystalReportViewer2.RefreshReport()
End If
End Sub
' Once again we execute the SQL statements against our DataBase
adapter.Fill(dt)
BunifuDataGridView3.DataSource = dt
Label25.Text = dt.Rows.Count
crystalReport1.SetDataSource(dsCustomers1)
Me.CrystalReportViewer2.ReportSource = crystalReport1
Me.CrystalReportViewer2.RefreshReport()
ElseIf TabControl1.SelectedTab Is tbGraphView Then
End If
End Sub
End Sub
If Me.BunifuLabel161.InvokeRequired Then
Else
Me.BunifuLabel161.Text = [text]
End If
End Sub
openFileDialog1.InitialDirectory = "c:\"
openFileDialog1.Filter = Nothing
openFileDialog1.FilterIndex = 2
openFileDialog1.RestoreDirectory = True
openFileDialog1.FileName = ""
Try
myStream = openFileDialog1.OpenFile()
BunifuTextBox54.Text = ""
img = openFileDialog1.FileName
BunifuPictureBox15.Image = System.Drawing.Bitmap.FromFile(img)
BunifuTextBox54.Text = openFileDialog1.FileName
End If
Catch Ex As Exception
MessageBox.Show("Cannot read file from disk. Original error: " & Ex.Message)
Finally
myStream.Close()
End If
End Try
End If
End Sub
num += 1
Else
End If
Next
Console.WriteLine("pane zviripo")
Else
Console.WriteLine("no no no")
End If
End Sub
Private Sub BunifuButton37_Click(sender As Object, e As EventArgs) Handles BunifuButton37.Click
num += 0
Else
num += 1
End If
Next
If num = 0 Then
ListBox2.Items.Remove(ListBox2.SelectedItem)
End If
End Sub
ListBox2.Items.Remove(ListBox2.SelectedItem)
End If
Next
End Sub
b += a & ","
Next
Else
If userfound = 1 Then
SaveData(b)
Else
End If
End If
End If
dialog.Dispose()
myconnection.Close()
End Sub
Else
If userfound = 1 Then
If MessageBox.Show("Are you sure you want to delete the selected dates?", "DELETE",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
Dim i As Integer
For i = 0 To ListBox2.SelectedIndices.Count - 1
ListBox2.Items.RemoveAt(ListBox2.SelectedIndices(0))
Next
b += a & ","
Next
SaveData(b)
End If
Else
End If
End If
End If
dialog.Dispose()
myconnection.Close()
Else
End If
End Sub
Else
If userfound = 1 Then
sqlupdate = "UPDATE controls SET late_time=@late_time WHERE time_flag='" & time & "'"
myconnection.Open()
If MessageBox.Show("Are you sure you want to update the School's Late Time?",
"Change", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK
Then
myconnection.Close()
retrieveTime()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Else
End If
End If
End If
dialog.Dispose()
myconnection.Close()
Else
MsgBox("The Late Time must be later than the current Start Time and earlier than the current
Absent Time.")
End If
End Sub
Else
If userfound = 1 Then
sqlupdate = "UPDATE controls SET start_time=@start_time WHERE time_flag='" & time &
"'"
Try
myconnection.Open()
If MessageBox.Show("Are you sure you want to update the School's Start Time?",
"Change", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK
Then
myconnection.Close()
retrieveTime()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
End If
End If
dialog.Dispose()
myconnection.Close()
Else
MsgBox("The Start Time must be earlier than the current Late Time.")
End If
End Sub
Dim i As Integer
For i = 0 To ListBox2.SelectedIndices.Count - 1
ListBox2.Items.RemoveAt(ListBox2.SelectedIndices(0))
Next
End Sub
ComboBox8.Enabled = False
ComboBox9.Enabled = False
Else
TextBox21.Enabled = True
TextBox21.Text = ""
ComboBox8.Enabled = True
ComboBox9.Enabled = True
End If
End Sub
If Me.BunifuLabel159.InvokeRequired Then
Else
Me.BunifuLabel159.Text = [text]
End If
End Sub
If Me.Label7.InvokeRequired Then
Else
Me.Label7.Text = [text]
End If
End Sub
If Me.Label8.InvokeRequired Then
Else
Me.Label8.Text = [text]
End If
End Sub
If Me.Label9.InvokeRequired Then
Else
Me.Label9.Text = [text]
End If
End Sub
If Me.Label1.InvokeRequired Then
Else
Me.Label1.Text = [text]
End If
End Sub
Console.WriteLine("Plugged In")
SetLabel30Text("Connected")
Else
SetLabel30Text("Disconnected")
End If
End Sub
If SerialPort1.IsOpen Then
Else
Label13.Text = "Disconnected"
'Label90.Text = "Disconnected"
SetControlEnabled(Button16, True)
SetControlEnabled(ComboBox2, True)
SetCombo2("")
Label13.ForeColor = Color.Red
'Label90.ForeColor = Color.Red
End If
SetLabel30Text("Connected")
Else
SetLabel30Text("Disconnected")
End If
End Sub
If ctl.InvokeRequired Then
Else
ctl.Enabled = enabled
End If
End Sub
End Sub
Public Sub SetCombo2(ByVal [text] As String)
If Me.ComboBox2.InvokeRequired Then
Else
Me.ComboBox2.Text = [text]
End If
End Sub
If Me.Label30.InvokeRequired Then
Else
Me.Label30.Text = [text]
End If
End Sub
Else
If userfound = 1 Then
cmd.Parameters.Add(New OleDbParameter("@school_year_start",
dtpSchoolStart.Value.Date))
myconnection.Open()
myconnection.Close()
getYearAndTerm()
' retrieveSignout()
' SetTarget()
' retrieveTime()
End If
End If
myconnection.Close()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Else
End If
End If
End If
dialog.Dispose()
Else
End If
Else
End If
End If
End Sub
Else
cmd.Parameters.AddWithValue("@title", txtTitle.Text)
Try
myconnection.Open()
If MessageBox.Show("Are you sure you want to add this Title to the database?", "WARNING",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
myconnection.Close()
retrieveTitle()
dailyGraphs()
txtTitle.Text = ""
End If
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
retrieveTitle()
End Try
End If
End Sub
Else
Dim sql As String = "DELETE * FROM titles WHERE title='" & txtTitle.Text & "'"
Else
If userfound = 1 Then
Try
myconnection.Open()
txtTitle.Text = ""
cbTitlePreview.Text = ""
End If
End If
myconnection.Close()
retrieveTitle()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
retrieveTitle()
End Try
Else
End If
End If
End If
dialog.Dispose()
End If
End Sub
Else
Dim sql As String = "DELETE * FROM subjects WHERE subject='" & txtSubjects.Text & "'"
Else
If userfound = 1 Then
Try
myconnection.Open()
txtSubjects.Text = ""
cbSubjectsPreview.Text = ""
End If
End If
myconnection.Close()
retrieveSubject()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
retrieveSubject()
End Try
ElseIf userfound = 2 Then
Else
End If
End If
End If
dialog.Dispose()
End If
End Sub
Else
cmd.Parameters.AddWithValue("@subject", txtSubjects.Text)
Try
myconnection.Open()
If MessageBox.Show("Are you sure you want to add this Subject to the database?",
"WARNING", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) =
Windows.Forms.DialogResult.OK Then
End If
myconnection.Close()
retrieveSubject()
dailyGraphs()
txtSubjects.Text = ""
End If
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
retrieveSubject()
End Try
End If
End Sub
txtTitle.Text = cbTitlePreview.SelectedItem
End Sub
txtSubjects.Text = cbSubjectsPreview.SelectedItem
End Sub
strtDate = dtpTermStart.Value.Date
endDate = dtpTermEnd.Value.Date
adapter.Fill(dt)
If dt.Rows.Count = 0 Then
strtDate = dtpSchoolStart.Value.Date
Else
End If
Else
cmd.Parameters.AddWithValue("@id_number", cbTermAdd.SelectedItem)
cmd.Parameters.AddWithValue("@start_date", strtDate)
cmd.Parameters.AddWithValue("@end_date", endDate)
Try
myconnection.Open()
End If
myconnection.Close()
dailyGraphs()
retrieveTerm()
cbTermAdd.Text = ""
dtpTermStart.Value = Now
dtpTermEnd.Value = Now
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Else
MessageBox.Show("The Start date of a term cannot be earlier than the End Date of the
previous term", "KADTRACK")
End If
Else
MessageBox.Show("The End date cannot be earlier than the Start date.", "KADTRACK")
End If
Else
MessageBox.Show("Term cannot be less than the start date of the School Year. Or Term cannot
be greater than the end date of the School Year.", "KADTRACK")
End If
End If
End Sub
BunifuPages1.SetPage("Add Staff")
End Sub
' BunifuPages1.SetPage("records")
'End Sub
'Private Sub BunifuButton47_Click(sender As Object, e As EventArgs) Handles BunifuButton47.Click
' BunifuPages1.SetPage("AddStudent")
'End Sub
'End Sub
Else
Dim sql As String = "DELETE * FROM terms WHERE id_number=" & dpTermPreview.SelectedIndex
+ 1 & ""
Else
Try
myconnection.Open()
dpTermPreview.Text = ""
End If
End If
myconnection.Close()
retrieveTerm()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
retrieveTerm()
End Try
Else
End If
End If
End If
dialog.Dispose()
End If
End Sub
txtFirstNameStaff.Select(txtFirstNameStaff.Text.Length, 0)
End If
txtTagIdStaff.Select(txtTagIdStaff.Text.Length, 0)
End If
txtLastNameStaff.Select(txtLastNameStaff.Text.Length, 0)
End If
txtContactStaff.Select(txtContactStaff.Text.Length, 0)
End If
' txtStaffID.Select(txtStaffID.Text.Length, 0)
'End If
txtAddressStaff.Select(txtAddressStaff.Text.Length, 0)
End If
End If
txtCityStaff.Select(txtCityStaff.Text.Length, 0)
End If
txtParishStaff.Select(txtParishStaff.Text.Length, 0)
End If
End Sub
' We use the INSERT statement which tells our program to add the information
' from the Forms Text fields into the Databases columns.
'sqlinsert = "INSERT INTO Staff (tag_id, staff_id, contactnumber, firstname, lastname, gender,
address, city, parish, postoffice, stafftype, department, ReceiveSms )" &
'sqlinsert = "INSERT INTO Staff (tag_id, staff_id, contactnumber, firstname, lastname, gender,
address, postoffice, city, parish, stafftype, department, ReceiveSms )" &
sqlinsert = "INSERT INTO staff (tag_id, staff_id, contactnumber, firstname, lastname, gender,
address, postoffice, city, parish, stafftype, department, ReceiveSms, age, birthday, title, userType, status,
PicturePath )" &
' This assigns the values for our columns in the DataBase.
' To ensure the correct values are written to the correct column
Try
myconnection.Open()
If MessageBox.Show("Are you sure the information has been entered correctly?", "Save",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
cmdsg.ExecuteNonQuery()
myconnection.Close()
Example1()
clearfieldsnew()
generate_student_id()
dailyGraphs()
update_linked_table()
' RefreshDGV()
filldb()
Update()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
Finally
myconnection.Close()
End Try
End If
End Sub
'Private Sub BunifuButton46_Click(sender As Object, e As EventArgs) Handles BunifuButton46.Click
'End Sub
End Sub
staffmale = "Male"
End If
End Sub
Try
' See if the desired device shows up in the device manager. '
Return True
End If
End If
Next
Catch ex As Exception
End Try
'We did not find the device we were looking for '
Return False
End Function
staffmale = "Female"
End If
End Sub
End Sub
Private Sub btnAddStaff2_Click(sender As Object, e As EventArgs) Handles btnAddStaff2.Click
BunifuPages1.SetPage("Add Staff")
End Sub
BunifuPages1.SetPage("records")
End Sub
BunifuPages1.SetPage("AddStudent")
End Sub
End Sub
dbStaffFilter.Enabled = False
dbStudentFilter.Enabled = True
dbStaffFilter.Text = ""
dbStaffFilter.SelectedIndex = -1
ElseIf dbRecordType.SelectedItem = "Staff" Then
dbStudentFilter.Enabled = False
dbStaffFilter.Enabled = True
dbStudentFilter.Text = ""
dbStudentFilter.SelectedIndex = -1
End If
End Sub
clearfieldsnew()
End Sub
End Sub
txtsearch.Enabled = False
txtsearch.Clear()
Else
txtsearch.Enabled = True
End If
Else
End If
End Sub
txtsearch.Enabled = False
txtsearch.Clear()
Else
txtsearch.Enabled = True
End If
Else
End If
End Sub
End Sub
BunifuPages1.SetPage("records")
UpdateClearfieldsNew()
refreshRegGridStaff()
Else
End If
End Sub
Else
'viewImage(dr("tag_id"))
' genderstaff(dr("tag_id"))
Try
'cmd.ExecuteNonQuery()
' BunifuPages1.SetPage("records")
myconnection.Open()
myconnection.Close()
' BunifuPages1.SetPage("records")
End If
Else
myconnection.Close()
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
' This are subs in Module1, to clear all the TextBoxes on the form
' and refresh the DataGridView on the MainFsorm to show our new records.
ClearTextBox(Me)
refreshRegGridStaff()
End If
End Sub
openFileDialog1.InitialDirectory = "c:\"
openFileDialog1.Filter = Nothing
openFileDialog1.FilterIndex = 2
openFileDialog1.RestoreDirectory = True
openFileDialog1.FileName = ""
Try
myStream = openFileDialog1.OpenFile()
imgbox = ""
img = openFileDialog1.FileName
pbStaffPhoto.Image = System.Drawing.Bitmap.FromFile(img)
imgbox = openFileDialog1.FileName
End If
Catch Ex As Exception
MessageBox.Show("Cannot read file from disk. Original error: " & Ex.Message)
Finally
myStream.Close()
End If
End Try
End If
End Sub
openFileDialog1.InitialDirectory = "c:\"
openFileDialog1.Filter = Nothing
openFileDialog1.FilterIndex = 2
openFileDialog1.RestoreDirectory = True
openFileDialog1.FileName = ""
Try
myStream = openFileDialog1.OpenFile()
img = openFileDialog1.FileName
pbStaffPhoto2.Image = System.Drawing.Bitmap.FromFile(img)
imgboxreplace = openFileDialog1.FileName
End If
Catch Ex As Exception
MessageBox.Show("Cannot read file from disk. Original error: " & Ex.Message)
Finally
myStream.Close()
End If
End Try
End If
End Sub
End Sub
Private Sub dbRegistryType_SelectedIndexChanged(sender As Object, e As EventArgs) Handles
dbRegistryType.SelectedIndexChanged
btnRemoveActive.Enabled = False
Else
btnRemoveActive.Enabled = True
End If
End Sub
Else
Else
If userfound = 1 Then
Try
myconnection.Open()
sqldelete = "DELETE * FROM students WHERE id='" & txtsearch.Text & "'"
ActivetoGlobalStatus(txtsearch.Text)
myconnection.Close()
cleartxt()
refreshRegGrid()
dailyGraphs()
End If
End If
sqldelete = "DELETE * FROM staff WHERE staff_id='" & txtsearch.Text & "'"
ActivetoGlobalStatus(txtsearch.Text)
myconnection.Close()
cleartxt()
refreshRegGrid()
dailyGraphs()
End If
End If
End If
Catch ex As Exception
'myconnection.Close()
End Try
Else
End If
End If
End If
dialog.Dispose()
myconnection.Close()
End If
End Sub
crystalReport.SetDataSource(dsCustomers)
Me.CrystalReportViewer2.ReportSource = crystalReport
Me.CrystalReportViewer2.RefreshReport()
End Sub
crystalReport.SetDataSource(dsCustomers)
Me.CrystalReportViewer2.ReportSource = crystalReport
Me.CrystalReportViewer2.RefreshReport()
End Sub
sda.SelectCommand = cmd
sda.Fill(dsCustomers, "students")
Return dsCustomers
End Using
End Using
End Using
End Using
End Function
adapter.Fill(dt, "global_students")
Return dt
End Function
rdStaffId.Enabled = False
rbStaffLevel.Enabled = False
ddStaffSms.Enabled = False
'ddStaffSms2.Enabled = False
tbStaffSms.Enabled = False
rbStaffLevel.Checked = False
rdStaffId.Checked = False
Else
rdStaffId.Enabled = True
rbStaffLevel.Enabled = True
ddStaffSms.Enabled = True
'ddStaffSms2.Enabled = True
tbStaffSms.Enabled = True
End If
End Sub
LabelStaff.Text = 0
eDS.Clear()
eDA.Fill(dtt)
dgvStaff.DataSource = dtt
dgvStaff.Show()
Else
dgvStaff.Hide()
End If
End Sub
LabelStaff.Text = 0
eDS.Clear()
eDA.Fill(dtt)
dgvStaff.DataSource = dtt
dgvStaff.Show()
tbStaffSms.Enabled = True
ddStaffSms.Enabled = False
'ddStaffSms2.Enabled = False
Else
dgvStaff.Hide()
tbStaffSms.Enabled = False
tbStaffSms.Text = ""
ddStaffSms.Enabled = True
'ddStaffSms2.Enabled = True
End If
End Sub
LabelStaff.Text = 0
eDS.Clear()
eDA.Fill(dtt)
dgvStaff.DataSource = dtt
dgvStaff.Show()
ddStaffSms.Enabled = True
'ddStaffSms2.Enabled = False
tbStaffSms.Enabled = False
Else
dgvStaff.Hide()
ddStaffSms.Enabled = False
ddStaffSms.Text = ""
'ddStaffSms2.Enabled = True
tbStaffSms.Enabled = True
End If
End Sub
myconnection.ConnectionString = provider
' SQL Statement so our User can search for either FirstName or LastName
sqlsearch = "SELECT staff_id, Firstname, lastname, Gender, contactnumber, Department FROM staff
WHERE staff_id LIKE '%" & tbStaffSms.Text & "%'" & ""
' Once again we execute the SQL statements against our DataBase
adapter.Fill(dt)
dgvStaff.DataSource = dt
End Sub
LabelStaff.Text = 0
drpt2 = ddStaffSms.SelectedItem
' sql = "SELECT staff_ID, Firstname, lastname, contactnumber, department as [Level] FROM staff
WHERE department='" & drpt2 & "'"
sql = "SELECT staff_id, Firstname, lastname, Gender, contactnumber, Department FROM staff
WHERE department LIKE '%" & drpt2 & "'"
adapter.Fill(dt)
dgvStaff.DataSource = dt
End If
End Sub
num += 1
Else
End If
Next
If num >= 1 Then
gridCheck = True
Else
gridCheck = False
End If
If rdSendStaff.Checked = True And Not tbStaffMessages.Text.Trim = "" And gridCheck = True Then
numbers.Clear()
btnStaffSend.Enabled = False
numbers.Add(oRow.Cells("Contactnumber").Value)
'ss(oRow.Cells(0).ColumnIndex) = tbStaffMessages.Text
sValue = tbStaffMessages.Text
End If
Next
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
Else
End If
btnStaffSend.Enabled = False
'Dosms(oRow.Cells("Guardiannumber1").Value, tbStaffMessages.Text)
Else
End If
Else
End If
btnStaffSend.Enabled = True
clearSmsCon()
numbers.Clear()
myconnection.Open()
eDS.Clear()
eDA.Fill(eDS)
btnStaffSend.Enabled = False
eDR = eDS.Tables(0).Rows(i)
numbers.Add(eDR("Guardiannumber1"))
sValue = tbStaffMessages.Text
Next
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
btnStaffSend.Enabled = True
clearSmsCon()
Else
End If
myconnection.Open()
eDS.Clear()
eDA.Fill(eDS)
btnStaffSend.Enabled = False
eDR = eDS.Tables(0).Rows(i)
Dosms(eDR("Guardiannumber1"), TextBox37.Text)
Next
btnStaffSend.Enabled = True
clearSmsCon()
Else
RetrieveChkSms()
End If
End If
Else
End If
End Sub
rbStaffDisableAuto.Checked = False
rbStaffEnableAuto.Checked = False
rbStaffSignin.Checked = True
rbStaffSignout.Checked = True
rbStaffAbsentSms.Checked = True
rbStaffSignin.Enabled = False
rbStaffSignout.Enabled = False
rbStaffAbsentSms.Enabled = False
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Else
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End If
End Sub
rbStaffDisableAuto.Checked = False
rbStaffEnableAll.Checked = False
rbStaffSignin.Checked = True
rbStaffSignout.Checked = False
rbStaffAbsentSms.Checked = False
rbStaffSignin.Enabled = True
rbStaffSignout.Enabled = True
rbStaffAbsentSms.Enabled = True
btnStaffSend2.Enabled = True
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Else
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End If
End Sub
rbStaffSignin.Checked = False
rbStaffSignout.Checked = False
rbStaffAbsentSms.Checked = False
rbStaffEnableAll.Checked = False
rbStaffEnableAuto.Checked = False
rbStaffSignin.Enabled = False
rbStaffSignout.Enabled = False
rbStaffAbsentSms.Enabled = False
btnStaffSend2.Enabled = False
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Else
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Dim cmd As New OleDbCommand(sqlupdate, myconnection)
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End If
End Sub
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Dim cmd As New OleDbCommand(sqlupdate, myconnection)
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Else
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
rbStaffSignin.Checked = True
Exit Sub
End If
End If
End Sub
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
Else
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
rbStaffSignout.Checked = True
Exit Sub
End If
End If
End Sub
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
btnStaffSend2.Enabled = False
Else
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & opt & "'"
Try
myconnection.Open()
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
btnStaffSend2.Enabled = True
rbStaffAbsentSms.Checked = True
Exit Sub
End If
End If
End Sub
Else
sendStaffAbsentsms()
MsgBox("The absent message was successfully sent.")
myconnection.Close()
End If
End Sub
Else
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & time & "'"
Try
myconnection.Open()
If MessageBox.Show("Are you sure you want to update the Absent message?", "Change",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
myconnection.Close()
staffRetrieveMessages()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End If
End Sub
Else
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & time & "'"
myconnection.Open()
If MessageBox.Show("Are you sure you want to update the Sign-Out message?", "Change",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
myconnection.Close()
staffRetrieveMessages()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End If
End Sub
Else
If userfound = 1 Then
BunifuPages1.SetPage("StaffRelog")
TextBox1.Focus()
Else
End If
End If
End If
dialog.Dispose()
myconnection.Close()
End Sub
Else
' CODE INSERT
sqlupdate = "UPDATE controlsignout SET timeset=@timeset WHERE flag='" & time & "'"
Try
myconnection.Open()
If MessageBox.Show("Are you sure you want to update the Sign-In message?", "Change",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
myconnection.Close()
staffRetrieveMessages()
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
myconnection.Close()
End Try
End If
End Sub
myconnection.Open()
eDS.Clear()
eDS.Clear()
eDA.Fill(eDS)
eDR = eDS.Tables(0).Rows(0)
fname = eDR("firstname")
Sname = eDR("lastname")
a = eDR("count")
userfound = True
insertimage_relog()
End If
dDS.Clear()
dDA.Fill(dDS)
dDR = dDS.Tables(0).Rows(0)
Button222.Enabled = True
'insertstd_relog() 'found
'insertstd_relog() 'found
Else
dDS.Clear()
dDA.Fill(dDS)
dDR = dDS.Tables(0).Rows(0)
fillAnotherStudDb()
Button222.Enabled = True
insertstd_relog()
Label20.Text = "Student Successfully Resinged-In"
'dDS.Clear()
'dDA.Fill(dDS)
' 'insertstd_relog()
'Else
' fillAnotherStudDb()
' insertstd_relog()
'End If
Else
Button222.Enabled = True
'insertstd_relog()
'makeThemAbsent()
End If
dDR = Nothing
dDS.Dispose()
dDA.Dispose()
cleartimer_relog()
Else
cleartimer_relog()
Button222.Enabled = False
End If
eDR = Nothing
eDS.Dispose()
eDA.Dispose()
myconnection.Close()
End Sub
dDR = dDS.Tables(0).NewRow()
BunifuTextBox5.Text = ftime
strSQL = "UPDATE studentsrecords SET time_in=#" & BunifuTextBox5.Text & "#, flag='" & flag & "'
WHERE tag_id='" & BunifuTextBox7.Text & "' AND date_in=#" & datey & "# AND Flag IS Null"
Try
While dr.Read
SigninMsg = dr("timeset")
End While
sValue = SigninMsg
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Try
While dr.Read
number = dr("Guardiannumber1")
'number2 = dr("Guardiannumber2")
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
numbers.Add(number)
'numbers.Add(number2)
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
'sendSmS(SigninMsg)
'Label3.Text = "processing"
numbers.Clear()
numbers.Add(number)
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
'sendSmS(SigninMsg)
'Label3.Text = "processing"
End If
End If
number = 0
End If
Else
BunifuTextBox6.Text = ftime
strSQL = "UPDATE studentsrecords SET time_out=#" & BunifuTextBox6.Text & "# WHERE tag_id='"
& BunifuTextBox7.Text & "' AND date_in=#" & datey & "# and flag='1' and time_out IS NULL" 'time_in=#"
& BunifuTextBox5.Text & "#"
Try
SigninMsg1 = dr("timeset")
End While
sValue = SigninMsg1
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Try
While dr.Read
number = dr("Guardiannumber1")
number2 = dr("Guardiannumber2")
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
numbers.Clear()
numbers.Add(number)
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
'sendSmS(SigninMsg1)
'Label3.Text = "processing"
numbers.Clear()
numbers.Add(number)
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
'sendSmS(SigninMsg1)
'Label3.Text = "processing"
End If
End If
number = 0
End If
End If
dCmd.ExecuteNonQuery()
dCmd.Dispose()
dDR = Nothing
dDS.Dispose()
dDA.Dispose()
myconnection.Close()
Button222.Enabled = False
End Sub
cnn.Open()
End If
Dim da As New OleDb.OleDbDataAdapter("SELECT * FROM students WHERE count = " & a, cnn)
da.Fill(dt)
Me.BunifuTextBox8.Text = dt.Rows(0).Item("PicturePath")
Try
BunifuPictureBox16.Image = System.Drawing.Bitmap.FromFile(BunifuTextBox8.Text)
cnn.Close()
Catch ex As Exception
cnn.Close()
End Try
End Sub
strSQ = "UPDATE studentsrecords SET date_in=#" & Format(Now, "MM/d/yyyy") & "# WHERE
tag_id='" & BunifuTextBox7.Text & "' and date_in IS NULL and time_in IS NULL and time_out IS NULL and
Flag IS Null and tag_id IS NOT NULL"
Try
command.ExecuteNonQuery()
comm.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
End Sub
timeLeft = 5
End Sub
status = ddRegistryTypeFilter.SelectedIndex
End Sub
End Sub
check_staff_relog()
End Sub
BunifuPages1.SetPage("student")
End Sub
timeLeft -= 1
Else
Timer3.[Stop]()
BunifuTextBox7.Clear()
BunifuTextBox7.ReadOnly = False
BunifuTextBox8.Clear()
'BunifuTextBox3.Clear()
'BunifuTextBox4.Clear()
'BunifuTextBox5.Clear()
BunifuTextBox2.Clear()
BunifuTextBox7.Focus()
'Label2.Text = ""
Label20.Text = "."
End If
End Sub
Call BunifuButton36_Click(sender, e)
Else
' MessageBox.Show(tmp.KeyChar)
End If
End Sub
Try
txtsearch.Text = BunifuDataGridView3.Rows(e.RowIndex).Cells(0).Value.ToString
viewImage(BunifuDataGridView3.Rows(e.RowIndex).Cells(1).Value.ToString)
viewImageStaff(BunifuDataGridView3.Rows(e.RowIndex).Cells(1).Value.ToString)
Else
End If
'rdId.Checked = True
'BunifuRadioButton1.Checked = False
'rdName.Checked = False
'rdGaurdian.Checked = False
Catch ex As Exception
'MsgBox(ex.Message)
End Try
End Sub
End Sub
End Sub
refreshModerm()
End Sub
End Sub
End Sub
End Sub
If MessageBox.Show("Are you sure you want to leave this page now? Changes will not be saved if
not updated", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) =
Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("studentsrecords")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("studentsrecords")
End If
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("studentsrecords")
End If
ElseIf BunifuPages1.SelectedTab Is tpAddStuff Then
If MessageBox.Show("Are you sure you want to leave this page now?", "Warning",
MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) = Windows.Forms.DialogResult.OK Then
BunifuPages1.SetPage("studentsrecords")
End If
Else
BunifuPages1.SetPage("studentsrecords")
End If
End Sub
ComboBox2.Items.Clear()
myPort = IO.Ports.SerialPort.GetPortNames()
For i = 0 To UBound(myPort)
ComboBox2.Items.Add(myPort(i))
Next
Try
Catch ex As Exception
End Try
End Sub
End Sub
staffsms = "1"
Else
staffsms = "o"
End If
End Sub
End Sub
#End Region
#Region "Relog Staff Scan"
myconnection.Open()
eDS.Clear()
eDS.Clear()
eDA.Fill(eDS)
eDR = eDS.Tables(0).Rows(0)
fname = eDR("firstname")
Sname = eDR("lastname")
a = eDR("count")
userfound = True
insertimage_staff_relog()
End If
dDS.Clear()
dDA.Fill(dDS)
Button222.Enabled = True
'insertstd_relog() 'found
'insertstd_relog() 'found
Else
dDS.Clear()
dDA.Fill(dDS)
dDR = dDS.Tables(0).Rows(0)
fillAnotherStaffDb()
Button222.Enabled = True
insertstaff_relog()
'dDS.Clear()
'dDA.Fill(dDS)
' 'insertstd_relog()
'Else
' fillAnotherStudDb()
' insertstd_relog()
'End If
Else
Button222.Enabled = True
'insertstd_relog()
'makeThemAbsent()
End If
End If
dDR = Nothing
dDS.Dispose()
dDA.Dispose()
cleartimerStaff_relog()
Else
cleartimerStaff_relog()
Button222.Enabled = False
End If
eDR = Nothing
eDS.Dispose()
eDA.Dispose()
myconnection.Close()
End Sub
dDR = dDS.Tables(0).NewRow()
ftime = DateTime.Now.ToString("hh:mm:ss tt")
BunifuTextBox21.Text = ftime
strSQL = "UPDATE studentsrecords SET time_in=#" & BunifuTextBox21.Text & "#, flag='" & flag & "'
WHERE tag_id='" & TextBox1.Text & "' AND date_in=#" & datey & "# AND Flag IS Null"
Try
While dr.Read
SigninMsg = dr("timeset")
End While
sValue = SigninMsg
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Try
While dr.Read
number = dr("contactnumber")
'number2 = dr("Guardiannumber2")
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
numbers.Clear()
numbers.Add(number)
'numbers.Add(number2)
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
'sendSmS(SigninMsg)
'Label3.Text = "processing"
numbers.Clear()
numbers.Add(number)
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
'sendSmS(SigninMsg)
'Label3.Text = "processing"
End If
number = 0
End If
Else
BunifuTextBox22.Text = ftime
strSQL = "UPDATE studentsrecords SET time_out=#" & BunifuTextBox22.Text & "# WHERE
tag_id='" & TextBox1.Text & "' AND date_in=#" & datey & "# and flag='1' and time_out IS NULL"
'time_in=#" & BunifuTextBox5.Text & "#"
Try
While dr.Read
SigninMsg1 = dr("timeset")
End While
sValue = SigninMsg1
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
Try
While dr.Read
number = dr("contactnumber")
'number2 = dr("Guardiannumber2")
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
numbers.Clear()
numbers.Add(number)
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
'sendSmS(SigninMsg1)
'Label3.Text = "processing"
numbers.Clear()
numbers.Add(number)
NumWorkers = NumWorkers + 1
ReDim Workers(NumWorkers)
Workers(NumWorkers).WorkerReportsProgress = True
Workers(NumWorkers).WorkerSupportsCancellation = True
Workers(NumWorkers).RunWorkerAsync()
'sendSmS(SigninMsg1)
'Label3.Text = "processing"
End If
End If
number = 0
End If
End If
dCmd.ExecuteNonQuery()
dCmd.Dispose()
dDR = Nothing
dDS.Dispose()
dDA.Dispose()
myconnection.Close()
Button222.Enabled = False
End Sub
cnn.Open()
End If
Dim da As New OleDb.OleDbDataAdapter("SELECT * FROM staff WHERE count = " & a, cnn)
da.Fill(dt)
Me.BunifuTextBox20.Text = dt.Rows(0).Item("PicturePath")
Try
BunifuPictureBox7.Image = System.Drawing.Bitmap.FromFile(BunifuTextBox20.Text)
cnn.Close()
Catch ex As Exception
cnn.Close()
End Try
End Sub
strSQ = "UPDATE studentsrecords SET date_in=#" & Format(Now, "MM/d/yyyy") & "# WHERE
tag_id='" & TextBox1.Text & "' and date_in IS NULL and time_in IS NULL and time_out IS NULL and Flag IS
Null and tag_id IS NOT NULL"
Try
command.ExecuteNonQuery()
comm.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
myconnection.Close()
End Try
End Sub
timeLeft = 5
Timer5.Start()
End Sub
timeLeft -= 1
Timer5.[Stop]()
TextBox1.Clear()
TextBox1.ReadOnly = False
BunifuTextBox21.Clear()
'BunifuTextBox3.Clear()
BunifuTextBox22.Clear()
BunifuTextBox14.Clear()
BunifuTextBox20.Clear()
TextBox1.Focus()
'Label2.Text = ""
Label33.Text = "."
End If
End Sub
#End Region
cmd.CommandType = CommandType.Text
sda.Fill(dt)
dgvStaff.DataSource = dt
End Using
End Using
End Using
End Using
headerCheckBox2.BackColor = Color.White
headerCheckBox2.Width = 15
dgvStaff.Controls.Add(headerCheckBox2)
'Add a CheckBox Column to the DataGridView at the first position.
checkBoxColumn.HeaderText = ""
checkBoxColumn.Width = 30
checkBoxColumn.Name = "checkBoxColumn"
dgvStaff.Columns.Insert(0, checkBoxColumn)
End Sub
dgvStaff.EndEdit()
'Loop and check and uncheck all row CheckBoxes based on Header Cell CheckBox.
checkBox.Value = headerCheckBox2.Checked
Next
End Sub
isChecked = False
Exit For
End If
Next
headerCheckBox2.Checked = isChecked
End If
End Sub
Console.WriteLine("we involked")
count2 += 1
Else
End If
Next
LabelStaff.Text = count2
End If
End Sub
#End Region
End Class