Foxtable(狐表)用户栏目专家坐堂 → 发现一个很奇怪的窗口问题


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

主题:发现一个很奇怪的窗口问题

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


加好友 发短信
等级:五尾狐 帖子:1033 积分:7258 威望:0 精华:0 注册:2008/9/1 22:34:00
发现一个很奇怪的窗口问题  发帖心情 Post By:2012/12/25 14:46:00 [显示全部帖子]

做了个产品管理窗口,在开发版的环境中测试是没问题的,但运行发布后的时候就不行了.发布后当先择"铝门锁","窗门锁","胆仔锁","鹅旦锁","内胆锁","有尾门锁","83内胆-锁" 类产品时程序就死了.

 

   实在是想不明白,希望有人能找出原因。


 

情况是这样的,比如想在产品规格表中双击某一产品时会根据产品的类别打开不同的格式窗口,表的

DoubleClick事件代码如下:

 

Select Case Tables("obas_part_spec").Current("产品类别")
   
Case "铝门锁","窗门锁","胆仔锁","鹅旦锁","内胆锁","有尾门锁","83内胆-锁"
    Forms("产品规格表2").Open
Case Else
    Forms("产品规格表").Open
End Select

当打开产品格表窗口时,窗口有一个选择组合框,可以根据选择不同的产品类别打开不同的窗口,

ValueChanged

代码如下:

 

Dim s As String
s=e.Sender.Text
try
    Dim ids As String
    Dim drs As List(Of DataRow)
    drs = DataTables("料品资料查询表").Select("type_name = '" & s &"'")
   
    For Each dr As DataRow In drs
        ids = ids & ",'" & dr("part_no") & "'"
    Next
    ids= ids.Trim(",")
    DataTables("obas_part_spec").LoadFilter = "part_no In (" & ids & ")"
    DataTables("obas_part_spec").Load()
Catch ex As Exception
    MessageBox.Show("没找到相关数据1!","提示",MessageBoxButtons.OK)
   
   
End Try
Select Case s
    Case "铝门锁","窗门锁","胆仔锁","鹅旦锁","内胆锁","有尾门锁","83内胆-锁"
       
        Forms("产品规格表2").Open()
        Forms("产品规格表").Close
       
       
        'Case Else
        ' Return
    Case Else
       
        try
           
            Dim s1 As String = Tables("obas_part_spec").Current("part_no")
            Dim s2 As String ="0"
            Dim t As WinForm.Table = e.Form.Controls("Table1")
            If e.Form.Controls("TextBox1").Text <> "" Then
                t.Table.Fill("SELECT parent_part as 内部编码,child_part,Left(unit_qty,4) As 数量,bom_sort As 排序,ov_part.item_no As 物料编码,ov_part.part_name As 名称,ov_part.part_spec As 规格,obas_part1.bom_draw_no As 图号 from obom_stru2 INNER JOIN ov_part on obom_stru2.child_part = ov_part.part_no INNER JOIN obas_part1 on obom_stru2.child_part = obas_part1.part_no where parent_part='" & s1 & "'ORDER BY 排序","erp",True)
                t.Table.SetColVisibleWidth("物料编码|77|名称|75|规格|207|数量|19|图号|60")
            Else
                t.Table.Fill("SELECT parent_part as 内部编码,child_part,Left(unit_qty,4) As 数量,bom_sort As 排序,ov_part.item_no As 物料编码,ov_part.part_name As 名称,ov_part.part_spec As 规格,obas_part1.bom_draw_no As 图号 from obom_stru2 INNER JOIN ov_part on obom_stru2.child_part = ov_part.part_no INNER JOIN obas_part1 on obom_stru2.child_part = obas_part1.part_no where parent_part='" & s2 & "'ORDER BY 排序","erp",True)
                t.Table.SetColVisibleWidth("物料编码|77|名称|75|规格|207|数量|19|图号|60")
            End If
        Catch ex As Exception
            Dim s2 As String ="0"
            Dim t As WinForm.Table = e.Form.Controls("Table1")
           
            t.Table.Fill("SELECT parent_part as 内部编码,child_part,Left(unit_qty,4) As 数量,bom_sort As 排序,ov_part.item_no As 物料编码,ov_part.part_name As 名称,ov_part.part_spec As 规格,obas_part1.bom_draw_no As 图号 from obom_stru2 INNER JOIN ov_part on obom_stru2.child_part = ov_part.part_no INNER JOIN obas_part1 on obom_stru2.child_part = obas_part1.part_no where parent_part='" & s2 & "'ORDER BY 排序","erp",True)
            t.Table.SetColVisibleWidth("物料编码|77|名称|75|规格|207|数量|19|图号|60")
           
            MessageBox.Show("没找到相关数据!","提示",MessageBoxButtons.OK)
        End Try
       
End Select

 

 

另窗口中也有个产品编码的文本框控件,

TextChanged

代码如下:

 

Try
    Dim s As String = Tables("obas_part_spec").Current("part_no")
    Dim s1 As String ="0"
    Dim t As WinForm.Table = e.Form.Controls("Table1")
    Select Case Forms("产品规格表").Controls("Label8").text
        Case "铝门锁","窗门锁","胆仔锁","鹅旦锁","内胆锁","有尾门锁","83内胆-锁"
            Forms("产品规格表2").Open()
            Forms("产品规格表").Close
           
           
            'If  Tables("obas_part_spec").Current("产品类别") <> "铝门锁" Then
            'Dim s2 As String = "铝门锁,窗门锁,胆仔锁,鹅旦锁,内胆锁,有尾门锁"
            'Dim s3 As String = Tables("obas_part_spec").Current("产品类别")
            'If s2.indexof(s3) < 0 Then
        Case Else
            If e.Sender.Text <> "" Then
                t.Table.Fill("SELECT parent_part as 内部编码,child_part,Left(unit_qty,4) As 数量,bom_sort As 排序,ov_part.item_no As 物料编码,ov_part.part_name As 名称,ov_part.part_spec As 规格,obas_part1.bom_draw_no As 图号 from obom_stru2 INNER JOIN ov_part on obom_stru2.child_part = ov_part.part_no INNER JOIN obas_part1 on obom_stru2.child_part = obas_part1.part_no where parent_part='" & s & "'ORDER BY 排序","erp",True)
                t.Table.SetColVisibleWidth("物料编码|77|名称|75|规格|207|数量|19|图号|60")
            Else
                t.Table.Fill("SELECT parent_part as 内部编码,child_part,Left(unit_qty,4) As 数量,bom_sort As 排序,ov_part.item_no As 物料编码,ov_part.part_name As 名称,ov_part.part_spec As 规格,obas_part1.bom_draw_no As 图号 from obom_stru2 INNER JOIN ov_part on obom_stru2.child_part = ov_part.part_no INNER JOIN obas_part1 on obom_stru2.child_part = obas_part1.part_no where parent_part='" & s1 & "'ORDER BY 排序","erp",True)
                t.Table.SetColVisibleWidth("物料编码|77|名称|75|规格|207|数量|19|图号|60")
            End If
    End Select
Catch ex As Exception
End Try


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


加好友 发短信
等级:五尾狐 帖子:1033 积分:7258 威望:0 精华:0 注册:2008/9/1 22:34:00
  发帖心情 Post By:2012/12/25 15:03:00 [显示全部帖子]

联系了客服qq,没在线。且程序是用sql数据源的,数据量大,难以传输,如果能远程测试就最好。


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


加好友 发短信
等级:五尾狐 帖子:1033 积分:7258 威望:0 精华:0 注册:2008/9/1 22:34:00
  发帖心情 Post By:2012/12/25 15:19:00 [显示全部帖子]

以下是引用lin_hailun在2012-12-25 15:13:00的发言:


客服在线的,我就在线。

你qq号码多少啊?


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


加好友 发短信
等级:五尾狐 帖子:1033 积分:7258 威望:0 精华:0 注册:2008/9/1 22:34:00
  发帖心情 Post By:2012/12/25 15:24:00 [显示全部帖子]

1192309894这个号没人应的.

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


加好友 发短信
等级:五尾狐 帖子:1033 积分:7258 威望:0 精华:0 注册:2008/9/1 22:34:00
  发帖心情 Post By:2012/12/25 17:59:00 [显示全部帖子]

要下班时候,总算找到方案解决了.

 

只要是加个暂停事件的代码.....

[此贴子已经被作者于2012-12-25 18:00:18编辑过]

 回到顶部