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

樣品進度表(英文版).vb 181KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924
  1. Option Strict Off
  2. Imports System.Data.SqlClient
  3. Imports System.IO
  4. Imports Microsoft.Office.Interop.Excel.XlUnderlineStyle
  5. Imports Microsoft.Office.Interop.Excel.Constants
  6. Imports Microsoft.Office.Interop.Excel.XlBordersIndex
  7. Imports Microsoft.Office.Interop.Excel.XlLineStyle
  8. Imports Microsoft.Office.Interop.Excel.XlBorderWeight
  9. Imports Microsoft.Office.Interop.Excel.XlThemeFont
  10. Imports Microsoft.Office.Interop.Excel.XlThemeColor
  11. Imports Microsoft.Office.Interop.Excel.XlWindowState
  12. Imports Microsoft.Office.Interop.Excel
  13. Imports System.Threading
  14. Imports System.Text.RegularExpressions
  15. Public Class 樣品進度表_英文版_
  16. Dim conn As New SqlConnection
  17. Dim da As New SqlDataAdapter
  18. Dim cmd As New SqlCommand
  19. Dim ds As New DataSet : Dim ds1 As New DataSet : Dim ds2 As New DataSet : Dim ds3 As New DataSet : Dim ds4 As New DataSet
  20. Dim ds5 As New DataSet : Dim ds6 As New DataSet : Dim ds7 As New DataSet : Dim ds8 As New DataSet
  21. Dim dr As SqlDataReader
  22. Dim N1 As Integer = 0 : Dim N2 As Integer = 0 : Dim N3 As Integer = 0 : Dim N4 As Integer = 0 : Dim N5 As Integer = 0 : Dim N6 As Integer = 0 : Dim FFGG As Integer
  23. Dim xlApp As Application
  24. Dim xlBook As Workbook
  25. Dim xlSheet As Worksheet
  26. Dim SSDD As String : Dim AAWW As String : Dim HHGG As String
  27. Dim BBNN1 As Integer : Dim BBNN2 As Integer : Dim BBNN3 As Integer : Dim BBNN4 As Integer : Dim BBNN5 As Integer
  28. Dim BBNN11 As String : Dim BBNN12 As String : Dim BBNN13 As String : Dim BBNN14 As String : Dim BBNN15 As String
  29. Dim RRTT As New Regex("[\u4e00-\u9fa5]")
  30. Private Sub Set_清單1()
  31. DataGridView2.DataSource = Nothing : ds1.Clear()
  32. DataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  33. DataGridView2.ColumnHeadersHeight = 25
  34. DataGridView2.AllowUserToAddRows = False
  35. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  36. SQL1 = "SELECT SO, 版次 FROM 樣品訂單控制表 WHERE 季節 LIKE N'" & ComboBox7.Text & "' AND 客戶 LIKE N'" & ComboBox2.Text & "' AND 狀態 LIKE N'" & 樣品進度表分類2 & "' ORDER BY 型體號碼, SO, 版次 DESC"
  37. cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds1) : DataGridView2.DataSource = ds1.Tables(0) : conn.Close()
  38. End Sub
  39. '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  40. Private Sub Set_讀取清單2()
  41. DataGridView3.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  42. DataGridView3.ColumnHeadersHeight = 25
  43. DataGridView3.AllowUserToAddRows = False
  44. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  45. SQL1 = "SELECT 部件, 材料名稱, 材料說明, 備註, 廠商, 流水號
  46. FROM 樣品訂單部件表
  47. WHERE (SO LIKE '" & DataGridView2.Rows(N2).Cells("SO").Value & "') AND (版次 LIKE '" & DataGridView2.Rows(N2).Cells("版次").Value & "') AND (部件 LIKE N'A.%')
  48. ORDER BY SO, 版次, 流水號, 部件"
  49. cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds2) : DataGridView3.DataSource = ds2.Tables(0) : conn.Close()
  50. End Sub
  51. Private Sub Set_清單2()
  52. DataGridView3.DataSource = Nothing : ds2.Clear()
  53. For i As Integer = 0 To DataGridView2.Rows.Count - 1
  54. If DataGridView2.Rows(i).Cells("版次").Value = "V01" Then
  55. N2 = i : Set_讀取清單2()
  56. ElseIf DataGridView2.Rows(i).Cells("版次").Value <> "V01" Then
  57. N2 = i : Set_讀取清單2()
  58. i = i + Val(Strings.Right(DataGridView2.Rows(i).Cells("版次").Value, 2)) - 1
  59. End If
  60. Next
  61. 去中文2()
  62. End Sub
  63. Private Sub 去中文2()
  64. BBNN1 = 0 : BBNN2 = 0 : BBNN3 = 0 : BBNN4 = 0 : BBNN5 = 0
  65. BBNN11 = "" : BBNN12 = "" : BBNN13 = "" : BBNN14 = "" : BBNN15 = ""
  66. For i As Integer = 0 To DataGridView3.Rows.Count - 1
  67. 資料數 = DataGridView3.Rows.Count : MyModule1.進度條()
  68. BBNN1 = DataGridView3.Rows(i).Cells("部件").Value.ToString.Length.ToString() : BBNN2 = DataGridView3.Rows(i).Cells("材料名稱").Value.ToString.Length.ToString()
  69. BBNN3 = DataGridView3.Rows(i).Cells("材料說明").Value.ToString.Length.ToString() : BBNN4 = DataGridView3.Rows(i).Cells("備註").Value.ToString.Length.ToString()
  70. BBNN5 = DataGridView3.Rows(i).Cells("廠商").Value.ToString.Length.ToString()
  71. '--------------------------------------------------------------------------------------------
  72. For II As Integer = 0 To BBNN1 - 1
  73. If II = 0 Then
  74. AAWW = Strings.Left(DataGridView3.Rows(i).Cells("部件").Value.ToString, 1)
  75. If RRTT.IsMatch(AAWW) Then : Else : BBNN11 = Strings.Left(DataGridView3.Rows(i).Cells("部件").Value.ToString, 1) : End If
  76. Else
  77. AAWW = Strings.Mid(DataGridView3.Rows(i).Cells("部件").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN11 : BBNN11 = HHGG & AAWW : End If
  78. End If
  79. Next : DataGridView3.Rows(i).Cells("部件").Value = BBNN11
  80. '--------------------------------------------------------------------------------------------
  81. For II As Integer = 0 To BBNN2 - 1
  82. If II = 0 Then
  83. AAWW = Strings.Left(DataGridView3.Rows(i).Cells("材料名稱").Value.ToString, 1)
  84. If RRTT.IsMatch(AAWW) Then : Else : BBNN12 = Strings.Left(DataGridView3.Rows(i).Cells("材料名稱").Value.ToString, 1) : End If
  85. Else
  86. AAWW = Strings.Mid(DataGridView3.Rows(i).Cells("材料名稱").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN12 : BBNN12 = HHGG & AAWW : End If
  87. End If
  88. Next : DataGridView3.Rows(i).Cells("材料名稱").Value = BBNN12
  89. '--------------------------------------------------------------------------------------------
  90. For II As Integer = 0 To BBNN3 - 1
  91. If II = 0 Then
  92. AAWW = Strings.Left(DataGridView3.Rows(i).Cells("材料說明").Value.ToString, 1)
  93. If RRTT.IsMatch(AAWW) Then : Else : BBNN13 = Strings.Left(DataGridView3.Rows(i).Cells("材料說明").Value.ToString, 1) : End If
  94. Else
  95. AAWW = Strings.Mid(DataGridView3.Rows(i).Cells("材料說明").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN13 : BBNN13 = HHGG & AAWW : End If
  96. End If
  97. Next : DataGridView3.Rows(i).Cells("材料說明").Value = BBNN13
  98. '--------------------------------------------------------------------------------------------
  99. For II As Integer = 0 To BBNN4 - 1
  100. If II = 0 Then
  101. AAWW = Strings.Left(DataGridView3.Rows(i).Cells("備註").Value.ToString, 1)
  102. If RRTT.IsMatch(AAWW) Then : Else : BBNN14 = Strings.Left(DataGridView3.Rows(i).Cells("備註").Value.ToString, 1) : End If
  103. Else
  104. AAWW = Strings.Mid(DataGridView3.Rows(i).Cells("備註").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN14 : BBNN14 = HHGG & AAWW : End If
  105. End If
  106. Next : DataGridView3.Rows(i).Cells("備註").Value = BBNN14
  107. '--------------------------------------------------------------------------------------------
  108. For II As Integer = 0 To BBNN5 - 1
  109. If II = 0 Then
  110. AAWW = Strings.Left(DataGridView3.Rows(i).Cells("廠商").Value.ToString, 1)
  111. If RRTT.IsMatch(AAWW) Then : Else : BBNN15 = Strings.Left(DataGridView3.Rows(i).Cells("廠商").Value.ToString, 1) : End If
  112. Else
  113. AAWW = Strings.Mid(DataGridView3.Rows(i).Cells("廠商").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN15 : BBNN15 = HHGG & AAWW : End If
  114. End If
  115. Next : DataGridView3.Rows(i).Cells("廠商").Value = BBNN15
  116. Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
  117. End Sub
  118. '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  119. Private Sub Set_讀取清單3()
  120. DataGridView4.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  121. DataGridView4.ColumnHeadersHeight = 25
  122. DataGridView4.AllowUserToAddRows = False
  123. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  124. SQL1 = "SELECT 部件, 材料名稱, 材料說明, 備註, 廠商, 流水號
  125. FROM 樣品訂單部件表
  126. WHERE (SO LIKE '" & DataGridView2.Rows(N2).Cells("SO").Value & "') AND (版次 LIKE '" & DataGridView2.Rows(N2).Cells("版次").Value & "') AND (部件 LIKE N'B.%')
  127. ORDER BY SO, 版次, 流水號, 部件"
  128. cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds3) : DataGridView4.DataSource = ds3.Tables(0) : conn.Close()
  129. End Sub
  130. Private Sub Set_清單3()
  131. DataGridView4.DataSource = Nothing : ds3.Clear()
  132. For i As Integer = 0 To DataGridView2.Rows.Count - 1
  133. If DataGridView2.Rows(i).Cells("版次").Value = "V01" Then
  134. N2 = i : Set_讀取清單3()
  135. ElseIf DataGridView2.Rows(i).Cells("版次").Value <> "V01" Then
  136. N2 = i : Set_讀取清單3()
  137. i = i + Val(Strings.Right(DataGridView2.Rows(i).Cells("版次").Value, 2)) - 1
  138. End If
  139. Next
  140. 去中文3()
  141. End Sub
  142. Private Sub 去中文3()
  143. BBNN1 = 0 : BBNN2 = 0 : BBNN3 = 0 : BBNN4 = 0 : BBNN5 = 0
  144. BBNN11 = "" : BBNN12 = "" : BBNN13 = "" : BBNN14 = "" : BBNN15 = ""
  145. For i As Integer = 0 To DataGridView4.Rows.Count - 1
  146. 資料數 = DataGridView4.Rows.Count : MyModule1.進度條()
  147. BBNN1 = DataGridView4.Rows(i).Cells("部件").Value.ToString.Length.ToString() : BBNN2 = DataGridView4.Rows(i).Cells("材料名稱").Value.ToString.Length.ToString()
  148. BBNN3 = DataGridView4.Rows(i).Cells("材料說明").Value.ToString.Length.ToString() : BBNN4 = DataGridView4.Rows(i).Cells("備註").Value.ToString.Length.ToString()
  149. BBNN5 = DataGridView4.Rows(i).Cells("廠商").Value.ToString.Length.ToString()
  150. '--------------------------------------------------------------------------------------------
  151. For II As Integer = 0 To BBNN1 - 1
  152. If II = 0 Then
  153. AAWW = Strings.Left(DataGridView4.Rows(i).Cells("部件").Value.ToString, 1)
  154. If RRTT.IsMatch(AAWW) Then : Else : BBNN11 = Strings.Left(DataGridView4.Rows(i).Cells("部件").Value.ToString, 1) : End If
  155. Else
  156. AAWW = Strings.Mid(DataGridView4.Rows(i).Cells("部件").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN11 : BBNN11 = HHGG & AAWW : End If
  157. End If
  158. Next : DataGridView4.Rows(i).Cells("部件").Value = BBNN11
  159. '--------------------------------------------------------------------------------------------
  160. For II As Integer = 0 To BBNN2 - 1
  161. If II = 0 Then
  162. AAWW = Strings.Left(DataGridView4.Rows(i).Cells("材料名稱").Value.ToString, 1)
  163. If RRTT.IsMatch(AAWW) Then : Else : BBNN12 = Strings.Left(DataGridView4.Rows(i).Cells("材料名稱").Value.ToString, 1) : End If
  164. Else
  165. AAWW = Strings.Mid(DataGridView4.Rows(i).Cells("材料名稱").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN12 : BBNN12 = HHGG & AAWW : End If
  166. End If
  167. Next : DataGridView4.Rows(i).Cells("材料名稱").Value = BBNN12
  168. '--------------------------------------------------------------------------------------------
  169. For II As Integer = 0 To BBNN3 - 1
  170. If II = 0 Then
  171. AAWW = Strings.Left(DataGridView4.Rows(i).Cells("材料說明").Value.ToString, 1)
  172. If RRTT.IsMatch(AAWW) Then : Else : BBNN13 = Strings.Left(DataGridView4.Rows(i).Cells("材料說明").Value.ToString, 1) : End If
  173. Else
  174. AAWW = Strings.Mid(DataGridView4.Rows(i).Cells("材料說明").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN13 : BBNN13 = HHGG & AAWW : End If
  175. End If
  176. Next : DataGridView4.Rows(i).Cells("材料說明").Value = BBNN13
  177. '--------------------------------------------------------------------------------------------
  178. For II As Integer = 0 To BBNN4 - 1
  179. If II = 0 Then
  180. AAWW = Strings.Left(DataGridView4.Rows(i).Cells("備註").Value.ToString, 1)
  181. If RRTT.IsMatch(AAWW) Then : Else : BBNN14 = Strings.Left(DataGridView4.Rows(i).Cells("備註").Value.ToString, 1) : End If
  182. Else
  183. AAWW = Strings.Mid(DataGridView4.Rows(i).Cells("備註").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN14 : BBNN14 = HHGG & AAWW : End If
  184. End If
  185. Next : DataGridView4.Rows(i).Cells("備註").Value = BBNN14
  186. '--------------------------------------------------------------------------------------------
  187. For II As Integer = 0 To BBNN5 - 1
  188. If II = 0 Then
  189. AAWW = Strings.Left(DataGridView4.Rows(i).Cells("廠商").Value.ToString, 1)
  190. If RRTT.IsMatch(AAWW) Then : Else : BBNN15 = Strings.Left(DataGridView4.Rows(i).Cells("廠商").Value.ToString, 1) : End If
  191. Else
  192. AAWW = Strings.Mid(DataGridView4.Rows(i).Cells("廠商").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN15 : BBNN15 = HHGG & AAWW : End If
  193. End If
  194. Next : DataGridView4.Rows(i).Cells("廠商").Value = BBNN15
  195. Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
  196. End Sub
  197. '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  198. Private Sub Set_讀取清單4()
  199. DataGridView5.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  200. DataGridView5.ColumnHeadersHeight = 25
  201. DataGridView5.AllowUserToAddRows = False
  202. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  203. SQL1 = "SELECT 部件, 材料名稱, 材料說明, 備註, 廠商, 流水號
  204. FROM 樣品訂單部件表
  205. WHERE (SO LIKE '" & DataGridView2.Rows(N2).Cells("SO").Value & "') AND (版次 LIKE '" & DataGridView2.Rows(N2).Cells("版次").Value & "') AND (部件 LIKE N'C.%')
  206. ORDER BY SO, 版次, 流水號, 部件"
  207. cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds4) : DataGridView5.DataSource = ds4.Tables(0) : conn.Close()
  208. End Sub
  209. Private Sub Set_清單4()
  210. DataGridView5.DataSource = Nothing : ds4.Clear()
  211. For i As Integer = 0 To DataGridView2.Rows.Count - 1
  212. If DataGridView2.Rows(i).Cells("版次").Value = "V01" Then
  213. N2 = i : Set_讀取清單4()
  214. ElseIf DataGridView2.Rows(i).Cells("版次").Value <> "V01" Then
  215. N2 = i : Set_讀取清單4()
  216. i = i + Val(Strings.Right(DataGridView2.Rows(i).Cells("版次").Value, 2)) - 1
  217. End If
  218. Next
  219. 去中文4()
  220. End Sub
  221. Private Sub 去中文4()
  222. BBNN1 = 0 : BBNN2 = 0 : BBNN3 = 0 : BBNN4 = 0 : BBNN5 = 0
  223. BBNN11 = "" : BBNN12 = "" : BBNN13 = "" : BBNN14 = "" : BBNN15 = ""
  224. For i As Integer = 0 To DataGridView5.Rows.Count - 1
  225. 資料數 = DataGridView5.Rows.Count : MyModule1.進度條()
  226. BBNN1 = DataGridView5.Rows(i).Cells("部件").Value.ToString.Length.ToString() : BBNN2 = DataGridView5.Rows(i).Cells("材料名稱").Value.ToString.Length.ToString()
  227. BBNN3 = DataGridView5.Rows(i).Cells("材料說明").Value.ToString.Length.ToString() : BBNN4 = DataGridView5.Rows(i).Cells("備註").Value.ToString.Length.ToString()
  228. BBNN5 = DataGridView5.Rows(i).Cells("廠商").Value.ToString.Length.ToString()
  229. '--------------------------------------------------------------------------------------------
  230. For II As Integer = 0 To BBNN1 - 1
  231. If II = 0 Then
  232. AAWW = Strings.Left(DataGridView5.Rows(i).Cells("部件").Value.ToString, 1)
  233. If RRTT.IsMatch(AAWW) Then : Else : BBNN11 = Strings.Left(DataGridView5.Rows(i).Cells("部件").Value.ToString, 1) : End If
  234. Else
  235. AAWW = Strings.Mid(DataGridView5.Rows(i).Cells("部件").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN11 : BBNN11 = HHGG & AAWW : End If
  236. End If
  237. Next : DataGridView5.Rows(i).Cells("部件").Value = BBNN11
  238. '--------------------------------------------------------------------------------------------
  239. For II As Integer = 0 To BBNN2 - 1
  240. If II = 0 Then
  241. AAWW = Strings.Left(DataGridView5.Rows(i).Cells("材料名稱").Value.ToString, 1)
  242. If RRTT.IsMatch(AAWW) Then : Else : BBNN12 = Strings.Left(DataGridView5.Rows(i).Cells("材料名稱").Value.ToString, 1) : End If
  243. Else
  244. AAWW = Strings.Mid(DataGridView5.Rows(i).Cells("材料名稱").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN12 : BBNN12 = HHGG & AAWW : End If
  245. End If
  246. Next : DataGridView5.Rows(i).Cells("材料名稱").Value = BBNN12
  247. '--------------------------------------------------------------------------------------------
  248. For II As Integer = 0 To BBNN3 - 1
  249. If II = 0 Then
  250. AAWW = Strings.Left(DataGridView5.Rows(i).Cells("材料說明").Value.ToString, 1)
  251. If RRTT.IsMatch(AAWW) Then : Else : BBNN13 = Strings.Left(DataGridView5.Rows(i).Cells("材料說明").Value.ToString, 1) : End If
  252. Else
  253. AAWW = Strings.Mid(DataGridView5.Rows(i).Cells("材料說明").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN13 : BBNN13 = HHGG & AAWW : End If
  254. End If
  255. Next : DataGridView5.Rows(i).Cells("材料說明").Value = BBNN13
  256. '--------------------------------------------------------------------------------------------
  257. For II As Integer = 0 To BBNN4 - 1
  258. If II = 0 Then
  259. AAWW = Strings.Left(DataGridView5.Rows(i).Cells("備註").Value.ToString, 1)
  260. If RRTT.IsMatch(AAWW) Then : Else : BBNN14 = Strings.Left(DataGridView5.Rows(i).Cells("備註").Value.ToString, 1) : End If
  261. Else
  262. AAWW = Strings.Mid(DataGridView5.Rows(i).Cells("備註").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN14 : BBNN14 = HHGG & AAWW : End If
  263. End If
  264. Next : DataGridView5.Rows(i).Cells("備註").Value = BBNN14
  265. '--------------------------------------------------------------------------------------------
  266. For II As Integer = 0 To BBNN5 - 1
  267. If II = 0 Then
  268. AAWW = Strings.Left(DataGridView5.Rows(i).Cells("廠商").Value.ToString, 1)
  269. If RRTT.IsMatch(AAWW) Then : Else : BBNN15 = Strings.Left(DataGridView5.Rows(i).Cells("廠商").Value.ToString, 1) : End If
  270. Else
  271. AAWW = Strings.Mid(DataGridView5.Rows(i).Cells("廠商").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN15 : BBNN15 = HHGG & AAWW : End If
  272. End If
  273. Next : DataGridView5.Rows(i).Cells("廠商").Value = BBNN15
  274. Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
  275. End Sub
  276. '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  277. Private Sub Set_讀取清單5()
  278. DataGridView6.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  279. DataGridView6.ColumnHeadersHeight = 25
  280. DataGridView6.AllowUserToAddRows = False
  281. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  282. SQL1 = "SELECT 部件, 材料名稱, 材料說明, 備註, 廠商, 流水號
  283. FROM 樣品訂單部件表
  284. WHERE (SO LIKE '" & DataGridView2.Rows(N2).Cells("SO").Value & "') AND (版次 LIKE '" & DataGridView2.Rows(N2).Cells("版次").Value & "') AND (部件 LIKE N'D.%')
  285. ORDER BY SO, 版次, 流水號, 部件"
  286. cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds5) : DataGridView6.DataSource = ds5.Tables(0) : conn.Close()
  287. End Sub
  288. Private Sub Set_清單5()
  289. DataGridView6.DataSource = Nothing : ds5.Clear()
  290. For i As Integer = 0 To DataGridView2.Rows.Count - 1
  291. If DataGridView2.Rows(i).Cells("版次").Value = "V01" Then
  292. N2 = i : Set_讀取清單5()
  293. ElseIf DataGridView2.Rows(i).Cells("版次").Value <> "V01" Then
  294. N2 = i : Set_讀取清單5()
  295. i = i + Val(Strings.Right(DataGridView2.Rows(i).Cells("版次").Value, 2)) - 1
  296. End If
  297. Next
  298. '去中文5()
  299. End Sub
  300. Private Sub 去中文5()
  301. BBNN1 = 0 : BBNN2 = 0 : BBNN3 = 0 : BBNN4 = 0 : BBNN5 = 0
  302. BBNN11 = "" : BBNN12 = "" : BBNN13 = "" : BBNN14 = "" : BBNN15 = ""
  303. For i As Integer = 0 To DataGridView6.Rows.Count - 1
  304. 資料數 = DataGridView6.Rows.Count : MyModule1.進度條()
  305. BBNN1 = DataGridView6.Rows(i).Cells("部件").Value.ToString.Length.ToString() : BBNN2 = DataGridView6.Rows(i).Cells("材料名稱").Value.ToString.Length.ToString()
  306. BBNN3 = DataGridView6.Rows(i).Cells("材料說明").Value.ToString.Length.ToString() : BBNN4 = DataGridView6.Rows(i).Cells("備註").Value.ToString.Length.ToString()
  307. BBNN5 = DataGridView6.Rows(i).Cells("廠商").Value.ToString.Length.ToString()
  308. '--------------------------------------------------------------------------------------------
  309. For II As Integer = 0 To BBNN1 - 1
  310. If II = 0 Then
  311. AAWW = Strings.Left(DataGridView6.Rows(i).Cells("部件").Value.ToString, 1)
  312. If RRTT.IsMatch(AAWW) Then : Else : BBNN11 = Strings.Left(DataGridView6.Rows(i).Cells("部件").Value.ToString, 1) : End If
  313. Else
  314. AAWW = Strings.Mid(DataGridView6.Rows(i).Cells("部件").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN11 : BBNN11 = HHGG & AAWW : End If
  315. End If
  316. Next : DataGridView6.Rows(i).Cells("部件").Value = BBNN11
  317. '--------------------------------------------------------------------------------------------
  318. For II As Integer = 0 To BBNN2 - 1
  319. If II = 0 Then
  320. AAWW = Strings.Left(DataGridView6.Rows(i).Cells("材料名稱").Value.ToString, 1)
  321. If RRTT.IsMatch(AAWW) Then : Else : BBNN12 = Strings.Left(DataGridView6.Rows(i).Cells("材料名稱").Value.ToString, 1) : End If
  322. Else
  323. AAWW = Strings.Mid(DataGridView6.Rows(i).Cells("材料名稱").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN12 : BBNN12 = HHGG & AAWW : End If
  324. End If
  325. Next : DataGridView6.Rows(i).Cells("材料名稱").Value = BBNN12
  326. '--------------------------------------------------------------------------------------------
  327. For II As Integer = 0 To BBNN3 - 1
  328. If II = 0 Then
  329. AAWW = Strings.Left(DataGridView6.Rows(i).Cells("材料說明").Value.ToString, 1)
  330. If RRTT.IsMatch(AAWW) Then : Else : BBNN13 = Strings.Left(DataGridView6.Rows(i).Cells("材料說明").Value.ToString, 1) : End If
  331. Else
  332. AAWW = Strings.Mid(DataGridView6.Rows(i).Cells("材料說明").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN13 : BBNN13 = HHGG & AAWW : End If
  333. End If
  334. Next : DataGridView6.Rows(i).Cells("材料說明").Value = BBNN13
  335. '--------------------------------------------------------------------------------------------
  336. For II As Integer = 0 To BBNN4 - 1
  337. If II = 0 Then
  338. AAWW = Strings.Left(DataGridView6.Rows(i).Cells("備註").Value.ToString, 1)
  339. If RRTT.IsMatch(AAWW) Then : Else : BBNN14 = Strings.Left(DataGridView6.Rows(i).Cells("備註").Value.ToString, 1) : End If
  340. Else
  341. AAWW = Strings.Mid(DataGridView6.Rows(i).Cells("備註").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN14 : BBNN14 = HHGG & AAWW : End If
  342. End If
  343. Next : DataGridView6.Rows(i).Cells("備註").Value = BBNN14
  344. '--------------------------------------------------------------------------------------------
  345. For II As Integer = 0 To BBNN5 - 1
  346. If II = 0 Then
  347. AAWW = Strings.Left(DataGridView6.Rows(i).Cells("廠商").Value.ToString, 1)
  348. If RRTT.IsMatch(AAWW) Then : Else : BBNN15 = Strings.Left(DataGridView6.Rows(i).Cells("廠商").Value.ToString, 1) : End If
  349. Else
  350. AAWW = Strings.Mid(DataGridView6.Rows(i).Cells("廠商").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN15 : BBNN15 = HHGG & AAWW : End If
  351. End If
  352. Next : DataGridView6.Rows(i).Cells("廠商").Value = BBNN15
  353. Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
  354. End Sub
  355. '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  356. Private Sub Set_讀取清單6()
  357. DataGridView7.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  358. DataGridView7.ColumnHeadersHeight = 25
  359. DataGridView7.AllowUserToAddRows = False
  360. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  361. SQL1 = "SELECT 部件, 材料名稱, 材料說明, 備註, 廠商, 流水號
  362. FROM 樣品訂單部件表
  363. WHERE (SO LIKE '" & DataGridView2.Rows(N2).Cells("SO").Value & "') AND (版次 LIKE '" & DataGridView2.Rows(N2).Cells("版次").Value & "') AND (部件 LIKE N'E.%')
  364. ORDER BY SO, 版次, 流水號, 部件"
  365. cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds6) : DataGridView7.DataSource = ds6.Tables(0) : conn.Close()
  366. End Sub
  367. Private Sub Set_清單6()
  368. DataGridView7.DataSource = Nothing : ds6.Clear()
  369. For i As Integer = 0 To DataGridView2.Rows.Count - 1
  370. If DataGridView2.Rows(i).Cells("版次").Value = "V01" Then
  371. N2 = i : Set_讀取清單6()
  372. ElseIf DataGridView2.Rows(i).Cells("版次").Value <> "V01" Then
  373. N2 = i : Set_讀取清單6()
  374. i = i + Val(Strings.Right(DataGridView2.Rows(i).Cells("版次").Value, 2)) - 1
  375. End If
  376. Next
  377. '去中文6()
  378. End Sub
  379. Private Sub 去中文6()
  380. BBNN1 = 0 : BBNN2 = 0 : BBNN3 = 0 : BBNN4 = 0 : BBNN5 = 0
  381. BBNN11 = "" : BBNN12 = "" : BBNN13 = "" : BBNN14 = "" : BBNN15 = ""
  382. For i As Integer = 0 To DataGridView7.Rows.Count - 1
  383. 資料數 = DataGridView7.Rows.Count : MyModule1.進度條()
  384. BBNN1 = DataGridView7.Rows(i).Cells("部件").Value.ToString.Length.ToString() : BBNN2 = DataGridView7.Rows(i).Cells("材料名稱").Value.ToString.Length.ToString()
  385. BBNN3 = DataGridView7.Rows(i).Cells("材料說明").Value.ToString.Length.ToString() : BBNN4 = DataGridView7.Rows(i).Cells("備註").Value.ToString.Length.ToString()
  386. BBNN5 = DataGridView7.Rows(i).Cells("廠商").Value.ToString.Length.ToString()
  387. '--------------------------------------------------------------------------------------------
  388. For II As Integer = 0 To BBNN1 - 1
  389. If II = 0 Then
  390. AAWW = Strings.Left(DataGridView7.Rows(i).Cells("部件").Value.ToString, 1)
  391. If RRTT.IsMatch(AAWW) Then : Else : BBNN11 = Strings.Left(DataGridView7.Rows(i).Cells("部件").Value.ToString, 1) : End If
  392. Else
  393. AAWW = Strings.Mid(DataGridView7.Rows(i).Cells("部件").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN11 : BBNN11 = HHGG & AAWW : End If
  394. End If
  395. Next : DataGridView7.Rows(i).Cells("部件").Value = BBNN11
  396. '--------------------------------------------------------------------------------------------
  397. For II As Integer = 0 To BBNN2 - 1
  398. If II = 0 Then
  399. AAWW = Strings.Left(DataGridView7.Rows(i).Cells("材料名稱").Value.ToString, 1)
  400. If RRTT.IsMatch(AAWW) Then : Else : BBNN12 = Strings.Left(DataGridView7.Rows(i).Cells("材料名稱").Value.ToString, 1) : End If
  401. Else
  402. AAWW = Strings.Mid(DataGridView7.Rows(i).Cells("材料名稱").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN12 : BBNN12 = HHGG & AAWW : End If
  403. End If
  404. Next : DataGridView7.Rows(i).Cells("材料名稱").Value = BBNN12
  405. '--------------------------------------------------------------------------------------------
  406. For II As Integer = 0 To BBNN3 - 1
  407. If II = 0 Then
  408. AAWW = Strings.Left(DataGridView7.Rows(i).Cells("材料說明").Value.ToString, 1)
  409. If RRTT.IsMatch(AAWW) Then : Else : BBNN13 = Strings.Left(DataGridView7.Rows(i).Cells("材料說明").Value.ToString, 1) : End If
  410. Else
  411. AAWW = Strings.Mid(DataGridView7.Rows(i).Cells("材料說明").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN13 : BBNN13 = HHGG & AAWW : End If
  412. End If
  413. Next : DataGridView7.Rows(i).Cells("材料說明").Value = BBNN13
  414. '--------------------------------------------------------------------------------------------
  415. For II As Integer = 0 To BBNN4 - 1
  416. If II = 0 Then
  417. AAWW = Strings.Left(DataGridView7.Rows(i).Cells("備註").Value.ToString, 1)
  418. If RRTT.IsMatch(AAWW) Then : Else : BBNN14 = Strings.Left(DataGridView7.Rows(i).Cells("備註").Value.ToString, 1) : End If
  419. Else
  420. AAWW = Strings.Mid(DataGridView7.Rows(i).Cells("備註").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN14 : BBNN14 = HHGG & AAWW : End If
  421. End If
  422. Next : DataGridView7.Rows(i).Cells("備註").Value = BBNN14
  423. '--------------------------------------------------------------------------------------------
  424. For II As Integer = 0 To BBNN5 - 1
  425. If II = 0 Then
  426. AAWW = Strings.Left(DataGridView7.Rows(i).Cells("廠商").Value.ToString, 1)
  427. If RRTT.IsMatch(AAWW) Then : Else : BBNN15 = Strings.Left(DataGridView7.Rows(i).Cells("廠商").Value.ToString, 1) : End If
  428. Else
  429. AAWW = Strings.Mid(DataGridView7.Rows(i).Cells("廠商").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN15 : BBNN15 = HHGG & AAWW : End If
  430. End If
  431. Next : DataGridView7.Rows(i).Cells("廠商").Value = BBNN15
  432. Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
  433. End Sub
  434. '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  435. Private Sub Set_讀取清單7()
  436. DataGridView8.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  437. DataGridView8.ColumnHeadersHeight = 25
  438. DataGridView8.AllowUserToAddRows = False
  439. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  440. SQL1 = "SELECT 部件, 材料名稱, 材料說明, 備註, 廠商, 流水號
  441. FROM 樣品訂單部件表
  442. WHERE (SO LIKE '" & DataGridView2.Rows(N2).Cells("SO").Value & "') AND (版次 LIKE '" & DataGridView2.Rows(N2).Cells("版次").Value & "') AND (部件 LIKE N'F.%')
  443. ORDER BY SO, 版次, 流水號, 部件"
  444. cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds7) : DataGridView8.DataSource = ds7.Tables(0) : conn.Close()
  445. End Sub
  446. Private Sub Set_清單7()
  447. DataGridView8.DataSource = Nothing : ds7.Clear()
  448. For i As Integer = 0 To DataGridView2.Rows.Count - 1
  449. If DataGridView2.Rows(i).Cells("版次").Value = "V01" Then
  450. N2 = i : Set_讀取清單7()
  451. ElseIf DataGridView2.Rows(i).Cells("版次").Value <> "V01" Then
  452. N2 = i : Set_讀取清單7()
  453. i = i + Val(Strings.Right(DataGridView2.Rows(i).Cells("版次").Value, 2)) - 1
  454. End If
  455. Next
  456. 去中文7()
  457. End Sub
  458. Private Sub 去中文7()
  459. BBNN1 = 0 : BBNN2 = 0 : BBNN3 = 0 : BBNN4 = 0 : BBNN5 = 0
  460. BBNN11 = "" : BBNN12 = "" : BBNN13 = "" : BBNN14 = "" : BBNN15 = ""
  461. For i As Integer = 0 To DataGridView8.Rows.Count - 1
  462. 資料數 = DataGridView8.Rows.Count : MyModule1.進度條()
  463. BBNN1 = DataGridView8.Rows(i).Cells("部件").Value.ToString.Length.ToString() : BBNN2 = DataGridView8.Rows(i).Cells("材料名稱").Value.ToString.Length.ToString()
  464. BBNN3 = DataGridView8.Rows(i).Cells("材料說明").Value.ToString.Length.ToString() : BBNN4 = DataGridView8.Rows(i).Cells("備註").Value.ToString.Length.ToString()
  465. BBNN5 = DataGridView8.Rows(i).Cells("廠商").Value.ToString.Length.ToString()
  466. '--------------------------------------------------------------------------------------------
  467. For II As Integer = 0 To BBNN1 - 1
  468. If II = 0 Then
  469. AAWW = Strings.Left(DataGridView8.Rows(i).Cells("部件").Value.ToString, 1)
  470. If RRTT.IsMatch(AAWW) Then : Else : BBNN11 = Strings.Left(DataGridView8.Rows(i).Cells("部件").Value.ToString, 1) : End If
  471. Else
  472. AAWW = Strings.Mid(DataGridView8.Rows(i).Cells("部件").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN11 : BBNN11 = HHGG & AAWW : End If
  473. End If
  474. Next : DataGridView8.Rows(i).Cells("部件").Value = BBNN11
  475. '--------------------------------------------------------------------------------------------
  476. For II As Integer = 0 To BBNN2 - 1
  477. If II = 0 Then
  478. AAWW = Strings.Left(DataGridView8.Rows(i).Cells("材料名稱").Value.ToString, 1)
  479. If RRTT.IsMatch(AAWW) Then : Else : BBNN12 = Strings.Left(DataGridView8.Rows(i).Cells("材料名稱").Value.ToString, 1) : End If
  480. Else
  481. AAWW = Strings.Mid(DataGridView8.Rows(i).Cells("材料名稱").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN12 : BBNN12 = HHGG & AAWW : End If
  482. End If
  483. Next : DataGridView8.Rows(i).Cells("材料名稱").Value = BBNN12
  484. '--------------------------------------------------------------------------------------------
  485. For II As Integer = 0 To BBNN3 - 1
  486. If II = 0 Then
  487. AAWW = Strings.Left(DataGridView8.Rows(i).Cells("材料說明").Value.ToString, 1)
  488. If RRTT.IsMatch(AAWW) Then : Else : BBNN13 = Strings.Left(DataGridView8.Rows(i).Cells("材料說明").Value.ToString, 1) : End If
  489. Else
  490. AAWW = Strings.Mid(DataGridView8.Rows(i).Cells("材料說明").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN13 : BBNN13 = HHGG & AAWW : End If
  491. End If
  492. Next : DataGridView8.Rows(i).Cells("材料說明").Value = BBNN13
  493. '--------------------------------------------------------------------------------------------
  494. For II As Integer = 0 To BBNN4 - 1
  495. If II = 0 Then
  496. AAWW = Strings.Left(DataGridView8.Rows(i).Cells("備註").Value.ToString, 1)
  497. If RRTT.IsMatch(AAWW) Then : Else : BBNN14 = Strings.Left(DataGridView8.Rows(i).Cells("備註").Value.ToString, 1) : End If
  498. Else
  499. AAWW = Strings.Mid(DataGridView8.Rows(i).Cells("備註").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN14 : BBNN14 = HHGG & AAWW : End If
  500. End If
  501. Next : DataGridView8.Rows(i).Cells("備註").Value = BBNN14
  502. '--------------------------------------------------------------------------------------------
  503. For II As Integer = 0 To BBNN5 - 1
  504. If II = 0 Then
  505. AAWW = Strings.Left(DataGridView8.Rows(i).Cells("廠商").Value.ToString, 1)
  506. If RRTT.IsMatch(AAWW) Then : Else : BBNN15 = Strings.Left(DataGridView8.Rows(i).Cells("廠商").Value.ToString, 1) : End If
  507. Else
  508. AAWW = Strings.Mid(DataGridView8.Rows(i).Cells("廠商").Value.ToString, II + 1, 1) : If RRTT.IsMatch(AAWW) Then : Else : HHGG = BBNN15 : BBNN15 = HHGG & AAWW : End If
  509. End If
  510. Next : DataGridView8.Rows(i).Cells("廠商").Value = BBNN15
  511. Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
  512. End Sub
  513. '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  514. Private Sub Set_讀取清單()
  515. DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  516. DataGridView1.ColumnHeadersHeight = 25
  517. DataGridView1.AllowUserToAddRows = False
  518. DataGridView1.RowTemplate.Height = 140
  519. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  520. SQL1 = "SELECT 樣品訂單控制表.SO AS 序號, 鞋樣素描圖控制表.圖片, 樣品訂單控制表.SO, 樣品訂單控制表.版次, 樣品訂單控制表.型體號碼, 樣品訂單控制表.型體名稱 AS STYLE, 樣品訂單控制表.工廠,
  521. 樣品訂單控制表.ISS_DATE, 樣品訂單控制表.ETA, 樣品訂單清單.顏色, 樣品訂單清單.數量, 樣品訂單清單.SIZE, 樣品訂單清單.KEEP, 樣品訂單清單.流水號, 樣品訂單清單.流水號 AS UPPER,
  522. 樣品訂單清單.流水號 AS LINING, 樣品訂單清單.流水號 AS BUCKLE, 樣品訂單清單.流水號 AS [SOCK LINING], 樣品訂單清單.流水號 AS BOTTOM, 樣品訂單清單.流水號 AS OTHER
  523. FROM 樣品訂單控制表 LEFT OUTER JOIN 鞋樣素描圖控制表 ON 樣品訂單控制表.型體號碼 = 鞋樣素描圖控制表.型體編號 AND 樣品訂單控制表.型體名稱 = 鞋樣素描圖控制表.型體名稱 FULL OUTER JOIN
  524. 樣品訂單清單 ON 樣品訂單控制表.SO = 樣品訂單清單.SO AND 樣品訂單控制表.版次 = 樣品訂單清單.版次
  525. WHERE (樣品訂單控制表.季節 LIKE N'" & ComboBox7.Text & "') AND (樣品訂單控制表.客戶 LIKE N'" & ComboBox2.Text & "') AND
  526. (樣品訂單控制表.狀態 LIKE N'" & 樣品進度表分類2 & "') AND (樣品訂單控制表.SO LIKE '" & DataGridView2.Rows(N2).Cells("SO").Value & "') AND
  527. (樣品訂單控制表.版次 LIKE '" & DataGridView2.Rows(N2).Cells("版次").Value & "')
  528. ORDER BY 型體號碼, 樣品訂單控制表.SO, 樣品訂單控制表.版次 DESC"
  529. cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close() : Set_grid()
  530. End Sub
  531. Private Sub Set_清單()
  532. DataGridView1.DataSource = Nothing : ds.Clear()
  533. For i As Integer = 0 To DataGridView2.Rows.Count - 1
  534. If DataGridView2.Rows(i).Cells("版次").Value = "V01" Then
  535. N2 = i : Set_讀取清單()
  536. ElseIf DataGridView2.Rows(i).Cells("版次").Value <> "V01" Then
  537. N2 = i : Set_讀取清單()
  538. i = i + Val(Strings.Right(DataGridView2.Rows(i).Cells("版次").Value, 2)) - 1
  539. End If
  540. Next
  541. End Sub
  542. Private Sub Set_grid()
  543. DataGridView1.Columns(0).Width = 40 : DataGridView1.Columns(1).Width = 120 : DataGridView1.Columns(2).Visible = False : DataGridView1.Columns(3).Width = 40 : DataGridView1.Columns(4).Visible = False
  544. DataGridView1.Columns(5).Width = 100 : DataGridView1.Columns(6).Width = 80 : DataGridView1.Columns(7).Visible = False : DataGridView1.Columns(8).Width = 80
  545. DataGridView1.Columns(9).Width = 100 : DataGridView1.Columns(10).Width = 40 : DataGridView1.Columns(11).Width = 40 : DataGridView1.Columns(12).Visible = False
  546. DataGridView1.Columns(13).Visible = False : DataGridView1.Columns(14).Width = 250 : DataGridView1.Columns(15).Width = 250 : DataGridView1.Columns(16).Width = 200
  547. DataGridView1.Columns(17).Width = 200 : DataGridView1.Columns(18).Width = 200 : DataGridView1.Columns(19).Width = 130
  548. DataGridView1.Columns(10).DefaultCellStyle.Format = "#,##0.0" : DataGridView1.Columns(12).DefaultCellStyle.Format = "#,##0.0"
  549. DataGridView1.Columns(10).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(12).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
  550. DataGridView1.Columns(10).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(12).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
  551. DataGridView1.EditMode = DataGridViewEditMode.EditOnEnter
  552. N1 = 1
  553. For i As Integer = 0 To DataGridView1.Rows.Count - 1
  554. If i = DataGridView1.Rows.Count - 1 Then
  555. DataGridView1.Rows(i).Cells("序號").Value = N1.ToString : Exit For
  556. Else
  557. If DataGridView1(4, i).Value.ToString <> DataGridView1(4, i + 1).Value.ToString Then
  558. DataGridView1.Rows(i).Cells("序號").Value = N1.ToString : N1 = N1 + 1
  559. Else
  560. DataGridView1.Rows(i).Cells("序號").Value = N1.ToString
  561. End If
  562. End If
  563. Next
  564. End Sub
  565. Private Sub Set_grid0()
  566. For i As Integer = 0 To DataGridView1.Rows.Count - 1
  567. DataGridView1.Rows(i).Cells("STYLE").Value = DataGridView1.Rows(i).Cells("型體號碼").Value & "
  568. " & DataGridView1.Rows(i).Cells("STYLE").Value & "
  569. " & DataGridView1.Rows(i).Cells("SO").Value
  570. Next
  571. Dim mycol As DataGridViewImageColumn = DataGridView1.Columns("圖片")
  572. mycol.ImageLayout = DataGridViewImageCellLayout.Zoom
  573. End Sub
  574. Private Sub Set_清單8()
  575. DataGridView9.DataSource = Nothing : ds8.Clear()
  576. DataGridView9.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
  577. DataGridView9.ColumnHeadersHeight = 25
  578. DataGridView9.AllowUserToAddRows = False
  579. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  580. SQL1 = "SELECT 季節, 客戶 FROM 樣品訂單控制表 WHERE (狀態 LIKE '" & 樣品進度表分類2 & "') GROUP BY 季節, 客戶 ORDER BY 客戶, 季節"
  581. cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds8) : DataGridView9.DataSource = ds8.Tables(0) : conn.Close() : Set_grid8()
  582. End Sub
  583. Private Sub Set_grid8()
  584. DataGridView9.Columns(0).Width = 120 : DataGridView9.Columns(1).Width = 240
  585. End Sub
  586. Private Sub 導入A類料()
  587. For i As Integer = 0 To DataGridView1.Rows.Count - 1
  588. 資料數 = DataGridView1.Rows.Count : MyModule1.進度條()
  589. DataGridView1.Rows(i).Cells("UPPER").Value = ""
  590. Dim aa As Integer = 1
  591. For ii As Integer = 0 To DataGridView3.Rows.Count - 1
  592. If DataGridView1.Rows(i).Cells("流水號").Value = DataGridView3.Rows(ii).Cells("流水號").Value Then
  593. If aa = 1 Then
  594. If DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  595. DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  596. DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value &
  597. "-" & DataGridView3.Rows(ii).Cells("材料說明").Value & "-" & DataGridView3.Rows(ii).Cells("備註").Value & "-" & DataGridView3.Rows(ii).Cells("廠商").Value
  598. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  599. DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
  600. DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value &
  601. "-" & DataGridView3.Rows(ii).Cells("材料說明").Value & "-" & DataGridView3.Rows(ii).Cells("備註").Value
  602. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  603. DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  604. DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value &
  605. "-" & DataGridView3.Rows(ii).Cells("材料說明").Value & "-" & DataGridView3.Rows(ii).Cells("廠商").Value
  606. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
  607. DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  608. DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value &
  609. "-" & DataGridView3.Rows(ii).Cells("備註").Value & "-" & DataGridView3.Rows(ii).Cells("廠商").Value
  610. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  611. DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  612. DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料說明").Value &
  613. "-" & DataGridView3.Rows(ii).Cells("備註").Value & "-" & DataGridView3.Rows(ii).Cells("廠商").Value
  614. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  615. DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
  616. DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value &
  617. "-" & DataGridView3.Rows(ii).Cells("材料說明").Value
  618. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
  619. DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
  620. DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value &
  621. "-" & DataGridView3.Rows(ii).Cells("備註").Value
  622. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  623. DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
  624. DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料說明").Value &
  625. "-" & DataGridView3.Rows(ii).Cells("備註").Value
  626. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
  627. DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  628. DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value &
  629. "-" & DataGridView3.Rows(ii).Cells("廠商").Value
  630. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  631. DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  632. DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料說明").Value &
  633. "-" & DataGridView3.Rows(ii).Cells("廠商").Value
  634. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
  635. DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  636. DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("備註").Value &
  637. "-" & DataGridView3.Rows(ii).Cells("廠商").Value
  638. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
  639. DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
  640. DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value
  641. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  642. DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
  643. DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料說明").Value
  644. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
  645. DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
  646. DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("備註").Value
  647. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
  648. DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  649. DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("廠商").Value
  650. End If
  651. aa += 1
  652. Else
  653. If DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  654. DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  655. DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
  656. " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value &
  657. "-" & DataGridView3.Rows(ii).Cells("材料說明").Value & "-" & DataGridView3.Rows(ii).Cells("備註").Value & "-" & DataGridView3.Rows(ii).Cells("廠商").Value
  658. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  659. DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
  660. DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
  661. " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView3.Rows(ii).Cells("材料說明").Value &
  662. "-" & DataGridView3.Rows(ii).Cells("備註").Value
  663. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  664. DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  665. DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
  666. " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView3.Rows(ii).Cells("材料說明").Value &
  667. "-" & DataGridView3.Rows(ii).Cells("廠商").Value
  668. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
  669. DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  670. DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
  671. " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView3.Rows(ii).Cells("備註").Value &
  672. "-" & DataGridView3.Rows(ii).Cells("廠商").Value
  673. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  674. DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  675. DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
  676. " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料說明").Value & "-" & DataGridView3.Rows(ii).Cells("備註").Value &
  677. "-" & DataGridView3.Rows(ii).Cells("廠商").Value
  678. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  679. DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
  680. DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
  681. " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView3.Rows(ii).Cells("材料說明").Value
  682. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
  683. DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
  684. DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
  685. " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView3.Rows(ii).Cells("備註").Value
  686. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  687. DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
  688. DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
  689. " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料說明").Value & "-" & DataGridView3.Rows(ii).Cells("備註").Value
  690. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
  691. DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  692. DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
  693. " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView3.Rows(ii).Cells("廠商").Value
  694. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  695. DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  696. DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
  697. " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料說明").Value & "-" & DataGridView3.Rows(ii).Cells("廠商").Value
  698. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
  699. DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  700. DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
  701. " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("備註").Value & "-" & DataGridView3.Rows(ii).Cells("廠商").Value
  702. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
  703. DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
  704. DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
  705. " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value
  706. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  707. DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
  708. DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
  709. " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料說明").Value
  710. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
  711. DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
  712. DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
  713. " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("備註").Value
  714. ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
  715. DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  716. DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
  717. " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("廠商").Value
  718. End If
  719. aa += 1
  720. End If
  721. End If
  722. Next
  723. Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
  724. End Sub
  725. Private Sub 導入B類料()
  726. For i As Integer = 0 To DataGridView1.Rows.Count - 1
  727. 資料數 = DataGridView1.Rows.Count : MyModule1.進度條()
  728. DataGridView1.Rows(i).Cells("LINING").Value = ""
  729. Dim aa As Integer = 1
  730. For ii As Integer = 0 To DataGridView4.Rows.Count - 1
  731. If DataGridView1.Rows(i).Cells("流水號").Value = DataGridView4.Rows(ii).Cells("流水號").Value Then
  732. If aa = 1 Then
  733. If DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  734. DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  735. DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value &
  736. "-" & DataGridView4.Rows(ii).Cells("材料說明").Value & "-" & DataGridView4.Rows(ii).Cells("備註").Value & "-" & DataGridView4.Rows(ii).Cells("廠商").Value
  737. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  738. DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
  739. DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value &
  740. "-" & DataGridView4.Rows(ii).Cells("材料說明").Value & "-" & DataGridView4.Rows(ii).Cells("備註").Value
  741. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  742. DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  743. DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value &
  744. "-" & DataGridView4.Rows(ii).Cells("材料說明").Value & "-" & DataGridView4.Rows(ii).Cells("廠商").Value
  745. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
  746. DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  747. DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value &
  748. "-" & DataGridView4.Rows(ii).Cells("備註").Value & "-" & DataGridView4.Rows(ii).Cells("廠商").Value
  749. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  750. DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  751. DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料說明").Value &
  752. "-" & DataGridView4.Rows(ii).Cells("備註").Value & "-" & DataGridView4.Rows(ii).Cells("廠商").Value
  753. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  754. DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
  755. DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value &
  756. "-" & DataGridView4.Rows(ii).Cells("材料說明").Value
  757. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
  758. DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
  759. DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value &
  760. "-" & DataGridView4.Rows(ii).Cells("備註").Value
  761. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  762. DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
  763. DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料說明").Value &
  764. "-" & DataGridView4.Rows(ii).Cells("備註").Value
  765. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
  766. DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  767. DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value &
  768. "-" & DataGridView4.Rows(ii).Cells("廠商").Value
  769. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  770. DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  771. DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料說明").Value &
  772. "-" & DataGridView4.Rows(ii).Cells("廠商").Value
  773. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
  774. DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  775. DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("備註").Value &
  776. "-" & DataGridView4.Rows(ii).Cells("廠商").Value
  777. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
  778. DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
  779. DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value
  780. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  781. DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
  782. DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料說明").Value
  783. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
  784. DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
  785. DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("備註").Value
  786. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
  787. DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  788. DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("廠商").Value
  789. End If
  790. aa += 1
  791. Else
  792. If DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  793. DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  794. DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
  795. " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value &
  796. "-" & DataGridView4.Rows(ii).Cells("材料說明").Value & "-" & DataGridView4.Rows(ii).Cells("備註").Value & "-" & DataGridView4.Rows(ii).Cells("廠商").Value
  797. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  798. DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
  799. DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
  800. " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView4.Rows(ii).Cells("材料說明").Value &
  801. "-" & DataGridView4.Rows(ii).Cells("備註").Value
  802. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  803. DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  804. DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
  805. " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView4.Rows(ii).Cells("材料說明").Value &
  806. "-" & DataGridView4.Rows(ii).Cells("廠商").Value
  807. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
  808. DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  809. DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
  810. " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView4.Rows(ii).Cells("備註").Value &
  811. "-" & DataGridView4.Rows(ii).Cells("廠商").Value
  812. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  813. DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  814. DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
  815. " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料說明").Value & "-" & DataGridView4.Rows(ii).Cells("備註").Value &
  816. "-" & DataGridView4.Rows(ii).Cells("廠商").Value
  817. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  818. DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
  819. DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
  820. " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView4.Rows(ii).Cells("材料說明").Value
  821. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
  822. DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
  823. DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
  824. " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView4.Rows(ii).Cells("備註").Value
  825. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  826. DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
  827. DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
  828. " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料說明").Value & "-" & DataGridView4.Rows(ii).Cells("備註").Value
  829. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
  830. DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  831. DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
  832. " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView4.Rows(ii).Cells("廠商").Value
  833. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  834. DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  835. DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
  836. " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料說明").Value & "-" & DataGridView4.Rows(ii).Cells("廠商").Value
  837. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
  838. DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  839. DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
  840. " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("備註").Value & "-" & DataGridView4.Rows(ii).Cells("廠商").Value
  841. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
  842. DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
  843. DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
  844. " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value
  845. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  846. DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
  847. DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
  848. " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料說明").Value
  849. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
  850. DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
  851. DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
  852. " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("備註").Value
  853. ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
  854. DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  855. DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
  856. " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("廠商").Value
  857. End If
  858. aa += 1
  859. End If
  860. End If
  861. Next
  862. Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
  863. End Sub
  864. Private Sub 導入C類料()
  865. For i As Integer = 0 To DataGridView1.Rows.Count - 1
  866. 資料數 = DataGridView1.Rows.Count : MyModule1.進度條()
  867. DataGridView1.Rows(i).Cells("BUCKLE").Value = ""
  868. Dim aa As Integer = 1
  869. For ii As Integer = 0 To DataGridView5.Rows.Count - 1
  870. If DataGridView1.Rows(i).Cells("流水號").Value = DataGridView5.Rows(ii).Cells("流水號").Value Then
  871. If aa = 1 Then
  872. If DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  873. DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  874. DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value &
  875. "-" & DataGridView5.Rows(ii).Cells("材料說明").Value & "-" & DataGridView5.Rows(ii).Cells("備註").Value & "-" & DataGridView5.Rows(ii).Cells("廠商").Value
  876. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  877. DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
  878. DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value &
  879. "-" & DataGridView5.Rows(ii).Cells("材料說明").Value & "-" & DataGridView5.Rows(ii).Cells("備註").Value
  880. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  881. DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  882. DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value &
  883. "-" & DataGridView5.Rows(ii).Cells("材料說明").Value & "-" & DataGridView5.Rows(ii).Cells("廠商").Value
  884. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
  885. DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  886. DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value &
  887. "-" & DataGridView5.Rows(ii).Cells("備註").Value & "-" & DataGridView5.Rows(ii).Cells("廠商").Value
  888. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  889. DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  890. DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料說明").Value &
  891. "-" & DataGridView5.Rows(ii).Cells("備註").Value & "-" & DataGridView5.Rows(ii).Cells("廠商").Value
  892. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  893. DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
  894. DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value &
  895. "-" & DataGridView5.Rows(ii).Cells("材料說明").Value
  896. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
  897. DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
  898. DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value &
  899. "-" & DataGridView5.Rows(ii).Cells("備註").Value
  900. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  901. DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
  902. DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料說明").Value &
  903. "-" & DataGridView5.Rows(ii).Cells("備註").Value
  904. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
  905. DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  906. DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value &
  907. "-" & DataGridView5.Rows(ii).Cells("廠商").Value
  908. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  909. DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  910. DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料說明").Value &
  911. "-" & DataGridView5.Rows(ii).Cells("廠商").Value
  912. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
  913. DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  914. DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("備註").Value &
  915. "-" & DataGridView5.Rows(ii).Cells("廠商").Value
  916. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
  917. DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
  918. DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value
  919. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  920. DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
  921. DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料說明").Value
  922. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
  923. DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
  924. DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("備註").Value
  925. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
  926. DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  927. DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("廠商").Value
  928. End If
  929. aa += 1
  930. Else
  931. If DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  932. DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  933. DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
  934. " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value &
  935. "-" & DataGridView5.Rows(ii).Cells("材料說明").Value & "-" & DataGridView5.Rows(ii).Cells("備註").Value & "-" & DataGridView5.Rows(ii).Cells("廠商").Value
  936. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  937. DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
  938. DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
  939. " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView5.Rows(ii).Cells("材料說明").Value &
  940. "-" & DataGridView5.Rows(ii).Cells("備註").Value
  941. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  942. DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  943. DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
  944. " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView5.Rows(ii).Cells("材料說明").Value &
  945. "-" & DataGridView5.Rows(ii).Cells("廠商").Value
  946. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
  947. DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  948. DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
  949. " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView5.Rows(ii).Cells("備註").Value &
  950. "-" & DataGridView5.Rows(ii).Cells("廠商").Value
  951. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  952. DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  953. DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
  954. " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料說明").Value & "-" & DataGridView5.Rows(ii).Cells("備註").Value &
  955. "-" & DataGridView5.Rows(ii).Cells("廠商").Value
  956. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  957. DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
  958. DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
  959. " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView5.Rows(ii).Cells("材料說明").Value
  960. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
  961. DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
  962. DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
  963. " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView5.Rows(ii).Cells("備註").Value
  964. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  965. DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
  966. DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
  967. " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料說明").Value & "-" & DataGridView5.Rows(ii).Cells("備註").Value
  968. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
  969. DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  970. DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
  971. " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView5.Rows(ii).Cells("廠商").Value
  972. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  973. DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  974. DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
  975. " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料說明").Value & "-" & DataGridView5.Rows(ii).Cells("廠商").Value
  976. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
  977. DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  978. DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
  979. " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("備註").Value & "-" & DataGridView5.Rows(ii).Cells("廠商").Value
  980. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
  981. DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
  982. DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
  983. " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value
  984. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  985. DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
  986. DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
  987. " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料說明").Value
  988. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
  989. DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
  990. DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
  991. " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("備註").Value
  992. ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
  993. DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  994. DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
  995. " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("廠商").Value
  996. End If
  997. aa += 1
  998. End If
  999. End If
  1000. Next
  1001. Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
  1002. End Sub
  1003. Private Sub 導入D類料()
  1004. For i As Integer = 0 To DataGridView1.Rows.Count - 1
  1005. 資料數 = DataGridView1.Rows.Count : MyModule1.進度條()
  1006. DataGridView1.Rows(i).Cells("SOCK LINING").Value = ""
  1007. Dim aa As Integer = 1
  1008. For ii As Integer = 0 To DataGridView6.Rows.Count - 1
  1009. If DataGridView1.Rows(i).Cells("流水號").Value = DataGridView6.Rows(ii).Cells("流水號").Value Then
  1010. If aa = 1 Then
  1011. If DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1012. DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1013. DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value &
  1014. "-" & DataGridView6.Rows(ii).Cells("材料說明").Value & "-" & DataGridView6.Rows(ii).Cells("備註").Value & "-" & DataGridView6.Rows(ii).Cells("廠商").Value
  1015. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1016. DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1017. DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value &
  1018. "-" & DataGridView6.Rows(ii).Cells("材料說明").Value & "-" & DataGridView6.Rows(ii).Cells("備註").Value
  1019. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1020. DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1021. DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value &
  1022. "-" & DataGridView6.Rows(ii).Cells("材料說明").Value & "-" & DataGridView6.Rows(ii).Cells("廠商").Value
  1023. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1024. DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1025. DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value &
  1026. "-" & DataGridView6.Rows(ii).Cells("備註").Value & "-" & DataGridView6.Rows(ii).Cells("廠商").Value
  1027. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1028. DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1029. DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料說明").Value &
  1030. "-" & DataGridView6.Rows(ii).Cells("備註").Value & "-" & DataGridView6.Rows(ii).Cells("廠商").Value
  1031. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1032. DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1033. DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value &
  1034. "-" & DataGridView6.Rows(ii).Cells("材料說明").Value
  1035. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1036. DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1037. DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value &
  1038. "-" & DataGridView6.Rows(ii).Cells("備註").Value
  1039. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1040. DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1041. DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料說明").Value &
  1042. "-" & DataGridView6.Rows(ii).Cells("備註").Value
  1043. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1044. DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1045. DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value &
  1046. "-" & DataGridView6.Rows(ii).Cells("廠商").Value
  1047. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1048. DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1049. DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料說明").Value &
  1050. "-" & DataGridView6.Rows(ii).Cells("廠商").Value
  1051. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1052. DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1053. DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("備註").Value &
  1054. "-" & DataGridView6.Rows(ii).Cells("廠商").Value
  1055. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1056. DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1057. DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value
  1058. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1059. DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1060. DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料說明").Value
  1061. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1062. DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1063. DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("備註").Value
  1064. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1065. DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1066. DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("廠商").Value
  1067. End If
  1068. aa += 1
  1069. Else
  1070. If DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1071. DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1072. DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
  1073. " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value &
  1074. "-" & DataGridView6.Rows(ii).Cells("材料說明").Value & "-" & DataGridView6.Rows(ii).Cells("備註").Value & "-" & DataGridView6.Rows(ii).Cells("廠商").Value
  1075. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1076. DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1077. DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
  1078. " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView6.Rows(ii).Cells("材料說明").Value &
  1079. "-" & DataGridView6.Rows(ii).Cells("備註").Value
  1080. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1081. DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1082. DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
  1083. " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView6.Rows(ii).Cells("材料說明").Value &
  1084. "-" & DataGridView6.Rows(ii).Cells("廠商").Value
  1085. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1086. DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1087. DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
  1088. " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView6.Rows(ii).Cells("備註").Value &
  1089. "-" & DataGridView6.Rows(ii).Cells("廠商").Value
  1090. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1091. DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1092. DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
  1093. " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料說明").Value & "-" & DataGridView6.Rows(ii).Cells("備註").Value &
  1094. "-" & DataGridView6.Rows(ii).Cells("廠商").Value
  1095. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1096. DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1097. DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
  1098. " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView6.Rows(ii).Cells("材料說明").Value
  1099. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1100. DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1101. DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
  1102. " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView6.Rows(ii).Cells("備註").Value
  1103. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1104. DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1105. DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
  1106. " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料說明").Value & "-" & DataGridView6.Rows(ii).Cells("備註").Value
  1107. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1108. DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1109. DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
  1110. " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView6.Rows(ii).Cells("廠商").Value
  1111. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1112. DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1113. DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
  1114. " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料說明").Value & "-" & DataGridView6.Rows(ii).Cells("廠商").Value
  1115. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1116. DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1117. DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
  1118. " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("備註").Value & "-" & DataGridView6.Rows(ii).Cells("廠商").Value
  1119. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1120. DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1121. DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
  1122. " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value
  1123. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1124. DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1125. DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
  1126. " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料說明").Value
  1127. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1128. DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1129. DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
  1130. " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("備註").Value
  1131. ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1132. DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1133. DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
  1134. " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("廠商").Value
  1135. End If
  1136. aa += 1
  1137. End If
  1138. End If
  1139. Next
  1140. Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
  1141. End Sub
  1142. Private Sub 導入E類料()
  1143. For i As Integer = 0 To DataGridView1.Rows.Count - 1
  1144. 資料數 = DataGridView1.Rows.Count : MyModule1.進度條()
  1145. DataGridView1.Rows(i).Cells("BOTTOM").Value = ""
  1146. Dim aa As Integer = 1
  1147. For ii As Integer = 0 To DataGridView7.Rows.Count - 1
  1148. If DataGridView1.Rows(i).Cells("流水號").Value = DataGridView7.Rows(ii).Cells("流水號").Value Then
  1149. If aa = 1 Then
  1150. If DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1151. DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1152. DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value &
  1153. "-" & DataGridView7.Rows(ii).Cells("材料說明").Value & "-" & DataGridView7.Rows(ii).Cells("備註").Value & "-" & DataGridView7.Rows(ii).Cells("廠商").Value
  1154. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1155. DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1156. DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value &
  1157. "-" & DataGridView7.Rows(ii).Cells("材料說明").Value & "-" & DataGridView7.Rows(ii).Cells("備註").Value
  1158. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1159. DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1160. DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value &
  1161. "-" & DataGridView7.Rows(ii).Cells("材料說明").Value & "-" & DataGridView7.Rows(ii).Cells("廠商").Value
  1162. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1163. DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1164. DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value &
  1165. "-" & DataGridView7.Rows(ii).Cells("備註").Value & "-" & DataGridView7.Rows(ii).Cells("廠商").Value
  1166. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1167. DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1168. DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料說明").Value &
  1169. "-" & DataGridView7.Rows(ii).Cells("備註").Value & "-" & DataGridView7.Rows(ii).Cells("廠商").Value
  1170. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1171. DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value & " - ".ToString = "" Then
  1172. DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & DataGridView7.Rows(ii).Cells("材料名稱").Value &
  1173. "-" & DataGridView7.Rows(ii).Cells("材料說明").Value
  1174. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1175. DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1176. DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value &
  1177. "-" & DataGridView7.Rows(ii).Cells("備註").Value
  1178. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1179. DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1180. DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料說明").Value &
  1181. "-" & DataGridView7.Rows(ii).Cells("備註").Value
  1182. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1183. DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1184. DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value &
  1185. "-" & DataGridView7.Rows(ii).Cells("廠商").Value
  1186. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1187. DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1188. DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料說明").Value &
  1189. "-" & DataGridView7.Rows(ii).Cells("廠商").Value
  1190. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1191. DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1192. DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("備註").Value &
  1193. "-" & DataGridView7.Rows(ii).Cells("廠商").Value
  1194. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1195. DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1196. DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value
  1197. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1198. DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1199. DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料說明").Value
  1200. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1201. DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1202. DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("備註").Value
  1203. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1204. DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1205. DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("廠商").Value
  1206. End If
  1207. aa += 1
  1208. Else
  1209. If DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1210. DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1211. DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
  1212. " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value &
  1213. "-" & DataGridView7.Rows(ii).Cells("材料說明").Value & "-" & DataGridView7.Rows(ii).Cells("備註").Value & "-" & DataGridView7.Rows(ii).Cells("廠商").Value
  1214. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1215. DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1216. DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
  1217. " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView7.Rows(ii).Cells("材料說明").Value &
  1218. "-" & DataGridView7.Rows(ii).Cells("備註").Value
  1219. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1220. DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1221. DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
  1222. " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView7.Rows(ii).Cells("材料說明").Value &
  1223. "-" & DataGridView7.Rows(ii).Cells("廠商").Value
  1224. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1225. DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1226. DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
  1227. " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView7.Rows(ii).Cells("備註").Value &
  1228. "-" & DataGridView7.Rows(ii).Cells("廠商").Value
  1229. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1230. DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1231. DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
  1232. " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料說明").Value & "-" & DataGridView7.Rows(ii).Cells("備註").Value &
  1233. "-" & DataGridView7.Rows(ii).Cells("廠商").Value
  1234. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1235. DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1236. DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
  1237. " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView7.Rows(ii).Cells("材料說明").Value
  1238. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1239. DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1240. DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
  1241. " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView7.Rows(ii).Cells("備註").Value
  1242. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1243. DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1244. DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
  1245. " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料說明").Value & "-" & DataGridView7.Rows(ii).Cells("備註").Value
  1246. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1247. DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1248. DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
  1249. " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView7.Rows(ii).Cells("廠商").Value
  1250. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1251. DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1252. DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
  1253. " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料說明").Value & "-" & DataGridView7.Rows(ii).Cells("廠商").Value
  1254. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1255. DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1256. DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
  1257. " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("備註").Value & "-" & DataGridView7.Rows(ii).Cells("廠商").Value
  1258. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1259. DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1260. DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
  1261. " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value
  1262. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1263. DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1264. DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
  1265. " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料說明").Value
  1266. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1267. DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1268. DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
  1269. " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("備註").Value
  1270. ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1271. DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1272. DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
  1273. " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("廠商").Value
  1274. End If
  1275. aa += 1
  1276. End If
  1277. End If
  1278. Next
  1279. Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
  1280. End Sub
  1281. Private Sub 導入F類料()
  1282. For i As Integer = 0 To DataGridView1.Rows.Count - 1
  1283. 資料數 = DataGridView1.Rows.Count : MyModule1.進度條()
  1284. DataGridView1.Rows(i).Cells("OTHER").Value = ""
  1285. Dim aa As Integer = 1
  1286. For ii As Integer = 0 To DataGridView8.Rows.Count - 1
  1287. If DataGridView1.Rows(i).Cells("流水號").Value = DataGridView8.Rows(ii).Cells("流水號").Value Then
  1288. If aa = 1 Then
  1289. If DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1290. DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1291. DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value &
  1292. "-" & DataGridView8.Rows(ii).Cells("材料說明").Value & "-" & DataGridView8.Rows(ii).Cells("備註").Value & "-" & DataGridView8.Rows(ii).Cells("廠商").Value
  1293. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1294. DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1295. DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value &
  1296. "-" & DataGridView8.Rows(ii).Cells("材料說明").Value & "-" & DataGridView8.Rows(ii).Cells("備註").Value
  1297. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1298. DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1299. DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value &
  1300. "-" & DataGridView8.Rows(ii).Cells("材料說明").Value & "-" & DataGridView8.Rows(ii).Cells("廠商").Value
  1301. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1302. DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1303. DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value &
  1304. "-" & DataGridView8.Rows(ii).Cells("備註").Value & "-" & DataGridView8.Rows(ii).Cells("廠商").Value
  1305. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1306. DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1307. DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料說明").Value &
  1308. "-" & DataGridView8.Rows(ii).Cells("備註").Value & "-" & DataGridView8.Rows(ii).Cells("廠商").Value
  1309. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1310. DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1311. DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value &
  1312. "-" & DataGridView8.Rows(ii).Cells("材料說明").Value
  1313. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1314. DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1315. DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value &
  1316. "-" & DataGridView8.Rows(ii).Cells("備註").Value
  1317. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1318. DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1319. DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料說明").Value &
  1320. "-" & DataGridView8.Rows(ii).Cells("備註").Value
  1321. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1322. DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1323. DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value &
  1324. "-" & DataGridView8.Rows(ii).Cells("廠商").Value
  1325. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1326. DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1327. DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料說明").Value &
  1328. "-" & DataGridView8.Rows(ii).Cells("廠商").Value
  1329. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1330. DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1331. DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("備註").Value &
  1332. "-" & DataGridView8.Rows(ii).Cells("廠商").Value
  1333. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1334. DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1335. DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value
  1336. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1337. DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1338. DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料說明").Value
  1339. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1340. DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1341. DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("備註").Value
  1342. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1343. DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1344. DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("廠商").Value
  1345. End If
  1346. aa += 1
  1347. Else
  1348. If DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1349. DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1350. DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
  1351. " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value &
  1352. "-" & DataGridView8.Rows(ii).Cells("材料說明").Value & "-" & DataGridView8.Rows(ii).Cells("備註").Value & "-" & DataGridView8.Rows(ii).Cells("廠商").Value
  1353. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1354. DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1355. DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
  1356. " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView8.Rows(ii).Cells("材料說明").Value &
  1357. "-" & DataGridView8.Rows(ii).Cells("備註").Value
  1358. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1359. DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1360. DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
  1361. " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView8.Rows(ii).Cells("材料說明").Value &
  1362. "-" & DataGridView8.Rows(ii).Cells("廠商").Value
  1363. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1364. DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1365. DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
  1366. " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView8.Rows(ii).Cells("備註").Value &
  1367. "-" & DataGridView8.Rows(ii).Cells("廠商").Value
  1368. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1369. DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1370. DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
  1371. " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料說明").Value & "-" & DataGridView8.Rows(ii).Cells("備註").Value &
  1372. "-" & DataGridView8.Rows(ii).Cells("廠商").Value
  1373. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1374. DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1375. DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
  1376. " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView8.Rows(ii).Cells("材料說明").Value
  1377. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1378. DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1379. DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
  1380. " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView8.Rows(ii).Cells("備註").Value
  1381. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1382. DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1383. DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
  1384. " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料說明").Value & "-" & DataGridView8.Rows(ii).Cells("備註").Value
  1385. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1386. DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1387. DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
  1388. " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView8.Rows(ii).Cells("廠商").Value
  1389. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1390. DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1391. DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
  1392. " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料說明").Value & "-" & DataGridView8.Rows(ii).Cells("廠商").Value
  1393. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1394. DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1395. DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
  1396. " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("備註").Value & "-" & DataGridView8.Rows(ii).Cells("廠商").Value
  1397. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1398. DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1399. DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
  1400. " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value
  1401. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
  1402. DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1403. DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
  1404. " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料說明").Value
  1405. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1406. DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
  1407. DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
  1408. " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("備註").Value
  1409. ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
  1410. DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
  1411. DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
  1412. " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("廠商").Value
  1413. End If
  1414. aa += 1
  1415. End If
  1416. End If
  1417. Next
  1418. Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
  1419. End Sub
  1420. Private Sub ComboBox7下拉表單資料載入()
  1421. conn.Close()
  1422. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  1423. SQL1 = "SELECT SEASON FROM 季節清單 ORDER BY SEASON"
  1424. cmd.CommandText = SQL1 : cmd.Connection = conn : dr = cmd.ExecuteReader
  1425. ComboBox7.Items.Clear() : While (dr.Read()) : ComboBox7.Items.Add(dr("SEASON")) : End While : conn.Close()
  1426. End Sub
  1427. Private Sub ComboBox2下拉表單資料載入()
  1428. conn.Close()
  1429. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  1430. SQL1 = "SELECT 客戶簡稱 FROM 客戶控制表 ORDER BY 客戶簡稱"
  1431. cmd.CommandText = SQL1 : cmd.Connection = conn : dr = cmd.ExecuteReader
  1432. ComboBox2.Items.Clear() : While (dr.Read()) : ComboBox2.Items.Add(dr("客戶簡稱")) : End While : conn.Close()
  1433. End Sub
  1434. Private Sub 樣品進度表_英文版__Load(sender As Object, e As EventArgs) Handles MyBase.Load
  1435. Me.MdiParent = WINPROFIT_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
  1436. ComboBox7下拉表單資料載入() : ComboBox2下拉表單資料載入()
  1437. DataGridView2.Visible = False : DataGridView3.Visible = False : DataGridView4.Visible = False : DataGridView5.Visible = False : DataGridView6.Visible = False : DataGridView7.Visible = False
  1438. DataGridView8.Visible = False : GroupBox1.Visible = False : ComboBox7.Enabled = False : ComboBox2.Enabled = False
  1439. End Sub
  1440. Private Sub DataGridView1_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView1.RowPostPaint
  1441. Dim linePen As New Pen(Color.Blue, 2)
  1442. If e.RowIndex = DataGridView1.Rows.Count - 1 Then
  1443. Exit Sub
  1444. Else
  1445. If DataGridView1(0, e.RowIndex).Value.ToString <> DataGridView1(0, e.RowIndex + 1).Value.ToString Then
  1446. Dim startX As Integer = IIf(DataGridView1.RowHeadersVisible, DataGridView1.RowHeadersWidth, 0)
  1447. Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  1448. Dim endX As Integer = startX + DataGridView1.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView1.HorizontalScrollingOffset
  1449. e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
  1450. Exit Sub
  1451. End If
  1452. End If
  1453. End Sub
  1454. Private Sub DataGridView8_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView8.RowPostPaint
  1455. Dim linePen As New Pen(Color.Blue, 2)
  1456. If e.RowIndex = DataGridView8.Rows.Count - 1 Then
  1457. Exit Sub
  1458. Else
  1459. If DataGridView8(0, e.RowIndex).Value.ToString <> DataGridView8(0, e.RowIndex + 1).Value.ToString Then
  1460. Dim startX As Integer = IIf(DataGridView8.RowHeadersVisible, DataGridView8.RowHeadersWidth, 0)
  1461. Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
  1462. Dim endX As Integer = startX + DataGridView8.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView8.HorizontalScrollingOffset
  1463. e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
  1464. Exit Sub
  1465. End If
  1466. End If
  1467. End Sub
  1468. Private Sub DataGridView9_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView9.CellClick
  1469. If e.RowIndex = -1 Then : Else
  1470. ComboBox7下拉表單資料載入() : ComboBox2下拉表單資料載入()
  1471. ComboBox7.Text = DataGridView9.Rows(e.RowIndex).Cells("季節").Value
  1472. ComboBox2.Text = DataGridView9.Rows(e.RowIndex).Cells("客戶").Value
  1473. End If
  1474. End Sub
  1475. Private Sub ComboBox7_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox7.SelectedIndexChanged
  1476. If ComboBox7.Text = "" Or ComboBox2.Text = "" Then : Else : Set_清單1() : Set_清單2() : Set_清單3() : Set_清單4() : Set_清單5() : Set_清單6() : Set_清單7() : Set_清單()
  1477. 導入A類料() : 導入B類料() : 導入C類料() : 導入D類料() : 導入E類料() : 導入F類料() : Set_grid0() : ComboBox7.Enabled = False : ComboBox2.Enabled = False : End If
  1478. End Sub
  1479. Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedIndexChanged
  1480. If ComboBox7.Text = "" Or ComboBox2.Text = "" Then : Else : Set_清單1() : Set_清單2() : Set_清單3() : Set_清單4() : Set_清單5() : Set_清單6() : Set_清單7() : Set_清單()
  1481. 導入A類料() : 導入B類料() : 導入C類料() : 導入D類料() : 導入E類料() : 導入F類料() : Set_grid0() : ComboBox7.Enabled = False : ComboBox2.Enabled = False : End If
  1482. End Sub
  1483. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  1484. ComboBox7.Enabled = True : ComboBox2.Enabled = True
  1485. ComboBox7下拉表單資料載入() : ComboBox2下拉表單資料載入()
  1486. End Sub
  1487. Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  1488. GroupBox1.Visible = False
  1489. End Sub
  1490. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  1491. Set_清單8()
  1492. GroupBox1.Visible = True
  1493. End Sub
  1494. Private Sub 圖片導入2()
  1495. If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
  1496. SQL1 = "SELECT TOP (1) 圖片 FROM 鞋樣素描圖控制表 WHERE 型體編號 LIKE N'" & SSDD & "'"
  1497. cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
  1498. PictureBox2.Image = Nothing
  1499. While dr.Read() = True
  1500. Dim bytes As Byte() = New Byte(-1) {}
  1501. bytes = DirectCast(dr.Item("圖片"), Byte())
  1502. Dim oStream As New MemoryStream(bytes)
  1503. PictureBox2.Image = Bitmap.FromStream(oStream)
  1504. End While
  1505. conn.Close()
  1506. PictureBox2.SizeMode = 4
  1507. End Sub
  1508. Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
  1509. xlApp = CType(CreateObject("Excel.Application"), Application)
  1510. xlBook = xlApp.Workbooks.Add
  1511. xlApp.DisplayAlerts = True
  1512. xlBook.Activate()
  1513. xlSheet = NewMethod(xlBook)
  1514. xlSheet.Activate()
  1515. xlApp.Visible = True
  1516. xlApp.Application.WindowState = xlMaximized
  1517. FFGG = DataGridView1.Rows.Count + 3
  1518. AA(xlApp, xlSheet)
  1519. xlSheet.Cells(1, 1) = ComboBox2.Text & " - " & ComboBox7.Text & " - " & 樣品進度表分類2 & " - " & "SAMPLE SCHEDULE"
  1520. xlSheet.Cells(3, 1) = "No."
  1521. xlSheet.Cells(3, 2) = "工廠"
  1522. xlSheet.Cells(3, 3) = "Picture "
  1523. xlSheet.Cells(3, 4) = "STYLE"
  1524. xlSheet.Cells(3, 5) = "C_No"
  1525. xlSheet.Cells(3, 6) = "Color"
  1526. xlSheet.Cells(3, 7) = "SIZE"
  1527. xlSheet.Cells(3, 8) = "UPPER_____A."
  1528. xlSheet.Cells(3, 9) = "LINING_____B."
  1529. xlSheet.Cells(3, 10) = "STITCHING_____F."
  1530. xlSheet.Cells(3, 11) = "ACCESSORIES_____C."
  1531. xlSheet.Cells(3, 12) = "SOCK LINING_____D."
  1532. xlSheet.Cells(3, 13) = "BOTTOM_____E."
  1533. xlSheet.Cells(3, 14) = "Double"
  1534. xlSheet.Cells(3, 15) = "ETD"
  1535. xlSheet.Cells(3, 16) = "Remark"
  1536. xlSheet.Cells(3, 17) = "Express number"
  1537. Dim VVBB As String = "0"
  1538. For i As Integer = 0 To DataGridView1.Rows.Count - 1
  1539. N3 = i + 4
  1540. SSDD = DataGridView1.Rows(i).Cells("型體號碼").Value
  1541. If VVBB <> SSDD Then
  1542. 圖片導入2() : N6 = 1
  1543. For ii As Integer = 0 To 20
  1544. If PictureBox2.Image Is Nothing Then
  1545. Thread.Sleep(100) '延迟0.1秒
  1546. Else
  1547. BB(xlApp, xlSheet)
  1548. ii = 20
  1549. End If
  1550. Next ii
  1551. End If
  1552. VVBB = SSDD
  1553. xlSheet.Cells(i + 4, 1) = DataGridView1.Rows(i).Cells("序號").Value
  1554. xlSheet.Cells(i + 4, 2) = DataGridView1.Rows(i).Cells("工廠").Value
  1555. xlSheet.Cells(i + 4, 4) = DataGridView1.Rows(i).Cells("STYLE").Value
  1556. xlSheet.Cells(i + 4, 5) = N6
  1557. xlSheet.Cells(i + 4, 6) = DataGridView1.Rows(i).Cells("顏色").Value
  1558. xlSheet.Cells(i + 4, 7) = DataGridView1.Rows(i).Cells("SIZE").Value
  1559. xlSheet.Cells(i + 4, 8) = DataGridView1.Rows(i).Cells("UPPER").Value
  1560. xlSheet.Cells(i + 4, 9) = DataGridView1.Rows(i).Cells("LINING").Value
  1561. xlSheet.Cells(i + 4, 10) = DataGridView1.Rows(i).Cells("OTHER").Value
  1562. xlSheet.Cells(i + 4, 11) = DataGridView1.Rows(i).Cells("BUCKLE").Value
  1563. xlSheet.Cells(i + 4, 12) = DataGridView1.Rows(i).Cells("SOCK LINING").Value
  1564. xlSheet.Cells(i + 4, 13) = DataGridView1.Rows(i).Cells("BOTTOM").Value
  1565. xlSheet.Cells(i + 4, 14) = DataGridView1.Rows(i).Cells("數量").Value
  1566. xlSheet.Cells(i + 4, 15) = DataGridView1.Rows(i).Cells("ETA").Value
  1567. N6 = N6 + 1
  1568. Next i
  1569. CC(xlApp, xlSheet)
  1570. xlSheet.PageSetup.PrintArea = ""
  1571. xlApp.Cells.Select()
  1572. xlSheet.Range("B1").Select()
  1573. xlApp.Application.WindowState = xlMinimized
  1574. MsgBox("列印完成")
  1575. End Sub
  1576. Private Shared Function NewMethod(xlBook As Workbook) As Worksheet
  1577. Return CType(xlBook.Worksheets.Add, Worksheet)
  1578. End Function
  1579. Private Sub AA(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1580. xlSheet.Cells.Select()
  1581. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 12 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  1582. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1583. xlSheet.Rows("4:" & FFGG).Select
  1584. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 8 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  1585. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1586. myExcel.Selection.RowHeight = 90
  1587. With myExcel.Selection : .HorizontalAlignment = xlGeneral : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
  1588. .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1589. xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 3
  1590. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  1591. .ReadingOrder = xlContext : End With
  1592. xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 10
  1593. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  1594. .ReadingOrder = xlContext : End With
  1595. xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 16
  1596. xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 9
  1597. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  1598. .ReadingOrder = xlContext : End With
  1599. xlSheet.Columns("E:E").Select : myExcel.Selection.ColumnWidth = 4
  1600. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  1601. .ReadingOrder = xlContext : End With
  1602. xlSheet.Columns("F:F").Select : myExcel.Selection.ColumnWidth = 12
  1603. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  1604. .ReadingOrder = xlContext : End With
  1605. xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 5
  1606. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  1607. .ReadingOrder = xlContext : End With
  1608. xlSheet.Columns("H:H").Select : myExcel.Selection.ColumnWidth = 27 : xlSheet.Columns("I:I").Select : myExcel.Selection.ColumnWidth = 27
  1609. xlSheet.Columns("J:J").Select : myExcel.Selection.ColumnWidth = 20 : xlSheet.Columns("K:K").Select : myExcel.Selection.ColumnWidth = 27
  1610. xlSheet.Columns("L:L").Select : myExcel.Selection.ColumnWidth = 27 : xlSheet.Columns("M:M").Select : myExcel.Selection.ColumnWidth = 27
  1611. xlSheet.Columns("N:N").Select : myExcel.Selection.ColumnWidth = 6
  1612. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  1613. .ReadingOrder = xlContext : End With
  1614. xlSheet.Columns("O:O").Select : myExcel.Selection.ColumnWidth = 8
  1615. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
  1616. .ReadingOrder = xlContext : End With
  1617. xlSheet.Columns("P:P").Select : myExcel.Selection.ColumnWidth = 16
  1618. xlSheet.Columns("Q:Q").Select : myExcel.Selection.ColumnWidth = 15
  1619. xlSheet.Columns("I:I").Select : myExcel.Selection.ColumnWidth = 27
  1620. xlSheet.Rows("2:2").Select : myExcel.Selection.RowHeight = 5 : xlSheet.Rows("3:3").Select : myExcel.Selection.RowHeight = 35
  1621. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 8 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
  1622. .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1623. End Sub
  1624. Private Sub BB(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1625. Clipboard.SetDataObject(PictureBox2.Image)
  1626. xlSheet.Cells(1, 1).Select
  1627. Thread.Sleep(100) '延迟0.1秒
  1628. xlSheet.Range("C" & N3).Select()
  1629. myExcel.ActiveSheet.Paste
  1630. If PictureBox2.Image.Height < PictureBox2.Image.Width Then
  1631. myExcel.Selection.ShapeRange.Width = 45
  1632. Else
  1633. myExcel.Selection.ShapeRange.Height = 40
  1634. End If
  1635. myExcel.Selection.ShapeRange.IncrementLeft(2)
  1636. myExcel.Selection.ShapeRange.IncrementTop(2)
  1637. End Sub
  1638. Private Sub CC(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
  1639. xlSheet.Range("A3:Q3").Select()
  1640. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1641. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
  1642. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
  1643. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
  1644. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
  1645. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlThin : End With
  1646. myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
  1647. N4 = 0 : N5 = 0
  1648. Dim ZZXX As Boolean = False : Dim XXCC As Boolean = False
  1649. For i As Integer = 0 To DataGridView1.Rows.Count - 1
  1650. If i = DataGridView1.Rows.Count - 1 Then
  1651. xlSheet.Range("A" & N4 + 3 & ":Q" & N5 + 4).Select()
  1652. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1653. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
  1654. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
  1655. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
  1656. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
  1657. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlHairline : End With
  1658. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlHairline : End With
  1659. Exit For
  1660. ElseIf (DataGridView1.Rows(i).Cells("序號").Value = DataGridView1.Rows(i + 1).Cells("序號").Value) And i < DataGridView1.Rows.Count Then
  1661. If ZZXX = False Then
  1662. N4 = i + 1 : ZZXX = True
  1663. End If
  1664. N5 = i + 1
  1665. ElseIf (DataGridView1.Rows(i).Cells("序號").Value <> DataGridView1.Rows(i + 1).Cells("序號").Value) And i < DataGridView1.Rows.Count Then
  1666. If XXCC = False Then
  1667. xlSheet.Range("A" & N4 + 3 & ":Q" & N5 + 4).Select() : XXCC = True
  1668. Else
  1669. xlSheet.Range("A" & N4 + 4 & ":Q" & N5 + 4).Select()
  1670. End If
  1671. myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
  1672. With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
  1673. With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
  1674. With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
  1675. With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
  1676. With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlHairline : End With
  1677. With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlHairline : End With
  1678. ZZXX = False
  1679. If ZZXX = False Then
  1680. N4 = i + 1 : ZZXX = True
  1681. End If
  1682. N5 = i + 1
  1683. End If
  1684. Next
  1685. myExcel.ActiveWindow.Zoom = 90
  1686. xlSheet.Columns("B:B").Select : xlSheet.Range("B2").Activate() : myExcel.Selection.Delete
  1687. xlSheet.Columns("H:L").Select : xlSheet.Range("H2").Activate() : myExcel.Selection.Delete
  1688. xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 30 : xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 100
  1689. xlSheet.Rows("4:" & DataGridView1.Rows.Count + 3).EntireRow.AutoFit
  1690. xlSheet.Range("A1:K1").Select()
  1691. With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
  1692. .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
  1693. myExcel.Selection.Merge
  1694. With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 18 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
  1695. .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
  1696. ZZXX = False : XXCC = False
  1697. myExcel.Application.PrintCommunication = False
  1698. With myExcel.ActiveSheet.PageSetup
  1699. .PrintTitleRows = "$1:$3"
  1700. .PrintTitleColumns = ""
  1701. End With
  1702. myExcel.Application.PrintCommunication = True
  1703. myExcel.ActiveSheet.PageSetup.PrintArea = ""
  1704. myExcel.Application.PrintCommunication = False
  1705. With myExcel.ActiveSheet.PageSetup
  1706. .LeftHeader = ""
  1707. .CenterHeader = ""
  1708. .RightHeader = ""
  1709. .LeftFooter = ""
  1710. .CenterFooter = ""
  1711. .RightFooter = ""
  1712. .LeftMargin = myExcel.Application.InchesToPoints(0.25)
  1713. .RightMargin = myExcel.Application.InchesToPoints(0.25)
  1714. .TopMargin = myExcel.Application.InchesToPoints(0.75)
  1715. .BottomMargin = myExcel.Application.InchesToPoints(0.75)
  1716. .HeaderMargin = myExcel.Application.InchesToPoints(0.3)
  1717. .FooterMargin = myExcel.Application.InchesToPoints(0.3)
  1718. .PrintHeadings = False
  1719. .PrintGridlines = False
  1720. .PrintQuality = 600
  1721. .CenterHorizontally = False
  1722. .CenterVertically = False
  1723. .Draft = False
  1724. .FirstPageNumber = xlAutomatic
  1725. .BlackAndWhite = False
  1726. .Zoom = 50
  1727. .OddAndEvenPagesHeaderFooter = False
  1728. .DifferentFirstPageHeaderFooter = False
  1729. .ScaleWithDocHeaderFooter = True
  1730. .AlignMarginsHeaderFooter = True
  1731. .EvenPage.LeftHeader.Text = ""
  1732. .EvenPage.CenterHeader.Text = ""
  1733. .EvenPage.RightHeader.Text = ""
  1734. .EvenPage.LeftFooter.Text = ""
  1735. .EvenPage.CenterFooter.Text = ""
  1736. .EvenPage.RightFooter.Text = ""
  1737. .FirstPage.LeftHeader.Text = ""
  1738. .FirstPage.CenterHeader.Text = ""
  1739. .FirstPage.RightHeader.Text = ""
  1740. .FirstPage.LeftFooter.Text = ""
  1741. .FirstPage.CenterFooter.Text = ""
  1742. .FirstPage.RightFooter.Text = ""
  1743. End With
  1744. myExcel.Application.PrintCommunication = True
  1745. End Sub
  1746. End Class