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