Foxtable(狐表)用户栏目专家坐堂 → 想在这段代码前价格判断 ,如果数据被复制过,就不执行


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

主题:想在这段代码前价格判断 ,如果数据被复制过,就不执行

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


加好友 发短信
等级:五尾狐 帖子:1062 积分:9781 威望:0 精华:0 注册:2012/3/13 5:23:00
想在这段代码前价格判断 ,如果数据被复制过,就不执行  发帖心情 Post By:2015/8/18 18:47:00 [只看该作者]

想在这段代码前价格判断 ,如果数据被复制过,就只复制新的数据,不再复制之前已经复制过的数据



Dim Cols1() As String = {"tanumru","jiecun","chuanhuoc","tasallnum","shangpinming","cord"}
Dim Cols2() As String = {"in","jie","chuanhuo","xiaoshou","name","cord"}

For Each dr1 As DataRow In DataTables("product").Select("[newnum]<>0")
    Dim dr2 As DataRow = DataTables("kucun").AddNew()
    
    For i As Integer = 0 To Cols1.Length -1
        dr2(Cols2(i)) = dr1(Cols1(i))
        
    Next
Next

If Tables("xiaoshou").Current IsNot Nothing Then
    Dim p As String = Tables("xiaoshou").Current("time1")
    
    Dim Book1 As New XLS.Book(ProjectPath & "Attachments\库存.xls") '打开模板
    Dim fl1 As String = ProjectPath & "Reports\库存.xls"
    Dim Sheet1 As XLS.Sheet = Book1.Sheets(0)
    Book1.Build() '生成报表
    Book1.Save(fl1)
    Dim Proc1 As New Process
    Proc1.File = fl1
    Book1.Save("c:\mifeng\kucun\" & p & format(Date.Now, "ddhhmm") & "库存.xls")
    Proc1.Start()
    msgbox(2)
    Dim Book2 As New XLS.Book(ProjectPath & "Attachments\明细.xls") '打开模板
    Dim fl2 As String = ProjectPath & "Reports\明细.xls"
    Dim Sheet2 As XLS.Sheet = Book2.Sheets(0)
    Book2.Build() '生成报表
    Book2.Save(fl2)
    Dim Proc2 As New Process
    Proc2.File = fl2
    Book2.Save("c:\mifeng\mingxi\" & p & format(Date.Now, "ddhhmm") & "明细.xls")
    Proc2.Start()
End If



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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/8/18 19:07:00 [只看该作者]

 叫你加一列判断。

 

For Each dr1 As DataRow In DataTables("product").Select("[newnum]<>0")
   
    If DataTables("kucun").Find("某列 = '" & dr1("某列") & "'") Is Nothing Then
        Dim dr2 As DataRow = DataTables("kucun").AddNew()
       
        For i As Integer = 0 To Cols1.Length -1
            dr2(Cols2(i)) = dr1(Cols1(i))
           
        Next
       
    End If
Next


 回到顶部