Imports System.Data
Imports System.Data.OleDb
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
Private Sub TextBox11_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged
End Sub
Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox3.TextChanged
If TextBox3.Text = "1" Then TextBox4.Text = "2:00"
If TextBox3.Text = "1" Then
Else : TextBox4.Text = "Error"
End If
If TextBox3.Text = "2" Then TextBox4.Text = "3:00"
End Sub
Private Sub TextBox6_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox6.TextChanged
If Val(TextBox4.Text) >= Val(TextBox6.Text) Then
TextBox9.Text = "Pass"
Else
TextBox9.Text = "Fail"
End If
If TextBox6.Text = "Over Day" Then TextBox9.Text = "Over"
End Sub
Private Sub TextBox9_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox9.TextChanged
End Sub
Private Sub TextBox12_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox12.TextChanged
End Sub
Private Sub TextBox7_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox7.TextChanged
Dim a As Single
a = Val(TextBox7.Text) - Val(TextBox5.Text)
If TextBox12.Text = TextBox13.Text Then
TextBox6.Text = a
Else
TextBox6.Text = "Over Day"
End If
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
setupScreen()
End Sub
Sub setupScreen()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""
TextBox11.Text = ""
TextBox12.Text = ""
TextBox13.Text = ""
End Sub
Private Sub Button16_Click() Handles Button16.Click
End
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
End Sub
Private Sub TextBox10_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox10.TextChanged
End Sub
Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged
End Sub
Private Sub Button15_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button15.Click
Dim Connection As System.Data.OleDb.OleDbConnection
Dim ConnectionString As String
ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Database1.accdb"
Connection = New System.Data.OleDb.OleDbConnection(ConnectionString)
Dim CommandString As String
CommandString = "Insert Into [Table2] ([Log ID], [Branch], [Severity], [No Hour], [Open Date], [Open Time], [Time Receive], [Close Date], [Close Time], [Time Usage], [Over SLA], [Technical], [Description]) Values (@LogID, @Branch, @Severity, @NoHour, @OpenDate, @OpenTime, @TimeReceive, @CloseDate, @CloseTime, @TimeUsage, @OverSLA, @Technical, @Description)"
Dim Command As New OleDbCommand(CommandString, Connection)
Command.Parameters.AddWithValue("@LogID", TextBox1.Text)
Command.Parameters.AddWithValue("@Branch", TextBox2.Text)
Command.Parameters.AddWithValue("@Severity", TextBox3.Text)
Command.Parameters.AddWithValue("@NoHour", TextBox4.Text)
Command.Parameters.AddWithValue("@OpenDate", TextBox12.Text)
Command.Parameters.AddWithValue("@OpenTime", TextBox5.Text)
Command.Parameters.AddWithValue("@TimeReceive", TextBox8.Text)
Command.Parameters.AddWithValue("@CloseDate", TextBox13.Text)
Command.Parameters.AddWithValue("@CloseTime", TextBox7.Text)
Command.Parameters.AddWithValue("@TimeUsage", TextBox6.Text)
Command.Parameters.AddWithValue("@OverSLA", TextBox9.Text)
Command.Parameters.AddWithValue("@Technical", TextBox10.Text)
Command.Parameters.AddWithValue("@Description", TextBox11.Text)
Try
Connection.Open()
Command.ExecuteNonQuery()
Connection.Close()
MessageBox.Show("Connect OK")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Database1DataSet5.Table2' table. You can move, or remove it, as needed.
Me.Table2TableAdapter.Fill(Me.Database1DataSet5.Table2)
End Sub
Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button16.Click
End Sub
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
End Sub
End Class