Option Strict Off
Public Class 個人帳號管理
    Dim FFGG As Integer
    Dim DDFF As String
    Private Sub Set_使用者資料()
        SQL_使用者資料()
        If dr.Read() Then : 姓名_rtb.Text = dr("姓名").ToString : 帳號_rtb.Text = dr("帳號").ToString : 密碼_rtb.Text = dr("密碼").ToString
            上次修改日期_rtb.Text = dr("密碼日期").ToString : DDFF = dr("密碼").ToString
        End If : conn.Close() : dr.Close()
    End Sub
    Private Sub Set_日期格式轉換()
        DTP = Format(Today(), "yyyy/MM/dd")
    End Sub
    Private Sub 存檔_rbt_MouseEnter(sender As Object, e As EventArgs) Handles 存檔_rbt.MouseEnter
        ToolTip1.SetToolTip(Me.存檔_rbt, "存檔")
    End Sub
    Private Sub 個人帳號管理_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    End Sub
    Private Sub 個人帳號管理_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
        Set_使用者資料()
        姓名_rtb.Enabled = False : 帳號_rtb.Enabled = False : 上次修改日期_rtb.Enabled = False : 剩餘有效日_rtb.Enabled = False
        FFGG = DateDiff("d", 上次修改日期_rtb.Text, Format(Today(), "yyyy/MM/dd"))
        If CC(45) = False Then : 剩餘有效日_rtb.Text = "NA" : Else : 剩餘有效日_rtb.Text = 密碼時限 - FFGG : End If : Me.ActiveControl = 密碼_rtb
    End Sub
    Private Sub 登入閒置控制_MouseMove(sender As Object, e As EventArgs) Handles MyBase.MouseMove
        timeNow = 0 : FH_ERP_SYS.Timer1.Enabled = False : FH_ERP_SYS.Timer1.Enabled = True
    End Sub
    Private Sub 登入閒置控制_KeyPress(sender As Object, e As EventArgs) Handles MyBase.KeyPress
        timeNow = 0 : FH_ERP_SYS.Timer1.Enabled = False : FH_ERP_SYS.Timer1.Enabled = True
    End Sub
    Private Sub 存檔_rbt_Click(sender As Object, e As EventArgs) Handles 存檔_rbt.Click
        Me.ActiveControl = 密碼_rtb
        If 姓名_rtb.Text = "" Or 帳號_rtb.Text = "" Or 密碼_rtb.Text = "" Then : MsgBox("資料有缺，請重新確認!!") : Else
            If DDFF = 密碼_rtb.Text Then : MsgBox("密碼不可以跟上一次依樣!!") : Else
                Set_日期格式轉換() : SQL_使用者資料修改() : conn.Close() : MsgBox("存檔完成!!") : Me.Close()
            End If
        End If
    End Sub
End Class