编译错误:function、get或operator中的retun语句 必须返回值
Dim e As RequestEventArgs = args(0)
Select Case e.Path
Case "addludan.htm"
Dim wb As New weui
Dim chp As List(of String) = DataTables("ZL_车辆信息").SQLGetValues("牌照号")
Dim zhucao As List(of String) = DataTables("RL_员工档案").SQLGetValues("姓名","当前_岗位 in ('010105','010106')","姓名 Desc")
Dim zhihui As List(of String) = DataTables("RL_员工档案").SQLGetValues("姓名","当前_岗位 in ('010105','010106,010107')","姓名 Desc")
wb.AddForm("","form1","handle.htm") '指定接收表单数据的的页面为handle.htm
With wb.AddInputGroup("form1","ipg1","新增路单")
.AddInput("LdName","姓  名:","text").Value=e.Cookies("uname")
.AddSelect("MonthOrDay","用车形式:","台班|包月")
.AddSelect("VehicleSource","车辆来源:","自有|外协")
.AddSelect("PlateNumber","牌 照 号:","|" & String.Join("|",chp.ToArray))
.AddInput("WorkUnit","用车单位:","text")
.AddInput("WorkUnit2","二级单位:","text")
.AddInput("WorkSite","用车地点:","text")
.AddInput("WorkContent","作业内容:","text")
.AddInput("BeganDate","开始时间:","datetime-local")
.AddInput("EndDate","结束时间:","datetime-local")
.AddSelect("FirstOperator","主  操:","|" & String.Join("|",zhucao.ToArray))
.AddSelect("DeputyOperator","副  操:","|" & String.Join("|",zhucao.ToArray))
.AddSelect("FirstCommander","主 指 挥:","|" & String.Join("|",zhihui.ToArray))
.AddSelect("DeputyCommander","副 指 挥:","|" & String.Join("|",zhihui.ToArray))
.AddSelect("SettlementModes","结账方式:","签单|现金")
.AddInput("CashAmount","现金金额:","number").Step = "0.01"
.AddInput("SigningHours","签单时长:","number").Step = "0.1"
.AddSelect("ChargVehicle","计费车型:","8|16|20|25|35|50|75|100|130|160|200|220|260|300|350")
With wb.AddInputGroup("form1","ipg2","备 注:")
.AddTextArea("Remarks",5).Placeholder = "请输入200字以内的备注"
End With
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "确定", "button").Attribute= ""
End With
With wb.AddDialog("","dlg1", "提示","增加路单成功,是否继续增加?") '增加订单成功提示框
.AddButton("btnYes","是").Attribute = ""
.AddButton("btnNo","否","http://www.anqy.work/index.htm").Kind = 1
End With
With wb.AddDialog("","dlg2", "错误","") '增加订单失败提示框
.AddButton("btnOK","确定")
End With
wb.AppendHTML("<script src='./lib/ldadd_ajaxform.js'></script>") '引入脚本文件
e.WriteString(wb.Build)
Case "handle.htm"
Dim nms() As String = {"LdName","MonthOrDay","VehicleSource","PlateNumber","WorkUnit","WorkUnit2","WorkSite","WorkContent","BeganDate","EndDate","FirstOperator","DeputyOperator","DeputyOperator","FirstCommander","DeputyCommander","SettlementModes","CashAmount","SigningHours","ChargVehicle","Remarks"}
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) = False Then
e.WriteString("请输入" & nm & "!") '返回错误消息
Return '必须返回
End If
Next
Dim dr As DataRow = DataTables("yw_ld").AddNew()
For Each nm As String In nms
dr(nm) = e.PostValues(nm)
Next
dr.Save()
e.WriteString("OK") '返回增加成功消息
End Select
[此贴子已经被作者于2020/5/5 14:41:49编辑过]