Dim Result As DialogResult
Result = MessageBox.Show("确认审核吗?","提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
'If usna Like "*总监*" Or usna="admin" Then
' Tables("生产制造单_table1").Current("审核人") = usna
Tables("生产制造单_table1").Current("审核") = True
Tables("生产制造单_table1").Current.Locked = True
Dim tb As Table = Tables("生产制造单_table2")
Dim str1 As String = "XS,S,M,L,XL,2XL,3XL,4XL,5XL,6XL,F,XF"
Dim str2 As String = "65,70,75,80,85,90,95,100"
For Each dr2 As DataRow In DataTables("生产制单明细").Select("[生产单号] = '" & Tables("生产制造单_table1").current("生产单号") & "'")
dr2("审核") = True
dr2.locked = True
Next
Dim drs = DataTables("生产制单明细").Select("[审核] = 'true'")
Dim ls As new List(Of String)
For Each cdr As DataRow In drs
Dim dr As DataRow = DataTables("销售明细尺码").find(" [_Identify] = '" & cdr("销售明细行ID") & "'")
If dr Is Nothing Then Continue For
For Each s As String In str1.Split(",")
If tb.Cols.Contains("衣裤尺码明细_" & s) Then
If ls.contains(dr("_Identify")) = False Then
dr("衣裤尺码明细_排产" & s)=val(cdr("衣裤尺码明细_" & s))
Else
dr("衣裤尺码明细_排产" & s)+=val(cdr("衣裤尺码明细_" & s))
End If
End If
Next
For Each s As String In str2.Split(",")
If tb.Cols.Contains("文胸尺码明细_" & s) Then
If ls.contains(dr("_Identify")) = False Then
dr("文胸尺码明细_排产" & s)=val(cdr("文胸尺码明细_" & s))
Else
dr("文胸尺码明细_排产" & s)+=val(cdr("文胸尺码明细_" & s))
End If
End If
Next
If ls.contains(dr("_Identify")) = False Then
ls.add(dr("_Identify"))
End If
dr.save()
dr.locked = True
Next
Else
MessageBox.show("你无权执行此项操作!")
'End If
End If