Foxtable(狐表)用户栏目专家坐堂 → 直接添加子表明细,求助


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

主题:直接添加子表明细,求助

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


加好友 发短信
等级:九尾狐 帖子:2482 积分:22932 威望:0 精华:0 注册:2011/3/29 17:14:00
直接添加子表明细,求助  发帖心情 Post By:2019/10/4 0:17:00 [只看该作者]

Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI '定义一个基于weui框架的网页生成器
Select Case e.Path
    Case "xzrl00001.htm"
        '------------------------------------------------------------------------------------------------------------------------------
        wb.AddPageTitle("","pageheader","艺徒国际","全球卓越人才档案")
        If e.PostValues.Count = 0 Then
            wb.AddForm("","form1","xzrl00001.htm")
            With wb.AddInputGroup("form1","ipg1","基础信息》》( * 号为必填)")
                With .AddInput("应聘日期","建档日期:*","date")
                    .Value = Date.Today
                End With
                .AddInput("职员姓名","姓名:*","Text")
                .AddInput("性别","性别*:","Text")
                .AddInput("身份证","身份证*:","Text")
            End With
            
            
            
            参考的这个帮助;没有这个复杂   http://www.foxtable.com/mobilehelp/
            子表都是通过身份证关联  增加多行即可
            
            ''''职员子表明细非关联添加
            'Dim dr As DataRow '订单
            'Dim url As String =  dr("身份证")  '传递页码和订单编号
            'If IsNew OrElse mr IsNot Nothing  Then
            'With wb.AddInputGroup("form1","ipg2",iif(IsNew,"新增明细","编辑明细"))
            'With wb.AddInputGroup("form1","ipg11","家庭信息》》")
            ''If IsNew Then '如果是新增订单明细
            '.AddInput("称谓","称谓","text")
            '.AddInput("亲人姓名","亲人姓名","text")
            '.AddInput("工作单位","工作单位","text")
            '.AddInput("职业","职业","text")
            '.AddInput("联系电话","联系电话","text")
            ''.AddInput("身份证","身份证","text").Value = mr("产品")
            'End With
            'End With
            'End If
            '
            'With wb.AddTable("form1","detailTable") '为了区分,明细表的名字设为detailTable
            '.head.AddRow("称谓","亲人姓名","工作单位","职业","联系电话")
            'End With
            '
            'With wb.AddButtonGroup("form1","btg2",False)
            '.Add("btn1", "增加亲人", "submit").FormAction = ""
            'End With
            '
            With wb.AddButtonGroup("form1","btg1",True)
                .Add("btn1", "确定提交", "submit")
            End With
            e.WriteString(wb.Build)
        Else
            
            Dim nms() As String = {"职员姓名","身份证","性别","民族","手机号","私人邮箱","政治面貌","婚姻状况","紧急联系人","与本人关系","联系人方式","文化程度","家庭住址","现居住地址","应聘信息_应聘岗位","应聘信息_期待薪酬","自我评价_个人技能与特长","自我评价_综合素质评价","身高" } '不能为空的列名数组
            For Each nm As String In nms
                If e.PostValues.ContainsKey(nm) = False Then '生成错误提示页
                    With wb.AddMsgPage("","msgpage","增加失败", nm & "列不能为空!")
                        .icon = "Warn" '改变图标
                        .AddButton("btn1","返回").Attribute = ""
                    End With
                    e.WriteString(wb.Build)
                    Return "" '必须返回
                End If
            Next
            
            nms = New String() {"职员姓名","身份证","出生日期","性别","民族","手机号","微信号","私人邮箱","籍贯","政治面貌","血型","婚姻状况","紧急联系人","与本人关系","联系人方式","毕业院校","文化程度","家庭住址","现居住地址","应聘信息_应聘岗位","应聘信息_期待薪酬","应聘信息_预计上班时间","仪容仪表气质评价","身高","自我评价_个人技能与特长","自我评价_综合素质评价" }   '重新定义了nms数组,增加了两列.
            Dim dr As DataRow = DataTables("人才档案").AddNew()
            For Each nm As String In nms
                If e.PostValues.ContainsKey(nm) Then
                    dr(nm) = e.PostValues(nm)
                End If
            Next
            dr("人档ID") = "TOYF" & Format(Date.now,"yyMMdd-HHmmss")
            For Each key As String In e.Files.Keys
                If key = "up1" Then
                    For Each fln As String In e.Files(key)
                        e.SaveFile(key, fln, ProjectPath & "Attachments\职员靓照\" & fln)  
                    Next
                    dr.Lines("图片") = e.Files(key)
                End If
            Next
            dr.save()
            With wb.AddMsgPage("","msgpage","增加成功", "艺徒创造更多感动!期待您加入!") '生成成功提示页
            End With
            e.WriteString(wb.Build)
        End If
        
        '-----------------------------------------------------------------------------------
End Select
[此贴子已经被作者于2019/10/4 0:47:13编辑过]

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:111422 积分:567186 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/10/6 10:52:00 [只看该作者]

没看懂,截图上说明要什么效果?

 回到顶部