大侠快帮忙!
Case "货号"
'根据货号从"名称货号单价"中提取数据,如果没有,则录入数据,并保存在"名称货号单价"中 ?????
Dim sts As String() = {"货号","产品名称","吊牌价","品类","细类","季别","男式女式"}
Dim dr As DataRow =DataTables("名称货号单价").Find("[货号] = '" & e.NewValue & "'")
If dr IsNot Nothing Then
For Each st As String In sts
e.DataRow(st) = dr(st)
Next
Else
Dim result As dialogresult = MessageBox.show("此货号数据库无记录,是否添加?","提示",MessageBoxbuttons.yesno)
If result = DialogResult.Yes Then
DataTables("名称货号单价").AddNew() ‘这个实现了!!!!!
Select Case e.DataCol.Name
Case "货号","产品名称","吊牌价"
Dim sts2 As String() ={"货号","产品名称","吊牌价"}
For Each st2 As String In sts
If e.DataRow.IsNull("货号") =False And e.DataRow.IsNull("产品名称") =False And e.DataRow.IsNull("吊牌价") =False Then
DataTables("名称货号单价").DataRows(DataTables("名称货号单价").DataRows.count - 1)(st2) = e.DataRow(st2) ’这个实现不了??
End If
Next
End Select
End If
End If
[此贴子已经被作者于2013-3-23 2:36:21编辑过]