Option Strict Off
Imports System.Data.SqlClient
Public Class 系統使用者管理
    ReadOnly conn As New SqlConnection
    ReadOnly da As New SqlDataAdapter
    ReadOnly cmd As New SqlCommand
    ReadOnly ds As New DataSet
    Dim dr As SqlDataReader
    Dim HH As String
    Private Sub Set_使用者清單()
        DataGridView1.DataSource = Nothing : ds.Clear()
        DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
        DataGridView1.ColumnHeadersHeight = 25
        DataGridView1.AllowUserToAddRows = False
        If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
        If PA = "" Then
            SQL1 = "SELECT " & 登入權限 & " 使用者權限管理表 ORDER BY 職稱"
        Else
            SQL1 = "SELECT " & 登入權限 & " 使用者權限管理表 WHERE 姓名 LIKE N'" & PA & "' OR 帳號 LIKE N'" & PA & "' OR 部門 LIKE N'" & PA & "' OR 職稱 LIKE N'" & PA & "' ORDER BY 職稱"
        End If
        cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close() : Set_grid()
    End Sub
    Private Sub Set_grid()
        DataGridView1.Columns(0).Width = 80 : DataGridView1.Columns(1).Width = 80 : DataGridView1.Columns(2).Width = 80 : DataGridView1.Columns(3).Width = 70 : DataGridView1.Columns(4).Width = 70
        For i As Integer = 0 To 95
            DataGridView1.Columns(i + 5).Visible = False
        Next
        For i As Integer = 0 To DataGridView1.Rows.Count - 1
            DataGridView1.Rows(i).Cells("密碼").Value = "*************"
        Next
    End Sub
    Private Sub Set_格式設定()
        '---------同時控制所有具有一定命名規則的控件---------------------------------------------------------------------------------------------------------------------------------------------
        For no As Integer = 1 To 96
            Dim checkbox As CheckBox = CType(Me.Controls.Find("CheckBox" + no.ToString(), True)(0), CheckBox)
            checkbox.Checked = False
        Next
    End Sub
    Private Sub ComboBox1下拉表單資料載入()
        conn.Close()
        If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
        SQL1 = "SELECT 部門 FROM METOO部門清單 ORDER BY 部門"
        cmd.CommandText = SQL1 : cmd.Connection = conn : dr = cmd.ExecuteReader
        ComboBox1.Items.Clear() : While (dr.Read()) : ComboBox1.Items.Add(dr("部門")) : End While : conn.Close()
    End Sub
    Private Sub ComboBox2下拉表單資料載入()
        conn.Close()
        If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
        SQL1 = "SELECT 職稱 FROM METOO職稱清單 ORDER BY 職稱"
        cmd.CommandText = SQL1 : cmd.Connection = conn : dr = cmd.ExecuteReader
        ComboBox2.Items.Clear() : While (dr.Read()) : ComboBox2.Items.Add(dr("職稱")) : End While : conn.Close()
    End Sub
    Private Sub 系統使用者管理_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.MdiParent = WINPROFIT_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
        Set_格式設定() : ComboBox1下拉表單資料載入() : ComboBox2下拉表單資料載入()
        Button1.Enabled = False
        Set_使用者清單() : Set_grid()
    End Sub
    Private Sub DataGridView1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick
        If e.RowIndex = -1 Then : Else
            TextBox1.Text = DataGridView1.Rows(e.RowIndex).Cells("姓名").Value.ToString : TextBox2.Text = DataGridView1.Rows(e.RowIndex).Cells("帳號").Value
            conn.Close()
            If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
            SQL1 = "SELECT 密碼 FROM 使用者權限管理表 WHERE 姓名 LIKE N'" & TextBox1.Text & "' OR 帳號 LIKE N'" & TextBox2.Text & "'"
            cmd.CommandText = SQL1 : cmd.Connection = conn : dr = cmd.ExecuteReader
            If (dr.Read()) Then : TextBox3.Text = dr("密碼") : End If : conn.Close()

            ComboBox1.Text = DataGridView1.Rows(e.RowIndex).Cells("部門").Value : ComboBox2.Text = DataGridView1.Rows(e.RowIndex).Cells("職稱").Value
            '---------同時控制所有具有一定命名規則的控件---------------------------------------------------------------------------------------------------------------------------------------------
            For no As Integer = 1 To 96
                If no - 1 < 10 Then : HH = "0" & no - 1 : ElseIf no - 1 >= 10 Then : HH = no - 1 : End If
                Dim checkbox As CheckBox = CType(Me.Controls.Find("CheckBox" + no.ToString(), True)(0), CheckBox)
                checkbox.Checked = DataGridView1.Rows(e.RowIndex).Cells("CC" & HH).Value
            Next
        End If
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
        SQL1 = "INSERT INTO 使用者權限管理表 (姓名, 帳號, 密碼, 部門, 職稱, 員工編號, ID卡號, CC00, CC01, CC02, CC03, CC04, CC05, CC06, CC07, CC08, CC09, CC10, CC11, CC12, CC13, CC14, CC15, CC16, 
                CC17, CC18, CC19, CC20, CC21, CC22, CC23, CC24, CC25, CC26, CC27, CC28, CC29, CC30, CC31, CC32, CC33, CC34, CC35, CC36, CC37, CC38, CC39, CC40, CC41, CC42, CC43, CC44, CC45, CC46, 
                CC47, CC48, CC49, CC50, CC51, CC52, CC53, CC54, CC55, CC56, CC57, CC58, CC59, CC60, CC61, CC62, CC63, CC64, CC65, CC66, CC67, CC68, CC69, CC70, CC71, CC72, CC73, CC74, CC75, CC76, 
                CC77, CC78, CC79, CC80, CC81, CC82, CC83, CC84, CC85, CC86, CC87, CC88, CC89, CC90, CC91, CC92, CC93, CC94, CC95) " &
               "VALUES (N'" & TextBox1.Text & "',N'" & TextBox2.Text & "',N'" & TextBox3.Text & "', N'" & ComboBox1.Text & "', N'" & ComboBox2.Text &
               "', N'', N'', '" & CheckBox1.Checked & "', '" & CheckBox2.Checked & "', '" & CheckBox3.Checked & "', '" & CheckBox4.Checked & "', '" & CheckBox5.Checked & "', '" & CheckBox6.Checked &
               "', '" & CheckBox7.Checked & "', '" & CheckBox8.Checked & "', '" & CheckBox9.Checked & "', '" & CheckBox10.Checked & "', '" & CheckBox11.Checked & "', '" & CheckBox12.Checked &
               "', '" & CheckBox13.Checked & "', '" & CheckBox14.Checked & "', '" & CheckBox15.Checked & "', '" & CheckBox16.Checked & "', '" & CheckBox17.Checked & "', '" & CheckBox18.Checked &
               "', '" & CheckBox19.Checked & "', '" & CheckBox20.Checked & "', '" & CheckBox21.Checked & "', '" & CheckBox22.Checked & "', '" & CheckBox23.Checked & "', '" & CheckBox24.Checked &
               "', '" & CheckBox25.Checked & "', '" & CheckBox26.Checked & "', '" & CheckBox27.Checked & "', '" & CheckBox28.Checked & "', '" & CheckBox29.Checked & "', '" & CheckBox30.Checked &
               "', '" & CheckBox31.Checked & "', '" & CheckBox32.Checked & "', '" & CheckBox33.Checked & "', '" & CheckBox34.Checked & "', '" & CheckBox35.Checked & "', '" & CheckBox36.Checked &
               "', '" & CheckBox37.Checked & "', '" & CheckBox38.Checked & "', '" & CheckBox39.Checked & "', '" & CheckBox40.Checked & "', '" & CheckBox41.Checked & "', '" & CheckBox42.Checked &
               "', '" & CheckBox43.Checked & "', '" & CheckBox44.Checked & "', '" & CheckBox45.Checked & "', '" & CheckBox46.Checked & "', '" & CheckBox47.Checked & "', '" & CheckBox48.Checked &
               "', '" & CheckBox49.Checked & "', '" & CheckBox50.Checked & "', '" & CheckBox51.Checked & "', '" & CheckBox52.Checked & "', '" & CheckBox53.Checked & "', '" & CheckBox54.Checked &
               "', '" & CheckBox55.Checked & "', '" & CheckBox56.Checked & "', '" & CheckBox57.Checked & "', '" & CheckBox58.Checked & "', '" & CheckBox59.Checked & "', '" & CheckBox60.Checked &
               "', '" & CheckBox61.Checked & "', '" & CheckBox62.Checked & "', '" & CheckBox63.Checked & "', '" & CheckBox64.Checked & "', '" & CheckBox65.Checked & "', '" & CheckBox66.Checked &
               "', '" & CheckBox67.Checked & "', '" & CheckBox68.Checked & "', '" & CheckBox69.Checked & "', '" & CheckBox70.Checked & "', '" & CheckBox71.Checked & "', '" & CheckBox72.Checked &
               "', '" & CheckBox73.Checked & "', '" & CheckBox74.Checked & "', '" & CheckBox75.Checked & "', '" & CheckBox76.Checked & "', '" & CheckBox77.Checked & "', '" & CheckBox78.Checked &
               "', '" & CheckBox79.Checked & "', '" & CheckBox80.Checked & "', '" & CheckBox81.Checked & "', '" & CheckBox82.Checked & "', '" & CheckBox83.Checked & "', '" & CheckBox84.Checked &
               "', '" & CheckBox85.Checked & "', '" & CheckBox86.Checked & "', '" & CheckBox87.Checked & "', '" & CheckBox88.Checked & "', '" & CheckBox89.Checked & "', '" & CheckBox90.Checked &
               "', '" & CheckBox91.Checked & "', '" & CheckBox92.Checked & "', '" & CheckBox93.Checked & "', '" & CheckBox94.Checked & "', '" & CheckBox95.Checked & "', '" & CheckBox96.Checked & "')"
        cmd.Connection = conn : cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close()
        MsgBox("新增完成")
        Set_使用者清單() : Button1.Enabled = False : Button4.Enabled = True
    End Sub
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Then
            MsgBox("輸入資料有誤")
        Else
            If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
            SQL1 = "UPDATE 使用者權限管理表 SET 姓名 = N'" & TextBox1.Text & "', 密碼 = N'" & TextBox3.Text & "', 部門 = N'" & ComboBox1.Text & "', 職稱 = N'" & ComboBox2.Text &
                   "', CC00 = '" & CheckBox1.Checked & "', CC01 = '" & CheckBox2.Checked & "', CC02 = '" & CheckBox3.Checked & "', CC03 = '" & CheckBox4.Checked & "', CC04 = '" & CheckBox5.Checked &
                   "', CC05 = '" & CheckBox6.Checked & "', CC06 = '" & CheckBox7.Checked & "', CC07 = '" & CheckBox8.Checked & "', CC08 = '" & CheckBox9.Checked & "', CC09 = '" & CheckBox10.Checked &
                   "', CC10 = '" & CheckBox11.Checked & "', CC11 = '" & CheckBox12.Checked & "', CC12 = '" & CheckBox13.Checked & "', CC13 = '" & CheckBox14.Checked & "', CC14 = '" & CheckBox15.Checked &
                   "', CC15 = '" & CheckBox16.Checked & "', CC16 = '" & CheckBox17.Checked & "', CC17 = '" & CheckBox18.Checked & "', CC18 = '" & CheckBox19.Checked & "', CC19 = '" & CheckBox20.Checked &
                   "', CC20 = '" & CheckBox21.Checked & "', CC21 = '" & CheckBox22.Checked & "', CC22 = '" & CheckBox23.Checked & "', CC23 = '" & CheckBox24.Checked & "', CC24 = '" & CheckBox25.Checked &
                   "', CC25 = '" & CheckBox26.Checked & "', CC26 = '" & CheckBox27.Checked & "', CC27 = '" & CheckBox28.Checked & "', CC28 = '" & CheckBox29.Checked & "', CC29 = '" & CheckBox30.Checked &
                   "', CC30 = '" & CheckBox31.Checked & "', CC31 = '" & CheckBox32.Checked & "', CC32 = '" & CheckBox33.Checked & "', CC33 = '" & CheckBox34.Checked & "', CC34 = '" & CheckBox35.Checked &
                   "', CC35 = '" & CheckBox36.Checked & "', CC36 = '" & CheckBox37.Checked & "', CC37 = '" & CheckBox38.Checked & "', CC38 = '" & CheckBox39.Checked & "', CC39 = '" & CheckBox40.Checked &
                   "', CC40 = '" & CheckBox41.Checked & "', CC41 = '" & CheckBox42.Checked & "', CC42 = '" & CheckBox43.Checked & "', CC43 = '" & CheckBox44.Checked & "', CC44 = '" & CheckBox45.Checked &
                   "', CC45 = '" & CheckBox46.Checked & "', CC46 = '" & CheckBox47.Checked & "', CC47 = '" & CheckBox48.Checked & "', CC48 = '" & CheckBox49.Checked & "', CC49 = '" & CheckBox50.Checked &
                   "', CC50 = '" & CheckBox51.Checked & "', CC51 = '" & CheckBox52.Checked & "', CC52 = '" & CheckBox53.Checked & "', CC53 = '" & CheckBox54.Checked & "', CC54 = '" & CheckBox55.Checked &
                   "', CC55 = '" & CheckBox56.Checked & "', CC56 = '" & CheckBox57.Checked & "', CC57 = '" & CheckBox58.Checked & "', CC58 = '" & CheckBox59.Checked & "', CC59 = '" & CheckBox60.Checked &
                   "', CC60 = '" & CheckBox61.Checked & "', CC61 = '" & CheckBox62.Checked & "', CC62 = '" & CheckBox63.Checked & "', CC63 = '" & CheckBox64.Checked & "', CC64 = '" & CheckBox65.Checked &
                   "', CC65 = '" & CheckBox66.Checked & "', CC66 = '" & CheckBox67.Checked & "', CC67 = '" & CheckBox68.Checked & "', CC68 = '" & CheckBox69.Checked & "', CC69 = '" & CheckBox70.Checked &
                   "', CC70 = '" & CheckBox71.Checked & "', CC71 = '" & CheckBox72.Checked & "', CC72 = '" & CheckBox73.Checked & "', CC73 = '" & CheckBox74.Checked & "', CC74 = '" & CheckBox75.Checked &
                   "', CC75 = '" & CheckBox76.Checked & "', CC76 = '" & CheckBox77.Checked & "', CC77 = '" & CheckBox78.Checked & "', CC78 = '" & CheckBox79.Checked & "', CC79 = '" & CheckBox80.Checked &
                   "', CC80 = '" & CheckBox81.Checked & "', CC81 = '" & CheckBox82.Checked & "', CC82 = '" & CheckBox83.Checked & "', CC83 = '" & CheckBox84.Checked & "', CC84 = '" & CheckBox85.Checked &
                   "', CC85 = '" & CheckBox86.Checked & "', CC86 = '" & CheckBox87.Checked & "', CC87 = '" & CheckBox88.Checked & "', CC88 = '" & CheckBox89.Checked & "', CC89 = '" & CheckBox90.Checked &
                   "', CC90 = '" & CheckBox91.Checked & "', CC91 = '" & CheckBox92.Checked & "', CC92 = '" & CheckBox93.Checked & "', CC93 = '" & CheckBox94.Checked & "', CC94 = '" & CheckBox95.Checked &
                   "', CC95 = '" & CheckBox96.Checked & "' " &
                   "WHERE (帳號 = '" & TextBox2.Text & "')"
            cmd.CommandText = SQL1 : cmd.ExecuteNonQuery() : conn.Close() : conn.Close()
            MsgBox("新增完成")
        End If
        Set_使用者清單()
    End Sub
    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        SQL1 = "DELETE FROM 使用者權限管理表 WHERE (帳號 = '" & TextBox2.Text & "')"
        cmd.CommandText = SQL1 : cmd.Connection = conn
        If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
        Dim aa As MsgBoxResult
        aa = MsgBox("確定要刪除該筆資料?", MsgBoxStyle.OkCancel)
        If aa = MsgBoxResult.Ok Then : cmd.ExecuteNonQuery() : cmd.ExecuteNonQuery() : MsgBox("刪除完成") : End If
        conn.Close() : conn.Close()
        TextBox1.Text = "" : TextBox2.Text = "" : TextBox2.Text = "" : ComboBox1下拉表單資料載入() : ComboBox2下拉表單資料載入() : CheckBox1.Checked = False
        Set_使用者清單()
    End Sub
    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
        TextBox1.Text = "" : TextBox2.Text = "" : TextBox3.Text = "" : ComboBox1下拉表單資料載入() : ComboBox2下拉表單資料載入() : Button4.Enabled = False : Button1.Enabled = True
        Set_格式設定()
    End Sub
    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
        PA = InputBox("請輸入要查詢的資料") : ComboBox2下拉表單資料載入()
    End Sub


    '*************************************************************************************************************************************
    Private Sub CheckBox11_Click(sender As Object, e As EventArgs) Handles CheckBox11.Click
        If CheckBox10.Checked = False Then : CheckBox10.Checked = True : End If
    End Sub
    Private Sub CheckBox12_Click(sender As Object, e As EventArgs) Handles CheckBox12.Click
        If CheckBox10.Checked = False Then : CheckBox10.Checked = True : End If
    End Sub
    Private Sub CheckBox13_Click(sender As Object, e As EventArgs) Handles CheckBox13.Click
        If CheckBox10.Checked = False Then : CheckBox10.Checked = True : End If : If CheckBox12.Checked = False Then : CheckBox12.Checked = True : End If
    End Sub
    Private Sub CheckBox37_Click(sender As Object, e As EventArgs) Handles CheckBox37.Click
        If CheckBox10.Checked = False Then : CheckBox10.Checked = True : End If
    End Sub
    Private Sub CheckBox38_Click(sender As Object, e As EventArgs) Handles CheckBox38.Click
        If CheckBox10.Checked = False Then : CheckBox10.Checked = True : End If
    End Sub


    '*************************************************************************************************************************************
    Private Sub CheckBox23_Click(sender As Object, e As EventArgs) Handles CheckBox23.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox24_Click(sender As Object, e As EventArgs) Handles CheckBox24.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If : If CheckBox23.Checked = False Then : CheckBox23.Checked = True : End If
    End Sub
    Private Sub CheckBox25_Click(sender As Object, e As EventArgs) Handles CheckBox25.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If : If CheckBox23.Checked = False Then : CheckBox23.Checked = True : End If
    End Sub
    Private Sub CheckBox26_Click(sender As Object, e As EventArgs) Handles CheckBox26.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If : If CheckBox23.Checked = False Then : CheckBox23.Checked = True : End If
    End Sub
    Private Sub CheckBox88_Click(sender As Object, e As EventArgs) Handles CheckBox88.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox64_Click(sender As Object, e As EventArgs) Handles CheckBox64.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox65_Click(sender As Object, e As EventArgs) Handles CheckBox65.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox66_Click(sender As Object, e As EventArgs) Handles CheckBox66.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox67_Click(sender As Object, e As EventArgs) Handles CheckBox67.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox68_Click(sender As Object, e As EventArgs) Handles CheckBox68.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox69_Click(sender As Object, e As EventArgs) Handles CheckBox69.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox70_Click(sender As Object, e As EventArgs) Handles CheckBox70.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox71_Click(sender As Object, e As EventArgs) Handles CheckBox71.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox72_Click(sender As Object, e As EventArgs) Handles CheckBox72.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox73_Click(sender As Object, e As EventArgs) Handles CheckBox73.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox74_Click(sender As Object, e As EventArgs) Handles CheckBox74.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox75_Click(sender As Object, e As EventArgs) Handles CheckBox75.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox76_Click(sender As Object, e As EventArgs) Handles CheckBox76.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox77_Click(sender As Object, e As EventArgs) Handles CheckBox77.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox78_Click(sender As Object, e As EventArgs) Handles CheckBox78.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox79_Click(sender As Object, e As EventArgs) Handles CheckBox79.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox80_Click(sender As Object, e As EventArgs) Handles CheckBox80.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox89_Click(sender As Object, e As EventArgs) Handles CheckBox89.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub
    Private Sub CheckBox90_Click(sender As Object, e As EventArgs) Handles CheckBox90.Click
        If CheckBox14.Checked = False Then : CheckBox14.Checked = True : End If
    End Sub



    '*************************************************************************************************************************************
    Private Sub CheckBox18_Click(sender As Object, e As EventArgs) Handles CheckBox18.Click
        If CheckBox22.Checked = False Then : CheckBox22.Checked = True : End If
    End Sub
    Private Sub CheckBox19_Click(sender As Object, e As EventArgs) Handles CheckBox19.Click
        If CheckBox22.Checked = False Then : CheckBox22.Checked = True : End If : If CheckBox18.Checked = False Then : CheckBox18.Checked = True : End If
    End Sub
    Private Sub CheckBox20_Click(sender As Object, e As EventArgs) Handles CheckBox20.Click
        If CheckBox22.Checked = False Then : CheckBox22.Checked = True : End If : If CheckBox18.Checked = False Then : CheckBox18.Checked = True : End If
    End Sub
    Private Sub CheckBox21_Click(sender As Object, e As EventArgs) Handles CheckBox21.Click
        If CheckBox22.Checked = False Then : CheckBox22.Checked = True : End If : If CheckBox18.Checked = False Then : CheckBox18.Checked = True : End If
    End Sub
    Private Sub CheckBox58_Click(sender As Object, e As EventArgs) Handles CheckBox58.Click
        If CheckBox22.Checked = False Then : CheckBox22.Checked = True : End If
    End Sub
    Private Sub CheckBox59_Click(sender As Object, e As EventArgs) Handles CheckBox59.Click
        If CheckBox22.Checked = False Then : CheckBox22.Checked = True : End If
    End Sub
    Private Sub CheckBox60_Click(sender As Object, e As EventArgs) Handles CheckBox60.Click
        If CheckBox22.Checked = False Then : CheckBox22.Checked = True : End If
    End Sub
    Private Sub CheckBox61_Click(sender As Object, e As EventArgs) Handles CheckBox61.Click
        If CheckBox22.Checked = False Then : CheckBox22.Checked = True : End If
    End Sub
    Private Sub CheckBox91_Click(sender As Object, e As EventArgs) Handles CheckBox91.Click
        If CheckBox22.Checked = False Then : CheckBox22.Checked = True : End If
    End Sub
    Private Sub CheckBox92_Click(sender As Object, e As EventArgs) Handles CheckBox92.Click
        If CheckBox22.Checked = False Then : CheckBox22.Checked = True : End If
    End Sub
    Private Sub CheckBox93_Click(sender As Object, e As EventArgs) Handles CheckBox93.Click
        If CheckBox22.Checked = False Then : CheckBox22.Checked = True : End If
    End Sub
    Private Sub CheckBox94_Click(sender As Object, e As EventArgs) Handles CheckBox94.Click
        If CheckBox22.Checked = False Then : CheckBox22.Checked = True : End If
    End Sub


    '*************************************************************************************************************************************
    Private Sub CheckBox6_Click(sender As Object, e As EventArgs) Handles CheckBox6.Click
        If CheckBox5.Checked = False Then : CheckBox5.Checked = True : End If
    End Sub
    Private Sub CheckBox7_Click(sender As Object, e As EventArgs) Handles CheckBox7.Click
        If CheckBox5.Checked = False Then : CheckBox5.Checked = True : End If : If CheckBox6.Checked = False Then : CheckBox6.Checked = True : End If
    End Sub
    Private Sub CheckBox8_Click(sender As Object, e As EventArgs) Handles CheckBox8.Click
        If CheckBox5.Checked = False Then : CheckBox5.Checked = True : End If : If CheckBox6.Checked = False Then : CheckBox6.Checked = True : End If
    End Sub
    Private Sub CheckBox9_Click(sender As Object, e As EventArgs) Handles CheckBox9.Click
        If CheckBox5.Checked = False Then : CheckBox5.Checked = True : End If : If CheckBox6.Checked = False Then : CheckBox6.Checked = True : End If
    End Sub
    Private Sub CheckBox34_Click(sender As Object, e As EventArgs) Handles CheckBox34.Click
        If CheckBox5.Checked = False Then : CheckBox5.Checked = True : End If
    End Sub


    '*************************************************************************************************************************************
    Private Sub CheckBox2_Click(sender As Object, e As EventArgs) Handles CheckBox2.Click
        If CheckBox1.Checked = False Then : CheckBox1.Checked = True : End If
    End Sub
    Private Sub CheckBox27_Click(sender As Object, e As EventArgs) Handles CheckBox27.Click
        If CheckBox1.Checked = False Then : CheckBox1.Checked = True : End If
    End Sub
    Private Sub CheckBox3_Click(sender As Object, e As EventArgs) Handles CheckBox3.Click
        If CheckBox1.Checked = False Then : CheckBox1.Checked = True : End If
    End Sub
    Private Sub CheckBox4_Click(sender As Object, e As EventArgs) Handles CheckBox4.Click
        If CheckBox1.Checked = False Then : CheckBox1.Checked = True : End If
    End Sub
    Private Sub CheckBox33_Click(sender As Object, e As EventArgs) Handles CheckBox33.Click
        If CheckBox1.Checked = False Then : CheckBox1.Checked = True : End If
    End Sub
    Private Sub CheckBox53_Click(sender As Object, e As EventArgs) Handles CheckBox53.Click
        If CheckBox1.Checked = False Then : CheckBox1.Checked = True : End If
    End Sub


    '*************************************************************************************************************************************
    Private Sub CheckBox29_Click(sender As Object, e As EventArgs) Handles CheckBox29.Click
        If CheckBox28.Checked = False Then : CheckBox28.Checked = True : End If
    End Sub
    Private Sub CheckBox30_Click(sender As Object, e As EventArgs) Handles CheckBox30.Click
        If CheckBox28.Checked = False Then : CheckBox28.Checked = True : End If
    End Sub
    Private Sub CheckBox31_Click(sender As Object, e As EventArgs) Handles CheckBox31.Click
        If CheckBox28.Checked = False Then : CheckBox28.Checked = True : End If
    End Sub
    Private Sub CheckBox32_Click(sender As Object, e As EventArgs) Handles CheckBox32.Click
        If CheckBox28.Checked = False Then : CheckBox28.Checked = True : End If
    End Sub
    Private Sub CheckBox44_Click(sender As Object, e As EventArgs) Handles CheckBox44.Click
        If CheckBox28.Checked = False Then : CheckBox28.Checked = True : End If
    End Sub


    '*************************************************************************************************************************************
    Private Sub CheckBox45_Click(sender As Object, e As EventArgs) Handles CheckBox45.Click
        If CheckBox35.Checked = False Then : CheckBox35.Checked = True : End If
    End Sub
    Private Sub CheckBox46_Click(sender As Object, e As EventArgs) Handles CheckBox46.Click
        If CheckBox35.Checked = False Then : CheckBox35.Checked = True : End If
    End Sub
    Private Sub CheckBox47_Click(sender As Object, e As EventArgs) Handles CheckBox47.Click
        If CheckBox35.Checked = False Then : CheckBox35.Checked = True : End If
    End Sub
    Private Sub CheckBox55_Click(sender As Object, e As EventArgs) Handles CheckBox55.Click
        If CheckBox35.Checked = False Then : CheckBox35.Checked = True : End If
    End Sub
    Private Sub CheckBox56_Click(sender As Object, e As EventArgs) Handles CheckBox56.Click
        If CheckBox35.Checked = False Then : CheckBox35.Checked = True : End If
    End Sub
    Private Sub CheckBox57_Click(sender As Object, e As EventArgs) Handles CheckBox57.Click
        If CheckBox35.Checked = False Then : CheckBox35.Checked = True : End If
    End Sub
    Private Sub CheckBox36_Click(sender As Object, e As EventArgs) Handles CheckBox36.Click
        If CheckBox35.Checked = False Then : CheckBox35.Checked = True : End If
    End Sub
    Private Sub CheckBox43_Click(sender As Object, e As EventArgs) Handles CheckBox43.Click
        If CheckBox35.Checked = False Then : CheckBox35.Checked = True : End If
    End Sub


    '*************************************************************************************************************************************
    Private Sub CheckBox41_Click(sender As Object, e As EventArgs) Handles CheckBox41.Click
        If CheckBox39.Checked = False Then : CheckBox39.Checked = True : End If
    End Sub
    Private Sub CheckBox42_Click(sender As Object, e As EventArgs) Handles CheckBox42.Click
        If CheckBox39.Checked = False Then : CheckBox39.Checked = True : End If : If CheckBox41.Checked = False Then : CheckBox41.Checked = True : End If
    End Sub
    Private Sub CheckBox63_Click(sender As Object, e As EventArgs) Handles CheckBox63.Click
        If CheckBox39.Checked = False Then : CheckBox39.Checked = True : End If
    End Sub
    Private Sub CheckBox15_Click(sender As Object, e As EventArgs) Handles CheckBox15.Click
        If CheckBox39.Checked = False Then : CheckBox39.Checked = True : End If
    End Sub
    Private Sub CheckBox84_Click(sender As Object, e As EventArgs) Handles CheckBox84.Click
        If CheckBox39.Checked = False Then : CheckBox39.Checked = True : End If
    End Sub
    Private Sub CheckBox16_Click(sender As Object, e As EventArgs) Handles CheckBox16.Click
        If CheckBox39.Checked = False Then : CheckBox39.Checked = True : End If : If CheckBox15.Checked = False Then : CheckBox15.Checked = True : End If
    End Sub
    Private Sub CheckBox17_Click(sender As Object, e As EventArgs) Handles CheckBox17.Click
        If CheckBox39.Checked = False Then : CheckBox39.Checked = True : End If : If CheckBox15.Checked = False Then : CheckBox15.Checked = True : End If
    End Sub
    Private Sub CheckBox40_Click(sender As Object, e As EventArgs) Handles CheckBox40.Click
        If CheckBox39.Checked = False Then : CheckBox39.Checked = True : End If
    End Sub
    Private Sub CheckBox85_Click(sender As Object, e As EventArgs) Handles CheckBox85.Click
        If CheckBox39.Checked = False Then : CheckBox39.Checked = True : End If
    End Sub
    Private Sub CheckBox86_Click(sender As Object, e As EventArgs) Handles CheckBox86.Click
        If CheckBox39.Checked = False Then : CheckBox39.Checked = True : End If
    End Sub
    Private Sub CheckBox87_Click(sender As Object, e As EventArgs) Handles CheckBox87.Click
        If CheckBox39.Checked = False Then : CheckBox39.Checked = True : End If
    End Sub


    '*************************************************************************************************************************************
    Private Sub CheckBox49_Click(sender As Object, e As EventArgs) Handles CheckBox49.Click
        If CheckBox48.Checked = False Then : CheckBox48.Checked = True : End If
    End Sub
    Private Sub CheckBox50_Click(sender As Object, e As EventArgs) Handles CheckBox50.Click
        If CheckBox48.Checked = False Then : CheckBox48.Checked = True : End If
    End Sub
    Private Sub CheckBox51_Click(sender As Object, e As EventArgs) Handles CheckBox51.Click
        If CheckBox48.Checked = False Then : CheckBox48.Checked = True : End If
    End Sub
    Private Sub CheckBox52_Click(sender As Object, e As EventArgs) Handles CheckBox52.Click
        If CheckBox48.Checked = False Then : CheckBox48.Checked = True : End If
    End Sub
    Private Sub CheckBox81_Click(sender As Object, e As EventArgs) Handles CheckBox81.Click
        If CheckBox48.Checked = False Then : CheckBox48.Checked = True : End If
    End Sub
    Private Sub CheckBox82_Click(sender As Object, e As EventArgs) Handles CheckBox82.Click
        If CheckBox48.Checked = False Then : CheckBox48.Checked = True : End If
    End Sub


    '*************************************************************************************************************************************
    Private Sub CheckBox54_Click(sender As Object, e As EventArgs) Handles CheckBox54.Click
        If CheckBox62.Checked = False Then : CheckBox62.Checked = True : End If
    End Sub
    Private Sub CheckBox95_Click(sender As Object, e As EventArgs) Handles CheckBox95.Click
        If CheckBox62.Checked = False Then : CheckBox62.Checked = True : End If
    End Sub
    Private Sub CheckBox96_Click(sender As Object, e As EventArgs) Handles CheckBox96.Click
        If CheckBox62.Checked = False Then : CheckBox62.Checked = True : End If
    End Sub
End Class