Foxtable(狐表)用户栏目专家坐堂 → [求助]开一个帖请教问题~


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

主题:[求助]开一个帖请教问题~

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/7/22 11:23:00 [只看该作者]

 那现在代码有什么问题,这句代码明细没有错啊 ndr("配比") = IIF(ndr("昨天配比")>0, 0, 1)

 

[此贴子已经被作者于2014-7-22 11:22:55编辑过]

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


加好友 发短信
等级:幼狐 帖子:184 积分:1148 威望:0 精华:0 注册:2014/6/10 20:24:00
我好像知道了~  发帖心情 Post By:2014/7/22 11:37:00 [只看该作者]

大概是我想多了~有点懂了!
然后想请教个用户问题~
就是我添加了一个用户  但他的权限我要设置下 他登录后 只能浏览系统里面的数据 只能去看
图片点击可在新窗口打开查看此主题相关图片如下:5.png
图片点击可在新窗口打开查看
不能去修改系统的里面的数据
这种权限是在哪种地方修改的?

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/7/22 11:44:00 [只看该作者]

 需要单独去做一个权限表

 

http://www.foxtable.com/help/topics/1600.htm

 


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


加好友 发短信
等级:幼狐 帖子:184 积分:1148 威望:0 精华:0 注册:2014/6/10 20:24:00
装配问题~有个问题  发帖心情 Post By:2014/7/25 21:42:00 [只看该作者]


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

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


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


加好友 发短信
等级:幼狐 帖子:184 积分:1148 威望:0 精华:0 注册:2014/6/10 20:24:00
装配问题~  发帖心情 Post By:2014/7/25 21:42:00 [只看该作者]

装配表产生的时候好像有个问题~ 
假设配7月20号的装配表   有两个客户7195  7185   
7195客户  19号也就是昨天有配过的   7185客户 昨天并没有配过  
但是最终产生的 装配表 两个客户 昨天的配比记录都存在~ 这个是有问题的!! 
代码是这样的:
Tables("装配表").Filter=" [日期] = '" & e.Form.Controls("DateTimePicker1").Value & "'"
Dim d As Date = e.Sender.Text
If DataTables("装配表").Find("日期 = #" & d & "#") Is Nothing Then
    SystemReady = False
    Dim n,n1,n2 As Integer
    Dim drs As List(Of DataRow) = DataTables("蔬菜采收表").Select("日期 = #" & d & "#")
    Dim drs_y As List(Of DataRow) = DataTables("蔬菜采收表").Select("日期 = #" & d.AddDays(-1) & "#")
    Dim drs_by As List(Of DataRow) = DataTables("蔬菜采收表").Select("日期 = #" & d.AddDays(-2) & "#")
    For Each dr As DataRow In DataTables("当天配送会员").Select("日期 = #" & d & "#")
        '统计是否满足装箱总斤数
        n=0
        n1=0
        n2=0
        Dim idx As Integer = 0
        For Each cdr As DataRow In drs
            Dim ndr As DataRow = DataTables("装配表").addnew
            If idx < drs_y.Count  Then
                ndr("昨天品种") = drs_y(idx)("品种")
                Dim fdr_y As DataRow = DataTables("蔬菜喜好表").Find("会员编号 = '" & dr("会员编号") & "' and 产品 = '" & drs_y(idx)("品种") & "'")
                If fdr_y IsNot Nothing Then
                    If fdr_y("喜好") = "吃" Then
                        n1=n1+1
                        If n1<=5 Then
                            ndr("昨天配比") = 1
                        Else
                            ndr("昨天配比") = 0
                        End If
                    ElseIf fdr_y("喜好") = "爱吃" Then
                        ndr("昨天配比") = 2
                        n1=n1+2
                        If n1<=5 Then
                            ndr("昨天配比") = 2
                        Else
                            ndr("昨天配比") = 0
                        End If
                    Else
                        ndr("昨天配比") = 0
                    End If
                    '没有找到记录     '
                Else
                    n1=n1+1
                    If n1<=5 Then
                        ndr("昨天配比") = 1
                    Else
                        ndr("昨天配比") = 0
                    End If
                End If
                
            End If
            If idx < drs_by.Count  Then
                ndr("前天品种") = drs_by(idx)("品种")
                Dim fdr_by As DataRow = DataTables("蔬菜喜好表").Find("会员编号 = '" & dr("会员编号") & "' and 产品 = '" & drs_by(idx)("品种") & "'")
                If fdr_by IsNot Nothing Then
                    If fdr_by("喜好") = "吃" Then
                        n2=n2+1
                        If n2<=5 Then
                            ndr("前天配比") = 1
                        Else
                            ndr("前天配比") = 0
                        End If
                    ElseIf fdr_by("喜好") = "爱吃" Then
                        n2=n2+2
                        If n2<=5 Then
                            ndr("前天配比") = 2
                        Else
                            ndr("前天配比") = 0
                        End If
                    Else
                        ndr("前天配比") = 0
                    End If
                    '没有找到记录     '
                Else
                    n2=n2+1
                    If n2<=5 Then
                        ndr("前天配比") = 1
                    Else
                        ndr("前天配比") = 0
                    End If
                End If
            End If
            ndr("日期") = dr("日期")
            ndr("会员编号") = dr("会员编号")
            ndr("品种") = cdr("品种")
            ndr("装箱总斤数")=dr("装箱斤数")
            Dim fdr As DataRow = DataTables("蔬菜喜好表").Find("会员编号 = '" & dr("会员编号") & "' and 产品 = '" & cdr("品种") & "'")
            
            If fdr IsNot Nothing Then
                ndr("喜好") = fdr("喜好")
                If fdr("喜好") = "吃" Then
                    n=n+1
                    '配比超过5斤
                    If n<=5 Then
                        'ndr("配比") = 1
                        ndr("配比") = IIF(ndr("昨天配比")>0, 0, 1) 
                        ndr("喜好参考")=1
                    Else
                        'ndr("配比") = 0
                        ndr("配比") = IIF(ndr("昨天配比")>0, 0, 1)  
                        ndr("喜好参考")=1
                    End If
                ElseIf fdr("喜好") = "爱吃" Then
                    n=n+2
                    '配比超过5斤
                    If n<=5 Then
                        'ndr("配比") = 1
                        ndr("配比") = IIF(ndr("昨天配比")>0, 0, 1)  
                        ndr("喜好参考")=2
                    Else
                        'ndr("配比") = 0
                        ndr("配比") = IIF(ndr("昨天配比")>0, 0, 1)  
                        ndr("喜好参考")=2
                    End If
                Else
                    ndr("配比") = 0
                    ndr("喜好参考")=0
                End If
                '没有找到记录     '
            Else
                n=n+1
                '配比超过5斤
                If n<=5 Then
                    ndr("喜好")="吃"
                    'ndr("配比") = 1
                    ndr("配比") = IIF(ndr("昨天配比")>0, 0, 1) 
                    ndr("喜好参考")=1
                Else
                    ndr("喜好")="吃"
                    'ndr("配比") = 0
                    ndr("配比") = IIF(ndr("昨天配比")>0, 0, 1)  
                    ndr("喜好参考")=1
                End If
            End If
            
            
            idx += 1
        Next
    Next
    For Each dr As DataRow In DataTables("装配表").Select("日期 = #" & d & "#")
        dr("小计") = DataTables("装配表").compute("sum(配比)", "日期 = #" & dr("日期") & "# and 会员编号 = '" & dr("会员编号") & "'")
        'dr("装箱参考")=dr("配比")
    Next
    SystemReady = True
End If

Dim t As Table = Forms("装配窗体").Controls("Table1").Table
Dim b As New GroupTableBuilder("统计表1", DataTables("装配表"))
b.Groups.AddDef("品种") '根据产品分组
b.Totals.AddDef("配比", AggregateEnum.Sum, "总数量") '对数量进行统计
b.Filter = "日期 = #" & d & "#"
t.DataSource = b.BuildDataSource '生成统计表
t.DataTable.DataCols.Add("实际产量", Gettype(Integer))
For Each r As Row In t.Rows
    Dim fdr As DataRow = DataTables("蔬菜采收表").Find("日期 = #" & d & "# And 品种 = '" & r("品种") & "'")
    If fdr IsNot Nothing Then
        r("实际产量") = fdr("实际产量")
    End If
Next

昨天和前天配比 好像是根据客户喜好产生的!!    正确的 应该是从 装配表里面 去读取20号昨天对应客户  也就是19号该客户的品种和配比 显示在昨天品种和昨天配比列上   
这个代码怎么调整?求指点!!

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/7/25 22:05:00 [只看该作者]

代码

 

Tables("装配表").Filter=" [日期] = '" & e.Form.Controls("DateTimePicker1").Value & "'"
Dim d As Date = e.Sender.Text
If DataTables("装配表").Find("日期 = #" & d & "#") Is Nothing Then
    SystemReady = False
    Dim n,n1,n2 As Integer
    Dim drs As List(Of DataRow) = DataTables("蔬菜采收表").Select("日期 = #" & d & "#")
    For Each dr As DataRow In DataTables("当天配送会员").Select("日期 = #" & d & "#")
        '统计是否满足装箱总斤数
        n=0
        Dim idx As Integer = 0
        For Each cdr As DataRow In drs
            Dim ndr As DataRow = DataTables("装配表").addnew
            ndr("日期") = dr("日期")
            ndr("会员编号") = dr("会员编号")
            ndr("品种") = cdr("品种")
            ndr("装箱总斤数")=dr("装箱斤数")
            Dim fdr As DataRow = DataTables("蔬菜喜好表").Find("会员编号 = '" & dr("会员编号") & "' and 产品 = '" & cdr("品种") & "'")
            Dim pfdr As DataRow = DataTables("装配表").Find("会员编号 = '" & dr("会员编号") & "' and 品种 = '" & cdr("品种") & "' and 日期 = #" & d.AddDays(-1) & "#")
            If pfdr IsNot Nothing Then
                ndr("昨天配比") = pfdr("配比")
                ndr("昨天品种") = pfdr("品种")
            End If
            pfdr = DataTables("装配表").Find("会员编号 = '" & dr("会员编号") & "' and 品种 = '" & cdr("品种") & "' and 日期 = #" & d.AddDays(-2) & "#")
            If pfdr IsNot Nothing Then
                ndr("前天配比") = pfdr("配比")
                ndr("前天品种") = pfdr("品种")
            End If
            If fdr IsNot Nothing Then
                ndr("喜好") = fdr("喜好")
                If fdr("喜好") = "吃" Then
                    n=n+1
                    '配比超过5斤
                    If n<=5 Then
                        'ndr("配比") = 1
                        ndr("配比") = IIF(ndr("昨天配比")>0, 0, 1)
                        ndr("喜好参考")=1
                    Else
                        'ndr("配比") = 0
                        ndr("配比") = IIF(ndr("昨天配比")>0, 0, 1)
                        ndr("喜好参考")=1
                    End If
                ElseIf fdr("喜好") = "爱吃" Then
                    n=n+2
                    '配比超过5斤
                    If n<=5 Then
                        'ndr("配比") = 1
                        ndr("配比") = IIF(ndr("昨天配比")>0, 0, 1)
                        ndr("喜好参考")=2
                    Else
                        'ndr("配比") = 0
                        ndr("配比") = IIF(ndr("昨天配比")>0, 0, 1)
                        ndr("喜好参考")=2
                    End If
                Else
                    ndr("配比") = 0
                    ndr("喜好参考")=0
                End If
                '没有找到记录     '
            Else
                n=n+1
                '配比超过5斤
                If n<=5 Then
                    ndr("喜好")="吃"
                    'ndr("配比") = 1
                    ndr("配比") = IIF(ndr("昨天配比")>0, 0, 1)
                    ndr("喜好参考")=1
                Else
                    ndr("喜好")="吃"
                    'ndr("配比") = 0
                    ndr("配比") = IIF(ndr("昨天配比")>0, 0, 1)
                    ndr("喜好参考")=1
                End If
            End If
        Next
    Next
    For Each dr As DataRow In DataTables("装配表").Select("日期 = #" & d & "#")
        dr("小计") = DataTables("装配表").compute("sum(配比)", "日期 = #" & dr("日期") & "# and 会员编号 = '" & dr("会员编号") & "'")
        'dr("装箱参考")=dr("配比")
    Next
    SystemReady = True
End If


Dim t As Table = Forms("装配窗体").Controls("Table1").Table
Dim b As New GroupTableBuilder("统计表1", DataTables("装配表"))
b.Groups.AddDef("品种") '根据产品分组
b.Totals.AddDef("配比", AggregateEnum.Sum, "总数量") '对数量进行统计
b.Filter = "日期 = #" & d & "#"
t.DataSource = b.BuildDataSource '生成统计表
t.DataTable.DataCols.Add("实际产量", Gettype(Integer))
For Each r As Row In t.Rows
    Dim fdr As DataRow = DataTables("蔬菜采收表").Find("日期 = #" & d & "# And 品种 = '" & r("品种") & "'")
    If fdr IsNot Nothing Then
        r("实际产量") = fdr("实际产量")
    End If
Next


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


加好友 发短信
等级:幼狐 帖子:184 积分:1148 威望:0 精华:0 注册:2014/6/10 20:24:00
可以  发帖心情 Post By:2014/7/25 22:10:00 [只看该作者]

试验了下~ 可以了 !非常感谢

 回到顶部
总数 27 上一页 1 2 3