Foxtable(狐表)用户栏目专家坐堂 → 这是咋回事


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

主题:这是咋回事

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


加好友 发短信
等级:一尾狐 帖子:437 积分:2943 威望:0 精华:0 注册:2011/3/15 12:49:00
这是咋回事  发帖心情 Post By:2022/4/24 13:54:00 [只看该作者]

Dim str As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim utr As WinForm.ComboBox = e.Form.Controls("ComboBox2")
Dim tst As WinForm.Label = e.Form.Controls("Label8")
Dim dr  As  DataRow
dr =  DataTables("规格类别").Find("[规格类别] = '" & str.Value &  "'")
If dr IsNot Nothing Then  '如果找到了同名的产品行,也就是dr不是Nothing
    If str.Value = "" Then
        tst = Nothing
    Else
        If tst.text.StartsWith(str.Value) = False '如果单据编号前缀不符
            Dim max As String
            Dim idx As Integer
            max = DataTables("规格类别").Compute("Max(代码)","规格类别 = '" & str.Value & "' And Len(代码) = 4")
            If max > "" Then '如果存在最大编号
                idx = CInt(max) + 1 '获得最大编号的后三位顺序号,并加1
            Else
                idx = 1 '否则顺序号等于1
            End If
            tst.text = Format(idx,"0000")
            Dim pdm As DataRow
            pdm = DataTables("规格类别").AddNew()
            pdm("规格类别") = str.Value
            pdm("名称") = utr.Value
            pdm("代码") = tst.text
            DataTables("规格类别").Save()
        End If
    End If
End  If
写入表时“名称”列没有写入
[此贴子已经被作者于2022/4/24 13:54:52编辑过]

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


加好友 发短信
等级:超级版主 帖子:106816 积分:543281 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/4/24 13:57:00 [只看该作者]

pdm("名称") = utr.text

 回到顶部