If e.DataCol.Name = "已开piao"
If e.DataRow("已开piao") = True Then
Dim nma() As String = {"_Identify","出库单编号", "出库_税率","开piao日期" ,"fa piao号码","出库_税金","出库_税金" } 'A表数据来源列
Dim nmb() As String = {"ID" ,"单据编号","规格", "日期","fa piao号码","单价","支出" } 'B表数据接收列
e.DataRow.save
Dim dr As DataRow = DataTables("收支表").Find("fa piao号码 = '" & e.DataRow("fa piao号码") & "'")
If dr Is Nothing Then
Dim dr As DataRow = DataTables("收支表").AddNew
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = e.DataRow(nma(i))
Next
dr("来源") = "支出" '入库表就改为"采购",其他表改为"其它"
dr("单位") = "份"
dr("数量") = "1"
dr("客户ID") = "S001"
dr("客户") = "园区国税"
dr("项目名称") = "增值税"
End If
Else
DataTables("收支表").deletefor("ID = '" & e.DataRow("_Identify") & "'")
End If
End If