-- 作者:zcgmxf
-- 发布时间:2017/7/26 23:48:00
-- [求助] 移动开发
老师 下面的代码执行后会弹出如图所示 对话框,请问 单击确定按钮后如何才能返回 dlg1 对话框?谢谢!
Dim e As RequestEventArgs = args(0) Dim wb As New weui If e.PostValues.Count = 0 Then wb.AddForm("","form1","upload.htm") Dim gjs As List(of String) = DataTables("项目设置").GetValues("从业类别") With wb.AddInputGroup("form1","ipg1","请正确填写个人信息") .AddInput("体检日期","体检日期","date").Value = Format(Date.Today,"yyyy-MM-dd") .AddInput("姓名","姓名","Text") .AddInput("身份证号码","身份证号码","Text").Placeholder = "请输入正确的身份证号码" .AddSelect("性别","性别","男|女") .AddInput("年龄","年龄","number") .AddInput("工作单位","工作单位","Text") .AddSelect("从业类别","从业类别","|" & String.Join("|",gjs.ToArray)).Attribute = "" \'调用js函数. .AddSelect("工种","工种","") For Each gj As String In gjs wb.InsertHTML("<p hidden id=\'" & gj & "\'>" & DataTables("项目设置").GetComboListString("工种","从业类别=\'" & gj & "\'") & "</p>") Next wb.AppendHTML("<script src=\'./zizhutijiandengji/brands.js\'></script>") \'引入脚本文件 .AddInput("联系电话","联系电话","Text") With .AddUploader("照片","照片",False) .TextPosition = 0 \'标题靠左 .AllowDelete = True \'允许删除 .Incremental = True \'允许重复选择文件或连续拍照 .ScaleWidth = 150 \'自动压缩图片宽度为400个像素,高度等比例压缩 .Rotate = 1 End With .AddSwitch("登记完成","登记完成",False).Value = True End With With wb.AddButtonGroup("form1","btg1",False) .Add("btn1", "提交信息", "button").Attribute= "" .Attribute= "" \'调用js函数上传 .Add("btn1", "退出", "", "default.htm") End With wb.AddToast("","tst1", "正在上传",1) wb.AddToast("","tst2", "上传成功",0) wb.AddToast("","tst3", "上传失败",0).Icon= "warn" wb.AppendHTML("<script src=\'./zizhutijiandengji/scystp.js\'></script>") \'引入脚本文件 With wb.AddDialog("","dlg1", "提示","登记成功,是否继续登记?") \'增加订单成功提示框 .AddButton("btnYes","继续").Attribute = "" .AddButton("btnNo","退出","default.htm").Kind = 1 End With With wb.AddDialog("","dlg2", "必填项目","") \'增加订单失败提示框 .AddButton("btnOK","确定") End With wb.AppendHTML("<script src=\'./lib/dhk.js\'></script>") \'引入脚本文件 e.WriteString(wb.Build) Else Dim nms() As String = {"姓名","身份证号码","性别","年龄","工作单位","从业类别","工种","联系电话"} \'不能为空的列名数组 For Each nm As String In nms If e.PostValues.ContainsKey(nm) = False Then e.WriteString("<h3 align=\'center\' style=\'margin-top:5px;color:Blue\'> ""请输入:" & nm & "!"" </h3>") Return ""\'必须返回 End If Next Dim qrs() As String = {"登记完成"} \'不能为空的列名数组 For Each qr As String In qrs If e.PostValues.ContainsKey(qr) = False Then e.WriteString("<h3 align=\'center\' style=\'margin-top:5px;color:Blue\'> ""请确认:" & qr & "!"" </h3>") 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 For Each key As String In e.Files.Keys If key = "照片" Then For Each fln As String In e.Files(key) e.SaveFile(key, fln, "d:\\中心文件管理\\健康证照片\\Attachments\\" & dr("身份证号码") & ".bmp") Next dr("照片") = "健康证照片\\Attachments\\" & dr("身份证号码") & ".bmp" End If Next dr.save() Dim d As DataRow = DataTables("从业人员健康检查表").SQLFind("身份证号码= \'" & dr("身份证号码") & "\'") If d IsNot Nothing Then Dim str As String = dr("编号") Dim bh As String = str.SubString(10) e.WriteString("<h3 align=\'center\' style=\'margin-top:5px;color:Blue\'> 请记住您的体检编号: \'" & bh & "\' </h3>") End If e.WriteString("OK") End If
此主题相关图片如下:qq图片20170726234620.png
|