If e.DataCol.Name = "编号" Then '发生变化的是产品编号吗? '在产品表找出该产品 Dim dr1 As DataRow dr1 = DataTables("客户订单").Find("编号 = " & "'" & e.DataRow("编号") & "'" ) If dr1 IsNot Nothing '如果找到, 则设置各列内容 e.DataRow("长")= dr1("长") e.DataRow("宽")= dr1("宽") e.DataRow("高")= dr1("高") e.DataRow("订购数量")= dr1("订购数量") End If End If Dim dr As DataRow = e.DataRow Select Case e.DataCol.Name Case "长", "宽", "刀数" dr("长度") = (dr("长") + dr("宽")) * dr("刀数") + 3.5 End Select Select Case e.DataCol.Name Case "宽", "高" dr("门幅") = (dr("高") + dr("宽")) +0.4 End Select Select Case e.DataCol.Name Case "宽" dr("左") = dr("宽") /2 +0.2 End Select Select Case e.DataCol.Name Case "高" dr("中") = dr("高") End Select Select Case e.DataCol.Name Case "左" dr("右") = dr("左") End Select
|