Brak opisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

系統通用變數管理.vb 1.9KB

1234567891011121314151617181920212223242526272829303132333435
  1. Option Strict Off
  2. Imports System.Data.SqlClient
  3. Public Class 系統通用變數管理
  4. Dim conn As New SqlConnection
  5. Dim cmd As New SqlCommand
  6. Dim dr As SqlDataReader
  7. Dim GGHH As Integer : Dim FFGG As Integer
  8. Private Sub 系統通用變數管理_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  9. Me.MdiParent = GCM_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
  10. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  11. SQL1 = "SELECT timeExit, timeExit2 FROM 系統閒置時間設定"
  12. cmd.CommandText = SQL1 : cmd.Connection = conn : dr = cmd.ExecuteReader
  13. If dr.Read() Then : TextBox2.Text = dr("timeExit") : TextBox1.Text = dr("timeExit2") : End If : conn.Close()
  14. GGHH = Val(TextBox2.Text) : FFGG = Val(TextBox1.Text)
  15. TextBox3.Text = 密碼時限
  16. End Sub
  17. Private Sub 登入閒置控制_MouseMove(sender As Object, e As EventArgs) Handles MyBase.MouseMove
  18. timeNow = 0
  19. GCM_ERP_SYS.Timer1.Enabled = False
  20. GCM_ERP_SYS.Timer1.Enabled = True
  21. End Sub
  22. Private Sub 登入閒置控制_KeyPress(sender As Object, e As EventArgs) Handles MyBase.KeyPress
  23. timeNow = 0
  24. GCM_ERP_SYS.Timer1.Enabled = False
  25. GCM_ERP_SYS.Timer1.Enabled = True
  26. End Sub
  27. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  28. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  29. SQL1 = "UPDATE 系統閒置時間設定 SET timeExit = N'" & TextBox2.Text & "', timeExit2 = N'" & TextBox1.Text & "' WHERE (timeExit = N'" & GGHH & "' AND timeExit2 = N'" & FFGG & "')"
  30. cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery()
  31. conn.Close()
  32. GGHH = Val(TextBox2.Text) : FFGG = Val(TextBox1.Text) : timeExit = GGHH : timeExit2 = FFGG
  33. MsgBox("修改完畢")
  34. End Sub
  35. End Class