暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

排班明細_參考.vb 127KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673
  1. Option Strict Off
  2. Imports System.Drawing.Imaging
  3. Imports System.IO
  4. Public Class 排班明細_參考
  5. ReadOnly ds, ds1 As New DataSet
  6. Dim X1, XX, XXX, AA As Double
  7. Dim Q, 開始位置1, 開始位置2, 標準長度, 行(20), 選擇項, 選擇處 As Integer
  8. Private Sub 讀取人員資料表()
  9. 人員_dgv.DataSource = Nothing : ds.Clear()
  10. 人員_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  11. 人員_dgv.ColumnHeadersHeight = 25
  12. 人員_dgv.AllowUserToAddRows = False
  13. If 全_ch.Checked = False Then
  14. SQL_排班系統_班別_人員()
  15. Else
  16. SQL_排班系統_班別_人員_全()
  17. End If
  18. da.Fill(ds) : 人員_dgv.DataSource = ds.Tables(0) : conn.Close()
  19. 人員_dgv.Columns(0).FillWeight = 70 : 人員_dgv.Columns(1).Visible = False : 人員_dgv.Columns(2).FillWeight = 100
  20. For i As Integer = 0 To 人員_dgv.Rows.Count - 1
  21. 人員_dgv.Rows(i).Cells("No.").Value = i + 1
  22. Next
  23. End Sub
  24. Private Sub 讀取排班資料表()
  25. 排班明細_dgv.DataSource = Nothing : ds1.Clear()
  26. 排班明細_dgv.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  27. 排班明細_dgv.ColumnHeadersHeight = 25
  28. 排班明細_dgv.AllowUserToAddRows = False
  29. SQL_排班系統_班別_排班()
  30. da.Fill(ds1) : 排班明細_dgv.DataSource = ds1.Tables(0) : conn.Close()
  31. 排班明細_dgv.Sort(排班明細_dgv.Columns("項"), System.ComponentModel.ListSortDirection.Ascending)
  32. For i As Integer = 0 To 排班明細_dgv.Rows.Count - 1
  33. If IsDBNull(排班明細_dgv.Rows(i).Cells("請假類別").Value) = True Then
  34. 排班明細_dgv.Rows(i).Cells("請假類別").Value = ""
  35. End If
  36. If CInt(排班明細_dgv.Rows(i).Cells("項次").Value.ToString) < 10 Then
  37. 排班明細_dgv.Rows(i).Cells("項次").Value = ("0" & i + 1)
  38. Else : 排班明細_dgv.Rows(i).Cells("項次").Value = (i + 1) : End If
  39. Next
  40. End Sub
  41. Private Sub 班別_下拉表單資料載入()
  42. SQL_排班系統_班別_下拉()
  43. 班別_cb1.Items.Clear() : 班別_cb2.Items.Clear() : 班別_cb3.Items.Clear() : 班別_cb4.Items.Clear() : 班別_cb5.Items.Clear() : 班別_cb6.Items.Clear()
  44. 班別_cb7.Items.Clear() : 班別_cb7.Items.Clear() : 班別_cb8.Items.Clear() : 班別_cb9.Items.Clear() : 班別_cb10.Items.Clear() : 班別_cb11.Items.Clear()
  45. 班別_cb12.Items.Clear() : 班別_cb13.Items.Clear() : 班別_cb14.Items.Clear() : 班別_cb15.Items.Clear() : 班別_cb16.Items.Clear() : 班別_cb17.Items.Clear()
  46. 班別_cb18.Items.Clear() : 班別_cb19.Items.Clear() : 班別_cb20.Items.Clear()
  47. While (dr.Read())
  48. 班別_cb1.Items.Add(dr("時段")) : 班別_cb2.Items.Add(dr("時段")) : 班別_cb3.Items.Add(dr("時段")) : 班別_cb4.Items.Add(dr("時段")) : 班別_cb5.Items.Add(dr("時段"))
  49. 班別_cb6.Items.Add(dr("時段")) : 班別_cb7.Items.Add(dr("時段")) : 班別_cb8.Items.Add(dr("時段")) : 班別_cb9.Items.Add(dr("時段")) : 班別_cb10.Items.Add(dr("時段"))
  50. 班別_cb11.Items.Add(dr("時段")) : 班別_cb12.Items.Add(dr("時段")) : 班別_cb13.Items.Add(dr("時段")) : 班別_cb14.Items.Add(dr("時段")) : 班別_cb15.Items.Add(dr("時段"))
  51. 班別_cb16.Items.Add(dr("時段")) : 班別_cb17.Items.Add(dr("時段")) : 班別_cb18.Items.Add(dr("時段")) : 班別_cb19.Items.Add(dr("時段")) : 班別_cb20.Items.Add(dr("時段"))
  52. End While
  53. conn.Close()
  54. End Sub
  55. Private Sub 職務_下拉表單資料載入()
  56. SQL_排班系統_職務_下拉()
  57. ComboBox1.Items.Clear() : ComboBox2.Items.Clear() : ComboBox3.Items.Clear() : ComboBox4.Items.Clear() : ComboBox5.Items.Clear() : ComboBox6.Items.Clear()
  58. ComboBox7.Items.Clear() : ComboBox8.Items.Clear() : ComboBox9.Items.Clear() : ComboBox10.Items.Clear() : ComboBox11.Items.Clear() : ComboBox12.Items.Clear()
  59. ComboBox13.Items.Clear() : ComboBox14.Items.Clear() : ComboBox15.Items.Clear() : ComboBox16.Items.Clear() : ComboBox17.Items.Clear() : ComboBox18.Items.Clear()
  60. ComboBox19.Items.Clear() : ComboBox20.Items.Clear() : ComboBox21.Items.Clear() : ComboBox22.Items.Clear() : ComboBox23.Items.Clear() : ComboBox24.Items.Clear()
  61. ComboBox25.Items.Clear() : ComboBox26.Items.Clear() : ComboBox27.Items.Clear() : ComboBox28.Items.Clear() : ComboBox29.Items.Clear() : ComboBox30.Items.Clear()
  62. ComboBox31.Items.Clear() : ComboBox32.Items.Clear() : ComboBox33.Items.Clear() : ComboBox34.Items.Clear() : ComboBox35.Items.Clear() : ComboBox36.Items.Clear()
  63. ComboBox37.Items.Clear() : ComboBox38.Items.Clear() : ComboBox39.Items.Clear() : ComboBox40.Items.Clear()
  64. While (dr.Read())
  65. ComboBox1.Items.Add(dr("職務")) : ComboBox2.Items.Add(dr("職務")) : ComboBox3.Items.Add(dr("職務")) : ComboBox4.Items.Add(dr("職務")) : ComboBox5.Items.Add(dr("職務"))
  66. ComboBox6.Items.Add(dr("職務")) : ComboBox7.Items.Add(dr("職務")) : ComboBox8.Items.Add(dr("職務")) : ComboBox9.Items.Add(dr("職務")) : ComboBox10.Items.Add(dr("職務"))
  67. ComboBox11.Items.Add(dr("職務")) : ComboBox12.Items.Add(dr("職務")) : ComboBox13.Items.Add(dr("職務")) : ComboBox14.Items.Add(dr("職務")) : ComboBox15.Items.Add(dr("職務"))
  68. ComboBox16.Items.Add(dr("職務")) : ComboBox17.Items.Add(dr("職務")) : ComboBox18.Items.Add(dr("職務")) : ComboBox19.Items.Add(dr("職務")) : ComboBox20.Items.Add(dr("職務"))
  69. ComboBox21.Items.Add(dr("職務")) : ComboBox22.Items.Add(dr("職務")) : ComboBox23.Items.Add(dr("職務")) : ComboBox24.Items.Add(dr("職務")) : ComboBox25.Items.Add(dr("職務"))
  70. ComboBox26.Items.Add(dr("職務")) : ComboBox27.Items.Add(dr("職務")) : ComboBox28.Items.Add(dr("職務")) : ComboBox29.Items.Add(dr("職務")) : ComboBox30.Items.Add(dr("職務"))
  71. ComboBox31.Items.Add(dr("職務")) : ComboBox32.Items.Add(dr("職務")) : ComboBox33.Items.Add(dr("職務")) : ComboBox34.Items.Add(dr("職務")) : ComboBox35.Items.Add(dr("職務"))
  72. ComboBox36.Items.Add(dr("職務")) : ComboBox37.Items.Add(dr("職務")) : ComboBox38.Items.Add(dr("職務")) : ComboBox39.Items.Add(dr("職務")) : ComboBox40.Items.Add(dr("職務"))
  73. End While
  74. conn.Close()
  75. End Sub
  76. Private Sub 班表鎖定變化()
  77. If gUserName = "*系統管理者" Then
  78. 存檔_bt.Enabled = True : 人員_dgv.Enabled = True : 全_ch.Enabled = True
  79. For no As Integer = 1 To 20
  80. Dim 姓名_tbS As TextBox = CType(Me.Controls.Find("姓名_tb" + no.ToString(), True)(0), TextBox)
  81. Dim 班別_cbS As ComboBox = CType(Me.Controls.Find("班別_cb" + no.ToString(), True)(0), ComboBox)
  82. Dim A_lbS As Label = CType(Me.Controls.Find("A_lb" + no.ToString(), True)(0), Label)
  83. Dim CheckBoxS As CheckBox = CType(Me.Controls.Find("CheckBox" + no.ToString(), True)(0), CheckBox)
  84. Dim NumericUpDownS As NumericUpDown = CType(Me.Controls.Find("NumericUpDown" + no.ToString(), True)(0), NumericUpDown)
  85. Dim NUPS As NumericUpDown = CType(Me.Controls.Find("NUP" + no.ToString(), True)(0), NumericUpDown)
  86. 姓名_tbS.Enabled = True : 班別_cbS.Enabled = True : CheckBoxS.Enabled = True : NumericUpDownS.Enabled = True : NUPS.Enabled = True
  87. Next
  88. Else
  89. If 鎖定_bt.Enabled = False Then
  90. 存檔_bt.Enabled = False : 人員_dgv.Enabled = False : 全_ch.Enabled = False
  91. For no As Integer = 1 To 20
  92. Dim 姓名_tbS As TextBox = CType(Me.Controls.Find("姓名_tb" + no.ToString(), True)(0), TextBox)
  93. Dim 班別_cbS As ComboBox = CType(Me.Controls.Find("班別_cb" + no.ToString(), True)(0), ComboBox)
  94. Dim A_lbS As Label = CType(Me.Controls.Find("A_lb" + no.ToString(), True)(0), Label)
  95. Dim CheckBoxS As CheckBox = CType(Me.Controls.Find("CheckBox" + no.ToString(), True)(0), CheckBox)
  96. Dim NumericUpDownS As NumericUpDown = CType(Me.Controls.Find("NumericUpDown" + no.ToString(), True)(0), NumericUpDown)
  97. Dim NUPS As NumericUpDown = CType(Me.Controls.Find("NUP" + no.ToString(), True)(0), NumericUpDown)
  98. 姓名_tbS.Enabled = False : 班別_cbS.Enabled = False : CheckBoxS.Enabled = False : NumericUpDownS.Enabled = False : NUPS.Enabled = False
  99. Next
  100. Else
  101. 存檔_bt.Enabled = True : 人員_dgv.Enabled = True : 全_ch.Enabled = True
  102. For no As Integer = 1 To 20
  103. Dim 姓名_tbS As TextBox = CType(Me.Controls.Find("姓名_tb" + no.ToString(), True)(0), TextBox)
  104. Dim 班別_cbS As ComboBox = CType(Me.Controls.Find("班別_cb" + no.ToString(), True)(0), ComboBox)
  105. Dim A_lbS As Label = CType(Me.Controls.Find("A_lb" + no.ToString(), True)(0), Label)
  106. Dim CheckBoxS As CheckBox = CType(Me.Controls.Find("CheckBox" + no.ToString(), True)(0), CheckBox)
  107. Dim NumericUpDownS As NumericUpDown = CType(Me.Controls.Find("NumericUpDown" + no.ToString(), True)(0), NumericUpDown)
  108. Dim NUPS As NumericUpDown = CType(Me.Controls.Find("NUP" + no.ToString(), True)(0), NumericUpDown)
  109. 姓名_tbS.Enabled = True : 班別_cbS.Enabled = True : CheckBoxS.Enabled = True : NumericUpDownS.Enabled = True : NUPS.Enabled = True
  110. Next
  111. End If
  112. End If
  113. End Sub
  114. Private Sub 進度條變化1()
  115. If 姓名_tb1.Text <> "" Or 班別_cb1.Text <> "休" Then
  116. Do2 = NumericUpDown1.Value : 班條長度()
  117. ComboBox1.Size = New Size(標準長度 + XXX, 32) : ComboBox2.Size = New Size(標準長度 - XXX, 25)
  118. If CheckBox1.Checked = False And Val(Strings.Left(班別_cb1.Text, 2)) < 17 Then : ComboBox2.Visible = True
  119. ElseIf CheckBox1.Checked = False And Val(Strings.Left(班別_cb1.Text, 2)) >= 17 Then : ComboBox2.Visible = False
  120. ElseIf CheckBox1.Checked = True Then : ComboBox2.Visible = False : End If
  121. End If
  122. End Sub
  123. Private Sub 進度條變化2()
  124. Do2 = NumericUpDown2.Value : 班條長度()
  125. If 姓名_tb2.Text <> "" Or 班別_cb2.Text <> "休" Then
  126. ComboBox3.Size = New Size(標準長度 + XXX, 32) : ComboBox4.Size = New Size(標準長度 - XXX, 25)
  127. If CheckBox2.Checked = False And Val(Strings.Left(班別_cb2.Text, 2)) < 17 Then : ComboBox4.Visible = True
  128. ElseIf CheckBox2.Checked = False And Val(Strings.Left(班別_cb2.Text, 2)) >= 17 Then : ComboBox4.Visible = False
  129. ElseIf CheckBox2.Checked = True Then : ComboBox4.Visible = False : End If
  130. End If
  131. End Sub
  132. Private Sub 進度條變化3()
  133. If 姓名_tb3.Text <> "" Or 班別_cb3.Text <> "休" Then
  134. Do2 = NumericUpDown3.Value : 班條長度()
  135. ComboBox5.Size = New Size(標準長度 + XXX, 32) : ComboBox6.Size = New Size(標準長度 - XXX, 25)
  136. If CheckBox3.Checked = False And Val(Strings.Left(班別_cb3.Text, 2)) < 17 Then : ComboBox6.Visible = True
  137. ElseIf CheckBox3.Checked = False And Val(Strings.Left(班別_cb3.Text, 2)) >= 17 Then : ComboBox6.Visible = False
  138. ElseIf CheckBox3.Checked = True Then : ComboBox6.Visible = False : End If
  139. End If
  140. End Sub
  141. Private Sub 進度條變化4()
  142. If 姓名_tb4.Text <> "" Or 班別_cb4.Text <> "休" Then
  143. Do2 = NumericUpDown4.Value : 班條長度()
  144. ComboBox7.Size = New Size(標準長度 + XXX, 32) : ComboBox8.Size = New Size(標準長度 - XXX, 25)
  145. If CheckBox4.Checked = False And Val(Strings.Left(班別_cb4.Text, 2)) < 17 Then : ComboBox8.Visible = True
  146. ElseIf CheckBox4.Checked = False And Val(Strings.Left(班別_cb4.Text, 2)) >= 17 Then : ComboBox8.Visible = False
  147. ElseIf CheckBox4.Checked = True Then : ComboBox8.Visible = False : End If
  148. End If
  149. End Sub
  150. Private Sub 進度條變化5()
  151. If 姓名_tb5.Text <> "" Or 班別_cb5.Text <> "休" Then
  152. Do2 = NumericUpDown5.Value : 班條長度()
  153. ComboBox9.Size = New Size(標準長度 + XXX, 32) : ComboBox10.Size = New Size(標準長度 - XXX, 25)
  154. If CheckBox5.Checked = False And Val(Strings.Left(班別_cb5.Text, 2)) < 17 Then : ComboBox10.Visible = True
  155. ElseIf CheckBox5.Checked = False And Val(Strings.Left(班別_cb5.Text, 2)) >= 17 Then : ComboBox10.Visible = False
  156. ElseIf CheckBox5.Checked = True Then : ComboBox10.Visible = False : End If
  157. End If
  158. End Sub
  159. Private Sub 進度條變化6()
  160. If 姓名_tb6.Text <> "" Or 班別_cb6.Text <> "休" Then
  161. Do2 = NumericUpDown6.Value : 班條長度()
  162. ComboBox11.Size = New Size(標準長度 + XXX, 32) : ComboBox12.Size = New Size(標準長度 - XXX, 25)
  163. If CheckBox6.Checked = False And Val(Strings.Left(班別_cb6.Text, 2)) < 17 Then : ComboBox12.Visible = True
  164. ElseIf CheckBox6.Checked = False And Val(Strings.Left(班別_cb6.Text, 2)) >= 17 Then : ComboBox12.Visible = False
  165. ElseIf CheckBox6.Checked = True Then : ComboBox12.Visible = False : End If
  166. End If
  167. End Sub
  168. Private Sub 進度條變化7()
  169. If 姓名_tb7.Text <> "" Or 班別_cb7.Text <> "休" Then
  170. Do2 = NumericUpDown7.Value : 班條長度()
  171. ComboBox13.Size = New Size(標準長度 + XXX, 32) : ComboBox14.Size = New Size(標準長度 - XXX, 25)
  172. If CheckBox7.Checked = False And Val(Strings.Left(班別_cb7.Text, 2)) < 17 Then : ComboBox14.Visible = True
  173. ElseIf CheckBox7.Checked = False And Val(Strings.Left(班別_cb7.Text, 2)) >= 17 Then : ComboBox14.Visible = False
  174. ElseIf CheckBox7.Checked = True Then : ComboBox14.Visible = False : End If
  175. End If
  176. End Sub
  177. Private Sub 進度條變化8()
  178. If 姓名_tb8.Text <> "" Or 班別_cb8.Text <> "休" Then
  179. Do2 = NumericUpDown8.Value : 班條長度()
  180. ComboBox15.Size = New Size(標準長度 + XXX, 32) : ComboBox16.Size = New Size(標準長度 - XXX, 25)
  181. If CheckBox8.Checked = False And Val(Strings.Left(班別_cb8.Text, 2)) < 17 Then : ComboBox16.Visible = True
  182. ElseIf CheckBox8.Checked = False And Val(Strings.Left(班別_cb8.Text, 2)) >= 17 Then : ComboBox16.Visible = False
  183. ElseIf CheckBox8.Checked = True Then : ComboBox16.Visible = False : End If
  184. End If
  185. End Sub
  186. Private Sub 進度條變化9()
  187. If 姓名_tb9.Text <> "" Or 班別_cb9.Text <> "休" Then
  188. Do2 = NumericUpDown9.Value : 班條長度()
  189. ComboBox17.Size = New Size(標準長度 + XXX, 32) : ComboBox18.Size = New Size(標準長度 - XXX, 25)
  190. If CheckBox9.Checked = False And Val(Strings.Left(班別_cb9.Text, 2)) < 17 Then : ComboBox18.Visible = True
  191. ElseIf CheckBox9.Checked = False And Val(Strings.Left(班別_cb9.Text, 2)) >= 17 Then : ComboBox18.Visible = False
  192. ElseIf CheckBox9.Checked = True Then : ComboBox18.Visible = False : End If
  193. End If
  194. End Sub
  195. Private Sub 進度條變化10()
  196. If 姓名_tb10.Text <> "" Or 班別_cb10.Text <> "休" Then
  197. Do2 = NumericUpDown10.Value : 班條長度()
  198. ComboBox19.Size = New Size(標準長度 + XXX, 32) : ComboBox20.Size = New Size(標準長度 - XXX, 25)
  199. If CheckBox10.Checked = False And Val(Strings.Left(班別_cb10.Text, 2)) < 17 Then : ComboBox20.Visible = True
  200. ElseIf CheckBox10.Checked = False And Val(Strings.Left(班別_cb10.Text, 2)) >= 17 Then : ComboBox20.Visible = False
  201. ElseIf CheckBox10.Checked = True Then : ComboBox20.Visible = False : End If
  202. End If
  203. End Sub
  204. Private Sub 進度條變化11()
  205. If 姓名_tb11.Text <> "" Or 班別_cb11.Text <> "休" Then
  206. Do2 = NumericUpDown11.Value : 班條長度()
  207. ComboBox21.Size = New Size(標準長度 + XXX, 32) : ComboBox22.Size = New Size(標準長度 - XXX, 25)
  208. If CheckBox11.Checked = False And Val(Strings.Left(班別_cb11.Text, 2)) < 17 Then : ComboBox22.Visible = True
  209. ElseIf CheckBox11.Checked = False And Val(Strings.Left(班別_cb11.Text, 2)) >= 17 Then : ComboBox22.Visible = False
  210. ElseIf CheckBox11.Checked = True Then : ComboBox22.Visible = False : End If
  211. End If
  212. End Sub
  213. Private Sub 進度條變化12()
  214. If 姓名_tb12.Text <> "" Or 班別_cb12.Text <> "休" Then
  215. Do2 = NumericUpDown12.Value : 班條長度()
  216. ComboBox23.Size = New Size(標準長度 + XXX, 32) : ComboBox24.Size = New Size(標準長度 - XXX, 25)
  217. If CheckBox12.Checked = False And Val(Strings.Left(班別_cb12.Text, 2)) < 17 Then : ComboBox24.Visible = True
  218. ElseIf CheckBox12.Checked = False And Val(Strings.Left(班別_cb12.Text, 2)) >= 17 Then : ComboBox24.Visible = False
  219. ElseIf CheckBox12.Checked = True Then : ComboBox24.Visible = False : End If
  220. End If
  221. End Sub
  222. Private Sub 進度條變化13()
  223. If 姓名_tb13.Text <> "" Or 班別_cb13.Text <> "休" Then
  224. Do2 = NumericUpDown13.Value : 班條長度()
  225. ComboBox25.Size = New Size(標準長度 + XXX, 32) : ComboBox26.Size = New Size(標準長度 - XXX, 25)
  226. If CheckBox13.Checked = False And Val(Strings.Left(班別_cb13.Text, 2)) < 17 Then : ComboBox26.Visible = True
  227. ElseIf CheckBox13.Checked = False And Val(Strings.Left(班別_cb13.Text, 2)) >= 17 Then : ComboBox26.Visible = False
  228. ElseIf CheckBox13.Checked = True Then : ComboBox26.Visible = False : End If
  229. End If
  230. End Sub
  231. Private Sub 進度條變化14()
  232. If 姓名_tb14.Text <> "" Or 班別_cb14.Text <> "休" Then
  233. Do2 = NumericUpDown14.Value : 班條長度()
  234. ComboBox27.Size = New Size(標準長度 + XXX, 32) : ComboBox28.Size = New Size(標準長度 - XXX, 25)
  235. If CheckBox14.Checked = False And Val(Strings.Left(班別_cb14.Text, 2)) < 17 Then : ComboBox28.Visible = True
  236. ElseIf CheckBox14.Checked = False And Val(Strings.Left(班別_cb14.Text, 2)) >= 17 Then : ComboBox28.Visible = False
  237. ElseIf CheckBox14.Checked = True Then : ComboBox28.Visible = False : End If
  238. End If
  239. End Sub
  240. Private Sub 進度條變化15()
  241. If 姓名_tb15.Text <> "" Or 班別_cb15.Text <> "休" Then
  242. Do2 = NumericUpDown15.Value : 班條長度()
  243. ComboBox29.Size = New Size(標準長度 + XXX, 32) : ComboBox30.Size = New Size(標準長度 - XXX, 25)
  244. If CheckBox15.Checked = False And Val(Strings.Left(班別_cb15.Text, 2)) < 17 Then : ComboBox30.Visible = True
  245. ElseIf CheckBox15.Checked = False And Val(Strings.Left(班別_cb15.Text, 2)) >= 17 Then : ComboBox30.Visible = False
  246. ElseIf CheckBox15.Checked = True Then : ComboBox30.Visible = False : End If
  247. End If
  248. End Sub
  249. Private Sub 進度條變化16()
  250. If 姓名_tb16.Text <> "" Or 班別_cb16.Text <> "休" Then
  251. Do2 = NumericUpDown16.Value : 班條長度()
  252. ComboBox31.Size = New Size(標準長度 + XXX, 32) : ComboBox32.Size = New Size(標準長度 - XXX, 25)
  253. If CheckBox16.Checked = False And Val(Strings.Left(班別_cb16.Text, 2)) < 17 Then : ComboBox32.Visible = True
  254. ElseIf CheckBox16.Checked = False And Val(Strings.Left(班別_cb16.Text, 2)) >= 17 Then : ComboBox32.Visible = False
  255. ElseIf CheckBox16.Checked = True Then : ComboBox32.Visible = False : End If
  256. End If
  257. End Sub
  258. Private Sub 進度條變化17()
  259. If 姓名_tb17.Text <> "" Or 班別_cb17.Text <> "休" Then
  260. Do2 = NumericUpDown17.Value : 班條長度()
  261. ComboBox33.Size = New Size(標準長度 + XXX, 32) : ComboBox34.Size = New Size(標準長度 - XXX, 25)
  262. If CheckBox17.Checked = False And Val(Strings.Left(班別_cb17.Text, 2)) < 17 Then : ComboBox34.Visible = True
  263. ElseIf CheckBox17.Checked = False And Val(Strings.Left(班別_cb17.Text, 2)) >= 17 Then : ComboBox34.Visible = False
  264. ElseIf CheckBox17.Checked = True Then : ComboBox34.Visible = False : End If
  265. End If
  266. End Sub
  267. Private Sub 進度條變化18()
  268. If 姓名_tb18.Text <> "" Or 班別_cb18.Text <> "休" Then
  269. Do2 = NumericUpDown18.Value : 班條長度()
  270. ComboBox35.Size = New Size(標準長度 + XXX, 32) : ComboBox36.Size = New Size(標準長度 - XXX, 25)
  271. If CheckBox18.Checked = False And Val(Strings.Left(班別_cb18.Text, 2)) < 17 Then : ComboBox36.Visible = True
  272. ElseIf CheckBox18.Checked = False And Val(Strings.Left(班別_cb18.Text, 2)) >= 17 Then : ComboBox36.Visible = False
  273. ElseIf CheckBox18.Checked = True Then : ComboBox36.Visible = False : End If
  274. End If
  275. End Sub
  276. Private Sub 進度條變化19()
  277. If 姓名_tb19.Text <> "" Or 班別_cb19.Text <> "休" Then
  278. Do2 = NumericUpDown19.Value : 班條長度()
  279. ComboBox37.Size = New Size(標準長度 + XXX, 32) : ComboBox38.Size = New Size(標準長度 - XXX, 25)
  280. If CheckBox19.Checked = False And Val(Strings.Left(班別_cb19.Text, 2)) < 17 Then : ComboBox38.Visible = True
  281. ElseIf CheckBox19.Checked = False And Val(Strings.Left(班別_cb19.Text, 2)) >= 17 Then : ComboBox38.Visible = False
  282. ElseIf CheckBox19.Checked = True Then : ComboBox38.Visible = False : End If
  283. End If
  284. End Sub
  285. Private Sub 進度條變化20()
  286. If 姓名_tb20.Text <> "" Or 班別_cb20.Text <> "休" Then
  287. Do2 = NumericUpDown20.Value : 班條長度()
  288. ComboBox39.Size = New Size(標準長度 + XXX, 32) : ComboBox40.Size = New Size(標準長度 - XXX, 25)
  289. If CheckBox20.Checked = False And Val(Strings.Left(班別_cb20.Text, 2)) < 17 Then : ComboBox40.Visible = True
  290. ElseIf CheckBox20.Checked = False And Val(Strings.Left(班別_cb20.Text, 2)) >= 17 Then : ComboBox40.Visible = False
  291. ElseIf CheckBox20.Checked = True Then : ComboBox40.Visible = False : End If
  292. End If
  293. End Sub
  294. Private Sub 休息變化1()
  295. XX = Val(Strings.Left(班別_cb1.Text, 2)) * 60 + Val(Strings.Mid(班別_cb1.Text, 4, 2)) : 班別圖示計算載入()
  296. X1 = NUP1.Value : 休息長度() : Do2 = NumericUpDown1.Value : 班條長度()
  297. ComboBox1.Location = New Point(開始位置1 + XX, 行(1)) : ComboBox2.Location = New Point(開始位置2 + XX + X1 + XXX, 行(1))
  298. 進度條變化1()
  299. End Sub
  300. Private Sub 休息變化2()
  301. XX = Val(Strings.Left(班別_cb2.Text, 2)) * 60 + Val(Strings.Mid(班別_cb2.Text, 4, 2)) : 班別圖示計算載入()
  302. X1 = NUP2.Value : 休息長度() : Do2 = NumericUpDown2.Value : 班條長度()
  303. ComboBox3.Location = New Point(開始位置1 + XX, 行(2)) : ComboBox4.Location = New Point(開始位置2 + XX + X1 + XXX, 行(2))
  304. 進度條變化2()
  305. End Sub
  306. Private Sub 休息變化3()
  307. XX = Val(Strings.Left(班別_cb3.Text, 2)) * 60 + Val(Strings.Mid(班別_cb3.Text, 4, 2)) : 班別圖示計算載入()
  308. X1 = NUP3.Value : 休息長度() : Do2 = NumericUpDown3.Value : 班條長度()
  309. ComboBox5.Location = New Point(開始位置1 + XX, 行(3)) : ComboBox6.Location = New Point(開始位置2 + XX + X1 + XXX, 行(3))
  310. 進度條變化3()
  311. End Sub
  312. Private Sub 休息變化4()
  313. XX = Val(Strings.Left(班別_cb4.Text, 2)) * 60 + Val(Strings.Mid(班別_cb4.Text, 4, 2)) : 班別圖示計算載入()
  314. X1 = NUP4.Value : 休息長度() : Do2 = NumericUpDown4.Value : 班條長度()
  315. ComboBox7.Location = New Point(開始位置1 + XX, 行(4)) : ComboBox8.Location = New Point(開始位置2 + XX + X1 + XXX, 行(4))
  316. 進度條變化4()
  317. End Sub
  318. Private Sub 休息變化5()
  319. XX = Val(Strings.Left(班別_cb5.Text, 2)) * 60 + Val(Strings.Mid(班別_cb5.Text, 4, 2)) : 班別圖示計算載入()
  320. X1 = NUP5.Value : 休息長度() : Do2 = NumericUpDown5.Value : 班條長度()
  321. ComboBox9.Location = New Point(開始位置1 + XX, 行(5)) : ComboBox10.Location = New Point(開始位置2 + XX + X1 + XXX, 行(5))
  322. 進度條變化5()
  323. End Sub
  324. Private Sub 休息變化6()
  325. XX = Val(Strings.Left(班別_cb6.Text, 2)) * 60 + Val(Strings.Mid(班別_cb6.Text, 4, 2)) : 班別圖示計算載入()
  326. X1 = NUP6.Value : 休息長度() : Do2 = NumericUpDown6.Value : 班條長度()
  327. ComboBox11.Location = New Point(開始位置1 + XX, 行(6)) : ComboBox12.Location = New Point(開始位置2 + XX + X1 + XXX, 行(6))
  328. 進度條變化6()
  329. End Sub
  330. Private Sub 休息變化7()
  331. XX = Val(Strings.Left(班別_cb7.Text, 2)) * 60 + Val(Strings.Mid(班別_cb7.Text, 4, 2)) : 班別圖示計算載入()
  332. X1 = NUP7.Value : 休息長度() : Do2 = NumericUpDown7.Value : 班條長度()
  333. ComboBox13.Location = New Point(開始位置1 + XX, 行(7)) : ComboBox14.Location = New Point(開始位置2 + XX + X1 + XXX, 行(7))
  334. 進度條變化7()
  335. End Sub
  336. Private Sub 休息變化8()
  337. XX = Val(Strings.Left(班別_cb8.Text, 2)) * 60 + Val(Strings.Mid(班別_cb8.Text, 4, 2)) : 班別圖示計算載入()
  338. X1 = NUP8.Value : 休息長度() : Do2 = NumericUpDown8.Value : 班條長度()
  339. ComboBox15.Location = New Point(開始位置1 + XX, 行(8)) : ComboBox16.Location = New Point(開始位置2 + XX + X1 + XXX, 行(8))
  340. 進度條變化8()
  341. End Sub
  342. Private Sub 休息變化9()
  343. XX = Val(Strings.Left(班別_cb9.Text, 2)) * 60 + Val(Strings.Mid(班別_cb9.Text, 4, 2)) : 班別圖示計算載入()
  344. X1 = NUP9.Value : 休息長度() : Do2 = NumericUpDown9.Value : 班條長度()
  345. ComboBox17.Location = New Point(開始位置1 + XX, 行(9)) : ComboBox18.Location = New Point(開始位置2 + XX + X1 + XXX, 行(9))
  346. 進度條變化9()
  347. End Sub
  348. Private Sub 休息變化10()
  349. XX = Val(Strings.Left(班別_cb10.Text, 2)) * 60 + Val(Strings.Mid(班別_cb10.Text, 4, 2)) : 班別圖示計算載入()
  350. X1 = NUP10.Value : 休息長度() : Do2 = NumericUpDown10.Value : 班條長度()
  351. ComboBox19.Location = New Point(開始位置1 + XX, 行(10)) : ComboBox20.Location = New Point(開始位置2 + XX + X1 + XXX, 行(10))
  352. 進度條變化10()
  353. End Sub
  354. Private Sub 休息變化11()
  355. XX = Val(Strings.Left(班別_cb11.Text, 2)) * 60 + Val(Strings.Mid(班別_cb11.Text, 4, 2)) : 班別圖示計算載入()
  356. X1 = NUP11.Value : 休息長度() : Do2 = NumericUpDown11.Value : 班條長度()
  357. ComboBox21.Location = New Point(開始位置1 + XX, 行(11)) : ComboBox22.Location = New Point(開始位置2 + XX + X1 + XXX, 行(11))
  358. 進度條變化11()
  359. End Sub
  360. Private Sub 休息變化12()
  361. XX = Val(Strings.Left(班別_cb12.Text, 2)) * 60 + Val(Strings.Mid(班別_cb12.Text, 4, 2)) : 班別圖示計算載入()
  362. X1 = NUP12.Value : 休息長度() : Do2 = NumericUpDown12.Value : 班條長度()
  363. ComboBox23.Location = New Point(開始位置1 + XX, 行(12)) : ComboBox24.Location = New Point(開始位置2 + XX + X1 + XXX, 行(12))
  364. 進度條變化12()
  365. End Sub
  366. Private Sub 休息變化13()
  367. XX = Val(Strings.Left(班別_cb13.Text, 2)) * 60 + Val(Strings.Mid(班別_cb13.Text, 4, 2)) : 班別圖示計算載入()
  368. X1 = NUP13.Value : 休息長度() : Do2 = NumericUpDown13.Value : 班條長度()
  369. ComboBox25.Location = New Point(開始位置1 + XX, 行(13)) : ComboBox26.Location = New Point(開始位置2 + XX + X1 + XXX, 行(13))
  370. 進度條變化13()
  371. End Sub
  372. Private Sub 休息變化14()
  373. XX = Val(Strings.Left(班別_cb14.Text, 2)) * 60 + Val(Strings.Mid(班別_cb14.Text, 4, 2)) : 班別圖示計算載入()
  374. X1 = NUP14.Value : 休息長度() : Do2 = NumericUpDown14.Value : 班條長度()
  375. ComboBox27.Location = New Point(開始位置1 + XX, 行(14)) : ComboBox28.Location = New Point(開始位置2 + XX + X1 + XXX, 行(14))
  376. 進度條變化14()
  377. End Sub
  378. Private Sub 休息變化15()
  379. XX = Val(Strings.Left(班別_cb15.Text, 2)) * 60 + Val(Strings.Mid(班別_cb15.Text, 4, 2)) : 班別圖示計算載入()
  380. X1 = NUP15.Value : 休息長度() : Do2 = NumericUpDown15.Value : 班條長度()
  381. ComboBox29.Location = New Point(開始位置1 + XX, 行(15)) : ComboBox30.Location = New Point(開始位置2 + XX + X1 + XXX, 行(15))
  382. 進度條變化15()
  383. End Sub
  384. Private Sub 休息變化16()
  385. XX = Val(Strings.Left(班別_cb16.Text, 2)) * 60 + Val(Strings.Mid(班別_cb16.Text, 4, 2)) : 班別圖示計算載入()
  386. X1 = NUP16.Value : 休息長度() : Do2 = NumericUpDown16.Value : 班條長度()
  387. ComboBox31.Location = New Point(開始位置1 + XX, 行(16)) : ComboBox32.Location = New Point(開始位置2 + XX + X1 + XXX, 行(16))
  388. 進度條變化16()
  389. End Sub
  390. Private Sub 休息變化17()
  391. XX = Val(Strings.Left(班別_cb17.Text, 2)) * 60 + Val(Strings.Mid(班別_cb17.Text, 4, 2)) : 班別圖示計算載入()
  392. X1 = NUP17.Value : 休息長度() : Do2 = NumericUpDown17.Value : 班條長度()
  393. ComboBox33.Location = New Point(開始位置1 + XX, 行(17)) : ComboBox34.Location = New Point(開始位置2 + XX + X1 + XXX, 行(17))
  394. 進度條變化17()
  395. End Sub
  396. Private Sub 休息變化18()
  397. XX = Val(Strings.Left(班別_cb18.Text, 2)) * 60 + Val(Strings.Mid(班別_cb18.Text, 4, 2)) : 班別圖示計算載入()
  398. X1 = NUP18.Value : 休息長度() : Do2 = NumericUpDown18.Value : 班條長度()
  399. ComboBox35.Location = New Point(開始位置1 + XX, 行(18)) : ComboBox36.Location = New Point(開始位置2 + XX + X1 + XXX, 行(18))
  400. 進度條變化18()
  401. End Sub
  402. Private Sub 休息變化19()
  403. XX = Val(Strings.Left(班別_cb19.Text, 2)) * 60 + Val(Strings.Mid(班別_cb19.Text, 4, 2)) : 班別圖示計算載入()
  404. X1 = NUP19.Value : 休息長度() : Do2 = NumericUpDown19.Value : 班條長度()
  405. ComboBox37.Location = New Point(開始位置1 + XX, 行(19)) : ComboBox38.Location = New Point(開始位置2 + XX + X1 + XXX, 行(19))
  406. 進度條變化19()
  407. End Sub
  408. Private Sub 休息變化20()
  409. XX = Val(Strings.Left(班別_cb20.Text, 2)) * 60 + Val(Strings.Mid(班別_cb20.Text, 4, 2)) : 班別圖示計算載入()
  410. X1 = NUP20.Value : 休息長度() : Do2 = NumericUpDown20.Value : 班條長度()
  411. ComboBox39.Location = New Point(開始位置1 + XX, 行(20)) : ComboBox40.Location = New Point(開始位置2 + XX + X1 + XXX, 行(20))
  412. 進度條變化20()
  413. End Sub
  414. Private Sub 回復預設()
  415. For no As Integer = 1 To 20
  416. Dim NUPS As NumericUpDown = CType(Me.Controls.Find("NUP" + no.ToString(), True)(0), NumericUpDown) : NUPS.Value = 1
  417. Next
  418. XX = 0 : Q = 0
  419. For no As Integer = 1 To 20
  420. Dim 姓名_tbS As TextBox = CType(Me.Controls.Find("姓名_tb" + no.ToString(), True)(0), TextBox)
  421. Dim 班別_cbS As ComboBox = CType(Me.Controls.Find("班別_cb" + no.ToString(), True)(0), ComboBox)
  422. Dim ComboBoxsS1 As ComboBox = CType(Me.Controls.Find("ComboBox" + (no + 40 + Q).ToString(), True)(0), ComboBox)
  423. Dim ComboBoxsS2 As ComboBox = CType(Me.Controls.Find("ComboBox" + (no + 40 + 1 + Q).ToString(), True)(0), ComboBox)
  424. Dim ComboBoxs1 As ComboBox = CType(Me.Controls.Find("ComboBox" + (no + Q).ToString(), True)(0), ComboBox)
  425. Dim ComboBoxs2 As ComboBox = CType(Me.Controls.Find("ComboBox" + (no + 1 + Q).ToString(), True)(0), ComboBox)
  426. 姓名_tbS.Text = "" : 班別_cbS.Text = "休" : ComboBoxsS1.SelectedIndex = 0 : ComboBoxsS2.SelectedIndex = 0
  427. If 姓名_tbS.Text = "" Then
  428. ComboBoxs1.Visible = False : ComboBoxs2.Visible = False
  429. Else
  430. ComboBoxs1.Visible = True : ComboBoxs2.Visible = True
  431. End If
  432. Next
  433. ComboBox1.Location = New Point(開始位置1 + XX, 行(1)) : ComboBox2.Location = New Point(開始位置2 + XX, 行(1))
  434. ComboBox3.Location = New Point(開始位置1 + XX, 行(2)) : ComboBox4.Location = New Point(開始位置2 + XX, 行(2))
  435. ComboBox5.Location = New Point(開始位置1 + XX, 行(3)) : ComboBox6.Location = New Point(開始位置2 + XX, 行(3))
  436. ComboBox7.Location = New Point(開始位置1 + XX, 行(4)) : ComboBox8.Location = New Point(開始位置2 + XX, 行(4))
  437. ComboBox9.Location = New Point(開始位置1 + XX, 行(5)) : ComboBox10.Location = New Point(開始位置2 + XX, 行(5))
  438. ComboBox11.Location = New Point(開始位置1 + XX, 行(6)) : ComboBox12.Location = New Point(開始位置2 + XX, 行(6))
  439. ComboBox13.Location = New Point(開始位置1 + XX, 行(7)) : ComboBox14.Location = New Point(開始位置2 + XX, 行(7))
  440. ComboBox15.Location = New Point(開始位置1 + XX, 行(8)) : ComboBox16.Location = New Point(開始位置2 + XX, 行(8))
  441. ComboBox17.Location = New Point(開始位置1 + XX, 行(9)) : ComboBox18.Location = New Point(開始位置2 + XX, 行(9))
  442. ComboBox19.Location = New Point(開始位置1 + XX, 行(10)) : ComboBox20.Location = New Point(開始位置2 + XX, 行(10))
  443. ComboBox21.Location = New Point(開始位置1 + XX, 行(11)) : ComboBox22.Location = New Point(開始位置2 + XX, 行(11))
  444. ComboBox23.Location = New Point(開始位置1 + XX, 行(12)) : ComboBox24.Location = New Point(開始位置2 + XX, 行(12))
  445. ComboBox25.Location = New Point(開始位置1 + XX, 行(13)) : ComboBox26.Location = New Point(開始位置2 + XX, 行(13))
  446. ComboBox27.Location = New Point(開始位置1 + XX, 行(14)) : ComboBox28.Location = New Point(開始位置2 + XX, 行(14))
  447. ComboBox29.Location = New Point(開始位置1 + XX, 行(15)) : ComboBox30.Location = New Point(開始位置2 + XX, 行(15))
  448. ComboBox31.Location = New Point(開始位置1 + XX, 行(16)) : ComboBox32.Location = New Point(開始位置2 + XX, 行(16))
  449. ComboBox33.Location = New Point(開始位置1 + XX, 行(17)) : ComboBox34.Location = New Point(開始位置2 + XX, 行(17))
  450. ComboBox35.Location = New Point(開始位置1 + XX, 行(18)) : ComboBox36.Location = New Point(開始位置2 + XX, 行(18))
  451. ComboBox37.Location = New Point(開始位置1 + XX, 行(19)) : ComboBox38.Location = New Point(開始位置2 + XX, 行(19))
  452. ComboBox39.Location = New Point(開始位置1 + XX, 行(20)) : ComboBox40.Location = New Point(開始位置2 + XX, 行(20))
  453. End Sub
  454. Private Sub 重新讀取()
  455. SQL_排班簽核讀取()
  456. If dr.Read Then
  457. 值日生1_bt.Text = dr("值日生1").ToString : 值日生2_bt.Text = dr("值日生2").ToString
  458. If dr("班表簽認") = "Y" Then
  459. 鎖定_bt.Enabled = False
  460. Else
  461. 鎖定_bt.Enabled = True
  462. End If : Else
  463. 鎖定_bt.Enabled = True
  464. End If
  465. 班表鎖定變化()
  466. SQL_排班系統_星期() : If dr.Read Then : 星期_lb.Text = dr("星期") : End If : PA6 = 星期_lb.Text
  467. SQL_門診_健保()
  468. If dr.Read Then : B1_lb.Text = dr("早") : B2_lb.Text = dr("中") : B3_lb.Text = dr("晚")
  469. Else : B1_lb.Text = "" : B2_lb.Text = "" : B3_lb.Text = "" : End If
  470. SQL_門診_美容()
  471. If dr.Read Then : B4_lb.Text = dr("早") : B5_lb.Text = dr("中") : B6_lb.Text = dr("晚")
  472. Else : B4_lb.Text = "" : B5_lb.Text = "" : B6_lb.Text = "" : End If
  473. 讀取排班資料表() : 排班()
  474. End Sub
  475. Private Sub 排班()
  476. If 排班明細_dgv.Rows.Count > 0 Then
  477. Q = 0
  478. For no As Integer = 1 To 20
  479. Dim 姓名_tbS As TextBox = CType(Me.Controls.Find("姓名_tb" + no.ToString(), True)(0), TextBox)
  480. Dim 請假_tbS As TextBox = CType(Me.Controls.Find("請假_tb" + no.ToString(), True)(0), TextBox)
  481. Dim 班別_cbS As ComboBox = CType(Me.Controls.Find("班別_cb" + no.ToString(), True)(0), ComboBox)
  482. Dim A_lbS As Label = CType(Me.Controls.Find("A_lb" + no.ToString(), True)(0), Label)
  483. Dim CheckBoxS As CheckBox = CType(Me.Controls.Find("CheckBox" + no.ToString(), True)(0), CheckBox)
  484. Dim NumericUpDownS As NumericUpDown = CType(Me.Controls.Find("NumericUpDown" + no.ToString(), True)(0), NumericUpDown)
  485. Dim NUPS As NumericUpDown = CType(Me.Controls.Find("NUP" + no.ToString(), True)(0), NumericUpDown)
  486. Dim ComboBoxsS1 As ComboBox = CType(Me.Controls.Find("ComboBox" + (no + 40 + Q).ToString(), True)(0), ComboBox)
  487. Dim ComboBoxsS2 As ComboBox = CType(Me.Controls.Find("ComboBox" + (no + 40 + 1 + Q).ToString(), True)(0), ComboBox)
  488. Dim ComboBoxs1 As ComboBox = CType(Me.Controls.Find("ComboBox" + (no + Q).ToString(), True)(0), ComboBox)
  489. Dim ComboBoxs2 As ComboBox = CType(Me.Controls.Find("ComboBox" + (no + 1 + Q).ToString(), True)(0), ComboBox) : Q += 1
  490. ComboBoxs1.Text = 排班明細_dgv.Rows(no - 1).Cells("一段").Value
  491. ComboBoxs2.Text = 排班明細_dgv.Rows(no - 1).Cells("二段").Value
  492. ComboBoxsS1.Text = 排班明細_dgv.Rows(no - 1).Cells("顏色1").Value
  493. ComboBoxsS2.Text = 排班明細_dgv.Rows(no - 1).Cells("顏色2").Value
  494. NUPS.Value = 排班明細_dgv.Rows(no - 1).Cells("休息").Value
  495. NumericUpDownS.Value = 排班明細_dgv.Rows(no - 1).Cells("時數").Value
  496. CheckBoxS.Checked = 排班明細_dgv.Rows(no - 1).Cells("半天").Value
  497. 班別_cbS.Text = 排班明細_dgv.Rows(no - 1).Cells("班別").Value.ToString
  498. 姓名_tbS.Text = 排班明細_dgv.Rows(no - 1).Cells("姓名").Value.ToString
  499. 請假_tbS.Text = 排班明細_dgv.Rows(no - 1).Cells("請假類別").Value.ToString
  500. Next
  501. End If
  502. End Sub
  503. Private Sub 班別圖示計算載入()
  504. XX = (XX - 480) * 1.25
  505. End Sub
  506. Private Sub 班條長度()
  507. Dim 小時 As Double = 80
  508. If Do2 = 4 Or Do2 = 6.5 Or Do2 = 7 Or Do2 = 7.5 Or Do2 = 8 Then : XXX = 0
  509. ElseIf Do2 = 2 Then : XXX = -(小時 * 2)
  510. ElseIf Do2 = 2.5 Then : XXX = -(小時) + (-(小時 / 2))
  511. ElseIf Do2 = 3 Then : XXX = -(小時)
  512. ElseIf Do2 = 3.5 Then : XXX = -(小時 / 2)
  513. ElseIf Do2 = 4.5 Then : XXX = 小時 / 2
  514. ElseIf Do2 = 5 Then : XXX = 小時
  515. ElseIf Do2 = 5.5 Then : XXX = 小時 + (小時 / 2)
  516. ElseIf Do2 = 6 Then : XXX = 小時 * 2
  517. End If
  518. End Sub
  519. Private Sub 休息長度()
  520. X1 = (X1 - 1) * 8 * 10
  521. End Sub
  522. Private Sub 排班明細_參考_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  523. '--------------坐標系設定---------------------------
  524. 開始位置1 = 592 : 開始位置2 = 967 : 行(0) = 27 : 標準長度 = 297
  525. 行(1) = 108 : 行(2) = 行(1) + 行(0) : 行(3) = 行(2) + 行(0) : 行(4) = 行(3) + 行(0) : 行(5) = 行(4) + 行(0) : 行(6) = 行(5) + 行(0) : 行(7) = 行(6) + 行(0) : 行(8) = 行(7) + 行(0)
  526. 行(9) = 行(8) + 行(0) : 行(10) = 行(9) + 行(0) : 行(11) = 行(10) + 行(0) : 行(12) = 行(11) + 行(0) : 行(13) = 行(12) + 行(0) : 行(14) = 行(13) + 行(0) : 行(15) = 行(14) + 行(0)
  527. 行(16) = 行(15) + 行(0) : 行(17) = 行(16) + 行(0) : 行(18) = 行(17) + 行(0) : 行(19) = 行(18) + 行(0) : 行(20) = 行(19) + 行(0)
  528. '--------------複製權限---------------------------
  529. If gUserName = "*系統管理者" Then
  530. 存檔_bt.Enabled = True : 複製班表_bt.Enabled = True : 人員_dgv.Enabled = True : 全_ch.Enabled = True : 複製班表_bt.Enabled = True
  531. For no As Integer = 1 To 20
  532. Dim 姓名_tbS As TextBox = CType(Me.Controls.Find("姓名_tb" + no.ToString(), True)(0), TextBox)
  533. Dim 班別_cbS As ComboBox = CType(Me.Controls.Find("班別_cb" + no.ToString(), True)(0), ComboBox)
  534. Dim A_lbS As Label = CType(Me.Controls.Find("A_lb" + no.ToString(), True)(0), Label)
  535. Dim CheckBoxS As CheckBox = CType(Me.Controls.Find("CheckBox" + no.ToString(), True)(0), CheckBox)
  536. Dim NumericUpDownS As NumericUpDown = CType(Me.Controls.Find("NumericUpDown" + no.ToString(), True)(0), NumericUpDown)
  537. Dim NUPS As NumericUpDown = CType(Me.Controls.Find("NUP" + no.ToString(), True)(0), NumericUpDown)
  538. 姓名_tbS.Enabled = True : 班別_cbS.Enabled = True : CheckBoxS.Enabled = True : NumericUpDownS.Enabled = True : NUPS.Enabled = True
  539. Next
  540. Else
  541. If CC(17) = False Then
  542. 存檔_bt.Enabled = False : 複製班表_bt.Enabled = False : 人員_dgv.Enabled = False : 全_ch.Enabled = False : 複製班表_bt.Enabled = False
  543. For no As Integer = 1 To 20
  544. Dim 姓名_tbS As TextBox = CType(Me.Controls.Find("姓名_tb" + no.ToString(), True)(0), TextBox)
  545. Dim 班別_cbS As ComboBox = CType(Me.Controls.Find("班別_cb" + no.ToString(), True)(0), ComboBox)
  546. Dim A_lbS As Label = CType(Me.Controls.Find("A_lb" + no.ToString(), True)(0), Label)
  547. Dim CheckBoxS As CheckBox = CType(Me.Controls.Find("CheckBox" + no.ToString(), True)(0), CheckBox)
  548. Dim NumericUpDownS As NumericUpDown = CType(Me.Controls.Find("NumericUpDown" + no.ToString(), True)(0), NumericUpDown)
  549. Dim NUPS As NumericUpDown = CType(Me.Controls.Find("NUP" + no.ToString(), True)(0), NumericUpDown)
  550. 姓名_tbS.Enabled = False : 班別_cbS.Enabled = False : CheckBoxS.Enabled = False : NumericUpDownS.Enabled = False : NUPS.Enabled = False
  551. Next
  552. Else
  553. 存檔_bt.Enabled = True : 複製班表_bt.Enabled = True : 人員_dgv.Enabled = True : 全_ch.Enabled = True : 複製班表_bt.Enabled = True
  554. For no As Integer = 1 To 20
  555. Dim 姓名_tbS As TextBox = CType(Me.Controls.Find("姓名_tb" + no.ToString(), True)(0), TextBox)
  556. Dim 班別_cbS As ComboBox = CType(Me.Controls.Find("班別_cb" + no.ToString(), True)(0), ComboBox)
  557. Dim A_lbS As Label = CType(Me.Controls.Find("A_lb" + no.ToString(), True)(0), Label)
  558. Dim CheckBoxS As CheckBox = CType(Me.Controls.Find("CheckBox" + no.ToString(), True)(0), CheckBox)
  559. Dim NumericUpDownS As NumericUpDown = CType(Me.Controls.Find("NumericUpDown" + no.ToString(), True)(0), NumericUpDown)
  560. Dim NUPS As NumericUpDown = CType(Me.Controls.Find("NUP" + no.ToString(), True)(0), NumericUpDown)
  561. 姓名_tbS.Enabled = True : 班別_cbS.Enabled = True : CheckBoxS.Enabled = True : NumericUpDownS.Enabled = True : NUPS.Enabled = True
  562. Next
  563. End If
  564. End If
  565. 年_lb.Text = PA : 月_lb.Text = PA1
  566. End Sub
  567. Private Sub 排班明細_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
  568. 班別_下拉表單資料載入() : 職務_下拉表單資料載入() : 讀取人員資料表()
  569. If Val(PA2) > 9 Then : 日_lb.Text = PA2 : Else : 日_lb.Text = "0" & PA2 : End If
  570. 回復預設()
  571. PA = 年_lb.Text & "/" & 月_lb.Text & "/" & 日_lb.Text
  572. 重新讀取()
  573. End Sub
  574. Private Sub 截圖_bt_Click(sender As Object, e As EventArgs) Handles 截圖_bt.Click
  575. Dim captureRectangle As New Rectangle(123, 0, 1698, 647) ' 指定要截取的範圍
  576. Dim bm As New Bitmap(captureRectangle.Width, captureRectangle.Height)
  577. Using g As Graphics = Graphics.FromImage(bm) ' 設定截圖的起點為 captureRectangle 左上角的位置
  578. g.CopyFromScreen(Me.PointToScreen(captureRectangle.Location), Point.Empty, captureRectangle.Size)
  579. End Using
  580. Me.Controls.SetChildIndex(PictureBox1, 0)
  581. My.Computer.Clipboard.SetImage(bm)
  582. PictureBox1.SendToBack()
  583. If 存檔_ch.Checked = True Then ' 保存圖片到桌面
  584. Dim desktopPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
  585. Dim filePath As String = Path.Combine(desktopPath, 年_lb.Text & 月_lb.Text & 日_lb.Text & 星期_lb.Text & ".png")
  586. bm.Save(filePath, ImageFormat.Png) : MsgBox("已將圖片存檔到桌面!!")
  587. End If
  588. End Sub
  589. Private Sub 上移_bt_Click(sender As Object, e As EventArgs) Handles 上移_bt.Click
  590. If 選擇項 <= 1 Then : Else
  591. If CInt(排班明細_dgv.Rows(選擇項 - 1).Cells("項次").Value) < 12 Then
  592. 排班明細_dgv.Rows(選擇項 - 1).Cells("項次").Value = "0" & CInt(排班明細_dgv.Rows(選擇項 - 1).Cells("項次").Value) - 2 & "-1"
  593. Else
  594. 排班明細_dgv.Rows(選擇項 - 1).Cells("項次").Value = CInt(排班明細_dgv.Rows(選擇項 - 1).Cells("項次").Value) - 2 & "-1"
  595. End If
  596. 排班明細_dgv.Sort(排班明細_dgv.Columns("項次"), System.ComponentModel.ListSortDirection.Ascending)
  597. For i As Integer = 0 To 排班明細_dgv.Rows.Count - 1 : 排班明細_dgv.Rows(i).Cells("項").Value = i + 1 : Next
  598. 排班明細_dgv.Sort(排班明細_dgv.Columns("項"), System.ComponentModel.ListSortDirection.Ascending)
  599. For i As Integer = 0 To 排班明細_dgv.Rows.Count - 1
  600. 排班明細_dgv.Rows(i).Cells("項次").Value = i + 1
  601. If CInt(排班明細_dgv.Rows(i).Cells("項次").Value) < 10 Then
  602. 排班明細_dgv.Rows(i).Cells("項次").Value = "0" & i + 1
  603. Else : 排班明細_dgv.Rows(i).Cells("項次").Value = i + 1 : End If
  604. Next : 選擇項 -= 1
  605. If 選擇項 <= 0 Then : 選擇項 = 0 : End If : 排班()
  606. End If
  607. End Sub
  608. Private Sub 下移_bt_Click(sender As Object, e As EventArgs) Handles 下移_bt.Click
  609. If 選擇項 = 0 Or 選擇項 = 1 Then : Else
  610. If CInt(排班明細_dgv.Rows(選擇項 - 1).Cells("項次").Value) < 9 Then
  611. 排班明細_dgv.Rows(選擇項 - 1).Cells("項次").Value = "0" & CInt(排班明細_dgv.Rows(選擇項 - 1).Cells("項次").Value) + 1 & "-1"
  612. Else
  613. 排班明細_dgv.Rows(選擇項 - 1).Cells("項次").Value = CInt(排班明細_dgv.Rows(選擇項 - 1).Cells("項次").Value) + 1 & "-1"
  614. End If
  615. 排班明細_dgv.Sort(排班明細_dgv.Columns("項次"), System.ComponentModel.ListSortDirection.Ascending)
  616. For i As Integer = 0 To 排班明細_dgv.Rows.Count - 1 : 排班明細_dgv.Rows(i).Cells("項").Value = i + 1 : Next
  617. 排班明細_dgv.Sort(排班明細_dgv.Columns("項"), System.ComponentModel.ListSortDirection.Ascending)
  618. For i As Integer = 0 To 排班明細_dgv.Rows.Count - 1
  619. 排班明細_dgv.Rows(i).Cells("項次").Value = i + 1
  620. If CInt(排班明細_dgv.Rows(i).Cells("項次").Value) < 10 Then
  621. 排班明細_dgv.Rows(i).Cells("項次").Value = "0" & i + 1
  622. Else : 排班明細_dgv.Rows(i).Cells("項次").Value = i + 1 : End If
  623. Next : 選擇項 += 1
  624. If 選擇項 >= 20 Then : 選擇項 = 20 : End If : 排班()
  625. End If
  626. End Sub
  627. Private Sub 備註存檔_tb_Click(sender As Object, e As EventArgs) Handles 備註存檔_tb.Click
  628. If 編號_tb.Text <> "" Then
  629. PA10 = 問題備註_tb.Text : PA11 = 人員職位_tb.Text : PA12 = 職務性質_tb.Text : PA13 = 早班_ch.Checked : PA14 = 晚班_ch.Checked : PA = 編號_tb.Text
  630. PA9 = 崗位01_ch.Checked : PA8 = 崗位02_ch.Checked : PA7 = 崗位03_ch.Checked : PA6 = 崗位04_ch.Checked : PA5 = 崗位05_ch.Checked : PA4 = 崗位06_ch.Checked
  631. PA3 = 崗位07_ch.Checked : PA2 = 崗位08_ch.Checked : PA1 = 穩定_ch.Checked
  632. SQL_人員備註修改() : MsgBox("存檔完成!!")
  633. End If
  634. End Sub
  635. Private Sub 人員資料讀取()
  636. PA = 人員_dgv("編號", 選擇處).Value.ToString : PA1 = 人員_dgv("姓名", 選擇處).Value.ToString
  637. 編號_tb.Text = 人員_dgv("編號", 選擇處).Value.ToString : 人員名稱_tb.Text = 人員_dgv("姓名", 選擇處).Value.ToString
  638. SQL_人員備註()
  639. If dr.Read Then
  640. 人員職位_tb.Text = dr("職位").ToString : 職務性質_tb.Text = dr("性質").ToString : 問題備註_tb.Text = dr("人員備註").ToString
  641. If IsDBNull(dr("早班")) Then : Else : 早班_ch.Checked = dr("早班") : End If : If IsDBNull(dr("晚班")) Then : Else : 晚班_ch.Checked = dr("晚班") : End If
  642. If IsDBNull(dr("崗位01")) Then : Else : 崗位01_ch.Checked = dr("崗位01") : End If : If IsDBNull(dr("崗位02")) Then : Else : 崗位02_ch.Checked = dr("崗位02") : End If
  643. If IsDBNull(dr("崗位03")) Then : Else : 崗位03_ch.Checked = dr("崗位03") : End If : If IsDBNull(dr("崗位04")) Then : Else : 崗位04_ch.Checked = dr("崗位04") : End If
  644. If IsDBNull(dr("崗位05")) Then : Else : 崗位05_ch.Checked = dr("崗位05") : End If : If IsDBNull(dr("崗位06")) Then : Else : 崗位06_ch.Checked = dr("崗位06") : End If
  645. If IsDBNull(dr("崗位07")) Then : Else : 崗位07_ch.Checked = dr("崗位07") : End If : If IsDBNull(dr("崗位08")) Then : Else : 崗位08_ch.Checked = dr("崗位08") : End If
  646. If IsDBNull(dr("穩定")) Then : Else : 穩定_ch.Checked = dr("穩定") : End If
  647. End If
  648. End Sub
  649. Private Sub 人員_dgv_CellContentClick(sender As Object, e As DataGridViewCellEventArgs) Handles 人員_dgv.CellClick
  650. If e.RowIndex = -1 Then : Else : 選擇處 = e.RowIndex : 人員資料讀取() : End If
  651. End Sub
  652. Private Sub 姓名1_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb1.Click
  653. 選擇項 = 1 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb1.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  654. End Sub
  655. Private Sub 姓名2_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb2.Click
  656. 選擇項 = 2 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb2.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  657. End Sub
  658. Private Sub 姓名3_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb3.Click
  659. 選擇項 = 3 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb3.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  660. End Sub
  661. Private Sub 姓名4_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb4.Click
  662. 選擇項 = 4 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb4.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  663. End Sub
  664. Private Sub 姓名5_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb5.Click
  665. 選擇項 = 5 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb5.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  666. End Sub
  667. Private Sub 姓名6_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb6.Click
  668. 選擇項 = 6 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb6.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  669. End Sub
  670. Private Sub 姓名7_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb7.Click
  671. 選擇項 = 7 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb7.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  672. End Sub
  673. Private Sub 姓名8_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb8.Click
  674. 選擇項 = 8 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb8.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  675. End Sub
  676. Private Sub 姓名9_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb9.Click
  677. 選擇項 = 9 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb9.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  678. End Sub
  679. Private Sub 姓名10_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb10.Click
  680. 選擇項 = 10 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb10.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  681. End Sub
  682. Private Sub 姓名11_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb11.Click
  683. 選擇項 = 11 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb11.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  684. End Sub
  685. Private Sub 姓名12_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb12.Click
  686. 選擇項 = 12 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb12.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  687. End Sub
  688. Private Sub 姓名13_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb13.Click
  689. 選擇項 = 13 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb13.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  690. End Sub
  691. Private Sub 姓名14_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb14.Click
  692. 選擇項 = 14 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb14.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  693. End Sub
  694. Private Sub 姓名15_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb15.Click
  695. 選擇項 = 15 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb15.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  696. End Sub
  697. Private Sub 姓名16_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb16.Click
  698. 選擇項 = 16 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb16.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  699. End Sub
  700. Private Sub 姓名17_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb17.Click
  701. 選擇項 = 17 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb17.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  702. End Sub
  703. Private Sub 姓名18_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb18.Click
  704. 選擇項 = 18 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb18.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  705. End Sub
  706. Private Sub 姓名19_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb19.Click
  707. 選擇項 = 19 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb19.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  708. End Sub
  709. Private Sub 姓名20_tb_Click(sender As Object, e As EventArgs) Handles 姓名_tb20.Click
  710. 選擇項 = 20 : For i As Integer = 0 To 人員_dgv.Rows.Count - 1 : If 姓名_tb20.Text = 人員_dgv.Rows(i).Cells("姓名").Value.ToString Then : 選擇處 = i : 人員資料讀取() : End If : Next
  711. End Sub
  712. Private Sub 班別01_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb1.SelectedIndexChanged
  713. If 班別_cb1.Text <> "休" Then : 休息變化1() : 半天變化1() : Else : ComboBox1.Visible = False : ComboBox2.Visible = False : End If
  714. End Sub
  715. Private Sub 班別02_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb2.SelectedIndexChanged
  716. If 班別_cb2.Text <> "休" Then : 休息變化2() : 半天變化2() : Else : ComboBox3.Visible = False : ComboBox4.Visible = False : End If
  717. End Sub
  718. Private Sub 班別03_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb3.SelectedIndexChanged
  719. If 班別_cb3.Text <> "休" Then : 休息變化3() : 半天變化3() : Else : ComboBox5.Visible = False : ComboBox6.Visible = False : End If
  720. End Sub
  721. Private Sub 班別04_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb4.SelectedIndexChanged
  722. If 班別_cb4.Text <> "休" Then : 休息變化4() : 半天變化4() : Else : ComboBox7.Visible = False : ComboBox8.Visible = False : End If
  723. End Sub
  724. Private Sub 班別05_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb5.SelectedIndexChanged
  725. If 班別_cb5.Text <> "休" Then : 休息變化5() : 半天變化5() : Else : ComboBox9.Visible = False : ComboBox10.Visible = False : End If
  726. End Sub
  727. Private Sub 班別06_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb6.SelectedIndexChanged
  728. If 班別_cb6.Text <> "休" Then : 休息變化6() : 半天變化6() : Else : ComboBox11.Visible = False : ComboBox12.Visible = False : End If
  729. End Sub
  730. Private Sub 班別07_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb7.SelectedIndexChanged
  731. If 班別_cb7.Text <> "休" Then : 休息變化7() : 半天變化7() : Else : ComboBox13.Visible = False : ComboBox14.Visible = False : End If
  732. End Sub
  733. Private Sub 班別08_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb8.SelectedIndexChanged
  734. If 班別_cb8.Text <> "休" Then : 休息變化8() : 半天變化8() : Else : ComboBox15.Visible = False : ComboBox16.Visible = False : End If
  735. End Sub
  736. Private Sub 班別09_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb9.SelectedIndexChanged
  737. If 班別_cb9.Text <> "休" Then : 休息變化9() : 半天變化9() : Else : ComboBox17.Visible = False : ComboBox18.Visible = False : End If
  738. End Sub
  739. Private Sub 班別10_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb10.SelectedIndexChanged
  740. If 班別_cb10.Text <> "休" Then : 休息變化10() : 半天變化10() : Else : ComboBox19.Visible = False : ComboBox20.Visible = False : End If
  741. End Sub
  742. Private Sub 班別11_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb11.SelectedIndexChanged
  743. If 班別_cb11.Text <> "休" Then : 休息變化11() : 半天變化11() : Else : ComboBox21.Visible = False : ComboBox22.Visible = False : End If
  744. End Sub
  745. Private Sub 班別12_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb12.SelectedIndexChanged
  746. If 班別_cb12.Text <> "休" Then : 休息變化12() : 半天變化12() : Else : ComboBox23.Visible = False : ComboBox24.Visible = False : End If
  747. End Sub
  748. Private Sub 班別13_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb13.SelectedIndexChanged
  749. If 班別_cb13.Text <> "休" Then : 休息變化13() : 半天變化13() : Else : ComboBox25.Visible = False : ComboBox26.Visible = False : End If
  750. End Sub
  751. Private Sub 班別14_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb14.SelectedIndexChanged
  752. If 班別_cb14.Text <> "休" Then : 休息變化14() : 半天變化14() : Else : ComboBox27.Visible = False : ComboBox28.Visible = False : End If
  753. End Sub
  754. Private Sub 班別15_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb15.SelectedIndexChanged
  755. If 班別_cb15.Text <> "休" Then : 休息變化15() : 半天變化15() : Else : ComboBox29.Visible = False : ComboBox30.Visible = False : End If
  756. End Sub
  757. Private Sub 班別16_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb16.SelectedIndexChanged
  758. If 班別_cb16.Text <> "休" Then : 休息變化16() : 半天變化16() : Else : ComboBox31.Visible = False : ComboBox32.Visible = False : End If
  759. End Sub
  760. Private Sub 班別17_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb17.SelectedIndexChanged
  761. If 班別_cb17.Text <> "休" Then : 休息變化17() : 半天變化17() : Else : ComboBox33.Visible = False : ComboBox34.Visible = False : End If
  762. End Sub
  763. Private Sub 班別18_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb18.SelectedIndexChanged
  764. If 班別_cb18.Text <> "休" Then : 休息變化18() : 半天變化18() : Else : ComboBox35.Visible = False : ComboBox36.Visible = False : End If
  765. End Sub
  766. Private Sub 班別19_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb19.SelectedIndexChanged
  767. If 班別_cb19.Text <> "休" Then : 休息變化19() : 半天變化19() : Else : ComboBox37.Visible = False : ComboBox38.Visible = False : End If
  768. End Sub
  769. Private Sub 班別20_cb_SelectedIndexChanged(sender As Object, e As EventArgs) Handles 班別_cb20.SelectedIndexChanged
  770. If 班別_cb20.Text <> "休" Then : 休息變化20() : 半天變化20() : Else : ComboBox39.Visible = False : ComboBox40.Visible = False : End If
  771. End Sub
  772. Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox1.CheckedChanged
  773. If 班別_cb1.Text <> "休" Then : 休息變化1() : End If
  774. End Sub
  775. Private Sub CheckBox2_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox2.CheckedChanged
  776. If 班別_cb2.Text <> "休" Then : 休息變化2() : End If
  777. End Sub
  778. Private Sub CheckBox3_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox3.CheckedChanged
  779. If 班別_cb3.Text <> "休" Then : 休息變化3() : End If
  780. End Sub
  781. Private Sub CheckBox4_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox4.CheckedChanged
  782. If 班別_cb4.Text <> "休" Then : 休息變化4() : End If
  783. End Sub
  784. Private Sub CheckBox5_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox5.CheckedChanged
  785. If 班別_cb5.Text <> "休" Then : 休息變化5() : End If
  786. End Sub
  787. Private Sub CheckBox6_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox6.CheckedChanged
  788. If 班別_cb6.Text <> "休" Then : 休息變化6() : End If
  789. End Sub
  790. Private Sub CheckBox7_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox7.CheckedChanged
  791. If 班別_cb7.Text <> "休" Then : 休息變化7() : End If
  792. End Sub
  793. Private Sub CheckBox8_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox8.CheckedChanged
  794. If 班別_cb8.Text <> "休" Then : 休息變化8() : End If
  795. End Sub
  796. Private Sub CheckBox9_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox9.CheckedChanged
  797. If 班別_cb9.Text <> "休" Then : 休息變化9() : End If
  798. End Sub
  799. Private Sub CheckBox10_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox10.CheckedChanged
  800. If 班別_cb10.Text <> "休" Then : 休息變化10() : End If
  801. End Sub
  802. Private Sub CheckBox11_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox11.CheckedChanged
  803. If 班別_cb11.Text <> "休" Then : 休息變化11() : End If
  804. End Sub
  805. Private Sub CheckBox12_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox12.CheckedChanged
  806. If 班別_cb12.Text <> "休" Then : 休息變化12() : End If
  807. End Sub
  808. Private Sub CheckBox13_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox13.CheckedChanged
  809. If 班別_cb13.Text <> "休" Then : 休息變化13() : End If
  810. End Sub
  811. Private Sub CheckBox14_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox14.CheckedChanged
  812. If 班別_cb14.Text <> "休" Then : 休息變化14() : End If
  813. End Sub
  814. Private Sub CheckBox15_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox15.CheckedChanged
  815. If 班別_cb15.Text <> "休" Then : 休息變化15() : End If
  816. End Sub
  817. Private Sub CheckBox16_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox16.CheckedChanged
  818. If 班別_cb16.Text <> "休" Then : 休息變化16() : End If
  819. End Sub
  820. Private Sub CheckBox17_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox17.CheckedChanged
  821. If 班別_cb17.Text <> "休" Then : 休息變化17() : End If
  822. End Sub
  823. Private Sub CheckBox18_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox18.CheckedChanged
  824. If 班別_cb18.Text <> "休" Then : 休息變化18() : End If
  825. End Sub
  826. Private Sub CheckBox19_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox19.CheckedChanged
  827. If 班別_cb19.Text <> "休" Then : 休息變化19() : End If
  828. End Sub
  829. Private Sub CheckBox20_CheckedChanged(sender As Object, e As EventArgs) Handles CheckBox20.CheckedChanged
  830. If 班別_cb20.Text <> "休" Then : 休息變化20() : End If
  831. End Sub
  832. Private Sub NumericUpDown1_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown1.ValueChanged
  833. If 班別_cb1.Text <> "休" Then : 休息變化1() : End If
  834. End Sub
  835. Private Sub NumericUpDown2_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown2.ValueChanged
  836. If 班別_cb2.Text <> "休" Then : 休息變化2() : End If
  837. End Sub
  838. Private Sub NumericUpDown3_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown3.ValueChanged
  839. If 班別_cb3.Text <> "休" Then : 休息變化3() : End If
  840. End Sub
  841. Private Sub NumericUpDown4_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown4.ValueChanged
  842. If 班別_cb4.Text <> "休" Then : 休息變化4() : End If
  843. End Sub
  844. Private Sub NumericUpDown5_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown5.ValueChanged
  845. If 班別_cb5.Text <> "休" Then : 休息變化5() : End If
  846. End Sub
  847. Private Sub NumericUpDown6_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown6.ValueChanged
  848. If 班別_cb6.Text <> "休" Then : 休息變化6() : End If
  849. End Sub
  850. Private Sub NumericUpDown7_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown7.ValueChanged
  851. If 班別_cb7.Text <> "休" Then : 休息變化7() : End If
  852. End Sub
  853. Private Sub NumericUpDown8_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown8.ValueChanged
  854. If 班別_cb8.Text <> "休" Then : 休息變化8() : End If
  855. End Sub
  856. Private Sub NumericUpDown9_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown9.ValueChanged
  857. If 班別_cb9.Text <> "休" Then : 休息變化9() : End If
  858. End Sub
  859. Private Sub NumericUpDown10_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown10.ValueChanged
  860. If 班別_cb10.Text <> "休" Then : 休息變化10() : End If
  861. End Sub
  862. Private Sub NumericUpDown11_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown11.ValueChanged
  863. If 班別_cb11.Text <> "休" Then : 休息變化11() : End If
  864. End Sub
  865. Private Sub NumericUpDown12_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown12.ValueChanged
  866. If 班別_cb12.Text <> "休" Then : 休息變化12() : End If
  867. End Sub
  868. Private Sub NumericUpDown13_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown13.ValueChanged
  869. If 班別_cb13.Text <> "休" Then : 休息變化13() : End If
  870. End Sub
  871. Private Sub NumericUpDown14_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown14.ValueChanged
  872. If 班別_cb14.Text <> "休" Then : 休息變化14() : End If
  873. End Sub
  874. Private Sub NumericUpDown15_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown15.ValueChanged
  875. If 班別_cb15.Text <> "休" Then : 休息變化15() : End If
  876. End Sub
  877. Private Sub NumericUpDown16_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown16.ValueChanged
  878. If 班別_cb16.Text <> "休" Then : 休息變化16() : End If
  879. End Sub
  880. Private Sub NumericUpDown17_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown17.ValueChanged
  881. If 班別_cb17.Text <> "休" Then : 休息變化17() : End If
  882. End Sub
  883. Private Sub NumericUpDown18_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown18.ValueChanged
  884. If 班別_cb18.Text <> "休" Then : 休息變化18() : End If
  885. End Sub
  886. Private Sub NumericUpDown19_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown19.ValueChanged
  887. If 班別_cb19.Text <> "休" Then : 休息變化19() : End If
  888. End Sub
  889. Private Sub NumericUpDown20_ValueChanged(sender As Object, e As EventArgs) Handles NumericUpDown20.ValueChanged
  890. If 班別_cb20.Text <> "休" Then : 休息變化20() : End If
  891. End Sub
  892. Private Sub NUP1_ValueChanged(sender As Object, e As EventArgs) Handles NUP1.ValueChanged
  893. If 班別_cb1.Text <> "休" Then : 休息變化1() : 半天變化1() : Else : ComboBox1.Visible = False : ComboBox2.Visible = False : End If
  894. End Sub
  895. Private Sub NUP2_ValueChanged(sender As Object, e As EventArgs) Handles NUP2.ValueChanged
  896. If 班別_cb2.Text <> "休" Then : 休息變化2() : 半天變化2() : Else : ComboBox3.Visible = False : ComboBox4.Visible = False : End If
  897. End Sub
  898. Private Sub NUP3_ValueChanged(sender As Object, e As EventArgs) Handles NUP3.ValueChanged
  899. If 班別_cb3.Text <> "休" Then : 休息變化3() : 半天變化3() : Else : ComboBox5.Visible = False : ComboBox6.Visible = False : End If
  900. End Sub
  901. Private Sub NUP4_ValueChanged(sender As Object, e As EventArgs) Handles NUP4.ValueChanged
  902. If 班別_cb4.Text <> "休" Then : 休息變化4() : 半天變化4() : Else : ComboBox7.Visible = False : ComboBox8.Visible = False : End If
  903. End Sub
  904. Private Sub NUP5_ValueChanged(sender As Object, e As EventArgs) Handles NUP5.ValueChanged
  905. If 班別_cb5.Text <> "休" Then : 休息變化5() : 半天變化5() : Else : ComboBox9.Visible = False : ComboBox10.Visible = False : End If
  906. End Sub
  907. Private Sub NUP6_ValueChanged(sender As Object, e As EventArgs) Handles NUP6.ValueChanged
  908. If 班別_cb6.Text <> "休" Then : 休息變化6() : 半天變化6() : Else : ComboBox11.Visible = False : ComboBox12.Visible = False : End If
  909. End Sub
  910. Private Sub NUP7_ValueChanged(sender As Object, e As EventArgs) Handles NUP7.ValueChanged
  911. If 班別_cb7.Text <> "休" Then : 休息變化7() : 半天變化7() : Else : ComboBox13.Visible = False : ComboBox14.Visible = False : End If
  912. End Sub
  913. Private Sub NUP8_ValueChanged(sender As Object, e As EventArgs) Handles NUP8.ValueChanged
  914. If 班別_cb8.Text <> "休" Then : 休息變化8() : 半天變化8() : Else : ComboBox15.Visible = False : ComboBox16.Visible = False : End If
  915. End Sub
  916. Private Sub NUP9_ValueChanged(sender As Object, e As EventArgs) Handles NUP9.ValueChanged
  917. If 班別_cb9.Text <> "休" Then : 休息變化9() : 半天變化9() : Else : ComboBox17.Visible = False : ComboBox18.Visible = False : End If
  918. End Sub
  919. Private Sub NUP10_ValueChanged(sender As Object, e As EventArgs) Handles NUP10.ValueChanged
  920. If 班別_cb10.Text <> "休" Then : 休息變化10() : 半天變化10() : Else : ComboBox19.Visible = False : ComboBox20.Visible = False : End If
  921. End Sub
  922. Private Sub NUP11_ValueChanged(sender As Object, e As EventArgs) Handles NUP11.ValueChanged
  923. If 班別_cb11.Text <> "休" Then : 休息變化11() : 半天變化11() : Else : ComboBox21.Visible = False : ComboBox22.Visible = False : End If
  924. End Sub
  925. Private Sub NUP12_ValueChanged(sender As Object, e As EventArgs) Handles NUP12.ValueChanged
  926. If 班別_cb12.Text <> "休" Then : 休息變化12() : 半天變化12() : Else : ComboBox23.Visible = False : ComboBox24.Visible = False : End If
  927. End Sub
  928. Private Sub NUP13_ValueChanged(sender As Object, e As EventArgs) Handles NUP13.ValueChanged
  929. If 班別_cb13.Text <> "休" Then : 休息變化13() : 半天變化13() : Else : ComboBox25.Visible = False : ComboBox26.Visible = False : End If
  930. End Sub
  931. Private Sub NUP14_ValueChanged(sender As Object, e As EventArgs) Handles NUP14.ValueChanged
  932. If 班別_cb14.Text <> "休" Then : 休息變化14() : 半天變化14() : Else : ComboBox27.Visible = False : ComboBox28.Visible = False : End If
  933. End Sub
  934. Private Sub NUP15_ValueChanged(sender As Object, e As EventArgs) Handles NUP15.ValueChanged
  935. If 班別_cb15.Text <> "休" Then : 休息變化15() : 半天變化15() : Else : ComboBox29.Visible = False : ComboBox30.Visible = False : End If
  936. End Sub
  937. Private Sub NUP16_ValueChanged(sender As Object, e As EventArgs) Handles NUP16.ValueChanged
  938. If 班別_cb16.Text <> "休" Then : 休息變化16() : 半天變化16() : Else : ComboBox31.Visible = False : ComboBox32.Visible = False : End If
  939. End Sub
  940. Private Sub NUP17_ValueChanged(sender As Object, e As EventArgs) Handles NUP17.ValueChanged
  941. If 班別_cb17.Text <> "休" Then : 休息變化17() : 半天變化17() : Else : ComboBox33.Visible = False : ComboBox34.Visible = False : End If
  942. End Sub
  943. Private Sub NUP18_ValueChanged(sender As Object, e As EventArgs) Handles NUP18.ValueChanged
  944. If 班別_cb18.Text <> "休" Then : 休息變化18() : 半天變化18() : Else : ComboBox35.Visible = False : ComboBox36.Visible = False : End If
  945. End Sub
  946. Private Sub NUP19_ValueChanged(sender As Object, e As EventArgs) Handles NUP19.ValueChanged
  947. If 班別_cb19.Text <> "休" Then : 休息變化19() : 半天變化19() : Else : ComboBox37.Visible = False : ComboBox38.Visible = False : End If
  948. End Sub
  949. Private Sub NUP20_ValueChanged(sender As Object, e As EventArgs) Handles NUP20.ValueChanged
  950. If 班別_cb20.Text <> "休" Then : 休息變化20() : 半天變化20() : Else : ComboBox39.Visible = False : ComboBox40.Visible = False : End If
  951. End Sub
  952. Private Sub 半天變化1()
  953. If CheckBox1.Checked = False Then : ComboBox1.Visible = True : ComboBox2.Visible = True : Else : ComboBox1.Visible = True : ComboBox2.Visible = False : End If
  954. End Sub
  955. Private Sub 半天變化2()
  956. If CheckBox2.Checked = False Then : ComboBox3.Visible = True : ComboBox4.Visible = True : Else : ComboBox3.Visible = True : ComboBox4.Visible = False : End If
  957. End Sub
  958. Private Sub 半天變化3()
  959. If CheckBox3.Checked = False Then : ComboBox5.Visible = True : ComboBox6.Visible = True : Else : ComboBox5.Visible = True : ComboBox6.Visible = False : End If
  960. End Sub
  961. Private Sub 半天變化4()
  962. If CheckBox4.Checked = False Then : ComboBox7.Visible = True : ComboBox8.Visible = True : Else : ComboBox7.Visible = True : ComboBox8.Visible = False : End If
  963. End Sub
  964. Private Sub 半天變化5()
  965. If CheckBox5.Checked = False Then : ComboBox9.Visible = True : ComboBox10.Visible = True : Else : ComboBox9.Visible = True : ComboBox10.Visible = False : End If
  966. End Sub
  967. Private Sub 半天變化6()
  968. If CheckBox6.Checked = False Then : ComboBox11.Visible = True : ComboBox12.Visible = True : Else : ComboBox11.Visible = True : ComboBox12.Visible = False : End If
  969. End Sub
  970. Private Sub 半天變化7()
  971. If CheckBox7.Checked = False Then : ComboBox13.Visible = True : ComboBox14.Visible = True : Else : ComboBox13.Visible = True : ComboBox14.Visible = False : End If
  972. End Sub
  973. Private Sub 半天變化8()
  974. If CheckBox8.Checked = False Then : ComboBox15.Visible = True : ComboBox16.Visible = True : Else : ComboBox15.Visible = True : ComboBox16.Visible = False : End If
  975. End Sub
  976. Private Sub 半天變化9()
  977. If CheckBox9.Checked = False Then : ComboBox17.Visible = True : ComboBox18.Visible = True : Else : ComboBox17.Visible = True : ComboBox18.Visible = False : End If
  978. End Sub
  979. Private Sub 半天變化10()
  980. If CheckBox10.Checked = False Then : ComboBox19.Visible = True : ComboBox20.Visible = True : Else : ComboBox19.Visible = True : ComboBox20.Visible = False : End If
  981. End Sub
  982. Private Sub 半天變化11()
  983. If CheckBox11.Checked = False Then : ComboBox21.Visible = True : ComboBox22.Visible = True : Else : ComboBox21.Visible = True : ComboBox22.Visible = False : End If
  984. End Sub
  985. Private Sub 半天變化12()
  986. If CheckBox12.Checked = False Then : ComboBox23.Visible = True : ComboBox24.Visible = True : Else : ComboBox23.Visible = True : ComboBox24.Visible = False : End If
  987. End Sub
  988. Private Sub 半天變化13()
  989. If CheckBox13.Checked = False Then : ComboBox25.Visible = True : ComboBox26.Visible = True : Else : ComboBox25.Visible = True : ComboBox26.Visible = False : End If
  990. End Sub
  991. Private Sub 半天變化14()
  992. If CheckBox14.Checked = False Then : ComboBox27.Visible = True : ComboBox28.Visible = True : Else : ComboBox27.Visible = True : ComboBox28.Visible = False : End If
  993. End Sub
  994. Private Sub 半天變化15()
  995. If CheckBox15.Checked = False Then : ComboBox29.Visible = True : ComboBox30.Visible = True : Else : ComboBox29.Visible = True : ComboBox30.Visible = False : End If
  996. End Sub
  997. Private Sub 半天變化16()
  998. If CheckBox16.Checked = False Then : ComboBox31.Visible = True : ComboBox32.Visible = True : Else : ComboBox31.Visible = True : ComboBox32.Visible = False : End If
  999. End Sub
  1000. Private Sub 半天變化17()
  1001. If CheckBox17.Checked = False Then : ComboBox33.Visible = True : ComboBox34.Visible = True : Else : ComboBox33.Visible = True : ComboBox34.Visible = False : End If
  1002. End Sub
  1003. Private Sub 半天變化18()
  1004. If CheckBox18.Checked = False Then : ComboBox35.Visible = True : ComboBox36.Visible = True : Else : ComboBox35.Visible = True : ComboBox36.Visible = False : End If
  1005. End Sub
  1006. Private Sub 半天變化19()
  1007. If CheckBox19.Checked = False Then : ComboBox37.Visible = True : ComboBox38.Visible = True : Else : ComboBox37.Visible = True : ComboBox38.Visible = False : End If
  1008. End Sub
  1009. Private Sub 半天變化20()
  1010. If CheckBox20.Checked = False Then : ComboBox39.Visible = True : ComboBox40.Visible = True : Else : ComboBox39.Visible = True : ComboBox40.Visible = False : End If
  1011. End Sub
  1012. Private Sub 全_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 全_ch.CheckedChanged
  1013. 讀取人員資料表()
  1014. End Sub
  1015. Private Sub 減一天_bt_Click(sender As Object, e As EventArgs) Handles 減一天_bt.Click
  1016. DTP1.Value = 年_lb.Text & "/" & 月_lb.Text & "/" & 日_lb.Text
  1017. DTP1.Value = DTP1.Value.AddDays(-1)
  1018. PA = Format(DTP1.Value, "yyyy/MM/dd")
  1019. 年_lb.Text = Strings.Left(PA, 4) : 月_lb.Text = Strings.Mid(PA, 6, 2) : PA2 = Strings.Right(PA, 2)
  1020. '----------------回復預設-----------------------------------------------------------------------------------------------
  1021. If Val(PA2) > 9 Then : 日_lb.Text = PA2 : Else : 日_lb.Text = "0" & Val(PA2) : End If
  1022. 回復預設() : 重新讀取()
  1023. End Sub
  1024. Private Sub 加一天_bt1_Click(sender As Object, e As EventArgs) Handles 加一天_bt1.Click
  1025. DTP1.Value = 年_lb.Text & "/" & 月_lb.Text & "/" & 日_lb.Text
  1026. DTP1.Value = DTP1.Value.AddDays(+1)
  1027. PA = Format(DTP1.Value, "yyyy/MM/dd")
  1028. 年_lb.Text = Strings.Left(PA, 4) : 月_lb.Text = Strings.Mid(PA, 6, 2) : PA2 = Strings.Right(PA, 2)
  1029. '----------------回復預設-----------------------------------------------------------------------------------------------
  1030. If Val(PA2) > 9 Then : 日_lb.Text = PA2 : Else : 日_lb.Text = "0" & Val(PA2) : End If
  1031. 回復預設() : 重新讀取()
  1032. End Sub
  1033. Private Sub ComboBox41_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox41.SelectedIndexChanged
  1034. If ComboBox41.SelectedIndex = 0 Then : ComboBox1.BackColor = Color.LawnGreen
  1035. ElseIf ComboBox41.SelectedIndex = 1 Then : ComboBox1.BackColor = Color.LightBlue
  1036. ElseIf ComboBox41.SelectedIndex = 2 Then : ComboBox1.BackColor = Color.LightCoral
  1037. ElseIf ComboBox41.SelectedIndex = 3 Then : ComboBox1.BackColor = Color.LightCyan
  1038. ElseIf ComboBox41.SelectedIndex = 4 Then : ComboBox1.BackColor = Color.LightGoldenrodYellow
  1039. ElseIf ComboBox41.SelectedIndex = 5 Then : ComboBox1.BackColor = Color.LightGray
  1040. ElseIf ComboBox41.SelectedIndex = 6 Then : ComboBox1.BackColor = Color.LightGreen
  1041. ElseIf ComboBox41.SelectedIndex = 7 Then : ComboBox1.BackColor = Color.LightPink
  1042. ElseIf ComboBox41.SelectedIndex = 8 Then : ComboBox1.BackColor = Color.LightSalmon
  1043. ElseIf ComboBox41.SelectedIndex = 9 Then : ComboBox1.BackColor = Color.Gray
  1044. End If
  1045. End Sub
  1046. Private Sub ComboBox42_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox42.SelectedIndexChanged
  1047. If ComboBox42.SelectedIndex = 0 Then : ComboBox2.BackColor = Color.LawnGreen
  1048. ElseIf ComboBox42.SelectedIndex = 1 Then : ComboBox2.BackColor = Color.LightBlue
  1049. ElseIf ComboBox42.SelectedIndex = 2 Then : ComboBox2.BackColor = Color.LightCoral
  1050. ElseIf ComboBox42.SelectedIndex = 3 Then : ComboBox2.BackColor = Color.LightCyan
  1051. ElseIf ComboBox42.SelectedIndex = 4 Then : ComboBox2.BackColor = Color.LightGoldenrodYellow
  1052. ElseIf ComboBox42.SelectedIndex = 5 Then : ComboBox2.BackColor = Color.LightGray
  1053. ElseIf ComboBox42.SelectedIndex = 6 Then : ComboBox2.BackColor = Color.LightGreen
  1054. ElseIf ComboBox42.SelectedIndex = 7 Then : ComboBox2.BackColor = Color.LightPink
  1055. ElseIf ComboBox42.SelectedIndex = 8 Then : ComboBox2.BackColor = Color.LightSalmon
  1056. ElseIf ComboBox42.SelectedIndex = 9 Then : ComboBox2.BackColor = Color.Gray
  1057. End If
  1058. End Sub
  1059. Private Sub ComboBox43_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox43.SelectedIndexChanged
  1060. If ComboBox43.SelectedIndex = 0 Then : ComboBox3.BackColor = Color.LawnGreen
  1061. ElseIf ComboBox43.SelectedIndex = 1 Then : ComboBox3.BackColor = Color.LightBlue
  1062. ElseIf ComboBox43.SelectedIndex = 2 Then : ComboBox3.BackColor = Color.LightCoral
  1063. ElseIf ComboBox43.SelectedIndex = 3 Then : ComboBox3.BackColor = Color.LightCyan
  1064. ElseIf ComboBox43.SelectedIndex = 4 Then : ComboBox3.BackColor = Color.LightGoldenrodYellow
  1065. ElseIf ComboBox43.SelectedIndex = 5 Then : ComboBox3.BackColor = Color.LightGray
  1066. ElseIf ComboBox43.SelectedIndex = 6 Then : ComboBox3.BackColor = Color.LightGreen
  1067. ElseIf ComboBox43.SelectedIndex = 7 Then : ComboBox3.BackColor = Color.LightPink
  1068. ElseIf ComboBox43.SelectedIndex = 8 Then : ComboBox3.BackColor = Color.LightSalmon
  1069. ElseIf ComboBox43.SelectedIndex = 9 Then : ComboBox3.BackColor = Color.Gray
  1070. End If
  1071. End Sub
  1072. Private Sub ComboBox44_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox44.SelectedIndexChanged
  1073. If ComboBox44.SelectedIndex = 0 Then : ComboBox4.BackColor = Color.LawnGreen
  1074. ElseIf ComboBox44.SelectedIndex = 1 Then : ComboBox4.BackColor = Color.LightBlue
  1075. ElseIf ComboBox44.SelectedIndex = 2 Then : ComboBox4.BackColor = Color.LightCoral
  1076. ElseIf ComboBox44.SelectedIndex = 3 Then : ComboBox4.BackColor = Color.LightCyan
  1077. ElseIf ComboBox44.SelectedIndex = 4 Then : ComboBox4.BackColor = Color.LightGoldenrodYellow
  1078. ElseIf ComboBox44.SelectedIndex = 5 Then : ComboBox4.BackColor = Color.LightGray
  1079. ElseIf ComboBox44.SelectedIndex = 6 Then : ComboBox4.BackColor = Color.LightGreen
  1080. ElseIf ComboBox44.SelectedIndex = 7 Then : ComboBox4.BackColor = Color.LightPink
  1081. ElseIf ComboBox44.SelectedIndex = 8 Then : ComboBox4.BackColor = Color.LightSalmon
  1082. ElseIf ComboBox44.SelectedIndex = 9 Then : ComboBox4.BackColor = Color.Gray
  1083. End If
  1084. End Sub
  1085. Private Sub ComboBox45_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox45.SelectedIndexChanged
  1086. If ComboBox45.SelectedIndex = 0 Then : ComboBox5.BackColor = Color.LawnGreen
  1087. ElseIf ComboBox45.SelectedIndex = 1 Then : ComboBox5.BackColor = Color.LightBlue
  1088. ElseIf ComboBox45.SelectedIndex = 2 Then : ComboBox5.BackColor = Color.LightCoral
  1089. ElseIf ComboBox45.SelectedIndex = 3 Then : ComboBox5.BackColor = Color.LightCyan
  1090. ElseIf ComboBox45.SelectedIndex = 4 Then : ComboBox5.BackColor = Color.LightGoldenrodYellow
  1091. ElseIf ComboBox45.SelectedIndex = 5 Then : ComboBox5.BackColor = Color.LightGray
  1092. ElseIf ComboBox45.SelectedIndex = 6 Then : ComboBox5.BackColor = Color.LightGreen
  1093. ElseIf ComboBox45.SelectedIndex = 7 Then : ComboBox5.BackColor = Color.LightPink
  1094. ElseIf ComboBox45.SelectedIndex = 8 Then : ComboBox5.BackColor = Color.LightSalmon
  1095. ElseIf ComboBox45.SelectedIndex = 9 Then : ComboBox5.BackColor = Color.Gray
  1096. End If
  1097. End Sub
  1098. Private Sub ComboBox46_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox46.SelectedIndexChanged
  1099. If ComboBox46.SelectedIndex = 0 Then : ComboBox6.BackColor = Color.LawnGreen
  1100. ElseIf ComboBox46.SelectedIndex = 1 Then : ComboBox6.BackColor = Color.LightBlue
  1101. ElseIf ComboBox46.SelectedIndex = 2 Then : ComboBox6.BackColor = Color.LightCoral
  1102. ElseIf ComboBox46.SelectedIndex = 3 Then : ComboBox6.BackColor = Color.LightCyan
  1103. ElseIf ComboBox46.SelectedIndex = 4 Then : ComboBox6.BackColor = Color.LightGoldenrodYellow
  1104. ElseIf ComboBox46.SelectedIndex = 5 Then : ComboBox6.BackColor = Color.LightGray
  1105. ElseIf ComboBox46.SelectedIndex = 6 Then : ComboBox6.BackColor = Color.LightGreen
  1106. ElseIf ComboBox46.SelectedIndex = 7 Then : ComboBox6.BackColor = Color.LightPink
  1107. ElseIf ComboBox46.SelectedIndex = 8 Then : ComboBox6.BackColor = Color.LightSalmon
  1108. ElseIf ComboBox46.SelectedIndex = 9 Then : ComboBox6.BackColor = Color.Gray
  1109. End If
  1110. End Sub
  1111. Private Sub ComboBox47_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox47.SelectedIndexChanged
  1112. If ComboBox47.SelectedIndex = 0 Then : ComboBox7.BackColor = Color.LawnGreen
  1113. ElseIf ComboBox47.SelectedIndex = 1 Then : ComboBox7.BackColor = Color.LightBlue
  1114. ElseIf ComboBox47.SelectedIndex = 2 Then : ComboBox7.BackColor = Color.LightCoral
  1115. ElseIf ComboBox47.SelectedIndex = 3 Then : ComboBox7.BackColor = Color.LightCyan
  1116. ElseIf ComboBox47.SelectedIndex = 4 Then : ComboBox7.BackColor = Color.LightGoldenrodYellow
  1117. ElseIf ComboBox47.SelectedIndex = 5 Then : ComboBox7.BackColor = Color.LightGray
  1118. ElseIf ComboBox47.SelectedIndex = 6 Then : ComboBox7.BackColor = Color.LightGreen
  1119. ElseIf ComboBox47.SelectedIndex = 7 Then : ComboBox7.BackColor = Color.LightPink
  1120. ElseIf ComboBox47.SelectedIndex = 8 Then : ComboBox7.BackColor = Color.LightSalmon
  1121. ElseIf ComboBox47.SelectedIndex = 9 Then : ComboBox7.BackColor = Color.Gray
  1122. End If
  1123. End Sub
  1124. Private Sub ComboBox48_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox48.SelectedIndexChanged
  1125. If ComboBox48.SelectedIndex = 0 Then : ComboBox8.BackColor = Color.LawnGreen
  1126. ElseIf ComboBox48.SelectedIndex = 1 Then : ComboBox8.BackColor = Color.LightBlue
  1127. ElseIf ComboBox48.SelectedIndex = 2 Then : ComboBox8.BackColor = Color.LightCoral
  1128. ElseIf ComboBox48.SelectedIndex = 3 Then : ComboBox8.BackColor = Color.LightCyan
  1129. ElseIf ComboBox48.SelectedIndex = 4 Then : ComboBox8.BackColor = Color.LightGoldenrodYellow
  1130. ElseIf ComboBox48.SelectedIndex = 5 Then : ComboBox8.BackColor = Color.LightGray
  1131. ElseIf ComboBox48.SelectedIndex = 6 Then : ComboBox8.BackColor = Color.LightGreen
  1132. ElseIf ComboBox48.SelectedIndex = 7 Then : ComboBox8.BackColor = Color.LightPink
  1133. ElseIf ComboBox48.SelectedIndex = 8 Then : ComboBox8.BackColor = Color.LightSalmon
  1134. ElseIf ComboBox48.SelectedIndex = 9 Then : ComboBox8.BackColor = Color.Gray
  1135. End If
  1136. End Sub
  1137. Private Sub ComboBox49_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox49.SelectedIndexChanged
  1138. If ComboBox49.SelectedIndex = 0 Then : ComboBox9.BackColor = Color.LawnGreen
  1139. ElseIf ComboBox49.SelectedIndex = 1 Then : ComboBox9.BackColor = Color.LightBlue
  1140. ElseIf ComboBox49.SelectedIndex = 2 Then : ComboBox9.BackColor = Color.LightCoral
  1141. ElseIf ComboBox49.SelectedIndex = 3 Then : ComboBox9.BackColor = Color.LightCyan
  1142. ElseIf ComboBox49.SelectedIndex = 4 Then : ComboBox9.BackColor = Color.LightGoldenrodYellow
  1143. ElseIf ComboBox49.SelectedIndex = 5 Then : ComboBox9.BackColor = Color.LightGray
  1144. ElseIf ComboBox49.SelectedIndex = 6 Then : ComboBox9.BackColor = Color.LightGreen
  1145. ElseIf ComboBox49.SelectedIndex = 7 Then : ComboBox9.BackColor = Color.LightPink
  1146. ElseIf ComboBox49.SelectedIndex = 8 Then : ComboBox9.BackColor = Color.LightSalmon
  1147. ElseIf ComboBox49.SelectedIndex = 9 Then : ComboBox9.BackColor = Color.Gray
  1148. End If
  1149. End Sub
  1150. Private Sub ComboBox50_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox50.SelectedIndexChanged
  1151. If ComboBox50.SelectedIndex = 0 Then : ComboBox10.BackColor = Color.LawnGreen
  1152. ElseIf ComboBox50.SelectedIndex = 1 Then : ComboBox10.BackColor = Color.LightBlue
  1153. ElseIf ComboBox50.SelectedIndex = 2 Then : ComboBox10.BackColor = Color.LightCoral
  1154. ElseIf ComboBox50.SelectedIndex = 3 Then : ComboBox10.BackColor = Color.LightCyan
  1155. ElseIf ComboBox50.SelectedIndex = 4 Then : ComboBox10.BackColor = Color.LightGoldenrodYellow
  1156. ElseIf ComboBox50.SelectedIndex = 5 Then : ComboBox10.BackColor = Color.LightGray
  1157. ElseIf ComboBox50.SelectedIndex = 6 Then : ComboBox10.BackColor = Color.LightGreen
  1158. ElseIf ComboBox50.SelectedIndex = 7 Then : ComboBox10.BackColor = Color.LightPink
  1159. ElseIf ComboBox50.SelectedIndex = 8 Then : ComboBox10.BackColor = Color.LightSalmon
  1160. ElseIf ComboBox50.SelectedIndex = 9 Then : ComboBox10.BackColor = Color.Gray
  1161. End If
  1162. End Sub
  1163. Private Sub ComboBox51_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox51.SelectedIndexChanged
  1164. If ComboBox51.SelectedIndex = 0 Then : ComboBox11.BackColor = Color.LawnGreen
  1165. ElseIf ComboBox51.SelectedIndex = 1 Then : ComboBox11.BackColor = Color.LightBlue
  1166. ElseIf ComboBox51.SelectedIndex = 2 Then : ComboBox11.BackColor = Color.LightCoral
  1167. ElseIf ComboBox51.SelectedIndex = 3 Then : ComboBox11.BackColor = Color.LightCyan
  1168. ElseIf ComboBox51.SelectedIndex = 4 Then : ComboBox11.BackColor = Color.LightGoldenrodYellow
  1169. ElseIf ComboBox51.SelectedIndex = 5 Then : ComboBox11.BackColor = Color.LightGray
  1170. ElseIf ComboBox51.SelectedIndex = 6 Then : ComboBox11.BackColor = Color.LightGreen
  1171. ElseIf ComboBox51.SelectedIndex = 7 Then : ComboBox11.BackColor = Color.LightPink
  1172. ElseIf ComboBox51.SelectedIndex = 8 Then : ComboBox11.BackColor = Color.LightSalmon
  1173. ElseIf ComboBox51.SelectedIndex = 9 Then : ComboBox11.BackColor = Color.Gray
  1174. End If
  1175. End Sub
  1176. Private Sub ComboBox52_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox52.SelectedIndexChanged
  1177. If ComboBox52.SelectedIndex = 0 Then : ComboBox12.BackColor = Color.LawnGreen
  1178. ElseIf ComboBox52.SelectedIndex = 1 Then : ComboBox12.BackColor = Color.LightBlue
  1179. ElseIf ComboBox52.SelectedIndex = 2 Then : ComboBox12.BackColor = Color.LightCoral
  1180. ElseIf ComboBox52.SelectedIndex = 3 Then : ComboBox12.BackColor = Color.LightCyan
  1181. ElseIf ComboBox52.SelectedIndex = 4 Then : ComboBox12.BackColor = Color.LightGoldenrodYellow
  1182. ElseIf ComboBox52.SelectedIndex = 5 Then : ComboBox12.BackColor = Color.LightGray
  1183. ElseIf ComboBox52.SelectedIndex = 6 Then : ComboBox12.BackColor = Color.LightGreen
  1184. ElseIf ComboBox52.SelectedIndex = 7 Then : ComboBox12.BackColor = Color.LightPink
  1185. ElseIf ComboBox52.SelectedIndex = 8 Then : ComboBox12.BackColor = Color.LightSalmon
  1186. ElseIf ComboBox52.SelectedIndex = 9 Then : ComboBox12.BackColor = Color.Gray
  1187. End If
  1188. End Sub
  1189. Private Sub ComboBox53_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox53.SelectedIndexChanged
  1190. If ComboBox53.SelectedIndex = 0 Then : ComboBox13.BackColor = Color.LawnGreen
  1191. ElseIf ComboBox53.SelectedIndex = 1 Then : ComboBox13.BackColor = Color.LightBlue
  1192. ElseIf ComboBox53.SelectedIndex = 2 Then : ComboBox13.BackColor = Color.LightCoral
  1193. ElseIf ComboBox53.SelectedIndex = 3 Then : ComboBox13.BackColor = Color.LightCyan
  1194. ElseIf ComboBox53.SelectedIndex = 4 Then : ComboBox13.BackColor = Color.LightGoldenrodYellow
  1195. ElseIf ComboBox53.SelectedIndex = 5 Then : ComboBox13.BackColor = Color.LightGray
  1196. ElseIf ComboBox53.SelectedIndex = 6 Then : ComboBox13.BackColor = Color.LightGreen
  1197. ElseIf ComboBox53.SelectedIndex = 7 Then : ComboBox13.BackColor = Color.LightPink
  1198. ElseIf ComboBox53.SelectedIndex = 8 Then : ComboBox13.BackColor = Color.LightSalmon
  1199. ElseIf ComboBox53.SelectedIndex = 9 Then : ComboBox13.BackColor = Color.Gray
  1200. End If
  1201. End Sub
  1202. Private Sub ComboBox54_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox54.SelectedIndexChanged
  1203. If ComboBox54.SelectedIndex = 0 Then : ComboBox14.BackColor = Color.LawnGreen
  1204. ElseIf ComboBox54.SelectedIndex = 1 Then : ComboBox14.BackColor = Color.LightBlue
  1205. ElseIf ComboBox54.SelectedIndex = 2 Then : ComboBox14.BackColor = Color.LightCoral
  1206. ElseIf ComboBox54.SelectedIndex = 3 Then : ComboBox14.BackColor = Color.LightCyan
  1207. ElseIf ComboBox54.SelectedIndex = 4 Then : ComboBox14.BackColor = Color.LightGoldenrodYellow
  1208. ElseIf ComboBox54.SelectedIndex = 5 Then : ComboBox14.BackColor = Color.LightGray
  1209. ElseIf ComboBox54.SelectedIndex = 6 Then : ComboBox14.BackColor = Color.LightGreen
  1210. ElseIf ComboBox54.SelectedIndex = 7 Then : ComboBox14.BackColor = Color.LightPink
  1211. ElseIf ComboBox54.SelectedIndex = 8 Then : ComboBox14.BackColor = Color.LightSalmon
  1212. ElseIf ComboBox54.SelectedIndex = 9 Then : ComboBox14.BackColor = Color.Gray
  1213. End If
  1214. End Sub
  1215. Private Sub ComboBox55_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox55.SelectedIndexChanged
  1216. If ComboBox55.SelectedIndex = 0 Then : ComboBox15.BackColor = Color.LawnGreen
  1217. ElseIf ComboBox55.SelectedIndex = 1 Then : ComboBox15.BackColor = Color.LightBlue
  1218. ElseIf ComboBox55.SelectedIndex = 2 Then : ComboBox15.BackColor = Color.LightCoral
  1219. ElseIf ComboBox55.SelectedIndex = 3 Then : ComboBox15.BackColor = Color.LightCyan
  1220. ElseIf ComboBox55.SelectedIndex = 4 Then : ComboBox15.BackColor = Color.LightGoldenrodYellow
  1221. ElseIf ComboBox55.SelectedIndex = 5 Then : ComboBox15.BackColor = Color.LightGray
  1222. ElseIf ComboBox55.SelectedIndex = 6 Then : ComboBox15.BackColor = Color.LightGreen
  1223. ElseIf ComboBox55.SelectedIndex = 7 Then : ComboBox15.BackColor = Color.LightPink
  1224. ElseIf ComboBox55.SelectedIndex = 8 Then : ComboBox15.BackColor = Color.LightSalmon
  1225. ElseIf ComboBox55.SelectedIndex = 9 Then : ComboBox15.BackColor = Color.Gray
  1226. End If
  1227. End Sub
  1228. Private Sub ComboBox56_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox56.SelectedIndexChanged
  1229. If ComboBox56.SelectedIndex = 0 Then : ComboBox16.BackColor = Color.LawnGreen
  1230. ElseIf ComboBox56.SelectedIndex = 1 Then : ComboBox16.BackColor = Color.LightBlue
  1231. ElseIf ComboBox56.SelectedIndex = 2 Then : ComboBox16.BackColor = Color.LightCoral
  1232. ElseIf ComboBox56.SelectedIndex = 3 Then : ComboBox16.BackColor = Color.LightCyan
  1233. ElseIf ComboBox56.SelectedIndex = 4 Then : ComboBox16.BackColor = Color.LightGoldenrodYellow
  1234. ElseIf ComboBox56.SelectedIndex = 5 Then : ComboBox16.BackColor = Color.LightGray
  1235. ElseIf ComboBox56.SelectedIndex = 6 Then : ComboBox16.BackColor = Color.LightGreen
  1236. ElseIf ComboBox56.SelectedIndex = 7 Then : ComboBox16.BackColor = Color.LightPink
  1237. ElseIf ComboBox56.SelectedIndex = 8 Then : ComboBox16.BackColor = Color.LightSalmon
  1238. ElseIf ComboBox56.SelectedIndex = 9 Then : ComboBox16.BackColor = Color.Gray
  1239. End If
  1240. End Sub
  1241. Private Sub ComboBox57_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox57.SelectedIndexChanged
  1242. If ComboBox57.SelectedIndex = 0 Then : ComboBox17.BackColor = Color.LawnGreen
  1243. ElseIf ComboBox57.SelectedIndex = 1 Then : ComboBox17.BackColor = Color.LightBlue
  1244. ElseIf ComboBox57.SelectedIndex = 2 Then : ComboBox17.BackColor = Color.LightCoral
  1245. ElseIf ComboBox57.SelectedIndex = 3 Then : ComboBox17.BackColor = Color.LightCyan
  1246. ElseIf ComboBox57.SelectedIndex = 4 Then : ComboBox17.BackColor = Color.LightGoldenrodYellow
  1247. ElseIf ComboBox57.SelectedIndex = 5 Then : ComboBox17.BackColor = Color.LightGray
  1248. ElseIf ComboBox57.SelectedIndex = 6 Then : ComboBox17.BackColor = Color.LightGreen
  1249. ElseIf ComboBox57.SelectedIndex = 7 Then : ComboBox17.BackColor = Color.LightPink
  1250. ElseIf ComboBox57.SelectedIndex = 8 Then : ComboBox17.BackColor = Color.LightSalmon
  1251. ElseIf ComboBox57.SelectedIndex = 9 Then : ComboBox17.BackColor = Color.Gray
  1252. End If
  1253. End Sub
  1254. Private Sub ComboBox58_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox58.SelectedIndexChanged
  1255. If ComboBox58.SelectedIndex = 0 Then : ComboBox18.BackColor = Color.LawnGreen
  1256. ElseIf ComboBox58.SelectedIndex = 1 Then : ComboBox18.BackColor = Color.LightBlue
  1257. ElseIf ComboBox58.SelectedIndex = 2 Then : ComboBox18.BackColor = Color.LightCoral
  1258. ElseIf ComboBox58.SelectedIndex = 3 Then : ComboBox18.BackColor = Color.LightCyan
  1259. ElseIf ComboBox58.SelectedIndex = 4 Then : ComboBox18.BackColor = Color.LightGoldenrodYellow
  1260. ElseIf ComboBox58.SelectedIndex = 5 Then : ComboBox18.BackColor = Color.LightGray
  1261. ElseIf ComboBox58.SelectedIndex = 6 Then : ComboBox18.BackColor = Color.LightGreen
  1262. ElseIf ComboBox58.SelectedIndex = 7 Then : ComboBox18.BackColor = Color.LightPink
  1263. ElseIf ComboBox58.SelectedIndex = 8 Then : ComboBox18.BackColor = Color.LightSalmon
  1264. ElseIf ComboBox58.SelectedIndex = 9 Then : ComboBox18.BackColor = Color.Gray
  1265. End If
  1266. End Sub
  1267. Private Sub ComboBox59_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox59.SelectedIndexChanged
  1268. If ComboBox59.SelectedIndex = 0 Then : ComboBox19.BackColor = Color.LawnGreen
  1269. ElseIf ComboBox59.SelectedIndex = 1 Then : ComboBox19.BackColor = Color.LightBlue
  1270. ElseIf ComboBox59.SelectedIndex = 2 Then : ComboBox19.BackColor = Color.LightCoral
  1271. ElseIf ComboBox59.SelectedIndex = 3 Then : ComboBox19.BackColor = Color.LightCyan
  1272. ElseIf ComboBox59.SelectedIndex = 4 Then : ComboBox19.BackColor = Color.LightGoldenrodYellow
  1273. ElseIf ComboBox59.SelectedIndex = 5 Then : ComboBox19.BackColor = Color.LightGray
  1274. ElseIf ComboBox59.SelectedIndex = 6 Then : ComboBox19.BackColor = Color.LightGreen
  1275. ElseIf ComboBox59.SelectedIndex = 7 Then : ComboBox19.BackColor = Color.LightPink
  1276. ElseIf ComboBox59.SelectedIndex = 8 Then : ComboBox19.BackColor = Color.LightSalmon
  1277. ElseIf ComboBox59.SelectedIndex = 9 Then : ComboBox19.BackColor = Color.Gray
  1278. End If
  1279. End Sub
  1280. Private Sub ComboBox60_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox60.SelectedIndexChanged
  1281. If ComboBox60.SelectedIndex = 0 Then : ComboBox20.BackColor = Color.LawnGreen
  1282. ElseIf ComboBox60.SelectedIndex = 1 Then : ComboBox20.BackColor = Color.LightBlue
  1283. ElseIf ComboBox60.SelectedIndex = 2 Then : ComboBox20.BackColor = Color.LightCoral
  1284. ElseIf ComboBox60.SelectedIndex = 3 Then : ComboBox20.BackColor = Color.LightCyan
  1285. ElseIf ComboBox60.SelectedIndex = 4 Then : ComboBox20.BackColor = Color.LightGoldenrodYellow
  1286. ElseIf ComboBox60.SelectedIndex = 5 Then : ComboBox20.BackColor = Color.LightGray
  1287. ElseIf ComboBox60.SelectedIndex = 6 Then : ComboBox20.BackColor = Color.LightGreen
  1288. ElseIf ComboBox60.SelectedIndex = 7 Then : ComboBox20.BackColor = Color.LightPink
  1289. ElseIf ComboBox60.SelectedIndex = 8 Then : ComboBox20.BackColor = Color.LightSalmon
  1290. ElseIf ComboBox60.SelectedIndex = 9 Then : ComboBox20.BackColor = Color.Gray
  1291. End If
  1292. End Sub
  1293. Private Sub ComboBox61_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox61.SelectedIndexChanged
  1294. If ComboBox61.SelectedIndex = 0 Then : ComboBox21.BackColor = Color.LawnGreen
  1295. ElseIf ComboBox61.SelectedIndex = 1 Then : ComboBox21.BackColor = Color.LightBlue
  1296. ElseIf ComboBox61.SelectedIndex = 2 Then : ComboBox21.BackColor = Color.LightCoral
  1297. ElseIf ComboBox61.SelectedIndex = 3 Then : ComboBox21.BackColor = Color.LightCyan
  1298. ElseIf ComboBox61.SelectedIndex = 4 Then : ComboBox21.BackColor = Color.LightGoldenrodYellow
  1299. ElseIf ComboBox61.SelectedIndex = 5 Then : ComboBox21.BackColor = Color.LightGray
  1300. ElseIf ComboBox61.SelectedIndex = 6 Then : ComboBox21.BackColor = Color.LightGreen
  1301. ElseIf ComboBox61.SelectedIndex = 7 Then : ComboBox21.BackColor = Color.LightPink
  1302. ElseIf ComboBox61.SelectedIndex = 8 Then : ComboBox21.BackColor = Color.LightSalmon
  1303. ElseIf ComboBox61.SelectedIndex = 9 Then : ComboBox21.BackColor = Color.Gray
  1304. End If
  1305. End Sub
  1306. Private Sub ComboBox62_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox62.SelectedIndexChanged
  1307. If ComboBox62.SelectedIndex = 0 Then : ComboBox22.BackColor = Color.LawnGreen
  1308. ElseIf ComboBox62.SelectedIndex = 1 Then : ComboBox22.BackColor = Color.LightBlue
  1309. ElseIf ComboBox62.SelectedIndex = 2 Then : ComboBox22.BackColor = Color.LightCoral
  1310. ElseIf ComboBox62.SelectedIndex = 3 Then : ComboBox22.BackColor = Color.LightCyan
  1311. ElseIf ComboBox62.SelectedIndex = 4 Then : ComboBox22.BackColor = Color.LightGoldenrodYellow
  1312. ElseIf ComboBox62.SelectedIndex = 5 Then : ComboBox22.BackColor = Color.LightGray
  1313. ElseIf ComboBox62.SelectedIndex = 6 Then : ComboBox22.BackColor = Color.LightGreen
  1314. ElseIf ComboBox62.SelectedIndex = 7 Then : ComboBox22.BackColor = Color.LightPink
  1315. ElseIf ComboBox62.SelectedIndex = 8 Then : ComboBox22.BackColor = Color.LightSalmon
  1316. ElseIf ComboBox62.SelectedIndex = 9 Then : ComboBox22.BackColor = Color.Gray
  1317. End If
  1318. End Sub
  1319. Private Sub ComboBox63_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox63.SelectedIndexChanged
  1320. If ComboBox63.SelectedIndex = 0 Then : ComboBox23.BackColor = Color.LawnGreen
  1321. ElseIf ComboBox63.SelectedIndex = 1 Then : ComboBox23.BackColor = Color.LightBlue
  1322. ElseIf ComboBox63.SelectedIndex = 2 Then : ComboBox23.BackColor = Color.LightCoral
  1323. ElseIf ComboBox63.SelectedIndex = 3 Then : ComboBox23.BackColor = Color.LightCyan
  1324. ElseIf ComboBox63.SelectedIndex = 4 Then : ComboBox23.BackColor = Color.LightGoldenrodYellow
  1325. ElseIf ComboBox63.SelectedIndex = 5 Then : ComboBox23.BackColor = Color.LightGray
  1326. ElseIf ComboBox63.SelectedIndex = 6 Then : ComboBox23.BackColor = Color.LightGreen
  1327. ElseIf ComboBox63.SelectedIndex = 7 Then : ComboBox23.BackColor = Color.LightPink
  1328. ElseIf ComboBox63.SelectedIndex = 8 Then : ComboBox23.BackColor = Color.LightSalmon
  1329. ElseIf ComboBox63.SelectedIndex = 9 Then : ComboBox23.BackColor = Color.Gray
  1330. End If
  1331. End Sub
  1332. Private Sub ComboBox64_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox64.SelectedIndexChanged
  1333. If ComboBox64.SelectedIndex = 0 Then : ComboBox24.BackColor = Color.LawnGreen
  1334. ElseIf ComboBox64.SelectedIndex = 1 Then : ComboBox24.BackColor = Color.LightBlue
  1335. ElseIf ComboBox64.SelectedIndex = 2 Then : ComboBox24.BackColor = Color.LightCoral
  1336. ElseIf ComboBox64.SelectedIndex = 3 Then : ComboBox24.BackColor = Color.LightCyan
  1337. ElseIf ComboBox64.SelectedIndex = 4 Then : ComboBox24.BackColor = Color.LightGoldenrodYellow
  1338. ElseIf ComboBox64.SelectedIndex = 5 Then : ComboBox24.BackColor = Color.LightGray
  1339. ElseIf ComboBox64.SelectedIndex = 6 Then : ComboBox24.BackColor = Color.LightGreen
  1340. ElseIf ComboBox64.SelectedIndex = 7 Then : ComboBox24.BackColor = Color.LightPink
  1341. ElseIf ComboBox64.SelectedIndex = 8 Then : ComboBox24.BackColor = Color.LightSalmon
  1342. ElseIf ComboBox64.SelectedIndex = 9 Then : ComboBox24.BackColor = Color.Gray
  1343. End If
  1344. End Sub
  1345. Private Sub ComboBox65_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox65.SelectedIndexChanged
  1346. If ComboBox65.SelectedIndex = 0 Then : ComboBox25.BackColor = Color.LawnGreen
  1347. ElseIf ComboBox65.SelectedIndex = 1 Then : ComboBox25.BackColor = Color.LightBlue
  1348. ElseIf ComboBox65.SelectedIndex = 2 Then : ComboBox25.BackColor = Color.LightCoral
  1349. ElseIf ComboBox65.SelectedIndex = 3 Then : ComboBox25.BackColor = Color.LightCyan
  1350. ElseIf ComboBox65.SelectedIndex = 4 Then : ComboBox25.BackColor = Color.LightGoldenrodYellow
  1351. ElseIf ComboBox65.SelectedIndex = 5 Then : ComboBox25.BackColor = Color.LightGray
  1352. ElseIf ComboBox65.SelectedIndex = 6 Then : ComboBox25.BackColor = Color.LightGreen
  1353. ElseIf ComboBox65.SelectedIndex = 7 Then : ComboBox25.BackColor = Color.LightPink
  1354. ElseIf ComboBox65.SelectedIndex = 8 Then : ComboBox25.BackColor = Color.LightSalmon
  1355. ElseIf ComboBox65.SelectedIndex = 9 Then : ComboBox25.BackColor = Color.Gray
  1356. End If
  1357. End Sub
  1358. Private Sub ComboBox66_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox66.SelectedIndexChanged
  1359. If ComboBox66.SelectedIndex = 0 Then : ComboBox26.BackColor = Color.LawnGreen
  1360. ElseIf ComboBox66.SelectedIndex = 1 Then : ComboBox26.BackColor = Color.LightBlue
  1361. ElseIf ComboBox66.SelectedIndex = 2 Then : ComboBox26.BackColor = Color.LightCoral
  1362. ElseIf ComboBox66.SelectedIndex = 3 Then : ComboBox26.BackColor = Color.LightCyan
  1363. ElseIf ComboBox66.SelectedIndex = 4 Then : ComboBox26.BackColor = Color.LightGoldenrodYellow
  1364. ElseIf ComboBox66.SelectedIndex = 5 Then : ComboBox26.BackColor = Color.LightGray
  1365. ElseIf ComboBox66.SelectedIndex = 6 Then : ComboBox26.BackColor = Color.LightGreen
  1366. ElseIf ComboBox66.SelectedIndex = 7 Then : ComboBox26.BackColor = Color.LightPink
  1367. ElseIf ComboBox66.SelectedIndex = 8 Then : ComboBox26.BackColor = Color.LightSalmon
  1368. ElseIf ComboBox66.SelectedIndex = 9 Then : ComboBox26.BackColor = Color.Gray
  1369. End If
  1370. End Sub
  1371. Private Sub ComboBox67_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox67.SelectedIndexChanged
  1372. If ComboBox67.SelectedIndex = 0 Then : ComboBox27.BackColor = Color.LawnGreen
  1373. ElseIf ComboBox67.SelectedIndex = 1 Then : ComboBox27.BackColor = Color.LightBlue
  1374. ElseIf ComboBox67.SelectedIndex = 2 Then : ComboBox27.BackColor = Color.LightCoral
  1375. ElseIf ComboBox67.SelectedIndex = 3 Then : ComboBox27.BackColor = Color.LightCyan
  1376. ElseIf ComboBox67.SelectedIndex = 4 Then : ComboBox27.BackColor = Color.LightGoldenrodYellow
  1377. ElseIf ComboBox67.SelectedIndex = 5 Then : ComboBox27.BackColor = Color.LightGray
  1378. ElseIf ComboBox67.SelectedIndex = 6 Then : ComboBox27.BackColor = Color.LightGreen
  1379. ElseIf ComboBox67.SelectedIndex = 7 Then : ComboBox27.BackColor = Color.LightPink
  1380. ElseIf ComboBox67.SelectedIndex = 8 Then : ComboBox27.BackColor = Color.LightSalmon
  1381. ElseIf ComboBox67.SelectedIndex = 9 Then : ComboBox27.BackColor = Color.Gray
  1382. End If
  1383. End Sub
  1384. Private Sub ComboBox68_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox68.SelectedIndexChanged
  1385. If ComboBox68.SelectedIndex = 0 Then : ComboBox28.BackColor = Color.LawnGreen
  1386. ElseIf ComboBox68.SelectedIndex = 1 Then : ComboBox28.BackColor = Color.LightBlue
  1387. ElseIf ComboBox68.SelectedIndex = 2 Then : ComboBox28.BackColor = Color.LightCoral
  1388. ElseIf ComboBox68.SelectedIndex = 3 Then : ComboBox28.BackColor = Color.LightCyan
  1389. ElseIf ComboBox68.SelectedIndex = 4 Then : ComboBox28.BackColor = Color.LightGoldenrodYellow
  1390. ElseIf ComboBox68.SelectedIndex = 5 Then : ComboBox28.BackColor = Color.LightGray
  1391. ElseIf ComboBox68.SelectedIndex = 6 Then : ComboBox28.BackColor = Color.LightGreen
  1392. ElseIf ComboBox68.SelectedIndex = 7 Then : ComboBox28.BackColor = Color.LightPink
  1393. ElseIf ComboBox68.SelectedIndex = 8 Then : ComboBox28.BackColor = Color.LightSalmon
  1394. ElseIf ComboBox68.SelectedIndex = 9 Then : ComboBox28.BackColor = Color.Gray
  1395. End If
  1396. End Sub
  1397. Private Sub ComboBox69_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox69.SelectedIndexChanged
  1398. If ComboBox69.SelectedIndex = 0 Then : ComboBox29.BackColor = Color.LawnGreen
  1399. ElseIf ComboBox69.SelectedIndex = 1 Then : ComboBox29.BackColor = Color.LightBlue
  1400. ElseIf ComboBox69.SelectedIndex = 2 Then : ComboBox29.BackColor = Color.LightCoral
  1401. ElseIf ComboBox69.SelectedIndex = 3 Then : ComboBox29.BackColor = Color.LightCyan
  1402. ElseIf ComboBox69.SelectedIndex = 4 Then : ComboBox29.BackColor = Color.LightGoldenrodYellow
  1403. ElseIf ComboBox69.SelectedIndex = 5 Then : ComboBox29.BackColor = Color.LightGray
  1404. ElseIf ComboBox69.SelectedIndex = 6 Then : ComboBox29.BackColor = Color.LightGreen
  1405. ElseIf ComboBox69.SelectedIndex = 7 Then : ComboBox29.BackColor = Color.LightPink
  1406. ElseIf ComboBox69.SelectedIndex = 8 Then : ComboBox29.BackColor = Color.LightSalmon
  1407. ElseIf ComboBox69.SelectedIndex = 9 Then : ComboBox29.BackColor = Color.Gray
  1408. End If
  1409. End Sub
  1410. Private Sub ComboBox70_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox70.SelectedIndexChanged
  1411. If ComboBox70.SelectedIndex = 0 Then : ComboBox30.BackColor = Color.LawnGreen
  1412. ElseIf ComboBox70.SelectedIndex = 1 Then : ComboBox30.BackColor = Color.LightBlue
  1413. ElseIf ComboBox70.SelectedIndex = 2 Then : ComboBox30.BackColor = Color.LightCoral
  1414. ElseIf ComboBox70.SelectedIndex = 3 Then : ComboBox30.BackColor = Color.LightCyan
  1415. ElseIf ComboBox70.SelectedIndex = 4 Then : ComboBox30.BackColor = Color.LightGoldenrodYellow
  1416. ElseIf ComboBox70.SelectedIndex = 5 Then : ComboBox30.BackColor = Color.LightGray
  1417. ElseIf ComboBox70.SelectedIndex = 6 Then : ComboBox30.BackColor = Color.LightGreen
  1418. ElseIf ComboBox70.SelectedIndex = 7 Then : ComboBox30.BackColor = Color.LightPink
  1419. ElseIf ComboBox70.SelectedIndex = 8 Then : ComboBox30.BackColor = Color.LightSalmon
  1420. ElseIf ComboBox70.SelectedIndex = 9 Then : ComboBox30.BackColor = Color.Gray
  1421. End If
  1422. End Sub
  1423. Private Sub ComboBox71_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox71.SelectedIndexChanged
  1424. If ComboBox71.SelectedIndex = 0 Then : ComboBox31.BackColor = Color.LawnGreen
  1425. ElseIf ComboBox71.SelectedIndex = 1 Then : ComboBox31.BackColor = Color.LightBlue
  1426. ElseIf ComboBox71.SelectedIndex = 2 Then : ComboBox31.BackColor = Color.LightCoral
  1427. ElseIf ComboBox71.SelectedIndex = 3 Then : ComboBox31.BackColor = Color.LightCyan
  1428. ElseIf ComboBox71.SelectedIndex = 4 Then : ComboBox31.BackColor = Color.LightGoldenrodYellow
  1429. ElseIf ComboBox71.SelectedIndex = 5 Then : ComboBox31.BackColor = Color.LightGray
  1430. ElseIf ComboBox71.SelectedIndex = 6 Then : ComboBox31.BackColor = Color.LightGreen
  1431. ElseIf ComboBox71.SelectedIndex = 7 Then : ComboBox31.BackColor = Color.LightPink
  1432. ElseIf ComboBox71.SelectedIndex = 8 Then : ComboBox31.BackColor = Color.LightSalmon
  1433. ElseIf ComboBox71.SelectedIndex = 9 Then : ComboBox31.BackColor = Color.Gray
  1434. End If
  1435. End Sub
  1436. Private Sub ComboBox72_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox72.SelectedIndexChanged
  1437. If ComboBox72.SelectedIndex = 0 Then : ComboBox32.BackColor = Color.LawnGreen
  1438. ElseIf ComboBox72.SelectedIndex = 1 Then : ComboBox32.BackColor = Color.LightBlue
  1439. ElseIf ComboBox72.SelectedIndex = 2 Then : ComboBox32.BackColor = Color.LightCoral
  1440. ElseIf ComboBox72.SelectedIndex = 3 Then : ComboBox32.BackColor = Color.LightCyan
  1441. ElseIf ComboBox72.SelectedIndex = 4 Then : ComboBox32.BackColor = Color.LightGoldenrodYellow
  1442. ElseIf ComboBox72.SelectedIndex = 5 Then : ComboBox32.BackColor = Color.LightGray
  1443. ElseIf ComboBox72.SelectedIndex = 6 Then : ComboBox32.BackColor = Color.LightGreen
  1444. ElseIf ComboBox72.SelectedIndex = 7 Then : ComboBox32.BackColor = Color.LightPink
  1445. ElseIf ComboBox72.SelectedIndex = 8 Then : ComboBox32.BackColor = Color.LightSalmon
  1446. ElseIf ComboBox72.SelectedIndex = 9 Then : ComboBox32.BackColor = Color.Gray
  1447. End If
  1448. End Sub
  1449. Private Sub ComboBox73_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox73.SelectedIndexChanged
  1450. If ComboBox73.SelectedIndex = 0 Then : ComboBox33.BackColor = Color.LawnGreen
  1451. ElseIf ComboBox73.SelectedIndex = 1 Then : ComboBox33.BackColor = Color.LightBlue
  1452. ElseIf ComboBox73.SelectedIndex = 2 Then : ComboBox33.BackColor = Color.LightCoral
  1453. ElseIf ComboBox73.SelectedIndex = 3 Then : ComboBox33.BackColor = Color.LightCyan
  1454. ElseIf ComboBox73.SelectedIndex = 4 Then : ComboBox33.BackColor = Color.LightGoldenrodYellow
  1455. ElseIf ComboBox73.SelectedIndex = 5 Then : ComboBox33.BackColor = Color.LightGray
  1456. ElseIf ComboBox73.SelectedIndex = 6 Then : ComboBox33.BackColor = Color.LightGreen
  1457. ElseIf ComboBox73.SelectedIndex = 7 Then : ComboBox33.BackColor = Color.LightPink
  1458. ElseIf ComboBox73.SelectedIndex = 8 Then : ComboBox33.BackColor = Color.LightSalmon
  1459. ElseIf ComboBox73.SelectedIndex = 9 Then : ComboBox33.BackColor = Color.Gray
  1460. End If
  1461. End Sub
  1462. Private Sub ComboBox74_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox74.SelectedIndexChanged
  1463. If ComboBox74.SelectedIndex = 0 Then : ComboBox34.BackColor = Color.LawnGreen
  1464. ElseIf ComboBox74.SelectedIndex = 1 Then : ComboBox34.BackColor = Color.LightBlue
  1465. ElseIf ComboBox74.SelectedIndex = 2 Then : ComboBox34.BackColor = Color.LightCoral
  1466. ElseIf ComboBox74.SelectedIndex = 3 Then : ComboBox34.BackColor = Color.LightCyan
  1467. ElseIf ComboBox74.SelectedIndex = 4 Then : ComboBox34.BackColor = Color.LightGoldenrodYellow
  1468. ElseIf ComboBox74.SelectedIndex = 5 Then : ComboBox34.BackColor = Color.LightGray
  1469. ElseIf ComboBox74.SelectedIndex = 6 Then : ComboBox34.BackColor = Color.LightGreen
  1470. ElseIf ComboBox74.SelectedIndex = 7 Then : ComboBox34.BackColor = Color.LightPink
  1471. ElseIf ComboBox74.SelectedIndex = 8 Then : ComboBox34.BackColor = Color.LightSalmon
  1472. ElseIf ComboBox74.SelectedIndex = 9 Then : ComboBox34.BackColor = Color.Gray
  1473. End If
  1474. End Sub
  1475. Private Sub ComboBox75_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox75.SelectedIndexChanged
  1476. If ComboBox75.SelectedIndex = 0 Then : ComboBox35.BackColor = Color.LawnGreen
  1477. ElseIf ComboBox75.SelectedIndex = 1 Then : ComboBox35.BackColor = Color.LightBlue
  1478. ElseIf ComboBox75.SelectedIndex = 2 Then : ComboBox35.BackColor = Color.LightCoral
  1479. ElseIf ComboBox75.SelectedIndex = 3 Then : ComboBox35.BackColor = Color.LightCyan
  1480. ElseIf ComboBox75.SelectedIndex = 4 Then : ComboBox35.BackColor = Color.LightGoldenrodYellow
  1481. ElseIf ComboBox75.SelectedIndex = 5 Then : ComboBox35.BackColor = Color.LightGray
  1482. ElseIf ComboBox75.SelectedIndex = 6 Then : ComboBox35.BackColor = Color.LightGreen
  1483. ElseIf ComboBox75.SelectedIndex = 7 Then : ComboBox35.BackColor = Color.LightPink
  1484. ElseIf ComboBox75.SelectedIndex = 8 Then : ComboBox35.BackColor = Color.LightSalmon
  1485. ElseIf ComboBox75.SelectedIndex = 9 Then : ComboBox35.BackColor = Color.Gray
  1486. End If
  1487. End Sub
  1488. Private Sub ComboBox76_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox76.SelectedIndexChanged
  1489. If ComboBox76.SelectedIndex = 0 Then : ComboBox36.BackColor = Color.LawnGreen
  1490. ElseIf ComboBox76.SelectedIndex = 1 Then : ComboBox36.BackColor = Color.LightBlue
  1491. ElseIf ComboBox76.SelectedIndex = 2 Then : ComboBox36.BackColor = Color.LightCoral
  1492. ElseIf ComboBox76.SelectedIndex = 3 Then : ComboBox36.BackColor = Color.LightCyan
  1493. ElseIf ComboBox76.SelectedIndex = 4 Then : ComboBox36.BackColor = Color.LightGoldenrodYellow
  1494. ElseIf ComboBox76.SelectedIndex = 5 Then : ComboBox36.BackColor = Color.LightGray
  1495. ElseIf ComboBox76.SelectedIndex = 6 Then : ComboBox36.BackColor = Color.LightGreen
  1496. ElseIf ComboBox76.SelectedIndex = 7 Then : ComboBox36.BackColor = Color.LightPink
  1497. ElseIf ComboBox76.SelectedIndex = 8 Then : ComboBox36.BackColor = Color.LightSalmon
  1498. ElseIf ComboBox76.SelectedIndex = 9 Then : ComboBox36.BackColor = Color.Gray
  1499. End If
  1500. End Sub
  1501. Private Sub ComboBox77_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox77.SelectedIndexChanged
  1502. If ComboBox77.SelectedIndex = 0 Then : ComboBox37.BackColor = Color.LawnGreen
  1503. ElseIf ComboBox77.SelectedIndex = 1 Then : ComboBox37.BackColor = Color.LightBlue
  1504. ElseIf ComboBox77.SelectedIndex = 2 Then : ComboBox37.BackColor = Color.LightCoral
  1505. ElseIf ComboBox77.SelectedIndex = 3 Then : ComboBox37.BackColor = Color.LightCyan
  1506. ElseIf ComboBox77.SelectedIndex = 4 Then : ComboBox37.BackColor = Color.LightGoldenrodYellow
  1507. ElseIf ComboBox77.SelectedIndex = 5 Then : ComboBox37.BackColor = Color.LightGray
  1508. ElseIf ComboBox77.SelectedIndex = 6 Then : ComboBox37.BackColor = Color.LightGreen
  1509. ElseIf ComboBox77.SelectedIndex = 7 Then : ComboBox37.BackColor = Color.LightPink
  1510. ElseIf ComboBox77.SelectedIndex = 8 Then : ComboBox37.BackColor = Color.LightSalmon
  1511. ElseIf ComboBox77.SelectedIndex = 9 Then : ComboBox37.BackColor = Color.Gray
  1512. End If
  1513. End Sub
  1514. Private Sub ComboBox78_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox78.SelectedIndexChanged
  1515. If ComboBox78.SelectedIndex = 0 Then : ComboBox38.BackColor = Color.LawnGreen
  1516. ElseIf ComboBox78.SelectedIndex = 1 Then : ComboBox38.BackColor = Color.LightBlue
  1517. ElseIf ComboBox78.SelectedIndex = 2 Then : ComboBox38.BackColor = Color.LightCoral
  1518. ElseIf ComboBox78.SelectedIndex = 3 Then : ComboBox38.BackColor = Color.LightCyan
  1519. ElseIf ComboBox78.SelectedIndex = 4 Then : ComboBox38.BackColor = Color.LightGoldenrodYellow
  1520. ElseIf ComboBox78.SelectedIndex = 5 Then : ComboBox38.BackColor = Color.LightGray
  1521. ElseIf ComboBox78.SelectedIndex = 6 Then : ComboBox38.BackColor = Color.LightGreen
  1522. ElseIf ComboBox78.SelectedIndex = 7 Then : ComboBox38.BackColor = Color.LightPink
  1523. ElseIf ComboBox78.SelectedIndex = 8 Then : ComboBox38.BackColor = Color.LightSalmon
  1524. ElseIf ComboBox78.SelectedIndex = 9 Then : ComboBox38.BackColor = Color.Gray
  1525. End If
  1526. End Sub
  1527. Private Sub ComboBox79_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox79.SelectedIndexChanged
  1528. If ComboBox79.SelectedIndex = 0 Then : ComboBox39.BackColor = Color.LawnGreen
  1529. ElseIf ComboBox79.SelectedIndex = 1 Then : ComboBox39.BackColor = Color.LightBlue
  1530. ElseIf ComboBox79.SelectedIndex = 2 Then : ComboBox39.BackColor = Color.LightCoral
  1531. ElseIf ComboBox79.SelectedIndex = 3 Then : ComboBox39.BackColor = Color.LightCyan
  1532. ElseIf ComboBox79.SelectedIndex = 4 Then : ComboBox39.BackColor = Color.LightGoldenrodYellow
  1533. ElseIf ComboBox79.SelectedIndex = 5 Then : ComboBox39.BackColor = Color.LightGray
  1534. ElseIf ComboBox79.SelectedIndex = 6 Then : ComboBox39.BackColor = Color.LightGreen
  1535. ElseIf ComboBox79.SelectedIndex = 7 Then : ComboBox39.BackColor = Color.LightPink
  1536. ElseIf ComboBox79.SelectedIndex = 8 Then : ComboBox39.BackColor = Color.LightSalmon
  1537. ElseIf ComboBox79.SelectedIndex = 9 Then : ComboBox39.BackColor = Color.Gray
  1538. End If
  1539. End Sub
  1540. Private Sub ComboBox80_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox80.SelectedIndexChanged
  1541. If ComboBox80.SelectedIndex = 0 Then : ComboBox40.BackColor = Color.LawnGreen
  1542. ElseIf ComboBox80.SelectedIndex = 1 Then : ComboBox40.BackColor = Color.LightBlue
  1543. ElseIf ComboBox80.SelectedIndex = 2 Then : ComboBox40.BackColor = Color.LightCoral
  1544. ElseIf ComboBox80.SelectedIndex = 3 Then : ComboBox40.BackColor = Color.LightCyan
  1545. ElseIf ComboBox80.SelectedIndex = 4 Then : ComboBox40.BackColor = Color.LightGoldenrodYellow
  1546. ElseIf ComboBox80.SelectedIndex = 5 Then : ComboBox40.BackColor = Color.LightGray
  1547. ElseIf ComboBox80.SelectedIndex = 6 Then : ComboBox40.BackColor = Color.LightGreen
  1548. ElseIf ComboBox80.SelectedIndex = 7 Then : ComboBox40.BackColor = Color.LightPink
  1549. ElseIf ComboBox80.SelectedIndex = 8 Then : ComboBox40.BackColor = Color.LightSalmon
  1550. ElseIf ComboBox80.SelectedIndex = 9 Then : ComboBox40.BackColor = Color.Gray
  1551. End If
  1552. End Sub
  1553. Private Sub 鎖定_bt_Click(sender As Object, e As EventArgs) Handles 鎖定_bt.Click
  1554. PA = 年_lb.Text & "/" & 月_lb.Text & "/" & 日_lb.Text : SQL_排班簽核() : MsgBox("簽核完畢!!!")
  1555. 鎖定_bt.Enabled = False
  1556. 班表鎖定變化()
  1557. End Sub
  1558. Private Sub 解鎖_ch_CheckedChanged(sender As Object, e As EventArgs) Handles 解鎖_ch.Click
  1559. If 解鎖_ch.Checked = True Then
  1560. PA = InputBox("修改已鎖定班表請輸入密碼!!")
  1561. If PA = "753582" Then
  1562. 解鎖_ch.Checked = True
  1563. 鎖定_bt.Enabled = True
  1564. 班表鎖定變化()
  1565. Else
  1566. MsgBox("密碼錯誤!!")
  1567. 解鎖_ch.Checked = False
  1568. 鎖定_bt.Enabled = False
  1569. 班表鎖定變化()
  1570. End If
  1571. ElseIf 解鎖_ch.Checked = False Then
  1572. 解鎖_ch.Checked = False
  1573. 鎖定_bt.Enabled = False
  1574. 班表鎖定變化()
  1575. End If
  1576. End Sub
  1577. Private Sub ComboBox40_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox40.TextChanged
  1578. If ComboBox40.Text = "" Then : ComboBox40.DropDownStyle = 1 : Else : ComboBox40.DropDownStyle = 0 : End If
  1579. End Sub
  1580. Private Sub 存檔_bt_Click(sender As Object, e As EventArgs) Handles 存檔_bt.Click
  1581. PA = 年_lb.Text & "/" & 月_lb.Text & "/" & 日_lb.Text
  1582. SQL_排班明細_判斷是否有資料()
  1583. If dr.Read() Then
  1584. SQL_排班明細_刪除當天()
  1585. End If
  1586. Q = 0
  1587. For no As Integer = 1 To 20
  1588. Dim 姓名_tbS As TextBox = CType(Me.Controls.Find("姓名_tb" + no.ToString(), True)(0), TextBox)
  1589. Dim 班別_cbS As ComboBox = CType(Me.Controls.Find("班別_cb" + no.ToString(), True)(0), ComboBox)
  1590. Dim A_lbS As Label = CType(Me.Controls.Find("A_lb" + no.ToString(), True)(0), Label)
  1591. Dim CheckBoxS As CheckBox = CType(Me.Controls.Find("CheckBox" + no.ToString(), True)(0), CheckBox)
  1592. Dim NumericUpDownS As NumericUpDown = CType(Me.Controls.Find("NumericUpDown" + no.ToString(), True)(0), NumericUpDown)
  1593. Dim NUPS As NumericUpDown = CType(Me.Controls.Find("NUP" + no.ToString(), True)(0), NumericUpDown)
  1594. Dim ComboBoxsS1 As ComboBox = CType(Me.Controls.Find("ComboBox" + (no + 40 + Q).ToString(), True)(0), ComboBox)
  1595. Dim ComboBoxsS2 As ComboBox = CType(Me.Controls.Find("ComboBox" + (no + 40 + 1 + Q).ToString(), True)(0), ComboBox)
  1596. Dim ComboBoxs1 As ComboBox = CType(Me.Controls.Find("ComboBox" + (no + Q).ToString(), True)(0), ComboBox)
  1597. Dim ComboBoxs2 As ComboBox = CType(Me.Controls.Find("ComboBox" + (no + 1 + Q).ToString(), True)(0), ComboBox) : Q += 1
  1598. PA1 = A_lbS.Text : PA2 = 姓名_tbS.Text : PA3 = 班別_cbS.Text : BL1 = CheckBoxS.Checked : Do1 = NUPS.Value
  1599. PA5 = ComboBoxs1.Text : PA6 = ComboBoxs2.Text : PA7 = ComboBoxsS1.Text : PA8 = ComboBoxsS2.Text
  1600. SQL_排班明細_上午上班()
  1601. If dr.Read() Then : PA4 = dr("上午上班") : End If
  1602. If CheckBoxS.Checked = False Then
  1603. Do3 = 8
  1604. Else
  1605. Do3 = NumericUpDownS.Value
  1606. End If
  1607. Do2 = NumericUpDownS.Value
  1608. SQL_排班明細_新增當天()
  1609. Next
  1610. PA = 年_lb.Text & "/" & 月_lb.Text & "/" & 日_lb.Text : PA13 = 值日生1_bt.Text : PA14 = 值日生2_bt.Text
  1611. SQL_值日生存檔()
  1612. 解鎖_ch.Checked = False : 重新讀取()
  1613. MsgBox("存檔完成!!")
  1614. End Sub
  1615. Private Sub 複製班表_bt_Click(sender As Object, e As EventArgs) Handles 複製班表_bt.Click
  1616. Dim FF = MsgBox("確定要已該班表做模板複製到 " & Format(指定日期_dtp.Value, "yyyy/MM/dd") & " 去嗎 ?", MsgBoxStyle.OkCancel)
  1617. If FF = MsgBoxResult.Ok Then
  1618. PA = Format(指定日期_dtp.Value, "yyyy/MM/dd")
  1619. SQL_排班明細_判斷是否有資料()
  1620. If dr.Read() Then
  1621. SQL_排班明細_刪除當天()
  1622. End If
  1623. Q = 0
  1624. For no As Integer = 1 To 20
  1625. Dim 姓名_tbS As TextBox = CType(Me.Controls.Find("姓名_tb" + no.ToString(), True)(0), TextBox)
  1626. Dim 班別_cbS As ComboBox = CType(Me.Controls.Find("班別_cb" + no.ToString(), True)(0), ComboBox)
  1627. Dim A_lbS As Label = CType(Me.Controls.Find("A_lb" + no.ToString(), True)(0), Label)
  1628. Dim CheckBoxS As CheckBox = CType(Me.Controls.Find("CheckBox" + no.ToString(), True)(0), CheckBox)
  1629. Dim NumericUpDownS As NumericUpDown = CType(Me.Controls.Find("NumericUpDown" + no.ToString(), True)(0), NumericUpDown)
  1630. Dim NUPS As NumericUpDown = CType(Me.Controls.Find("NUP" + no.ToString(), True)(0), NumericUpDown)
  1631. Dim ComboBoxsS1 As ComboBox = CType(Me.Controls.Find("ComboBox" + (no + 40 + Q).ToString(), True)(0), ComboBox)
  1632. Dim ComboBoxsS2 As ComboBox = CType(Me.Controls.Find("ComboBox" + (no + 40 + 1 + Q).ToString(), True)(0), ComboBox)
  1633. Dim ComboBoxs1 As ComboBox = CType(Me.Controls.Find("ComboBox" + (no + Q).ToString(), True)(0), ComboBox)
  1634. Dim ComboBoxs2 As ComboBox = CType(Me.Controls.Find("ComboBox" + (no + 1 + Q).ToString(), True)(0), ComboBox) : Q += 1
  1635. PA1 = A_lbS.Text : PA2 = 姓名_tbS.Text : PA3 = 班別_cbS.Text : BL1 = CheckBoxS.Checked : Do1 = NUPS.Value
  1636. PA5 = ComboBoxs1.Text : PA6 = ComboBoxs2.Text : PA7 = ComboBoxsS1.Text : PA8 = ComboBoxsS2.Text
  1637. SQL_排班明細_上午上班()
  1638. If dr.Read() Then : PA4 = dr("上午上班") : End If
  1639. If CheckBoxS.Checked = False Then
  1640. Do3 = 8
  1641. Else
  1642. Do3 = NumericUpDownS.Value
  1643. End If
  1644. Do2 = NumericUpDownS.Value
  1645. SQL_排班明細_新增當天()
  1646. Next : MsgBox("存檔完成,請切換到指定日期去查看!!")
  1647. End If
  1648. End Sub
  1649. Private Sub 人員_dgv_CellContentClick_1(sender As Object, e As DataGridViewCellEventArgs) Handles 人員_dgv.CellDoubleClick
  1650. If e.RowIndex = -1 Then : Else
  1651. PA = 人員_dgv("編號", e.RowIndex).Value.ToString : PA1 = 人員_dgv("姓名", e.RowIndex).Value.ToString
  1652. End If
  1653. For no As Integer = 1 To 20
  1654. Dim 姓名_tbS As TextBox = CType(Me.Controls.Find("姓名_tb" + no.ToString(), True)(0), TextBox)
  1655. If 姓名_tbS.Text = PA1 Then
  1656. MsgBox("該人員已在班表內,無須再新增!!") : Exit Sub
  1657. End If
  1658. Next
  1659. For no As Integer = 1 To 20
  1660. Dim 姓名_tbS As TextBox = CType(Me.Controls.Find("姓名_tb" + no.ToString(), True)(0), TextBox)
  1661. If 姓名_tbS.Text <> "" Then
  1662. Else
  1663. 姓名_tbS.Text = PA1 : Exit For
  1664. End If
  1665. Next
  1666. End Sub
  1667. End Class