If Tables("盈亏对账主窗口_Table2").Rows.Count>0 Then If Tables("盈亏对账主窗口_Table2").Current.IsNull("盈亏号") = False Then If MessageBox.Show("是否删除","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question)=DialogResult.Yes Then Dim r As Row = Tables("盈亏对账主窗口_Table2").Current Dim n1 = r("盈亏号") Dim n2 = r("对账盈亏号") r.Delete Dim SumT1 As Integer=DataTables("盈亏对账数量表").Compute("Sum(对账数量)","[盈亏号] = '" & n1 & "'") Dim dr As DataRow = DataTables("盈亏待对账表").Find("盈亏号='" & n1 & "'") If dr IsNot Nothing Then dr("已对账数量")=SumT1 End If Dim SumT2 As Integer= DataTables("盈亏对账数量表").Compute("Sum(对账盈亏号数量)","[对账盈亏号] = '" & n2 & "'") Dim drzb As DataRow = DataTables("盈亏待对账表").Find("盈亏号='" & n2 & "'") If drzb IsNot Nothing Then drzb("已对账数量")=SumT2*-1 drzb("处理后数量")=drzb("亏损")+ drzb("已对账数量") End If End If Else Tables("盈亏对账主窗口_Table2").Current.Delete End If End If
|