1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924 |
- Option Strict Off
- Imports System.Data.SqlClient
- Imports System.IO
- Imports Microsoft.Office.Interop.Excel.XlUnderlineStyle
- Imports Microsoft.Office.Interop.Excel.Constants
- Imports Microsoft.Office.Interop.Excel.XlBordersIndex
- Imports Microsoft.Office.Interop.Excel.XlLineStyle
- Imports Microsoft.Office.Interop.Excel.XlBorderWeight
- Imports Microsoft.Office.Interop.Excel.XlThemeFont
- Imports Microsoft.Office.Interop.Excel.XlThemeColor
- Imports Microsoft.Office.Interop.Excel.XlWindowState
- Imports Microsoft.Office.Interop.Excel
- Imports System.Threading
- Imports System.Text.RegularExpressions
- Public Class 樣品進度表_英文版_
- Dim conn As New SqlConnection
- Dim da As New SqlDataAdapter
- Dim cmd As New SqlCommand
- 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
- Dim ds5 As New DataSet : Dim ds6 As New DataSet : Dim ds7 As New DataSet : Dim ds8 As New DataSet
- Dim dr As SqlDataReader
- 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
- Dim xlApp As Application
- Dim xlBook As Workbook
- Dim xlSheet As Worksheet
- Dim SSDD As String : Dim AAWW As String : Dim HHGG As String
- Dim BBNN1 As Integer : Dim BBNN2 As Integer : Dim BBNN3 As Integer : Dim BBNN4 As Integer : Dim BBNN5 As Integer
- Dim BBNN11 As String : Dim BBNN12 As String : Dim BBNN13 As String : Dim BBNN14 As String : Dim BBNN15 As String
- Dim RRTT As New Regex("[\u4e00-\u9fa5]")
- Private Sub Set_清單1()
- DataGridView2.DataSource = Nothing : ds1.Clear()
- DataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- DataGridView2.ColumnHeadersHeight = 25
- DataGridView2.AllowUserToAddRows = False
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT SO, 版次 FROM 樣品訂單控制表 WHERE 季節 LIKE N'" & ComboBox7.Text & "' AND 客戶 LIKE N'" & ComboBox2.Text & "' AND 狀態 LIKE N'" & 樣品進度表分類2 & "' ORDER BY 型體號碼, SO, 版次 DESC"
- cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds1) : DataGridView2.DataSource = ds1.Tables(0) : conn.Close()
- End Sub
- '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Private Sub Set_讀取清單2()
- DataGridView3.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- DataGridView3.ColumnHeadersHeight = 25
- DataGridView3.AllowUserToAddRows = False
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT 部件, 材料名稱, 材料說明, 備註, 廠商, 流水號
- FROM 樣品訂單部件表
- WHERE (SO LIKE '" & DataGridView2.Rows(N2).Cells("SO").Value & "') AND (版次 LIKE '" & DataGridView2.Rows(N2).Cells("版次").Value & "') AND (部件 LIKE N'A.%')
- ORDER BY SO, 版次, 流水號, 部件"
- cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds2) : DataGridView3.DataSource = ds2.Tables(0) : conn.Close()
- End Sub
- Private Sub Set_清單2()
- DataGridView3.DataSource = Nothing : ds2.Clear()
- For i As Integer = 0 To DataGridView2.Rows.Count - 1
- If DataGridView2.Rows(i).Cells("版次").Value = "V01" Then
- N2 = i : Set_讀取清單2()
- ElseIf DataGridView2.Rows(i).Cells("版次").Value <> "V01" Then
- N2 = i : Set_讀取清單2()
- i = i + Val(Strings.Right(DataGridView2.Rows(i).Cells("版次").Value, 2)) - 1
- End If
- Next
- 去中文2()
- End Sub
- Private Sub 去中文2()
- BBNN1 = 0 : BBNN2 = 0 : BBNN3 = 0 : BBNN4 = 0 : BBNN5 = 0
- BBNN11 = "" : BBNN12 = "" : BBNN13 = "" : BBNN14 = "" : BBNN15 = ""
- For i As Integer = 0 To DataGridView3.Rows.Count - 1
- 資料數 = DataGridView3.Rows.Count : MyModule1.進度條()
- BBNN1 = DataGridView3.Rows(i).Cells("部件").Value.ToString.Length.ToString() : BBNN2 = DataGridView3.Rows(i).Cells("材料名稱").Value.ToString.Length.ToString()
- BBNN3 = DataGridView3.Rows(i).Cells("材料說明").Value.ToString.Length.ToString() : BBNN4 = DataGridView3.Rows(i).Cells("備註").Value.ToString.Length.ToString()
- BBNN5 = DataGridView3.Rows(i).Cells("廠商").Value.ToString.Length.ToString()
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN1 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView3.Rows(i).Cells("部件").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN11 = Strings.Left(DataGridView3.Rows(i).Cells("部件").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView3.Rows(i).Cells("部件").Value = BBNN11
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN2 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView3.Rows(i).Cells("材料名稱").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN12 = Strings.Left(DataGridView3.Rows(i).Cells("材料名稱").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView3.Rows(i).Cells("材料名稱").Value = BBNN12
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN3 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView3.Rows(i).Cells("材料說明").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN13 = Strings.Left(DataGridView3.Rows(i).Cells("材料說明").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView3.Rows(i).Cells("材料說明").Value = BBNN13
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN4 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView3.Rows(i).Cells("備註").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN14 = Strings.Left(DataGridView3.Rows(i).Cells("備註").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView3.Rows(i).Cells("備註").Value = BBNN14
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN5 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView3.Rows(i).Cells("廠商").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN15 = Strings.Left(DataGridView3.Rows(i).Cells("廠商").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView3.Rows(i).Cells("廠商").Value = BBNN15
- Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
- End Sub
- '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Private Sub Set_讀取清單3()
- DataGridView4.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- DataGridView4.ColumnHeadersHeight = 25
- DataGridView4.AllowUserToAddRows = False
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT 部件, 材料名稱, 材料說明, 備註, 廠商, 流水號
- FROM 樣品訂單部件表
- WHERE (SO LIKE '" & DataGridView2.Rows(N2).Cells("SO").Value & "') AND (版次 LIKE '" & DataGridView2.Rows(N2).Cells("版次").Value & "') AND (部件 LIKE N'B.%')
- ORDER BY SO, 版次, 流水號, 部件"
- cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds3) : DataGridView4.DataSource = ds3.Tables(0) : conn.Close()
- End Sub
- Private Sub Set_清單3()
- DataGridView4.DataSource = Nothing : ds3.Clear()
- For i As Integer = 0 To DataGridView2.Rows.Count - 1
- If DataGridView2.Rows(i).Cells("版次").Value = "V01" Then
- N2 = i : Set_讀取清單3()
- ElseIf DataGridView2.Rows(i).Cells("版次").Value <> "V01" Then
- N2 = i : Set_讀取清單3()
- i = i + Val(Strings.Right(DataGridView2.Rows(i).Cells("版次").Value, 2)) - 1
- End If
- Next
- 去中文3()
- End Sub
- Private Sub 去中文3()
- BBNN1 = 0 : BBNN2 = 0 : BBNN3 = 0 : BBNN4 = 0 : BBNN5 = 0
- BBNN11 = "" : BBNN12 = "" : BBNN13 = "" : BBNN14 = "" : BBNN15 = ""
- For i As Integer = 0 To DataGridView4.Rows.Count - 1
- 資料數 = DataGridView4.Rows.Count : MyModule1.進度條()
- BBNN1 = DataGridView4.Rows(i).Cells("部件").Value.ToString.Length.ToString() : BBNN2 = DataGridView4.Rows(i).Cells("材料名稱").Value.ToString.Length.ToString()
- BBNN3 = DataGridView4.Rows(i).Cells("材料說明").Value.ToString.Length.ToString() : BBNN4 = DataGridView4.Rows(i).Cells("備註").Value.ToString.Length.ToString()
- BBNN5 = DataGridView4.Rows(i).Cells("廠商").Value.ToString.Length.ToString()
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN1 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView4.Rows(i).Cells("部件").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN11 = Strings.Left(DataGridView4.Rows(i).Cells("部件").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView4.Rows(i).Cells("部件").Value = BBNN11
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN2 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView4.Rows(i).Cells("材料名稱").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN12 = Strings.Left(DataGridView4.Rows(i).Cells("材料名稱").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView4.Rows(i).Cells("材料名稱").Value = BBNN12
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN3 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView4.Rows(i).Cells("材料說明").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN13 = Strings.Left(DataGridView4.Rows(i).Cells("材料說明").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView4.Rows(i).Cells("材料說明").Value = BBNN13
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN4 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView4.Rows(i).Cells("備註").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN14 = Strings.Left(DataGridView4.Rows(i).Cells("備註").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView4.Rows(i).Cells("備註").Value = BBNN14
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN5 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView4.Rows(i).Cells("廠商").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN15 = Strings.Left(DataGridView4.Rows(i).Cells("廠商").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView4.Rows(i).Cells("廠商").Value = BBNN15
- Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
- End Sub
- '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Private Sub Set_讀取清單4()
- DataGridView5.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- DataGridView5.ColumnHeadersHeight = 25
- DataGridView5.AllowUserToAddRows = False
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT 部件, 材料名稱, 材料說明, 備註, 廠商, 流水號
- FROM 樣品訂單部件表
- WHERE (SO LIKE '" & DataGridView2.Rows(N2).Cells("SO").Value & "') AND (版次 LIKE '" & DataGridView2.Rows(N2).Cells("版次").Value & "') AND (部件 LIKE N'C.%')
- ORDER BY SO, 版次, 流水號, 部件"
- cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds4) : DataGridView5.DataSource = ds4.Tables(0) : conn.Close()
- End Sub
- Private Sub Set_清單4()
- DataGridView5.DataSource = Nothing : ds4.Clear()
- For i As Integer = 0 To DataGridView2.Rows.Count - 1
- If DataGridView2.Rows(i).Cells("版次").Value = "V01" Then
- N2 = i : Set_讀取清單4()
- ElseIf DataGridView2.Rows(i).Cells("版次").Value <> "V01" Then
- N2 = i : Set_讀取清單4()
- i = i + Val(Strings.Right(DataGridView2.Rows(i).Cells("版次").Value, 2)) - 1
- End If
- Next
- 去中文4()
- End Sub
- Private Sub 去中文4()
- BBNN1 = 0 : BBNN2 = 0 : BBNN3 = 0 : BBNN4 = 0 : BBNN5 = 0
- BBNN11 = "" : BBNN12 = "" : BBNN13 = "" : BBNN14 = "" : BBNN15 = ""
- For i As Integer = 0 To DataGridView5.Rows.Count - 1
- 資料數 = DataGridView5.Rows.Count : MyModule1.進度條()
- BBNN1 = DataGridView5.Rows(i).Cells("部件").Value.ToString.Length.ToString() : BBNN2 = DataGridView5.Rows(i).Cells("材料名稱").Value.ToString.Length.ToString()
- BBNN3 = DataGridView5.Rows(i).Cells("材料說明").Value.ToString.Length.ToString() : BBNN4 = DataGridView5.Rows(i).Cells("備註").Value.ToString.Length.ToString()
- BBNN5 = DataGridView5.Rows(i).Cells("廠商").Value.ToString.Length.ToString()
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN1 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView5.Rows(i).Cells("部件").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN11 = Strings.Left(DataGridView5.Rows(i).Cells("部件").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView5.Rows(i).Cells("部件").Value = BBNN11
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN2 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView5.Rows(i).Cells("材料名稱").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN12 = Strings.Left(DataGridView5.Rows(i).Cells("材料名稱").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView5.Rows(i).Cells("材料名稱").Value = BBNN12
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN3 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView5.Rows(i).Cells("材料說明").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN13 = Strings.Left(DataGridView5.Rows(i).Cells("材料說明").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView5.Rows(i).Cells("材料說明").Value = BBNN13
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN4 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView5.Rows(i).Cells("備註").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN14 = Strings.Left(DataGridView5.Rows(i).Cells("備註").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView5.Rows(i).Cells("備註").Value = BBNN14
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN5 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView5.Rows(i).Cells("廠商").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN15 = Strings.Left(DataGridView5.Rows(i).Cells("廠商").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView5.Rows(i).Cells("廠商").Value = BBNN15
- Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
- End Sub
- '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Private Sub Set_讀取清單5()
- DataGridView6.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- DataGridView6.ColumnHeadersHeight = 25
- DataGridView6.AllowUserToAddRows = False
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT 部件, 材料名稱, 材料說明, 備註, 廠商, 流水號
- FROM 樣品訂單部件表
- WHERE (SO LIKE '" & DataGridView2.Rows(N2).Cells("SO").Value & "') AND (版次 LIKE '" & DataGridView2.Rows(N2).Cells("版次").Value & "') AND (部件 LIKE N'D.%')
- ORDER BY SO, 版次, 流水號, 部件"
- cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds5) : DataGridView6.DataSource = ds5.Tables(0) : conn.Close()
- End Sub
- Private Sub Set_清單5()
- DataGridView6.DataSource = Nothing : ds5.Clear()
- For i As Integer = 0 To DataGridView2.Rows.Count - 1
- If DataGridView2.Rows(i).Cells("版次").Value = "V01" Then
- N2 = i : Set_讀取清單5()
- ElseIf DataGridView2.Rows(i).Cells("版次").Value <> "V01" Then
- N2 = i : Set_讀取清單5()
- i = i + Val(Strings.Right(DataGridView2.Rows(i).Cells("版次").Value, 2)) - 1
- End If
- Next
- '去中文5()
- End Sub
- Private Sub 去中文5()
- BBNN1 = 0 : BBNN2 = 0 : BBNN3 = 0 : BBNN4 = 0 : BBNN5 = 0
- BBNN11 = "" : BBNN12 = "" : BBNN13 = "" : BBNN14 = "" : BBNN15 = ""
- For i As Integer = 0 To DataGridView6.Rows.Count - 1
- 資料數 = DataGridView6.Rows.Count : MyModule1.進度條()
- BBNN1 = DataGridView6.Rows(i).Cells("部件").Value.ToString.Length.ToString() : BBNN2 = DataGridView6.Rows(i).Cells("材料名稱").Value.ToString.Length.ToString()
- BBNN3 = DataGridView6.Rows(i).Cells("材料說明").Value.ToString.Length.ToString() : BBNN4 = DataGridView6.Rows(i).Cells("備註").Value.ToString.Length.ToString()
- BBNN5 = DataGridView6.Rows(i).Cells("廠商").Value.ToString.Length.ToString()
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN1 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView6.Rows(i).Cells("部件").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN11 = Strings.Left(DataGridView6.Rows(i).Cells("部件").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView6.Rows(i).Cells("部件").Value = BBNN11
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN2 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView6.Rows(i).Cells("材料名稱").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN12 = Strings.Left(DataGridView6.Rows(i).Cells("材料名稱").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView6.Rows(i).Cells("材料名稱").Value = BBNN12
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN3 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView6.Rows(i).Cells("材料說明").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN13 = Strings.Left(DataGridView6.Rows(i).Cells("材料說明").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView6.Rows(i).Cells("材料說明").Value = BBNN13
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN4 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView6.Rows(i).Cells("備註").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN14 = Strings.Left(DataGridView6.Rows(i).Cells("備註").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView6.Rows(i).Cells("備註").Value = BBNN14
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN5 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView6.Rows(i).Cells("廠商").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN15 = Strings.Left(DataGridView6.Rows(i).Cells("廠商").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView6.Rows(i).Cells("廠商").Value = BBNN15
- Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
- End Sub
- '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Private Sub Set_讀取清單6()
- DataGridView7.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- DataGridView7.ColumnHeadersHeight = 25
- DataGridView7.AllowUserToAddRows = False
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT 部件, 材料名稱, 材料說明, 備註, 廠商, 流水號
- FROM 樣品訂單部件表
- WHERE (SO LIKE '" & DataGridView2.Rows(N2).Cells("SO").Value & "') AND (版次 LIKE '" & DataGridView2.Rows(N2).Cells("版次").Value & "') AND (部件 LIKE N'E.%')
- ORDER BY SO, 版次, 流水號, 部件"
- cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds6) : DataGridView7.DataSource = ds6.Tables(0) : conn.Close()
- End Sub
- Private Sub Set_清單6()
- DataGridView7.DataSource = Nothing : ds6.Clear()
- For i As Integer = 0 To DataGridView2.Rows.Count - 1
- If DataGridView2.Rows(i).Cells("版次").Value = "V01" Then
- N2 = i : Set_讀取清單6()
- ElseIf DataGridView2.Rows(i).Cells("版次").Value <> "V01" Then
- N2 = i : Set_讀取清單6()
- i = i + Val(Strings.Right(DataGridView2.Rows(i).Cells("版次").Value, 2)) - 1
- End If
- Next
- '去中文6()
- End Sub
- Private Sub 去中文6()
- BBNN1 = 0 : BBNN2 = 0 : BBNN3 = 0 : BBNN4 = 0 : BBNN5 = 0
- BBNN11 = "" : BBNN12 = "" : BBNN13 = "" : BBNN14 = "" : BBNN15 = ""
- For i As Integer = 0 To DataGridView7.Rows.Count - 1
- 資料數 = DataGridView7.Rows.Count : MyModule1.進度條()
- BBNN1 = DataGridView7.Rows(i).Cells("部件").Value.ToString.Length.ToString() : BBNN2 = DataGridView7.Rows(i).Cells("材料名稱").Value.ToString.Length.ToString()
- BBNN3 = DataGridView7.Rows(i).Cells("材料說明").Value.ToString.Length.ToString() : BBNN4 = DataGridView7.Rows(i).Cells("備註").Value.ToString.Length.ToString()
- BBNN5 = DataGridView7.Rows(i).Cells("廠商").Value.ToString.Length.ToString()
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN1 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView7.Rows(i).Cells("部件").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN11 = Strings.Left(DataGridView7.Rows(i).Cells("部件").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView7.Rows(i).Cells("部件").Value = BBNN11
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN2 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView7.Rows(i).Cells("材料名稱").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN12 = Strings.Left(DataGridView7.Rows(i).Cells("材料名稱").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView7.Rows(i).Cells("材料名稱").Value = BBNN12
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN3 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView7.Rows(i).Cells("材料說明").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN13 = Strings.Left(DataGridView7.Rows(i).Cells("材料說明").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView7.Rows(i).Cells("材料說明").Value = BBNN13
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN4 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView7.Rows(i).Cells("備註").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN14 = Strings.Left(DataGridView7.Rows(i).Cells("備註").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView7.Rows(i).Cells("備註").Value = BBNN14
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN5 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView7.Rows(i).Cells("廠商").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN15 = Strings.Left(DataGridView7.Rows(i).Cells("廠商").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView7.Rows(i).Cells("廠商").Value = BBNN15
- Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
- End Sub
- '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Private Sub Set_讀取清單7()
- DataGridView8.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- DataGridView8.ColumnHeadersHeight = 25
- DataGridView8.AllowUserToAddRows = False
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT 部件, 材料名稱, 材料說明, 備註, 廠商, 流水號
- FROM 樣品訂單部件表
- WHERE (SO LIKE '" & DataGridView2.Rows(N2).Cells("SO").Value & "') AND (版次 LIKE '" & DataGridView2.Rows(N2).Cells("版次").Value & "') AND (部件 LIKE N'F.%')
- ORDER BY SO, 版次, 流水號, 部件"
- cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds7) : DataGridView8.DataSource = ds7.Tables(0) : conn.Close()
- End Sub
- Private Sub Set_清單7()
- DataGridView8.DataSource = Nothing : ds7.Clear()
- For i As Integer = 0 To DataGridView2.Rows.Count - 1
- If DataGridView2.Rows(i).Cells("版次").Value = "V01" Then
- N2 = i : Set_讀取清單7()
- ElseIf DataGridView2.Rows(i).Cells("版次").Value <> "V01" Then
- N2 = i : Set_讀取清單7()
- i = i + Val(Strings.Right(DataGridView2.Rows(i).Cells("版次").Value, 2)) - 1
- End If
- Next
- 去中文7()
- End Sub
- Private Sub 去中文7()
- BBNN1 = 0 : BBNN2 = 0 : BBNN3 = 0 : BBNN4 = 0 : BBNN5 = 0
- BBNN11 = "" : BBNN12 = "" : BBNN13 = "" : BBNN14 = "" : BBNN15 = ""
- For i As Integer = 0 To DataGridView8.Rows.Count - 1
- 資料數 = DataGridView8.Rows.Count : MyModule1.進度條()
- BBNN1 = DataGridView8.Rows(i).Cells("部件").Value.ToString.Length.ToString() : BBNN2 = DataGridView8.Rows(i).Cells("材料名稱").Value.ToString.Length.ToString()
- BBNN3 = DataGridView8.Rows(i).Cells("材料說明").Value.ToString.Length.ToString() : BBNN4 = DataGridView8.Rows(i).Cells("備註").Value.ToString.Length.ToString()
- BBNN5 = DataGridView8.Rows(i).Cells("廠商").Value.ToString.Length.ToString()
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN1 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView8.Rows(i).Cells("部件").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN11 = Strings.Left(DataGridView8.Rows(i).Cells("部件").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView8.Rows(i).Cells("部件").Value = BBNN11
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN2 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView8.Rows(i).Cells("材料名稱").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN12 = Strings.Left(DataGridView8.Rows(i).Cells("材料名稱").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView8.Rows(i).Cells("材料名稱").Value = BBNN12
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN3 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView8.Rows(i).Cells("材料說明").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN13 = Strings.Left(DataGridView8.Rows(i).Cells("材料說明").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView8.Rows(i).Cells("材料說明").Value = BBNN13
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN4 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView8.Rows(i).Cells("備註").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN14 = Strings.Left(DataGridView8.Rows(i).Cells("備註").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView8.Rows(i).Cells("備註").Value = BBNN14
- '--------------------------------------------------------------------------------------------
- For II As Integer = 0 To BBNN5 - 1
- If II = 0 Then
- AAWW = Strings.Left(DataGridView8.Rows(i).Cells("廠商").Value.ToString, 1)
- If RRTT.IsMatch(AAWW) Then : Else : BBNN15 = Strings.Left(DataGridView8.Rows(i).Cells("廠商").Value.ToString, 1) : End If
- Else
- 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
- End If
- Next : DataGridView8.Rows(i).Cells("廠商").Value = BBNN15
- Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
- End Sub
- '----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Private Sub Set_讀取清單()
- DataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- DataGridView1.ColumnHeadersHeight = 25
- DataGridView1.AllowUserToAddRows = False
- DataGridView1.RowTemplate.Height = 140
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT 樣品訂單控制表.SO AS 序號, 鞋樣素描圖控制表.圖片, 樣品訂單控制表.SO, 樣品訂單控制表.版次, 樣品訂單控制表.型體號碼, 樣品訂單控制表.型體名稱 AS STYLE, 樣品訂單控制表.工廠,
- 樣品訂單控制表.ISS_DATE, 樣品訂單控制表.ETA, 樣品訂單清單.顏色, 樣品訂單清單.數量, 樣品訂單清單.SIZE, 樣品訂單清單.KEEP, 樣品訂單清單.流水號, 樣品訂單清單.流水號 AS UPPER,
- 樣品訂單清單.流水號 AS LINING, 樣品訂單清單.流水號 AS BUCKLE, 樣品訂單清單.流水號 AS [SOCK LINING], 樣品訂單清單.流水號 AS BOTTOM, 樣品訂單清單.流水號 AS OTHER
- FROM 樣品訂單控制表 LEFT OUTER JOIN 鞋樣素描圖控制表 ON 樣品訂單控制表.型體號碼 = 鞋樣素描圖控制表.型體編號 AND 樣品訂單控制表.型體名稱 = 鞋樣素描圖控制表.型體名稱 FULL OUTER JOIN
- 樣品訂單清單 ON 樣品訂單控制表.SO = 樣品訂單清單.SO AND 樣品訂單控制表.版次 = 樣品訂單清單.版次
- WHERE (樣品訂單控制表.季節 LIKE N'" & ComboBox7.Text & "') AND (樣品訂單控制表.客戶 LIKE N'" & ComboBox2.Text & "') AND
- (樣品訂單控制表.狀態 LIKE N'" & 樣品進度表分類2 & "') AND (樣品訂單控制表.SO LIKE '" & DataGridView2.Rows(N2).Cells("SO").Value & "') AND
- (樣品訂單控制表.版次 LIKE '" & DataGridView2.Rows(N2).Cells("版次").Value & "')
- ORDER BY 型體號碼, 樣品訂單控制表.SO, 樣品訂單控制表.版次 DESC"
- cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds) : DataGridView1.DataSource = ds.Tables(0) : conn.Close() : Set_grid()
- End Sub
- Private Sub Set_清單()
- DataGridView1.DataSource = Nothing : ds.Clear()
- For i As Integer = 0 To DataGridView2.Rows.Count - 1
- If DataGridView2.Rows(i).Cells("版次").Value = "V01" Then
- N2 = i : Set_讀取清單()
- ElseIf DataGridView2.Rows(i).Cells("版次").Value <> "V01" Then
- N2 = i : Set_讀取清單()
- i = i + Val(Strings.Right(DataGridView2.Rows(i).Cells("版次").Value, 2)) - 1
- End If
- Next
- End Sub
- Private Sub Set_grid()
- 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
- DataGridView1.Columns(5).Width = 100 : DataGridView1.Columns(6).Width = 80 : DataGridView1.Columns(7).Visible = False : DataGridView1.Columns(8).Width = 80
- DataGridView1.Columns(9).Width = 100 : DataGridView1.Columns(10).Width = 40 : DataGridView1.Columns(11).Width = 40 : DataGridView1.Columns(12).Visible = False
- DataGridView1.Columns(13).Visible = False : DataGridView1.Columns(14).Width = 250 : DataGridView1.Columns(15).Width = 250 : DataGridView1.Columns(16).Width = 200
- DataGridView1.Columns(17).Width = 200 : DataGridView1.Columns(18).Width = 200 : DataGridView1.Columns(19).Width = 130
-
- DataGridView1.Columns(10).DefaultCellStyle.Format = "#,##0.0" : DataGridView1.Columns(12).DefaultCellStyle.Format = "#,##0.0"
- DataGridView1.Columns(10).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(12).DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight
- DataGridView1.Columns(10).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight : DataGridView1.Columns(12).HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight
- DataGridView1.EditMode = DataGridViewEditMode.EditOnEnter
- N1 = 1
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
- If i = DataGridView1.Rows.Count - 1 Then
- DataGridView1.Rows(i).Cells("序號").Value = N1.ToString : Exit For
- Else
- If DataGridView1(4, i).Value.ToString <> DataGridView1(4, i + 1).Value.ToString Then
- DataGridView1.Rows(i).Cells("序號").Value = N1.ToString : N1 = N1 + 1
- Else
- DataGridView1.Rows(i).Cells("序號").Value = N1.ToString
- End If
- End If
- Next
- End Sub
- Private Sub Set_grid0()
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
- DataGridView1.Rows(i).Cells("STYLE").Value = DataGridView1.Rows(i).Cells("型體號碼").Value & "
- " & DataGridView1.Rows(i).Cells("STYLE").Value & "
-
- " & DataGridView1.Rows(i).Cells("SO").Value
- Next
- Dim mycol As DataGridViewImageColumn = DataGridView1.Columns("圖片")
- mycol.ImageLayout = DataGridViewImageCellLayout.Zoom
- End Sub
- Private Sub Set_清單8()
- DataGridView9.DataSource = Nothing : ds8.Clear()
- DataGridView9.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing
- DataGridView9.ColumnHeadersHeight = 25
- DataGridView9.AllowUserToAddRows = False
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT 季節, 客戶 FROM 樣品訂單控制表 WHERE (狀態 LIKE '" & 樣品進度表分類2 & "') GROUP BY 季節, 客戶 ORDER BY 客戶, 季節"
- cmd.Connection = conn : cmd.CommandText = SQL1 : da.SelectCommand = cmd : da.Fill(ds8) : DataGridView9.DataSource = ds8.Tables(0) : conn.Close() : Set_grid8()
- End Sub
- Private Sub Set_grid8()
- DataGridView9.Columns(0).Width = 120 : DataGridView9.Columns(1).Width = 240
- End Sub
- Private Sub 導入A類料()
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
- 資料數 = DataGridView1.Rows.Count : MyModule1.進度條()
- DataGridView1.Rows(i).Cells("UPPER").Value = ""
- Dim aa As Integer = 1
- For ii As Integer = 0 To DataGridView3.Rows.Count - 1
- If DataGridView1.Rows(i).Cells("流水號").Value = DataGridView3.Rows(ii).Cells("流水號").Value Then
- If aa = 1 Then
- If DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView3.Rows(ii).Cells("材料說明").Value & "-" & DataGridView3.Rows(ii).Cells("備註").Value & "-" & DataGridView3.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView3.Rows(ii).Cells("材料說明").Value & "-" & DataGridView3.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView3.Rows(ii).Cells("材料說明").Value & "-" & DataGridView3.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView3.Rows(ii).Cells("備註").Value & "-" & DataGridView3.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView3.Rows(ii).Cells("備註").Value & "-" & DataGridView3.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView3.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView3.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView3.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView3.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView3.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("備註").Value &
- "-" & DataGridView3.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("廠商").Value
- End If
- aa += 1
- Else
- If DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
- " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView3.Rows(ii).Cells("材料說明").Value & "-" & DataGridView3.Rows(ii).Cells("備註").Value & "-" & DataGridView3.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
- " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView3.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView3.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
- " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView3.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView3.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
- " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView3.Rows(ii).Cells("備註").Value &
- "-" & DataGridView3.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
- " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料說明").Value & "-" & DataGridView3.Rows(ii).Cells("備註").Value &
- "-" & DataGridView3.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
- " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView3.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
- " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView3.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
- " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料說明").Value & "-" & DataGridView3.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
- " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView3.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
- " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料說明").Value & "-" & DataGridView3.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
- " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("備註").Value & "-" & DataGridView3.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
- " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料名稱").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
- " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
- " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView3.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView3.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView3.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView3.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("UPPER").Value = DataGridView1.Rows(i).Cells("UPPER").Value & "
- " & aa & "、" & DataGridView3.Rows(ii).Cells("部件").Value & " - " & DataGridView3.Rows(ii).Cells("廠商").Value
- End If
- aa += 1
- End If
- End If
- Next
- Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
- End Sub
- Private Sub 導入B類料()
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
- 資料數 = DataGridView1.Rows.Count : MyModule1.進度條()
- DataGridView1.Rows(i).Cells("LINING").Value = ""
- Dim aa As Integer = 1
- For ii As Integer = 0 To DataGridView4.Rows.Count - 1
- If DataGridView1.Rows(i).Cells("流水號").Value = DataGridView4.Rows(ii).Cells("流水號").Value Then
- If aa = 1 Then
- If DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView4.Rows(ii).Cells("材料說明").Value & "-" & DataGridView4.Rows(ii).Cells("備註").Value & "-" & DataGridView4.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView4.Rows(ii).Cells("材料說明").Value & "-" & DataGridView4.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView4.Rows(ii).Cells("材料說明").Value & "-" & DataGridView4.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView4.Rows(ii).Cells("備註").Value & "-" & DataGridView4.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView4.Rows(ii).Cells("備註").Value & "-" & DataGridView4.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView4.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView4.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView4.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView4.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView4.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("備註").Value &
- "-" & DataGridView4.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("廠商").Value
- End If
- aa += 1
- Else
- If DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
- " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView4.Rows(ii).Cells("材料說明").Value & "-" & DataGridView4.Rows(ii).Cells("備註").Value & "-" & DataGridView4.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
- " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView4.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView4.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
- " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView4.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView4.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
- " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView4.Rows(ii).Cells("備註").Value &
- "-" & DataGridView4.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
- " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料說明").Value & "-" & DataGridView4.Rows(ii).Cells("備註").Value &
- "-" & DataGridView4.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
- " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView4.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
- " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView4.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
- " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料說明").Value & "-" & DataGridView4.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
- " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView4.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
- " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料說明").Value & "-" & DataGridView4.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
- " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("備註").Value & "-" & DataGridView4.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
- " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料名稱").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
- " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
- " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView4.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView4.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView4.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView4.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("LINING").Value = DataGridView1.Rows(i).Cells("LINING").Value & "
- " & aa & "、" & DataGridView4.Rows(ii).Cells("部件").Value & " - " & DataGridView4.Rows(ii).Cells("廠商").Value
- End If
- aa += 1
- End If
- End If
- Next
- Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
- End Sub
- Private Sub 導入C類料()
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
- 資料數 = DataGridView1.Rows.Count : MyModule1.進度條()
- DataGridView1.Rows(i).Cells("BUCKLE").Value = ""
- Dim aa As Integer = 1
- For ii As Integer = 0 To DataGridView5.Rows.Count - 1
- If DataGridView1.Rows(i).Cells("流水號").Value = DataGridView5.Rows(ii).Cells("流水號").Value Then
- If aa = 1 Then
- If DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView5.Rows(ii).Cells("材料說明").Value & "-" & DataGridView5.Rows(ii).Cells("備註").Value & "-" & DataGridView5.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView5.Rows(ii).Cells("材料說明").Value & "-" & DataGridView5.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView5.Rows(ii).Cells("材料說明").Value & "-" & DataGridView5.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView5.Rows(ii).Cells("備註").Value & "-" & DataGridView5.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView5.Rows(ii).Cells("備註").Value & "-" & DataGridView5.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView5.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView5.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView5.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView5.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView5.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("備註").Value &
- "-" & DataGridView5.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("廠商").Value
- End If
- aa += 1
- Else
- If DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
- " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView5.Rows(ii).Cells("材料說明").Value & "-" & DataGridView5.Rows(ii).Cells("備註").Value & "-" & DataGridView5.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
- " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView5.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView5.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
- " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView5.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView5.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
- " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView5.Rows(ii).Cells("備註").Value &
- "-" & DataGridView5.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
- " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料說明").Value & "-" & DataGridView5.Rows(ii).Cells("備註").Value &
- "-" & DataGridView5.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
- " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView5.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
- " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView5.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
- " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料說明").Value & "-" & DataGridView5.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
- " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView5.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
- " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料說明").Value & "-" & DataGridView5.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
- " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("備註").Value & "-" & DataGridView5.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
- " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料名稱").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
- " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
- " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView5.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView5.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView5.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView5.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BUCKLE").Value = DataGridView1.Rows(i).Cells("BUCKLE").Value & "
- " & aa & "、" & DataGridView5.Rows(ii).Cells("部件").Value & " - " & DataGridView5.Rows(ii).Cells("廠商").Value
- End If
- aa += 1
- End If
- End If
- Next
- Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
- End Sub
- Private Sub 導入D類料()
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
- 資料數 = DataGridView1.Rows.Count : MyModule1.進度條()
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = ""
- Dim aa As Integer = 1
- For ii As Integer = 0 To DataGridView6.Rows.Count - 1
- If DataGridView1.Rows(i).Cells("流水號").Value = DataGridView6.Rows(ii).Cells("流水號").Value Then
- If aa = 1 Then
- If DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView6.Rows(ii).Cells("材料說明").Value & "-" & DataGridView6.Rows(ii).Cells("備註").Value & "-" & DataGridView6.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView6.Rows(ii).Cells("材料說明").Value & "-" & DataGridView6.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView6.Rows(ii).Cells("材料說明").Value & "-" & DataGridView6.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView6.Rows(ii).Cells("備註").Value & "-" & DataGridView6.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView6.Rows(ii).Cells("備註").Value & "-" & DataGridView6.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView6.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView6.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView6.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView6.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView6.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("備註").Value &
- "-" & DataGridView6.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("廠商").Value
- End If
- aa += 1
- Else
- If DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
- " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView6.Rows(ii).Cells("材料說明").Value & "-" & DataGridView6.Rows(ii).Cells("備註").Value & "-" & DataGridView6.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
- " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView6.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView6.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
- " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView6.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView6.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
- " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView6.Rows(ii).Cells("備註").Value &
- "-" & DataGridView6.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
- " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料說明").Value & "-" & DataGridView6.Rows(ii).Cells("備註").Value &
- "-" & DataGridView6.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
- " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView6.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
- " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView6.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
- " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料說明").Value & "-" & DataGridView6.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
- " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView6.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
- " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料說明").Value & "-" & DataGridView6.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
- " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("備註").Value & "-" & DataGridView6.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
- " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料名稱").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
- " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
- " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView6.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView6.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView6.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView6.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("SOCK LINING").Value = DataGridView1.Rows(i).Cells("SOCK LINING").Value & "
- " & aa & "、" & DataGridView6.Rows(ii).Cells("部件").Value & " - " & DataGridView6.Rows(ii).Cells("廠商").Value
- End If
- aa += 1
- End If
- End If
- Next
- Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
- End Sub
- Private Sub 導入E類料()
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
- 資料數 = DataGridView1.Rows.Count : MyModule1.進度條()
- DataGridView1.Rows(i).Cells("BOTTOM").Value = ""
- Dim aa As Integer = 1
- For ii As Integer = 0 To DataGridView7.Rows.Count - 1
- If DataGridView1.Rows(i).Cells("流水號").Value = DataGridView7.Rows(ii).Cells("流水號").Value Then
- If aa = 1 Then
- If DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView7.Rows(ii).Cells("材料說明").Value & "-" & DataGridView7.Rows(ii).Cells("備註").Value & "-" & DataGridView7.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView7.Rows(ii).Cells("材料說明").Value & "-" & DataGridView7.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView7.Rows(ii).Cells("材料說明").Value & "-" & DataGridView7.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView7.Rows(ii).Cells("備註").Value & "-" & DataGridView7.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView7.Rows(ii).Cells("備註").Value & "-" & DataGridView7.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value & " - ".ToString = "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & DataGridView7.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView7.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView7.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView7.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView7.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView7.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("備註").Value &
- "-" & DataGridView7.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("廠商").Value
- End If
- aa += 1
- Else
- If DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
- " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView7.Rows(ii).Cells("材料說明").Value & "-" & DataGridView7.Rows(ii).Cells("備註").Value & "-" & DataGridView7.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
- " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView7.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView7.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
- " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView7.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView7.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
- " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView7.Rows(ii).Cells("備註").Value &
- "-" & DataGridView7.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
- " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料說明").Value & "-" & DataGridView7.Rows(ii).Cells("備註").Value &
- "-" & DataGridView7.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
- " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView7.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
- " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView7.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
- " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料說明").Value & "-" & DataGridView7.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
- " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView7.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
- " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料說明").Value & "-" & DataGridView7.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
- " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("備註").Value & "-" & DataGridView7.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
- " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料名稱").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
- " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
- " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView7.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView7.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView7.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView7.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("BOTTOM").Value = DataGridView1.Rows(i).Cells("BOTTOM").Value & "
- " & aa & "、" & DataGridView7.Rows(ii).Cells("部件").Value & " - " & DataGridView7.Rows(ii).Cells("廠商").Value
- End If
- aa += 1
- End If
- End If
- Next
- Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
- End Sub
- Private Sub 導入F類料()
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
- 資料數 = DataGridView1.Rows.Count : MyModule1.進度條()
- DataGridView1.Rows(i).Cells("OTHER").Value = ""
- Dim aa As Integer = 1
- For ii As Integer = 0 To DataGridView8.Rows.Count - 1
- If DataGridView1.Rows(i).Cells("流水號").Value = DataGridView8.Rows(ii).Cells("流水號").Value Then
- If aa = 1 Then
- If DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView8.Rows(ii).Cells("材料說明").Value & "-" & DataGridView8.Rows(ii).Cells("備註").Value & "-" & DataGridView8.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView8.Rows(ii).Cells("材料說明").Value & "-" & DataGridView8.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView8.Rows(ii).Cells("材料說明").Value & "-" & DataGridView8.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView8.Rows(ii).Cells("備註").Value & "-" & DataGridView8.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView8.Rows(ii).Cells("備註").Value & "-" & DataGridView8.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView8.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView8.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView8.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView8.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView8.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("備註").Value &
- "-" & DataGridView8.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("廠商").Value
- End If
- aa += 1
- Else
- If DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
- " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value &
- "-" & DataGridView8.Rows(ii).Cells("材料說明").Value & "-" & DataGridView8.Rows(ii).Cells("備註").Value & "-" & DataGridView8.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
- " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView8.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView8.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
- " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView8.Rows(ii).Cells("材料說明").Value &
- "-" & DataGridView8.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
- " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView8.Rows(ii).Cells("備註").Value &
- "-" & DataGridView8.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
- " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料說明").Value & "-" & DataGridView8.Rows(ii).Cells("備註").Value &
- "-" & DataGridView8.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
- " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView8.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
- " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView8.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
- " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料說明").Value & "-" & DataGridView8.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
- " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value & "-" & DataGridView8.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
- " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料說明").Value & "-" & DataGridView8.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
- " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("備註").Value & "-" & DataGridView8.Rows(ii).Cells("廠商").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
- " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料名稱").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString <> "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
- " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("材料說明").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString <> "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString = "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
- " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("備註").Value
-
- ElseIf DataGridView8.Rows(ii).Cells("材料名稱").Value.ToString = "" And DataGridView8.Rows(ii).Cells("材料說明").Value.ToString = "" And
- DataGridView8.Rows(ii).Cells("備註").Value.ToString = "" And DataGridView8.Rows(ii).Cells("廠商").Value.ToString <> "" Then
- DataGridView1.Rows(i).Cells("OTHER").Value = DataGridView1.Rows(i).Cells("OTHER").Value & "
- " & aa & "、" & DataGridView8.Rows(ii).Cells("部件").Value & " - " & DataGridView8.Rows(ii).Cells("廠商").Value
- End If
- aa += 1
- End If
- End If
- Next
- Next : WINPROFIT_ERP_SYS.ToolStripProgressBar1.Value = 0 : 最終數 = 0
- End Sub
- Private Sub ComboBox7下拉表單資料載入()
- conn.Close()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT SEASON FROM 季節清單 ORDER BY SEASON"
- cmd.CommandText = SQL1 : cmd.Connection = conn : dr = cmd.ExecuteReader
- ComboBox7.Items.Clear() : While (dr.Read()) : ComboBox7.Items.Add(dr("SEASON")) : End While : conn.Close()
- End Sub
- Private Sub ComboBox2下拉表單資料載入()
- conn.Close()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT 客戶簡稱 FROM 客戶控制表 ORDER BY 客戶簡稱"
- cmd.CommandText = SQL1 : cmd.Connection = conn : dr = cmd.ExecuteReader
- ComboBox2.Items.Clear() : While (dr.Read()) : ComboBox2.Items.Add(dr("客戶簡稱")) : End While : conn.Close()
- End Sub
- Private Sub 樣品進度表_英文版__Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Me.MdiParent = WINPROFIT_ERP_SYS : Me.WindowState = 2 : Me.AutoScroll = True
- ComboBox7下拉表單資料載入() : ComboBox2下拉表單資料載入()
- DataGridView2.Visible = False : DataGridView3.Visible = False : DataGridView4.Visible = False : DataGridView5.Visible = False : DataGridView6.Visible = False : DataGridView7.Visible = False
- DataGridView8.Visible = False : GroupBox1.Visible = False : ComboBox7.Enabled = False : ComboBox2.Enabled = False
- End Sub
- Private Sub DataGridView1_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView1.RowPostPaint
- Dim linePen As New Pen(Color.Blue, 2)
- If e.RowIndex = DataGridView1.Rows.Count - 1 Then
- Exit Sub
- Else
- If DataGridView1(0, e.RowIndex).Value.ToString <> DataGridView1(0, e.RowIndex + 1).Value.ToString Then
- Dim startX As Integer = IIf(DataGridView1.RowHeadersVisible, DataGridView1.RowHeadersWidth, 0)
- Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
- Dim endX As Integer = startX + DataGridView1.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView1.HorizontalScrollingOffset
- e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
- Exit Sub
- End If
- End If
- End Sub
- Private Sub DataGridView8_RowPostPaint(ByVal sender As Object, ByVal e As DataGridViewRowPostPaintEventArgs) Handles DataGridView8.RowPostPaint
- Dim linePen As New Pen(Color.Blue, 2)
- If e.RowIndex = DataGridView8.Rows.Count - 1 Then
- Exit Sub
- Else
- If DataGridView8(0, e.RowIndex).Value.ToString <> DataGridView8(0, e.RowIndex + 1).Value.ToString Then
- Dim startX As Integer = IIf(DataGridView8.RowHeadersVisible, DataGridView8.RowHeadersWidth, 0)
- Dim startY As Integer = e.RowBounds.Top + e.RowBounds.Height - 1
- Dim endX As Integer = startX + DataGridView8.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) - DataGridView8.HorizontalScrollingOffset
- e.Graphics.DrawLine(linePen, startX, startY, endX, startY)
- Exit Sub
- End If
- End If
- End Sub
- Private Sub DataGridView9_CellClick(ByVal sender As System.Object, ByVal e As DataGridViewCellEventArgs) Handles DataGridView9.CellClick
- If e.RowIndex = -1 Then : Else
- ComboBox7下拉表單資料載入() : ComboBox2下拉表單資料載入()
- ComboBox7.Text = DataGridView9.Rows(e.RowIndex).Cells("季節").Value
- ComboBox2.Text = DataGridView9.Rows(e.RowIndex).Cells("客戶").Value
- End If
- End Sub
- Private Sub ComboBox7_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox7.SelectedIndexChanged
- If ComboBox7.Text = "" Or ComboBox2.Text = "" Then : Else : Set_清單1() : Set_清單2() : Set_清單3() : Set_清單4() : Set_清單5() : Set_清單6() : Set_清單7() : Set_清單()
- 導入A類料() : 導入B類料() : 導入C類料() : 導入D類料() : 導入E類料() : 導入F類料() : Set_grid0() : ComboBox7.Enabled = False : ComboBox2.Enabled = False : End If
- End Sub
- Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedIndexChanged
- If ComboBox7.Text = "" Or ComboBox2.Text = "" Then : Else : Set_清單1() : Set_清單2() : Set_清單3() : Set_清單4() : Set_清單5() : Set_清單6() : Set_清單7() : Set_清單()
- 導入A類料() : 導入B類料() : 導入C類料() : 導入D類料() : 導入E類料() : 導入F類料() : Set_grid0() : ComboBox7.Enabled = False : ComboBox2.Enabled = False : End If
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- ComboBox7.Enabled = True : ComboBox2.Enabled = True
- ComboBox7下拉表單資料載入() : ComboBox2下拉表單資料載入()
- End Sub
- Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
- GroupBox1.Visible = False
- End Sub
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- Set_清單8()
- GroupBox1.Visible = True
- End Sub
- Private Sub 圖片導入2()
- If conn.State = ConnectionState.Closed Then : conn.ConnectionString = ConString : conn.Open() : End If
- SQL1 = "SELECT TOP (1) 圖片 FROM 鞋樣素描圖控制表 WHERE 型體編號 LIKE N'" & SSDD & "'"
- cmd.Connection = conn : cmd.CommandText = SQL1 : dr = cmd.ExecuteReader
- PictureBox2.Image = Nothing
- While dr.Read() = True
- Dim bytes As Byte() = New Byte(-1) {}
- bytes = DirectCast(dr.Item("圖片"), Byte())
- Dim oStream As New MemoryStream(bytes)
- PictureBox2.Image = Bitmap.FromStream(oStream)
- End While
- conn.Close()
- PictureBox2.SizeMode = 4
- End Sub
- Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
- xlApp = CType(CreateObject("Excel.Application"), Application)
- xlBook = xlApp.Workbooks.Add
- xlApp.DisplayAlerts = True
- xlBook.Activate()
- xlSheet = NewMethod(xlBook)
- xlSheet.Activate()
- xlApp.Visible = True
- xlApp.Application.WindowState = xlMaximized
- FFGG = DataGridView1.Rows.Count + 3
- AA(xlApp, xlSheet)
- xlSheet.Cells(1, 1) = ComboBox2.Text & " - " & ComboBox7.Text & " - " & 樣品進度表分類2 & " - " & "SAMPLE SCHEDULE"
- xlSheet.Cells(3, 1) = "No."
- xlSheet.Cells(3, 2) = "工廠"
- xlSheet.Cells(3, 3) = "Picture "
- xlSheet.Cells(3, 4) = "STYLE"
- xlSheet.Cells(3, 5) = "C_No"
- xlSheet.Cells(3, 6) = "Color"
- xlSheet.Cells(3, 7) = "SIZE"
- xlSheet.Cells(3, 8) = "UPPER_____A."
- xlSheet.Cells(3, 9) = "LINING_____B."
- xlSheet.Cells(3, 10) = "STITCHING_____F."
- xlSheet.Cells(3, 11) = "ACCESSORIES_____C."
- xlSheet.Cells(3, 12) = "SOCK LINING_____D."
- xlSheet.Cells(3, 13) = "BOTTOM_____E."
- xlSheet.Cells(3, 14) = "Double"
- xlSheet.Cells(3, 15) = "ETD"
- xlSheet.Cells(3, 16) = "Remark"
- xlSheet.Cells(3, 17) = "Express number"
- Dim VVBB As String = "0"
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
- N3 = i + 4
- SSDD = DataGridView1.Rows(i).Cells("型體號碼").Value
- If VVBB <> SSDD Then
- 圖片導入2() : N6 = 1
- For ii As Integer = 0 To 20
- If PictureBox2.Image Is Nothing Then
- Thread.Sleep(100) '延迟0.1秒
- Else
- BB(xlApp, xlSheet)
- ii = 20
- End If
- Next ii
- End If
- VVBB = SSDD
- xlSheet.Cells(i + 4, 1) = DataGridView1.Rows(i).Cells("序號").Value
- xlSheet.Cells(i + 4, 2) = DataGridView1.Rows(i).Cells("工廠").Value
- xlSheet.Cells(i + 4, 4) = DataGridView1.Rows(i).Cells("STYLE").Value
- xlSheet.Cells(i + 4, 5) = N6
- xlSheet.Cells(i + 4, 6) = DataGridView1.Rows(i).Cells("顏色").Value
- xlSheet.Cells(i + 4, 7) = DataGridView1.Rows(i).Cells("SIZE").Value
- xlSheet.Cells(i + 4, 8) = DataGridView1.Rows(i).Cells("UPPER").Value
- xlSheet.Cells(i + 4, 9) = DataGridView1.Rows(i).Cells("LINING").Value
- xlSheet.Cells(i + 4, 10) = DataGridView1.Rows(i).Cells("OTHER").Value
- xlSheet.Cells(i + 4, 11) = DataGridView1.Rows(i).Cells("BUCKLE").Value
- xlSheet.Cells(i + 4, 12) = DataGridView1.Rows(i).Cells("SOCK LINING").Value
- xlSheet.Cells(i + 4, 13) = DataGridView1.Rows(i).Cells("BOTTOM").Value
- xlSheet.Cells(i + 4, 14) = DataGridView1.Rows(i).Cells("數量").Value
- xlSheet.Cells(i + 4, 15) = DataGridView1.Rows(i).Cells("ETA").Value
- N6 = N6 + 1
- Next i
- CC(xlApp, xlSheet)
- xlSheet.PageSetup.PrintArea = ""
- xlApp.Cells.Select()
- xlSheet.Range("B1").Select()
- xlApp.Application.WindowState = xlMinimized
- MsgBox("列印完成")
- End Sub
-
- Private Shared Function NewMethod(xlBook As Workbook) As Worksheet
- Return CType(xlBook.Worksheets.Add, Worksheet)
- End Function
- Private Sub AA(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
- xlSheet.Cells.Select()
- With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 12 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
- .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
- xlSheet.Rows("4:" & FFGG).Select
- With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 8 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
- .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
- myExcel.Selection.RowHeight = 90
- With myExcel.Selection : .HorizontalAlignment = xlGeneral : .VerticalAlignment = xlCenter : .WrapText = True : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0
- .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
-
- xlSheet.Columns("A:A").Select : myExcel.Selection.ColumnWidth = 3
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
- .ReadingOrder = xlContext : End With
- xlSheet.Columns("B:B").Select : myExcel.Selection.ColumnWidth = 10
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
- .ReadingOrder = xlContext : End With
- xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 16
- xlSheet.Columns("D:D").Select : myExcel.Selection.ColumnWidth = 9
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
- .ReadingOrder = xlContext : End With
- xlSheet.Columns("E:E").Select : myExcel.Selection.ColumnWidth = 4
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
- .ReadingOrder = xlContext : End With
- xlSheet.Columns("F:F").Select : myExcel.Selection.ColumnWidth = 12
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
- .ReadingOrder = xlContext : End With
-
- xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 5
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
- .ReadingOrder = xlContext : End With
-
- xlSheet.Columns("H:H").Select : myExcel.Selection.ColumnWidth = 27 : xlSheet.Columns("I:I").Select : myExcel.Selection.ColumnWidth = 27
- xlSheet.Columns("J:J").Select : myExcel.Selection.ColumnWidth = 20 : xlSheet.Columns("K:K").Select : myExcel.Selection.ColumnWidth = 27
- xlSheet.Columns("L:L").Select : myExcel.Selection.ColumnWidth = 27 : xlSheet.Columns("M:M").Select : myExcel.Selection.ColumnWidth = 27
- xlSheet.Columns("N:N").Select : myExcel.Selection.ColumnWidth = 6
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
- .ReadingOrder = xlContext : End With
- xlSheet.Columns("O:O").Select : myExcel.Selection.ColumnWidth = 8
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .Orientation = 0 : .AddIndent = False : .IndentLevel = 0 : .ShrinkToFit = False
- .ReadingOrder = xlContext : End With
- xlSheet.Columns("P:P").Select : myExcel.Selection.ColumnWidth = 16
- xlSheet.Columns("Q:Q").Select : myExcel.Selection.ColumnWidth = 15
- xlSheet.Columns("I:I").Select : myExcel.Selection.ColumnWidth = 27
-
- xlSheet.Rows("2:2").Select : myExcel.Selection.RowHeight = 5 : xlSheet.Rows("3:3").Select : myExcel.Selection.RowHeight = 35
- With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 8 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False : .Shadow = False
- .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
- End Sub
- Private Sub BB(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
- Clipboard.SetDataObject(PictureBox2.Image)
- xlSheet.Cells(1, 1).Select
- Thread.Sleep(100) '延迟0.1秒
- xlSheet.Range("C" & N3).Select()
- myExcel.ActiveSheet.Paste
- If PictureBox2.Image.Height < PictureBox2.Image.Width Then
- myExcel.Selection.ShapeRange.Width = 45
- Else
- myExcel.Selection.ShapeRange.Height = 40
- End If
- myExcel.Selection.ShapeRange.IncrementLeft(2)
- myExcel.Selection.ShapeRange.IncrementTop(2)
- End Sub
- Private Sub CC(ByVal myExcel As Application, ByVal xlSheet As Worksheet)
- xlSheet.Range("A3:Q3").Select()
- myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlThin : End With
- myExcel.Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
- N4 = 0 : N5 = 0
- Dim ZZXX As Boolean = False : Dim XXCC As Boolean = False
- For i As Integer = 0 To DataGridView1.Rows.Count - 1
- If i = DataGridView1.Rows.Count - 1 Then
- xlSheet.Range("A" & N4 + 3 & ":Q" & N5 + 4).Select()
- myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlHairline : End With
- With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlHairline : End With
- Exit For
- ElseIf (DataGridView1.Rows(i).Cells("序號").Value = DataGridView1.Rows(i + 1).Cells("序號").Value) And i < DataGridView1.Rows.Count Then
- If ZZXX = False Then
- N4 = i + 1 : ZZXX = True
- End If
- N5 = i + 1
- ElseIf (DataGridView1.Rows(i).Cells("序號").Value <> DataGridView1.Rows(i + 1).Cells("序號").Value) And i < DataGridView1.Rows.Count Then
- If XXCC = False Then
- xlSheet.Range("A" & N4 + 3 & ":Q" & N5 + 4).Select() : XXCC = True
- Else
- xlSheet.Range("A" & N4 + 4 & ":Q" & N5 + 4).Select()
- End If
- myExcel.Selection.Borders(xlDiagonalDown).LineStyle = xlNone : myExcel.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
- With myExcel.Selection.Borders(xlEdgeLeft) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeTop) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeBottom) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlEdgeRight) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlMedium : End With
- With myExcel.Selection.Borders(xlInsideVertical) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlHairline : End With
- With myExcel.Selection.Borders(xlInsideHorizontal) : .LineStyle = xlContinuous : .ColorIndex = xlAutomatic : .TintAndShade = 0 : .Weight = xlHairline : End With
-
- ZZXX = False
- If ZZXX = False Then
- N4 = i + 1 : ZZXX = True
- End If
- N5 = i + 1
- End If
- Next
- myExcel.ActiveWindow.Zoom = 90
-
- xlSheet.Columns("B:B").Select : xlSheet.Range("B2").Activate() : myExcel.Selection.Delete
- xlSheet.Columns("H:L").Select : xlSheet.Range("H2").Activate() : myExcel.Selection.Delete
- xlSheet.Columns("C:C").Select : myExcel.Selection.ColumnWidth = 30 : xlSheet.Columns("G:G").Select : myExcel.Selection.ColumnWidth = 100
- xlSheet.Rows("4:" & DataGridView1.Rows.Count + 3).EntireRow.AutoFit
- xlSheet.Range("A1:K1").Select()
- With myExcel.Selection : .HorizontalAlignment = xlCenter : .VerticalAlignment = xlCenter : .WrapText = False : .Orientation = 0 : .AddIndent = False
- .IndentLevel = 0 : .ShrinkToFit = False : .ReadingOrder = xlContext : .MergeCells = False : End With
- myExcel.Selection.Merge
- With myExcel.Selection.Font : .Name = "微軟正黑體" : .Size = 18 : .Strikethrough = False : .Superscript = False : .Subscript = False : .OutlineFont = False
- .Shadow = False : .Underline = xlUnderlineStyleNone : .ThemeColor = xlThemeColorLight1 : .TintAndShade = 0 : .ThemeFont = xlThemeFontNone : End With
-
- ZZXX = False : XXCC = False
- myExcel.Application.PrintCommunication = False
- With myExcel.ActiveSheet.PageSetup
- .PrintTitleRows = "$1:$3"
- .PrintTitleColumns = ""
- End With
- myExcel.Application.PrintCommunication = True
- myExcel.ActiveSheet.PageSetup.PrintArea = ""
- myExcel.Application.PrintCommunication = False
- With myExcel.ActiveSheet.PageSetup
- .LeftHeader = ""
- .CenterHeader = ""
- .RightHeader = ""
- .LeftFooter = ""
- .CenterFooter = ""
- .RightFooter = ""
- .LeftMargin = myExcel.Application.InchesToPoints(0.25)
- .RightMargin = myExcel.Application.InchesToPoints(0.25)
- .TopMargin = myExcel.Application.InchesToPoints(0.75)
- .BottomMargin = myExcel.Application.InchesToPoints(0.75)
- .HeaderMargin = myExcel.Application.InchesToPoints(0.3)
- .FooterMargin = myExcel.Application.InchesToPoints(0.3)
- .PrintHeadings = False
- .PrintGridlines = False
- .PrintQuality = 600
- .CenterHorizontally = False
- .CenterVertically = False
- .Draft = False
- .FirstPageNumber = xlAutomatic
- .BlackAndWhite = False
- .Zoom = 50
- .OddAndEvenPagesHeaderFooter = False
- .DifferentFirstPageHeaderFooter = False
- .ScaleWithDocHeaderFooter = True
- .AlignMarginsHeaderFooter = True
- .EvenPage.LeftHeader.Text = ""
- .EvenPage.CenterHeader.Text = ""
- .EvenPage.RightHeader.Text = ""
- .EvenPage.LeftFooter.Text = ""
- .EvenPage.CenterFooter.Text = ""
- .EvenPage.RightFooter.Text = ""
- .FirstPage.LeftHeader.Text = ""
- .FirstPage.CenterHeader.Text = ""
- .FirstPage.RightHeader.Text = ""
- .FirstPage.LeftFooter.Text = ""
- .FirstPage.CenterFooter.Text = ""
- .FirstPage.RightFooter.Text = ""
- End With
- myExcel.Application.PrintCommunication = True
- End Sub
- End Class
|