-- 作者:caoxy
-- 发布时间:2011/3/29 19:56:00
-- 多列自动显示
师傅你好:我写的代码请师傅帮助整理
Dim dr1 As DataRow = e.DataRow Select Case e.DataCol.Name Case "全木盘_材料","规格","全木盘_厚度", "地点" Dim dr2 As DataRow Dim fls As String fls = "名称 = \'" & dr1("全木盘_材料") & "\' And 规格 = \'" & dr1("规格") & "\' And 厚度 = " & dr1("全木盘_厚度") & " And 送货地点 = \'" & dr1("地点") & "\'" dr2 = DataTables("参数").Find(fls) If dr2 IsNot Nothing Then dr1("全木盘_单价") = dr2("单价") End If End Select Select Case e.DataCol.Name Case "芯板_材料","芯板_长度","芯板_厚度", "地点" Dim dr2 As DataRow Dim fls As String fls = "名称 = \'" & dr1("芯板_材料") & "\' And 规格 = \'" & dr1("芯板_长度") & "\' And 厚度 = " & dr1("芯板_厚度") & " And 送货地点 = \'" & dr1("地点") & "\'" dr2 = DataTables("参数").Find(fls) If dr2 IsNot Nothing Then dr1("芯板_单价") = dr2("单价") End If End Select Select Case e.DataCol.Name Case "封板_材料","封板_长度","封板_厚度", "地点" Dim dr2 As DataRow Dim fls As String fls = "名称 = \'" & dr1("封板_材料") & "\' And 规格 = \'" & dr1("封板_长度") & "\' And 厚度 = " & dr1("封板_厚度") & " And 送货地点 = \'" & dr1("地点") & "\'" dr2 = DataTables("参数").Find(fls) If dr2 IsNot Nothing Then dr1("封板_单价") = dr2("单价") End If End Select Select Case e.DataCol.Name Case "扇形板_材料","扇形板_长度","扇形板_厚度", "地点" Dim dr2 As DataRow Dim fls As String fls = "名称 = \'" & dr1("扇形板_材料") & "\' And 规格 = \'" & dr1("扇形板_长度") & "\' And 厚度 = " & dr1("扇形板_厚度") & " And 送货地点 = \'" & dr1("地点") & "\'" dr2 = DataTables("参数").Find(fls) If dr2 IsNot Nothing Then dr1("扇形板_单价") = dr2("单价") End If End Select
1、上面的代码只第一组能显示,其它的不显示。
2、上面的代码能不能筒化,只达到目的就行。
|