'自动把记录写入应付明细表
If e.DataCol.Name = "审核" Then
If e.NewValue = True Then
If e.DataRow("应付日期1") <> Nothing Then
Dim dr As DataRow = _dt销售出库应付日期明细.AddNew
dr("ID") = e.DataRow("_Identify")
dr("应付描述") = e.DataRow("应付描述1")
dr("应付日期") = e.DataRow("应付日期1")
dr("应付金额") = e.DataRow("应付金额1")
For Each dc As DataCol In _dt销售出库应付日期明细.DataCols
If e.DataTable.DataCols.Contains(dc.Name) Then
If e.DataRow.IsNull(dc.Name) = False Then
dr(dc.Name) = e.DataRow(dc.Name)
End If
End If
Next
dr.Save
End If
If e.DataRow("应付日期2") <> Nothing Then
Dim dr As DataRow = _dt销售出库应付日期明细.AddNew
dr("ID") = e.DataRow("_Identify")
dr("应付描述") = e.DataRow("应付描述2")
dr("应付日期") = e.DataRow("应付日期2")
dr("应付金额") = e.DataRow("应付金额2")
For Each dc As DataCol In _dt销售出库应付日期明细.DataCols
If e.DataTable.DataCols.Contains(dc.Name) Then
If e.DataRow.IsNull(dc.Name) = False Then
dr(dc.Name) = e.DataRow(dc.Name)
End If
End If
Next
dr.Save
End If
If e.DataRow("应付日期3") <> Nothing Then
Dim dr As DataRow = _dt销售出库应付日期明细.AddNew
dr("ID") = e.DataRow("_Identify")
dr("应付描述") = e.DataRow("应付描述3")
dr("应付日期") = e.DataRow("应付日期3")
dr("应付金额") = e.DataRow("应付金额3")
For Each dc As DataCol In _dt销售出库应付日期明细.DataCols
If e.DataTable.DataCols.Contains(dc.Name) Then
If e.DataRow.IsNull(dc.Name) = False Then
dr(dc.Name) = e.DataRow(dc.Name)
End If
End If
Next
dr.Save
End If
Else
_dt销售出库应付日期明细.SQLDeleteFor("ID = " & e.DataRow("_Identify"))
End If
End If