Dim cp As String = e.DataRow("产品名称")
Dim gnxh As String = e.DataRow("国内型号")
Dim gwxh As String = e.DataRow("国外型号")
Dim lx As Integer = e.DataRow("类型")
Dim ys As Integer = e.DataRow("叶数")
Dim zj As Double = e.DataRow("直径")
Dim lj As String = e.DataRow("螺距")
Dim c1 As String
Dim c2 As String
Dim c3 As String
Dim v1 As String
Dim v2 As String
Dim start As Boolean
Dim Values() As String
Dim Customers As List(Of String)
Dim Customer As String
If cp.IndexOf("-") >= 0 Then
Values = cp.split("-")
Dim x As Integer = Values.Length
If x = 2 Then
c1 = Values(0)
c2 = Values(1)
Else
c1 = Values(0)
c2 = Values(1)
c3 = Values(2)
End If
End If
Select Case e.DataCol.Name
Case "产品名称"
If c2 > "" AndAlso Char.IsDigit(c2.Chars(0)) Then
gnxh = c1
Else
If c2 > "" Then
Customers = DataTables("参数设置").GetValues("B","[X] = '产品参数' and [A] = '2S'")
For Each Customer In Customers
If c2.StartsWith(Customer) = True Then
Dim ds As DataRow = DataTables("参数设置").Find("[X] = '产品参数' and [A] = '2S' and [B] = '" & Customer & "'")
If ds IsNot Nothing Then
gnxh = c1 & ds("C")
End If
End If
Next
End If
End If
If c2 > "" AndAlso Char.IsLetter(c2.Chars(c2.Length-1)) Then
Customers = DataTables("参数设置").GetValues("B","[X] = '产品参数' and [A] = '2E'")
For Each Customer In Customers
If c2 > "" AndAlso c2.EndsWith(Customer) = True Then
Dim dd As DataRow = DataTables("参数设置").Find("[X] = '产品参数' and [A] = '2E' and [B] = '" & Customer & "'")
If dd IsNot Nothing Then
gnxh = gnxh & dd("C")
End If
End If
Next
End If
gnxh = gnxh.ToUpper()
Dim dn As DataRow = DataTables("参数设置").Find("[X] = '产品参数' and [A] = '型号' and [B] = '" & gnxh & "'")
If dn IsNot Nothing Then
gwxh = dn("C")
End If
e.DataRow("国内型号") = gnxh
e.DataRow("国外型号") = gwxh
Customers = DataTables("参数设置").GetValues("B","[X] = '产品参数' and [A] = '1S'")
For Each Customer In Customers
If cp > "" AndAlso cp.StartsWith(Customer) = True Then
Dim dy As DataRow = DataTables("参数设置").Find("[X] = '产品参数' and [A] = '1S' and [B] = '" & Customer & "'")
If dy IsNot Nothing Then
e.DataRow("类型") = dy("J")
e.DataRow("叶数") = dy("K")
End If
End If
Next
If c2 > "" AndAlso c2.Contains("X") Then
For i As Integer = c2.Length - 1 To 0 Step -1
If start = False Then
If Char.IsDigit(c2.Chars(i)) Or c2.Chars(i) = "." Then
v1 = c2.Chars(i) & v1
End If
End If
If start = True Then
If Char.IsDigit(c2.Chars(i)) Or c2.Chars(i) = "." Then
v2 = c2.Chars(i) & v2
Else
Exit For
End If
Else
If c2.Chars(i) = "X" Then
start = True
End If
End If
Next
Else
If c2 > "" Then
For i As Integer = c2.Length - 1 To 0 Step -1
If Char.IsLetter(c2.Chars(i)) Then
v1= c2.Chars(i) & v1
Else
If Char.IsDigit(c2.Chars(i)) Or c2.Chars(i) = "." Then
v2 = c2.Chars(i) & v2
End If
End If
Next
End If
End If
e.DataRow("螺距") = v1
e.DataRow("直径") = v2
Case "直径"
If e.DataRow("类型") IsNot Nothing Then
If e.DataRow("叶数") IsNot Nothing Then
If e.DataRow("直径") IsNot Nothing Then
Dim dr As DataRow = DataTables("工序点值").Find("类型 = '" & lx & "' and 叶数 = '" & ys & "' and 长度 = '" & zj & "' ")
If dr IsNot Nothing Then
If c2 > "" AndAlso c2.EndsWith("J") = True Then
Dim bs As Double = 4
e.DataRow("X01") = dr("X01") * bs
e.DataRow("X02") = dr("X02") * bs
e.DataRow("X03") = dr("X03") * bs
e.DataRow("X04") = dr("X04") * bs
e.DataRow("X05") = dr("X05") * bs
e.DataRow("X06") = dr("X06") * bs
e.DataRow("X07") = dr("X07") * bs
e.DataRow("X08") = dr("X08") * bs
e.DataRow("X09") = dr("X09") * bs
e.DataRow("X10") = dr("X10") * bs
e.DataRow("X11") = dr("X11") * bs
e.DataRow("X12") = dr("X12") * bs
e.DataRow("X13") = dr("X13") * bs
e.DataRow("X14") = dr("X14") * bs
e.DataRow("X15") = dr("X15") * bs
e.DataRow("X16") = dr("X16") * bs
e.DataRow("X17") = dr("X17") * bs
e.DataRow("X18") = dr("X18") * bs
e.DataRow("X19") = dr("X19") * bs
e.DataRow("X20") = dr("X20") * bs
e.DataRow("X21") = dr("X21") * bs
e.DataRow("X22") = dr("X22") * bs
e.DataRow("X23") = dr("X23") * bs
e.DataRow("X24") = dr("X24") * bs
e.DataRow("X25") = dr("X25") * bs
e.DataRow("X26") = dr("X26") * bs
e.DataRow("X27") = dr("X27") * bs
e.DataRow("X28") = dr("X28") * bs
e.DataRow("X29") = dr("X29") * bs
e.DataRow("X30") = dr("X30") * bs
Else
e.DataRow("X01") = dr("X01")
e.DataRow("X02") = dr("X02")
e.DataRow("X03") = dr("X03")
e.DataRow("X04") = dr("X04")
e.DataRow("X05") = dr("X05")
e.DataRow("X06") = dr("X06")
e.DataRow("X07") = dr("X07")
e.DataRow("X08") = dr("X08")
e.DataRow("X09") = dr("X09")
e.DataRow("X10") = dr("X10")
e.DataRow("X11") = dr("X11")
e.DataRow("X12") = dr("X12")
e.DataRow("X13") = dr("X13")
e.DataRow("X14") = dr("X14")
e.DataRow("X15") = dr("X15")
e.DataRow("X16") = dr("X16")
e.DataRow("X17") = dr("X17")
e.DataRow("X18") = dr("X18")
e.DataRow("X19") = dr("X19")
e.DataRow("X20") = dr("X20")
e.DataRow("X21") = dr("X21")
e.DataRow("X22") = dr("X22")
e.DataRow("X23") = dr("X23")
e.DataRow("X24") = dr("X24")
e.DataRow("X25") = dr("X25")
e.DataRow("X26") = dr("X26")
e.DataRow("X27") = dr("X27")
e.DataRow("X28") = dr("X28")
e.DataRow("X29") = dr("X29")
e.DataRow("X30") = dr("X30")
End If
End If
End If
End If
End If
End Select