以下是我写的复制行的代码,想请问如何实现已经复制过的行不再复制一次到表B中。
If e.DataCol.Name = "是否销售给航信" AndAlso e.DataRow("是否销售给航信") = True Then
Dim Result As DialogResult
Result = MessageBox.Show("销售客户确认为航信?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.NO Then
MessageBox.Show("销售客户不是航信.","提示")
e.Cancel = True '取消编辑
e.DataRow("是否销售给航信") = False
End If
If Result = DialogResult.YES Then
Dim nma() As String = {"品种","中文品名","荒料编号","测算表号","采购成本含税","现存仓库","销售日期","航信销售日期","航信销售总额","航信销售客户"} '"JKH荒料"表数据来源列
Dim nmb() As String = {"品种","品名","荒料编号","测算表号","采购成本","仓库","入库日期","航信销售日期","航信销售总额","航信销售客户"} '"航信台账"表数据接收列
Dim dr As DataRow = DataTables("航信台账").AddNew
For i As Integer = 0 To nma.Length - 1
dr(nmb(i)) = e.DataRow(nma(i))
Next
MessageBox.Show("本条销售记录已经带入【航信台账】", "提示")
End If
End If
[此贴子已经被作者于2016/6/24 9:53:17编辑过]