Foxtable(狐表)用户栏目专家坐堂 → 筛选问题


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

主题:筛选问题

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


加好友 发短信
等级:一尾狐 帖子:437 积分:2943 威望:0 精华:0 注册:2011/3/15 12:49:00
筛选问题  发帖心情 Post By:2021/3/31 15:43:00 [只看该作者]

        For Each f As String In FileSys.GetFiles(dzml2)
            If f.EndsWith(".log") Then
                Dim txt As String = FileSys.ReadAllText(f, Encoding.Default)
                Dim idx As Integer = txt.IndexOf("<?xml version")
                Dim idx2 As Integer = txt.IndexOf("</business>",idx)
                Do While idx > -1 And idx2 > -1
                    Dim s2 As String = txt.SubString(idx,idx2-idx+11)
                    idx  = txt.IndexOf("<?xml version",idx2)
                    If idx > -1
                        idx2  = txt.IndexOf("</business>",idx)
                    Else
                        idx2=-1
                    End If
                    Dim xmlDoc As New System.XML.XmlDocument
                    xmlDoc.Loadxml(s2)
                    Dim ndList1  = xmlDoc.GetElementsByTagName("kpxx")
                    If ndList1.count > 0
                        Dim ndList3   = ndList1(0).ChildNodes
                        Dim fpdm As String
                        Dim fphm As String
                        Dim ghdwmc As String
                        Dim ghdwdzdh As String
                        Dim ghdwsbh As String
                        Dim ghdwyhzh As String
                        Dim xhdwmc As String
                        Dim bz As String
                        For s As Integer = 0 To ndList3.count - 1
                            If ndList3(s).Item("fpdm") IsNot Nothing Then fpdm = ndList3(s).Item("fpdm").InnerText
                            If ndList3(s).Item("fphm") IsNot Nothing Then fphm = ndList3(s).Item("fphm").InnerText
                            If ndList3(s).Item("ghdwmc") IsNot Nothing Then ghdwmc = ndList3(s).Item("ghdwmc").InnerText
                            If ndList3(s).Item("ghdwdzdh") IsNot Nothing Then ghdwdzdh = ndList3(s).Item("ghdwdzdh").InnerText
                            If ndList3(s).Item("ghdwsbh") IsNot Nothing Then ghdwsbh = ndList3(s).Item("ghdwsbh").InnerText
                            If ndList3(s).Item("ghdwyhzh") IsNot Nothing Then ghdwyhzh = ndList3(s).Item("ghdwyhzh").InnerText
                            If ndList3(s).Item("xhdwmc") IsNot Nothing Then xhdwmc = ndList3(s).Item("xhdwmc").InnerText
                            If ndList3(s).Item("bz") IsNot Nothing Then bz = ndList3(s).Item("bz").InnerText
                            Dim ndList2  = xmlDoc.GetElementsByTagName("fyxm")
                            Dim ndList   = ndList2(0).ChildNodes
                            For i As Integer = 0 To ndList.count - 1
                                Dim sr As DataRow = DataTables("开piao导入查询窗口_开piao主表").find("fa piao代码 = '" & fpdm  & "'And fa piao号码= '" & fphm & "'")
                                If DataTables("开piao导入查询窗口_fa piao明细").find("fa piao代码 = '" & fpdm & "'And fa piao号码 = '" & fphm & "'And 行号 = '" & ndList(i).Attributes("xh").value  & "'") Is Nothing Then
                                    Dim r As DataRow = DataTables("开piao导入查询窗口_fa piao明细").addnew
                                    Dim spmc As String = ndList(i).Item("spmc").InnerText
                                    Dim ggxh As String = ndList(i).Item("ggxh").InnerText
                                    Dim sl As String = ndList(i).Item("sl").InnerText
                                    Dim se As String = ndList(i).Item("se").InnerText
                                    Dim dw As String = ndList(i).Item("dw").InnerText
                                    Dim spsl As String = ndList(i).Item("spsl").InnerText
                                    Dim dj As String = ndList(i).Item("dj").InnerText
                                    Dim zsl As String = ndList(i).Item("zsl").InnerText
                                    Dim je As String = ndList(i).Item("je").InnerText
                                    Dim fpxhh As String = ndList(i).Attributes("xh").value
                                    r("fa piao代码") = fpdm
                                    r("fa piao号码") = fphm
                                    r("客户名称") = ghdwmc
                                    r("货物或服务名称") = spmc
                                    r("规格") = ggxh
                                    r("单位") = dw
                                    r("数量") = spsl
                                    r("单价") = dj
                                    r("税率")  = Format(zsl,"Percent")
                                    r("税额") = se
                                    r("金额") = je
                                    r("行号") = fpxhh
                                    If sr Is Nothing Then
                                        r("fa piao状态") = "无fa piao信息"
                                    Else
                                        r("fa piao状态") = sr("fa piao状态")
                                        sr("地址电话") = ghdwdzdh
                                        sr("开户银行及账号") = ghdwyhzh
                                        sr("备注") = bz
                                        sr("fa piao标识") = xhdwmc
                                        If drt.SQLFind("客户名称 = '" & ghdwmc & "'and 税号 = '" & ghdwsbh & "'") Is Nothing Then
                                            Dim ksr As DataRow = drt.Addnew
                                            ksr("客户名称") = ghdwmc
                                            ksr("税号") = ghdwsbh
                                            ksr("地址电话") = ghdwdzdh
                                            ksr("银行账号") = ghdwyhzh
                                            drt.Save
                                            drt.Load
                                        End If
                                    End If
                                    r("文件名") = FileSys.GetName(f)
                                End If
                            Next
                        Next
                    End If
                Loop
            End If
        Next
在导入文件时,第一次导入代码没问题,如果再次按导入按钮时好的,但是关闭窗口后再次打开不知道为什么就会可以再次导入,求解
附上导入的文件
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:_sksclog.rar



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


加好友 发短信
等级:超级版主 帖子:106298 积分:540619 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/3/31 15:45:00 [只看该作者]

窗口表是不是没有加载数据,find改为sqlfind从后台查询

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


加好友 发短信
等级:一尾狐 帖子:437 积分:2943 威望:0 精华:0 注册:2011/3/15 12:49:00
  发帖心情 Post By:2021/3/31 16:10:00 [只看该作者]

是的,谢谢

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


加好友 发短信
等级:一尾狐 帖子:437 积分:2943 威望:0 精华:0 注册:2011/3/15 12:49:00
  发帖心情 Post By:2021/3/31 16:26:00 [只看该作者]

为什么还有部分的会重复,我本来就按照fa piao代码、fa piao号码和行号来筛选的?

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


加好友 发短信
等级:超级版主 帖子:106298 积分:540619 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/3/31 16:40:00 [只看该作者]

sqlfind只能查询已经保存的数据,每一行添加后马上保存

 回到顶部