Foxtable(狐表)用户栏目专家坐堂 → [求助]在窗口中如何取消表事件?


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

主题:[求助]在窗口中如何取消表事件?

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


加好友 发短信
等级:一尾狐 帖子:497 积分:4892 威望:0 精华:0 注册:2012/4/20 8:42:00
[求助]在窗口中如何取消表事件?  发帖心情 Post By:2012/5/24 9:36:00 [只看该作者]

狐爸问个问题啊,我现在在用窗口做一个表格的导入功能。

先上贴图。。再说问题。

在我上传的excel表中,第15行,有个单元格合并了,这样的话,我在狐表中的表,订单明细表中

DataColChanged事件中会提示错误,我如何在下面的代码中取消这种错误提示?也就是说,我通过代码增加行时,如果取消数据列数据变化而发生的事件?

Dim path As WinForm.TextBox = e.Form.Controls("TextBox5") '目录
Dim cmd As new SQLCommand
cmd.C '指定数据源
Dim Listo As String
Dim filess As String
Dim tb As Table = Tables("订单")
Dim oi As Table = Tables("orderitem") '订单明细表
Dim rm As Table = Tables("remarks") '订单备注
Dim d As Integer
For Each file As String In filesys.GetFiles(path.Value)
    ' filess = filesys.GetName(file)
    Dim Book As New XLS.Book(file)
    Dim Sheet1 As XLS.Sheet = Book.Sheets(0)
    cmd.CommandText = "Select listorder From {订单} Where listorder = '" & (sheet1(2,15).Value.Remove(0,5)) & " ' "
    Listo = cmd.ExecuteScalar()
   ' MessageBox.Show(cmd.CommandText)
   ' MessageBox.Show(Listo)
    If Listo = "" Then
        tb.AddNew()
        tb.Current("listorder") = sheet1(2,15).Value.Remove(0,5) '订单编号
        tb.Current("area") = sheet1(4,0).Value.Remove(0,5) '销售区域
        tb.Current("contact") = sheet1(4,4).Value.Remove(0,4) '联系人
        tb.Current("tel") = sheet1(4,7).Value.Remove(0,5) '联系电话
        tb.Current("setusers") = sheet1(4,10).Value.Remove(0,5) '安装用户
        tb.Current("dhdate") = sheet1(3,15).Value.Remove(0,5) '订货日期
        tb.Current("jhdate") = sheet1(4,15).Value.Remove(0,5) '交货日期
        '_____________________________以上是对订单表进行导入____________________________________
        For i As Integer = 8 To sheet1.Rows.Count
            If Integer.TryParse(sheet1(i,0).Value,d) And sheet1(i,0).Value <> "" And tb.Current("listorder") <> "" Then
                oi.AddNew()
                oi.Current("listorder")  = sheet1(2,15).Value.Remove(0,5) '删除空格,订单号
                oi.Current("dooropen")  = Replace(sheet1(i,1).Value," ","") '删除空格,门洞尺寸
                oi.Current("doorcasesize")  = Replace(sheet1(i,2).Value," ","") '删除空格,门框尺寸
                oi.Current("modelname")  = Replace(sheet1(i,3).Value," ","") '删除空格,产品型号
                oi.Current("doorcase")  = Replace(sheet1(i,4).Value," ","") '删除空格,门扇材质
                oi.Current("doorsize")  = Replace(sheet1(i,5).Value," ","") '删除空格,门框尺寸
                oi.Current("doorcolor")  = Replace(sheet1(i,6).Value," ","") '删除空格,门扇油漆
                oi.Current("doorglass")  = Replace(sheet1(i,7).Value," ","") '删除空格,门框玻璃
                oi.Current("doornum")  = Replace(sheet1(i,8).Value," ","") '删除空格,门扇数量
                oi.Current("doorcasemodel")  = Replace(sheet1(i,9).Value," ","") '删除空格,门框型号
                oi.Current("doorline")  = Replace(sheet1(i,10).Value," ","") '删除空格,门套线
                oi.Current("dccz")  = Replace(sheet1(i,11).Value," ","") '删除空格,门框材质
                oi.Current("doorcasecolor")  = Replace(sheet1(i,12).Value," ","") '删除空格,门框油漆
                oi.Current("doorcasenum")  = Replace(sheet1(i,13).Value," ","") '删除空格,门框数量
                oi.Current("doorcaseprice")  = Replace(sheet1(i,14).Value," ","") '删除空格,门框单价
                oi.Current("partsname")  = Replace(sheet1(i,16).Value," ","") '删除空格,配件名称
                oi.Current("partsnum")  = Replace(sheet1(i,17).Value," ","") '删除空格,配件数量
                oi.Current("partsprice")  = Replace(sheet1(i,18).Value," ","") '删除空格,配件单价
                oi.Current("listgod")  = Replace(sheet1(i,19).Value," ","") '删除空格,输入日期
                oi.Current("putdate")  = CDate(sheet1(3,15).Value.Remove(0,5)) '删除空格,输入日期
                oi.Current("listgod")  = Replace(sheet1(i,19).Value," ","") '删除空格,输入日期
            Else
            End If
        Next
        '_______________________________以上是明细表数据导入______________________
        For rs As Integer = 18 To sheet1.Rows.Count
            If sheet1(rs,0).Value = "备注" And tb.Current("listorder") <> "" Then
                rm.AddNew()
                rm.Current("listorder") =  sheet1(2,15).Value.Remove(0,5)
                rm.Current("remark") = sheet1(rs,1).Value
            End If
        Next
    End If
    Next


图片点击可在新窗口打开查看此主题相关图片如下:qq截图20120524092910.png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20120524093021.png
图片点击可在新窗口打开查看
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:大庆2012-04-2322.xls


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


加好友 发短信
等级:一尾狐 帖子:497 积分:4892 威望:0 精华:0 注册:2012/4/20 8:42:00
  发帖心情 Post By:2012/5/24 9:39:00 [只看该作者]

还有有一个问题:就是如何在窗口中,引用资源浏览器?

就是在窗口我可以通过选择文件夹来选择表文件?


图片点击可在新窗口打开查看此主题相关图片如下:qq截图20120524093844.png
图片点击可在新窗口打开查看

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


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2012/5/24 10:11:00 [只看该作者]


 回到顶部