Dim db4 As WinForm.DropDownBox = e.Form.Controls("DropBox4") Dim db5 As WinForm.DropDownBox = e.Form.Controls("DropBox5") Dim dzml4 As String = db4.text Dim dzml5 As String = db5.text If dzml4 IsNot Nothing Then Tables("表A").StopRedraw For Each dir As String In FileSys.GetDirectories(dzml4) For Each f As String In FileSys.GetFiles(dir) If f.EndsWith("_verifysign.log") Then Dim str = f.SubString(f.Length - 38) If DataTables("表B").Find("文件名 = '" & str & "'" ) Is Nothing Then Dim txt As String = FileSys.ReadAllText(f, Encoding.Default) Dim idx As Integer = txt.IndexOf("</business>") Dim s1 As String = txt.SubString(0, idx+11) Dim s2 As String = txt.SubString(idx+12) Dim xmlDoc As New System.XML.XmlDocument xmlDoc.Loadxml(s1) Dim ndList = xmlDoc.GetElementsByTagName("input") Dim kprq As String 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 hjje As String Dim hjse As String Dim jshj As String Dim bz As String Dim fpzt As String For i As Integer = 0 To ndList.count - 1 If ndList(i).Item("kprq") IsNot Nothing Then kprq = ndList(i).Item("kprq").InnerText If ndList(i).Item("fpdm") IsNot Nothing Then fpdm = ndList(i).Item("fpdm").InnerText If ndList(i).Item("fphm") IsNot Nothing Then fphm = ndList(i).Item("fphm").InnerText If ndList(i).Item("ghdwmc") IsNot Nothing Then ghdwmc = ndList(i).Item("ghdwmc").InnerText If ndList(i).Item("ghdwdzdh") IsNot Nothing Then ghdwdzdh = ndList(i).Item("ghdwdzdh").InnerText If ndList(i).Item("ghdwsbh") IsNot Nothing Then ghdwsbh = ndList(i).Item("ghdwsbh").InnerText If ndList(i).Item("ghdwyhzh") IsNot Nothing Then ghdwyhzh = ndList(i).Item("ghdwyhzh").InnerText If ndList(i).Item("hjje") IsNot Nothing Then hjje = ndList(i).Item("hjje").InnerText If ndList(i).Item("hjse") IsNot Nothing Then hjse = ndList(i).Item("hjse").InnerText If ndList(i).Item("jshj") IsNot Nothing Then jshj = ndList(i).Item("jshj").InnerText If ndList(i).Item("bz") IsNot Nothing Then bz = ndList(i).Item("bz").InnerText If ndList(i).Item("fpzt") IsNot Nothing Then fpzt = ndList(i).Item("fpzt").InnerText Next If fphm <> Nothing Then Dim ndr As DataRow = DataTables("表b").addnew ndr("开piao日期") = kprq.SubString(0,4) + "-" + kprq.SubString(4,2) + "-" + kprq.SubString(6,2) ndr("fa piao代码") = fpdm ndr("fa piao号码") = fphm ndr("客户名称") =ghdwmc ndr("地址电话") =ghdwdzdh ndr("纳税人识别号") = ghdwsbh ndr("开户银行及账号") = ghdwyhzh ndr("合计金额") = hjje ndr("合计税额") = hjse ndr("价税合计") = jshj ndr("备注") = bz ndr("fa piao状态") = fpzt ndr("文件名") = str ndList = xmlDoc.GetElementsByTagName("fyxm")(0).ChildNodes For i As Integer = 0 To ndList.count - 1 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 je As String = ndList(i).Item("je").InnerText Dim r As Row = Tables("表A").AddNew r("fa piao代码") = fpdm r("fa piao号码") = fphm r("客户名称") = ghdwmc r("货物或服务名称") = spmc r("规格") = ggxh r("单位") = dw r("数量") = spsl r("单价") = dj r("税率") = sl r("税额") = se r("金额") = je r("fa piao状态") = fpzt ndr("文件名") = str Next End If End If End If Next Next Tables("表A").ResumeRedraw DataTables("表b").DeleteFor("fa piao状态 = '2'") For Each s As String In DataTables("表A").GetValues("fa piao号码", "fa piao状态 = '3'") DataTables("表A").DeleteFor("fa piao号码 = '" & s & "' and fa piao状态 = '0'") Next For Each s1 As String In DataTables("表b").GetValues("fa piao号码", "fa piao状态 = '3'") DataTables("表b").DeleteFor("fa piao号码 = '" & s1 & "' and fa piao状态 = '0'") Next End If
|