-4
如何在显示表单之前获取所有消息,并逐个显示此表单?使用字符串显示表格
首先,我有一个程序获取条目,如果“客户端”已经签出或者客户端的预订已经过期。通过这种方法,我将得到他们的交易号码和客户号码,将他们的信息放在一个表格中并显示出来。请注意,我对于过期预订和退房有不同的表单
有人可以检查我的程序吗?这是我的代码,如果他/她的登记已过期,可以获得客户端。
Public Sub computeRemainingDaysForCheckedIns()
Dim computedDays As Integer
Dim dateNow As Date = Date.Now.ToString("yyyy-MM-dd")
Try
mysqlconn = New MySqlConnection(con)
mysqlconn.Open()
query = "select TransactionNumber, ClientNumber, DATEDIFF(dateout,curdate()) as 'ComputedDays' from dbo_transactions where ClientStatus = 'Checked In'"
cmd = New MySqlCommand(query, mysqlconn)
rd = cmd.ExecuteReader
If rd.HasRows Then
'hasRows ibig sabhin mayLAMAN ung table
While rd.Read
computedDays = rd.GetString("ComputedDays")
'Console.WriteLine(computedDays)
If computedDays > 0 Then
getTransactionNumber = ""
getClientNumber = ""
ElseIf computedDays < 0 Then
getTransactionNumber = rd.GetString("TransactionNumber")
getClientNumber = rd.GetString("ClientNumber")
iTitle = "CHECK OUT CLIENT."
iMessage.AppendLine("* Client: " & getClientNumber & ", Transaction: " & getTransactionNumber & " *")
isCNotifShowed = True
End If
End While
'notificationFormC.Show()
Else
'no data
End If
mysqlconn.Close()
Catch ex As Exception
isCNotifShowed = False
MsgBox("Something Went Wrong!" & vbNewLine &
ex.Message, MsgBoxStyle.Exclamation)
Finally
mysqlconn.Dispose()
End Try
End Sub
Public Sub computeRemainingDaysForReservations()
Dim computedDays As Integer
Try
mysqlconn = New MySqlConnection(con)
mysqlconn.Open()
query = "Select TransactionNumber, ClientNumber, DATEDIFF(DateIn, CURDATE()) as 'ComputedDays' from dbo_transactions where ClientStatus = 'Reserved'"
cmd = New MySqlCommand(query, mysqlconn)
rd = cmd.ExecuteReader
If rd.HasRows Then
'hasRows ibig sabhin mayLAMAN ung table
While rd.Read
computedDays = rd.GetString("ComputedDays")
'Console.WriteLine(computedDays)
If computedDays > 0 Then
getTransactionNumber = ""
getClientNumber = ""
ElseIf computedDays <= 0 Then
getTransactionNumber = rd.GetString("TransactionNumber")
getClientNumber = rd.GetString("ClientNumber")
iiTitle = "RESERVATION IS ALREADY EXPIRED."
iiMessage.AppendLine("* " & getClientNumber & ", Transaction: " & getTransactionNumber & " *")
isRNotifShowed = True
End If
End While
Else
'no data
End If
rd.Close()
mysqlconn.Close()
Catch ex As Exception
isRNotifShowed = False
MsgBox("Something Went Wrong!" & vbNewLine &
ex.Message, MsgBoxStyle.Exclamation)
Finally
mysqlconn.Dispose()
End Try
End Sub
然后使用表单
Private Sub RepeatProcess()
computeRemainingDaysForReservations()
computeRemainingDaysForCheckedIns()
If iMessage.Length <> 0 Then
ElseIf iiMessage.Length <> 0 Then
End If
'If isCNotifShowed = True Then
'notificationFormC.Show()
'ElseIf isRNotifShowed = True Then
' notificationFormR.Show()
'Else
'End If
End Sub
Private Sub timerTask_Tick_1(sender As Object, e As EventArgs) Handles timerTask.Tick
tCount += 1
If tCount = tSecs Then
Call RepeatProcess()
tCount = 0 'reset
End If
End Sub
请在您的问题中发布代码而不是链接到图像 – 2014-10-06 13:04:59
我为我的代码创建了一个链接。 – Ellis 2014-10-06 13:06:27
否 - 在此网站上发布您的代码;如果PasteBin删除你的代码,那么将来人们怎么可以引用它? – Paul 2014-10-06 15:19:06