Foxtable(狐表)用户栏目专家坐堂 → [求助]datacolchange


  共有4984人关注过本帖树形打印复制链接

主题:[求助]datacolchange

帅哥哟,离线,有人找我吗?
huhu
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1187 积分:8266 威望:0 精华:0 注册:2015/3/30 10:44:00
[求助]datacolchange  发帖心情 Post By:2016/2/29 14:12:00 [只看该作者]

1.click代码如下,红色代码用了向库存明细表增加数据---没有问题。问题是本以为向库存明细表写数据会触发datacolchange代码。可是发现没执行。原因我想应该是库存明细表的SN变化了,但是那个时间其他列的值为空,就没法向下执行datacolchange代码了。咋样能达到我想要的效果?
If (MessageBox.Show("确定提交入库?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.Yes ) Then
    DataTables("非插卡入库扫描").save
    Dim drs As List (of DataRow) = DataTables("U8物料数量汇总表").Select("入库单号 = '" & Vars("fckrkdhrk") & "'")
    For Each dr As DataRow In drs
        dr("状态") = "入库完成"
    Next
    Dim drrs As List (of DataRow) = DataTables("U8物料编码入库单收货统计").Select("入库单号 = '" & Vars("fckrkdhrk") & "'")
    For Each drr As DataRow In drrs
        drr("状态") = "入库完成"
    Next
    Dim nms() As String = {"生产订单号码","工单行号","物料编码","物料名称","类别说明","产品批次","订单号","订单行号","客户","备注","软件版本","SN","状态","数量","MAC","HW","入库单号","库位类别","库位编码","收货完成时间","入库完成时间","体态"}
    
    Dim lt As List(of DataRow) = DataTables("非插卡入库扫描").Select("入库单号 = '" & Vars("fckrkdhrk") & "'")
    For Each r As DataRow In lt
        If r("状态") = "入库完成" Then
            Dim rr As DataRow = DataTables("库存明细表").addnew
            For Each nm As String In nms
                rr(nm) = r(nm)
            Next
        End If
    Next
Else
    e.Cancel = True
End If`
2.库存明细表datacolchange代码如下。
If e.DataCol.name = "SN" Then
    If e.DataRow("体态") = "通用态" Then----没有执行
        Dim dr1 As DataRow = DataTables("库存通用态表").Find("物料编码 = '" & e.DataRow("物料编码") & "'")
        If dr1 IsNot Nothing Then
            dr1("库存数量") = dr1("库存数量") + 1
            dr1("可用数量") = dr1("可用数量") + 1
        Else
            Dim dr2 As DataRow = DataTables("库存通用态表").AddNew
            dr2("物料编码") = e.DataRow("物料编码")
            dr2("物料名称") = e.DataRow("物料名称")
            dr2("库存数量") = 1
            dr2("可用数量") = 1
        End If
    ElseIf e.DataRow("体态") = "特殊态" Then
        Dim dr3 As DataRow = DataTables("库存特殊态表").Find("物料编码 = '" & e.DataRow("物料编码") & "' and 订单号 = '" & e.DataRow("订单号") & "' and 订单行号 = '" & e.DataRow("订单行号") & "'")
        If dr3 IsNot Nothing Then
            dr3("库存数量") = dr3("库存数量") + 1
            dr3("可用数量") = dr3("可用数量") + 1
        Else
            Dim dr4 As DataRow = DataTables("库存特殊态表").AddNew
            dr4("物料编码") = e.DataRow("物料编码")
            dr4("物料名称") = e.DataRow("物料名称")
            dr4("物料名称") = e.DataRow("物料名称")
            dr4("订单号") = e.DataRow("订单号")
            dr4("订单行号") = e.DataRow("订单行号")
            dr4("客户") = e.DataRow("客户")
            dr4("库存数量") = 1
            dr4("可用数量") = 1
        End If
    End If
End If
'

 回到顶部
帅哥哟,离线,有人找我吗?
huhu
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1187 积分:8266 威望:0 精华:0 注册:2015/3/30 10:44:00
  发帖心情 Post By:2016/2/29 15:18:00 [只看该作者]

帖子跌下去了,我需要顶起来。哈哈,上头条。

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/2/29 15:37:00 [只看该作者]

Dim nms() As String = {"生产订单号码","工单行号","物料编码","物料名称","类别说明","产品批次","订单号","订单行号","客户","备注","软件版本","SN","状态","数量","MAC","HW","入库单号","库位类别","库位编码","收货完成时间","入库完成时间","体态"}

 

改成

 

Dim nms() As String = {"生产订单号码","工单行号","物料编码","物料名称","类别说明","产品批次","订单号","订单行号","客户","备注","软件版本","状态","数量","MAC","HW","入库单号","库位类别","库位编码","收货完成时间","入库完成时间","体态","SN"}


 回到顶部