Option Strict Off
Public Class 系統組織架構設定
    Private Sub Set_職稱清單()
        Dim ds1 As New DataSet
        職稱_dgv.DataSource = Nothing : ds1.Clear() : 職稱_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
        職稱_dgv.ColumnHeadersHeight = 25 : 職稱_dgv.AllowUserToAddRows = False : 職稱_dgv.RowTemplate.Height = 25
        SQL_職稱清單() : da.Fill(ds1) : 職稱_dgv.DataSource = ds1.Tables(0) : conn.Close()
        職稱_dgv.Columns(0).FillWeight = 100 : 職稱_dgv.Columns(1).FillWeight = 120 : 職稱_dgv.Columns(2).FillWeight = 110 : 職稱_dgv.Columns(3).FillWeight = 70
        職稱_dgv.Columns(4).FillWeight = 200 : 職稱_dgv.Columns(5).FillWeight = 30
        職稱_dgv.Columns(0).ReadOnly = True : 職稱_dgv.Columns(1).ReadOnly = True : 職稱_dgv.Columns(2).ReadOnly = True : 職稱_dgv.Columns(3).ReadOnly = True
        職稱_dgv.Columns(4).ReadOnly = True
        職稱_dgv.EditMode = DataGridViewEditMode.EditOnEnter
        If DGV位置4.Value >= 職稱_dgv.Rows.Count Then : DGV位置4.Value = 職稱_dgv.Rows.Count - 1 : End If
        If DGV位置4.Value > 0 Then : 職稱_dgv.CurrentCell = 職稱_dgv.Rows(DGV位置4.Value).Cells(0) : End If
    End Sub
    Private Sub Set_部門清單()
        Dim ds2 As New DataSet
        部門_dgv.DataSource = Nothing : ds2.Clear() : 部門_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
        部門_dgv.ColumnHeadersHeight = 25 : 部門_dgv.AllowUserToAddRows = False
        SQL_部門清單() : da.Fill(ds2) : 部門_dgv.DataSource = ds2.Tables(0) : conn.Close()
        部門_dgv.Columns(0).FillWeight = 100 : 部門_dgv.Columns(0).ReadOnly = True
        If DGV位置1.Value >= 部門_dgv.Rows.Count Then : DGV位置1.Value = 部門_dgv.Rows.Count - 1 : End If
        If DGV位置1.Value > 0 Then : 部門_dgv.CurrentCell = 部門_dgv.Rows(DGV位置1.Value).Cells(0) : End If
    End Sub
    Private Sub Set_處別清單()
        Dim ds As New DataSet
        處別_dgv.DataSource = Nothing : ds.Clear() : 處別_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
        處別_dgv.ColumnHeadersHeight = 25 : 處別_dgv.AllowUserToAddRows = False
        PA20 = Strings.Left(部門_tb.Text, 1) : SQL_處別清單() : da.Fill(ds) : 處別_dgv.DataSource = ds.Tables(0) : conn.Close()
        處別_dgv.Columns(0).FillWeight = 100 : 處別_dgv.Columns(0).ReadOnly = True
        If DGV位置2.Value >= 處別_dgv.Rows.Count Then : DGV位置2.Value = 處別_dgv.Rows.Count - 1 : End If
        If DGV位置2.Value > 0 Then : 處別_dgv.CurrentCell = 處別_dgv.Rows(DGV位置2.Value).Cells(0) : End If
    End Sub
    Private Sub Set_課別清單()
        Dim ds7 As New DataSet
        課別_dgv.DataSource = Nothing : ds7.Clear() : 課別_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
        課別_dgv.ColumnHeadersHeight = 25 : 課別_dgv.AllowUserToAddRows = False
        PA20 = Strings.Left(處別_tb.Text, 2) : SQL_課別清單() : da.Fill(ds7) : 課別_dgv.DataSource = ds7.Tables(0) : conn.Close()
        課別_dgv.Columns(0).FillWeight = 100 : 課別_dgv.Columns(0).ReadOnly = True
        If DGV位置3.Value >= 課別_dgv.Rows.Count Then : DGV位置3.Value = 課別_dgv.Rows.Count - 1 : End If
        If DGV位置3.Value > 0 Then : 課別_dgv.CurrentCell = 課別_dgv.Rows(DGV位置3.Value).Cells(0) : End If
    End Sub
    Private Sub Set_組別清單()
        Dim ds8 As New DataSet
        組別_dgv.DataSource = Nothing : ds8.Clear() : 組別_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
        組別_dgv.ColumnHeadersHeight = 25 : 組別_dgv.AllowUserToAddRows = False
        PA20 = Strings.Left(課別_tb.Text, 3) : SQL_組別清單() : da.Fill(ds8) : 組別_dgv.DataSource = ds8.Tables(0) : conn.Close()
        組別_dgv.Columns(0).FillWeight = 100 : 組別_dgv.Columns(0).ReadOnly = True
        If DGV位置5.Value >= 組別_dgv.Rows.Count Then : DGV位置5.Value = 組別_dgv.Rows.Count - 1 : End If
        If DGV位置5.Value > 0 Then : 組別_dgv.CurrentCell = 組別_dgv.Rows(DGV位置5.Value).Cells(0) : End If
    End Sub
    Private Sub 系統組織架構設定_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.MdiParent = YS_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
        小間距1_ch.Checked = True : 中間距1_ch.Checked = False : 大間距1_ch.Checked = False
        Set_職稱清單() : Set_部門清單() : Set_課別清單() : Set_組別清單() : Set_處別清單()
        職稱_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", 7.6)
        部門_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", 7.6)
        處別_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", 7.6)
        課別_dgv.RowsDefaultCellStyle.Font = New System.Drawing.Font("微軟正黑體", 7.6)
    End Sub
    Private Sub 介面關閉_Closed(sender As Object, e As EventArgs) Handles MyBase.Closed
        MyModule1.虛擬桌面開啟()
    End Sub
    Private Sub 登入閒置控制_MouseMove(sender As Object, e As EventArgs) Handles MyBase.MouseMove
        timeNow = 0 : YS_ERP_SYS.Timer1.Enabled = False : YS_ERP_SYS.Timer1.Enabled = True
    End Sub
    Private Sub 登入閒置控制_KeyPress(sender As Object, e As EventArgs) Handles MyBase.KeyPress
        timeNow = 0 : YS_ERP_SYS.Timer1.Enabled = False : YS_ERP_SYS.Timer1.Enabled = True
    End Sub
    Private Sub 職稱_dgv_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles 職稱_dgv.RowPostPaint
        Dim linePen As New Pen(Color.Blue, 2)
        If e.RowIndex = 職稱_dgv.Rows.Count - 1 Then
            Exit Sub
        Else
            If 職稱_dgv(1, e.RowIndex).Value.ToString = "02" Then
                Dim startX As Integer = IIf(職稱_dgv.RowHeadersVisible, 職稱_dgv.RowHeadersWidth, 0)
                Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
                Dim endX As Integer = startX + 職稱_dgv.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - 職稱_dgv.HorizontalScrollingOffset
                e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
                Exit Sub
            End If
        End If
        For i As Integer = 0 To 職稱_dgv.Rows.Count - 1
            If 職稱_dgv.Rows(i).Cells("級別").Value.ToString = "01" Then : 職稱_dgv.Rows(i).DefaultCellStyle.BackColor = Color.LightGoldenrodYellow
            ElseIf 職稱_dgv.Rows(i).Cells("級別").Value.ToString = "02" Then : 職稱_dgv.Rows(i).DefaultCellStyle.BackColor = Color.LightGreen
            ElseIf 職稱_dgv.Rows(i).Cells("級別").Value.ToString = "03" Then : 職稱_dgv.Rows(i).DefaultCellStyle.BackColor = Color.LightPink
            ElseIf 職稱_dgv.Rows(i).Cells("級別").Value.ToString = "04" Then : 職稱_dgv.Rows(i).DefaultCellStyle.BackColor = Color.LightBlue
            ElseIf 職稱_dgv.Rows(i).Cells("級別").Value.ToString = "05" Then : 職稱_dgv.Rows(i).DefaultCellStyle.BackColor = Color.LightBlue
            End If
        Next
    End Sub
    Private Sub 職稱_dgv_CellDoubleClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 職稱_dgv.CellDoubleClick
        If e.RowIndex = -1 Then : Else : DGV位置4.Value = e.RowIndex
            If 組織指定_ch.Checked = True Then
                If e.ColumnIndex = 0 Then : If 部門_tb.Text <> "" Then : 職稱_dgv.Rows(Val(選擇項次_tb.Text)).Cells(0).Value = 部門_tb.Text : End If
                ElseIf e.ColumnIndex = 1 Then : If 處別_tb.Text <> "" Then : 職稱_dgv.Rows(Val(選擇項次_tb.Text)).Cells(1).Value = 處別_tb.Text : End If
                ElseIf e.ColumnIndex = 2 Then : If 課別_tb.Text <> "" Then : 職稱_dgv.Rows(Val(選擇項次_tb.Text)).Cells(2).Value = 課別_tb.Text : End If
                ElseIf e.ColumnIndex = 3 Then : If 組別_tb.Text <> "" Then : 職稱_dgv.Rows(Val(選擇項次_tb.Text)).Cells(3).Value = 組別_tb.Text : End If
                End If
            End If
        End If
    End Sub
    Private Sub 職稱_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 職稱_dgv.CellClick
        If e.RowIndex = -1 Then : Else : DGV位置4.Value = e.RowIndex
            職稱_tb.Text = 職稱_dgv(4, e.RowIndex).Value.ToString : 級別_cb.Text = 職稱_dgv(5, e.RowIndex).Value.ToString
            選擇項次_tb.Text = e.RowIndex
        End If
    End Sub
    Private Sub 部門_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 部門_dgv.CellClick
        If e.RowIndex = -1 Then : Else : DGV位置1.Value = e.RowIndex
            部門_tb.Text = 部門_dgv(0, e.RowIndex).Value.ToString : Set_處別清單()
            If 組織指定_ch.Checked = True Then : 職稱_dgv.Rows(Val(選擇項次_tb.Text)).Cells(0).Value = 部門_dgv(0, e.RowIndex).Value.ToString : End If
        End If
    End Sub
    Private Sub 處別_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 處別_dgv.CellClick
        If e.RowIndex = -1 Then : Else : DGV位置2.Value = e.RowIndex
            處別_tb.Text = 處別_dgv(0, e.RowIndex).Value.ToString : Set_課別清單()
            If 組織指定_ch.Checked = True Then : 職稱_dgv.Rows(Val(選擇項次_tb.Text)).Cells(1).Value = 處別_dgv(0, e.RowIndex).Value.ToString : End If
        End If
    End Sub
    Private Sub 課別_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 課別_dgv.CellClick
        If e.RowIndex = -1 Then : Else : DGV位置3.Value = e.RowIndex
            課別_tb.Text = 課別_dgv(0, e.RowIndex).Value.ToString : Set_組別清單()
            If 組織指定_ch.Checked = True Then : 職稱_dgv.Rows(Val(選擇項次_tb.Text)).Cells(2).Value = 課別_dgv(0, e.RowIndex).Value.ToString : End If
        End If
    End Sub
    Private Sub 組別_dgv_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles 組別_dgv.CellClick
        If e.RowIndex = -1 Then : Else : DGV位置5.Value = e.RowIndex
            組別_tb.Text = 組別_dgv(0, e.RowIndex).Value.ToString
            If 組織指定_ch.Checked = True Then : 職稱_dgv.Rows(Val(選擇項次_tb.Text)).Cells(3).Value = 組別_dgv(0, e.RowIndex).Value.ToString : End If
        End If
    End Sub
    Private Sub SET_新增按鈕程式共用2()
        CmdSet_For_dr() : MsgBox("新增完成!!") : conn.Close() : dr.Close()
    End Sub
    Private Sub SET_修改按鈕程式共用1()
        CmdSet_For_dr() : conn.Close()
    End Sub
    Private Sub SET_刪除按鈕程式共用1()
        Dim result As DialogResult = MessageBox.Show("確定要刪除該筆資料??", "請選擇", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
        If result = DialogResult.Yes Then : ConnOpen() : CmdSet_For_dr() : MsgBox("刪除完成!!") : End If : conn.Close() : 式共用1()
    End Sub
    Private Sub 式共用1()
        Set_部門清單() : Set_課別清單() : Set_組別清單() : Set_處別清單() : PA = "" : PA1 = ""
    End Sub
    Private Sub 式共用2()
        conn.Close() : dr.Close() : ConnOpen()
    End Sub
    Private Sub 式共用3()
        ConnOpen()
    End Sub
    '------------------------------------------------------------------------------------------------------------------------------------
    Private Sub 職稱新增_bt_Click(sender As Object, e As EventArgs) Handles 職稱新增_bt.Click
        If 職稱_tb.Text = "" Then : MsgBox("輸入資料有誤!!") : Else
            式共用3() : SQL_職稱重複查詢() : CmdSet_For_dr()
            If dr.Read() Then : MsgBox("資料重複，請從新輸入或檢查!!") : conn.Close() : dr.Close()
            Else : 式共用2() : SQL_公司職稱清單_新增() : CmdSet_For_dr() : 式共用2() : SQL_系統權限預設表_新增() : SET_新增按鈕程式共用2() : End If
        End If : Set_職稱清單() : PA = "" : PA1 = ""
    End Sub
    Private Sub 職稱修改_bt_Click(sender As Object, e As EventArgs) Handles 職稱修改_bt.Click
        If 職稱_tb.Text = "" Then : MsgBox("輸入資料有誤!!") : Else
            PA = InputBox("請輸入要修改的內容!!", "資料修改", 職稱_tb.Text)
            If PA = "" Then : MsgBox("沒有輸入修改內容!!") : Else
                式共用3() : SQL_公司職稱清單_修改() : CmdSet_For_dr() : conn.Close()
                式共用3() : SQL_系統權限預設表_修改() : CmdSet_For_dr() : conn.Close()
                式共用3() : SQL_系統跨部門權限表_修改() : CmdSet_For_dr() : conn.Close()
                式共用3() : SQL_使用者權限管理表_修改() : SET_修改按鈕程式共用1()
            End If
        End If : Set_職稱清單() : PA = "" : PA1 = "" : MsgBox("修改完成!!")
    End Sub
    Private Sub 級別修改_bt_Click(sender As Object, e As EventArgs) Handles 級別修改_bt.Click
        If 職稱_tb.Text = "" Then : MsgBox("輸入資料有誤!!") : Else
            式共用3() : SQL_公司職稱清單_修改級別() : CmdSet_For_dr() : conn.Close() : 式共用3() : SQL_使用者權限管理表_修改級別() : SET_修改按鈕程式共用1()
        End If : Set_職稱清單() : PA = "" : PA1 = "" : MsgBox("修改完成!!")
    End Sub
    Private Sub 職稱刪除_bt_Click(sender As Object, e As EventArgs) Handles 職稱刪除_bt.Click
        Dim result As DialogResult = MessageBox.Show("確定要刪除該筆資料??", "請選擇", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
        If result = DialogResult.Yes Then
            SQL_公司職稱清單_刪除() : conn.Close() : SQL_系統權限預設表_刪除() : conn.Close() : SQL_使用者權限管理表_刪除() : conn.Close() : MsgBox("刪除完成!!")
        End If : conn.Close() : 式共用1()
    End Sub
    Private Sub 批量存檔_bt_Click(sender As Object, e As EventArgs) Handles 批量存檔_bt.Click
        If 組織指定_ch.Checked = True Then
            For i As Integer = 0 To 職稱_dgv.Rows.Count - 1
                資料數 = 職稱_dgv.Rows.Count : MyMod.進度條()
                PA1 = 職稱_dgv.Rows(i).Cells(0).Value.ToString : PA2 = 職稱_dgv.Rows(i).Cells(1).Value.ToString
                PA3 = 職稱_dgv.Rows(i).Cells(2).Value.ToString : PA4 = 職稱_dgv.Rows(i).Cells(3).Value.ToString
                PA5 = 職稱_dgv.Rows(i).Cells(4).Value.ToString : PA6 = 職稱_dgv.Rows(i).Cells(5).Value.ToString
                SQL_公司職稱清單_存檔() : conn.Close()
            Next : YS_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0 : 組織指定_ch.Checked = False : MsgBox("修改完成!!")
        Else : MsgBox("組織指定必須打勾，才能使用批量存檔!!") : End If
    End Sub
    '------------------------------------------------------------------------------------------------------------------------------------
    Private Sub 部門新增_bt_Click(sender As Object, e As EventArgs) Handles 部門新增_bt.Click
        PA1 = 部門_tb.Text
        If PA1 = "" Then : MsgBox("輸入資料有誤!!") : Else
            式共用3() : SQL_部門重複查詢() : CmdSet_For_dr()
            If dr.Read() Then
                MsgBox("資料重複，請從新輸入或檢查!!") : conn.Close() : dr.Close()
            Else : 式共用2() : SQL_公司部門清單_新增() : SET_新增按鈕程式共用2() : End If
        End If : 式共用1() : PA1 = ""
    End Sub
    Private Sub 部門修改_bt_Click(sender As Object, e As EventArgs) Handles 部門修改_bt.Click
        PA1 = 部門_tb.Text
        If PA1 = "" Then : MsgBox("輸入資料有誤!!") : Else
            PA = InputBox("請輸入要修改的內容!!", "資料修改", 部門_tb.Text)
            If PA = "" Then : MsgBox("沒有輸入修改內容!!")
            Else
                式共用3() : SQL_公司部門清單_修改部門() : SET_修改按鈕程式共用1()
                式共用3() : SQL_公司職稱清單_修改部門() : SET_修改按鈕程式共用1()
                式共用3() : SQL_使用者權限管理表_修改部門() : SET_修改按鈕程式共用1()
            End If
        End If : 式共用1() : Set_職稱清單() : PA = "" : PA1 = "" : MsgBox("修改完成!!")
    End Sub
    Private Sub 部門刪除_bt_Click(sender As Object, e As EventArgs) Handles 部門刪除_bt.Click
        PA1 = 部門_tb.Text : SQL_公司部門清單_刪除() : SET_刪除按鈕程式共用1() : PA1 = ""
    End Sub
    '------------------------------------------------------------------------------------------------------------------------------------
    Private Sub 課別新增_bt_Click(sender As Object, e As EventArgs) Handles 課別新增_bt.Click
        PA1 = 課別_tb.Text
        If PA1 = "" Then : MsgBox("輸入資料有誤!!") : Else : 式共用3() : SQL_課別重複查詢() : CmdSet_For_dr()
            If dr.Read() Then : MsgBox("資料重複，請從新輸入或檢查!!") : conn.Close() : dr.Close() : Else : 式共用2() : SQL_公司課別清單_新增() : SET_新增按鈕程式共用2() : End If
        End If : 式共用1() : PA1 = ""
    End Sub
    Private Sub 課別修改_bt_Click(sender As Object, e As EventArgs) Handles 課別修改_bt.Click
        PA1 = 課別_tb.Text
        If PA1 = "" Then : MsgBox("輸入資料有誤!!") : Else
            Dim SS, SS1, SS2 As String
            PA = InputBox("請輸入要修改的內容!!", "資料修改", 課別_tb.Text)
            If PA = "" Then : MsgBox("沒有輸入修改內容!!") : Else
                式共用3() : SQL_公司課別清單_修改課別() : SET_修改按鈕程式共用1()
                式共用3() : SQL_公司職稱清單_修改課別() : SET_修改按鈕程式共用1()
                式共用3() : SQL_使用者權限管理表_修改課別() : SET_修改按鈕程式共用1()
            End If
        End If : 式共用1() : Set_職稱清單() : PA = "" : PA1 = "" : MsgBox("修改完成!!")
    End Sub
    Private Sub 課別刪除_bt_Click(sender As Object, e As EventArgs) Handles 課別刪除_bt.Click
        PA1 = 課別_tb.Text : SQL_公司課別清單_刪除() : SET_刪除按鈕程式共用1() : PA1 = ""
    End Sub
    '------------------------------------------------------------------------------------------------------------------------------------
    Private Sub 組別新增_bt_Click(sender As Object, e As EventArgs) Handles 組別新增_bt.Click
        PA1 = 組別_tb.Text
        If PA1 = "" Then : MsgBox("輸入資料有誤!!") : Else
            式共用3() : SQL_組別重複查詢() : CmdSet_For_dr()
            If dr.Read() Then : MsgBox("資料重複，請從新輸入或檢查!!") : conn.Close() : dr.Close()
            Else : 式共用2() : SQL_公司組別清單_新增() : SET_新增按鈕程式共用2() : End If
        End If : 式共用1() : PA1 = ""
    End Sub
    Private Sub 組別修改_bt_Click(sender As Object, e As EventArgs) Handles 組別修改_bt.Click
        PA1 = 組別_tb.Text
        If 組別_tb.Text = "" Then : MsgBox("輸入資料有誤!!") : Else
            PA = InputBox("請輸入要修改的內容!!", "資料修改", 組別_tb.Text)
            If PA = "" Then : MsgBox("沒有輸入修改內容!!") : Else
                式共用3() : SQL_公司組別清單_修改組別() : SET_修改按鈕程式共用1() : 式共用3() : SQL_公司職稱清單_修改組別() : SET_修改按鈕程式共用1()
                式共用3() : SQL_使用者權限管理表_修改組別() : SET_修改按鈕程式共用1() : MsgBox("修改完成!!")
            End If
        End If : 式共用1() : Set_職稱清單() : PA = "" : PA1 = ""
    End Sub
    Private Sub 組別刪除_bt_Click(sender As Object, e As EventArgs) Handles 組別刪除_bt.Click
        PA1 = 組別_tb.Text : SQL_公司組別清單_刪除() : SET_刪除按鈕程式共用1() : PA1 = ""
    End Sub
    '------------------------------------------------------------------------------------------------------------------------------------
    Private Sub 處別新增_bt_Click(sender As Object, e As EventArgs) Handles 處別新增_bt.Click
        PA1 = 處別_tb.Text
        If PA1 = "" Then : MsgBox("輸入資料有誤!!") : Else
            式共用3() : SQL_處級重複查詢() : CmdSet_For_dr()
            If dr.Read() Then : MsgBox("資料重複，請從新輸入或檢查!!") : conn.Close() : dr.Close()
            Else : 式共用2() : SQL_公司處級清單_新增() : SET_新增按鈕程式共用2() : End If
        End If : 式共用1() : PA1 = ""
    End Sub
    Private Sub 處別修改_bt_Click(sender As Object, e As EventArgs) Handles 處別修改_bt.Click
        PA1 = 處別_tb.Text
        If PA1 = "" Then : MsgBox("輸入資料有誤!!") : Else
            PA = InputBox("請輸入要修改的內容!!", "資料修改", 處別_tb.Text)
            If PA = "" Then : MsgBox("沒有輸入修改內容!!") : Else
                式共用3() : SQL_公司處級清單_修改處級() : SET_修改按鈕程式共用1()
                式共用3() : SQL_公司職稱清單_修改處級() : SET_修改按鈕程式共用1()
                式共用3() : SQL_使用者權限管理表_修改處級() : SET_修改按鈕程式共用1() : MsgBox("修改完成!!")
            End If
        End If : 式共用1() : Set_職稱清單() : PA = "" : PA1 = ""
    End Sub
    Private Sub 處別刪除_bt_Click(sender As Object, e As EventArgs) Handles 處別刪除_bt.Click
        PA1 = 處別_tb.Text : SQL_公司處級清單_刪除() : SET_刪除按鈕程式共用1() : PA1 = ""
    End Sub
    Private Sub 小間距1_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 小間距1_ch.Click
        小間距1_ch.Checked = True : 中間距1_ch.Checked = False : 大間距1_ch.Checked = False : Set_職稱清單()
    End Sub
    Private Sub 中間距1_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 中間距1_ch.Click
        小間距1_ch.Checked = False : 中間距1_ch.Checked = True : 大間距1_ch.Checked = False : Set_職稱清單()
    End Sub
    Private Sub 大間距1_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 大間距1_ch.Click
        小間距1_ch.Checked = False : 中間距1_ch.Checked = False : 大間距1_ch.Checked = True : Set_職稱清單()
    End Sub
End Class