Module GcmProc ''' ''' MGB 通知視窗 strA 要顯示的文字 ''' strB:訊息類型 [1] 只有確定 ; [2] 有確定跟取消, 使用 [訊息回應] 字串回傳 [YES] OR [NO] ''' Public Sub MGB(ByVal strA As String, ByVal strB As String) 通知訊息 = strA : 訊息類型 = strB : 通知視窗.ShowDialog() End Sub ''' ''' INB 輸入視窗 strC 要顯示的文字 strD 要輸入的文字 ''' 輸入視窗會將訊息回傳到 [訊息回應] 上,在將 [訊息回應] 帶入要傳送的條件中。 ''' 如果要在輸入視窗的輸入控件上先帶入文字即可設定第二個變數,沒有設定就是空白。 ''' Public Sub INB(ByVal strC As String, Optional ByVal strD As String = "") 通知訊息 = strC : 輸入視窗.輸入_rtb.Text = strD : 輸入視窗.ShowDialog() End Sub ''' ''' 顯示說明 之前必須要宣告 [介面] ''' 開公告 輸入的是要顯示公告的次數。 ''' 如果要在輸入視窗的輸入控件上先帶入文字即可設定第二個變數,沒有設定就是空白。 ''' Public Sub LIN訊息通知(ByVal 代號 As String, ByVal 對象 As String, Optional ByVal 變數X As String = "", Optional ByVal 變數Y As String = "") LINE_權限代號 = 代號 : 發送對象 = 對象 : 通知變數X = 變數X : 通知變數Y = 變數Y : LINE_通知模塊() End Sub ''' ''' 輸入cb 用來載入Combox的清單 ''' 原來值 用來把原本的控件上的已選擇的值帶入變數,在沒有選擇任何資料時帶回原來的值。 ''' Public Sub CB選擇清單(ByVal 輸入cb As ComboBox, Optional ByVal 原來值 As String = "") Dim 原來的 As String = 原來值 For I As Integer = 0 To 3000 : PPBB(I) = "" : Next For I As Integer = 0 To 輸入cb.Items.Count - 1 : PPBB(I) = 輸入cb.Items(I).ToString : NN1 = I : Next If 輸入cb.Items.Count < 23 Then : 下拉清單_2.ShowDialog() : Else : 下拉清單_1.ShowDialog() : End If If PPAA = "" Then : 輸入cb.Text = 原來的 Else : 輸入cb.Text = PPAA : End If End Sub Public Sub CB選擇清單_可選空白(ByVal 輸入cb As ComboBox) For I As Integer = 0 To 3000 : PPBB(I) = "" : Next For I As Integer = 0 To 輸入cb.Items.Count - 1 : PPBB(I) = 輸入cb.Items(I).ToString : NN1 = I : Next If 輸入cb.Items.Count < 23 Then : 下拉清單_2.ShowDialog() : Else : 下拉清單_1.ShowDialog() : End If 輸入cb.Text = PPAA End Sub Public Sub 顯示說明(ByVal 開公告 As Integer, ByVal 公告顯示 As Boolean) Dim 開啟, 公告 As Integer : Dim 是否新增 As Boolean = False : Dim inputDate As Date : Dim yearValue As Integer Dim monthValue As Integer : Dim formattedMonth As String inputDate = Date.Now ' 假設您有一個日期,這裡我們使用當前日期作為示例 yearValue = Year(inputDate) ' 從日期中提取年份和月份 monthValue = Month(inputDate) ' 從日期中提取年份和月份 If monthValue < 10 Then : formattedMonth = "0" & monthValue.ToString() : Else : formattedMonth = monthValue.ToString() : End If ' 格式化月份以確保兩位數 PA45 = yearValue.ToString() : PA46 = formattedMonth ' 將年份和月份數值存入變數X和Y中 SQL_說明顯示查詢() If dr.Read Then : 開啟 = dr("開啟次數") : 公告 = dr("公告次數") : Else : 開啟 = 0 : 公告 = 0 : 是否新增 = True : End If If 公告顯示 = True Then If 開公告 > 公告 Then : PA48 = 公告 + 1 : ElseIf 登入人級別 = "00" Then : PA48 = 公告 + 1 : End If End If PA47 = 開啟 + 1 If 是否新增 = True Then : SQL_說明顯示新增() : Else : SQL_說明顯示修改() : End If End Sub End Module