从字符串到整数的转换无效

时间:2018-06-13 05:22:03

标签: vb.net

我再次收到错误,从字符串无效的整数转换,也许在ehandler.logtime

Private Sub VerificationControl_OnComplete(ByVal pTemplate As Object, ByVal FeatureSet As DPFP.FeatureSet, ByRef EventHandlerStatus As DPFP.Gui.EventHandlerStatus) Handles VerificationControl.OnComplete
        Dim validator As New validate
        Dim eHandler As New events
        Dim result As String = validator.validatefinger(FeatureSet, EventHandlerStatus)


    If result = "FAILED" Then
        EventHandlerStatus = DPFP.Gui.EventHandlerStatus.Failure

        If lblin.BackColor = Color.SeaGreen And lblout.BackColor = Color.SeaGreen Then
            panelinfo.BackColor = Color.Sienna
            lblwelcome.Text = "TOUCH LOGIN/LOGOUT first!"
            Timer2.Start()
        Else

            panelinfo.BackColor = Color.Red
            lblname.Text = ""
            lblwelcome.Text = ""
            lblid.Text = ""
            picbox.Image = Nothing
            lblwelcome.Text = "Not Found!"
            Timer2.Start()

        End If
    Else
        EventHandlerStatus = DPFP.Gui.EventHandlerStatus.Success
        If lblin.BackColor = Color.SeaGreen And lblout.BackColor = Color.SeaGreen Then
            panelinfo.BackColor = Color.Sienna
            lblwelcome.Text = "TOUCH LOGIN/LOGOUT first!"
            Timer2.Start()
        Else

            If lblin.BackColor = Color.Red Then
                    lblid.Text = result
                    lblname.ForeColor = Color.White
                    lblname.Text = validator.getcount(result)                    
                    panelinfo.BackColor = Color.SeaGreen
                    lblwelcome.Text = "Welcome!"


                    Timer2.Start()
                    *eHandler.logTime(lblid.Text, DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"), DateTime.Now.ToString("yyyy/MM/dd"), lbltime.Text, "LOGIN",lblname.Text ,"Insert")*


                End If
            End If

            If lblout.BackColor = Color.Red Then

                    lblid.Text = result
                    lblname.ForeColor = Color.White
                    lblname.Text = validator.getcount(result)
                    panelinfo.BackColor = Color.Red
                    lblwelcome.Text = "Goodbye!!"
                    Timer2.Start()
                    *eHandler.logTime(lblid.Text, DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"), DateTime.Now.ToString("yyyy/MM/dd"), lbltime.Text, "LOGOUT", lblname.Text, "Insert")*


                End If
            End If


        End If
    End If
End Sub

logTime Description该条-------------------

Public Sub logTime(ByVal id As String, ByVal logdate As String, ByVal logtime As String, ByVal logstat As String, ByVal count As Integer, ByVal type As String)
        Try
            If type = "Insert" Then
                ' query = String.Format("update tb_log set lol_status = '{0}' WHERE stafflog_id = 3", count)
                query = String.Format("insert into tb_log(staff_un,log_date,log_time,log_status,lol_status) values('{0}','{1}','{2}','{3}','{4}','{5}') ;update tb_log set lol_status = '{5}' WHERE stafflog_id = 1", id, logdate, logtime, logstat, count)

            Else
                type = "Update"
                ' query = String.Format("update tb_log set timeout='{0}' where studid='{1}' and activityid='{2}' and datelog='{3}'", timeout, sid, activityid, tdate)
                ' query = String.Format("update tb_log set lol_status = '{0}' WHERE stafflog_id = 3", count)
                query = String.Format("insert into tb_log(staff_un,log_date,log_time,log_status,lol_status) values('{0}','{1}','{2}','{3}','{4}','{5}') ;update tb_log set lol_status = '{5}' WHERE stafflog_id = 1", id, logdate, logtime, logstat, count)

            End If


            command = New MySqlCommand(query, SQLconnection)

            reader = command.ExecuteReader
            MessageBox.Show("Event Updated!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information)
            reader.Close()
        Catch ex As Exception
            MessageBox.Show("prompt")
            MsgBox(ex.Message)
        End Try
    End Sub

0 个答案:

没有答案