Dim e As RequestEventArgs = args(0)
Dim wb As New weui
Dim uuid As String = Guid.NewGuid.TOstring()
wb.AddTopTips("","toptip1","请输入手机号和验证码!")
If e.PostValues.Count = 0 Then
wb.Title = "生态环境和资源保护领域"
wb.AddForm("","form1","testyzm.htm").Attribute = "onsu bmit='return valid()'"
With wb.AddInputGroup("form1","ipg212","")
With .AddInput("举报类型","举报类型","text")
.Readonly=True
.Value="生态环境和资源保护领域"
End With
.AddInput("线索地点","线索地点*","text").PlaceHolder = "请输入准确的地址"
.AddInput("位置描述","位置描述*","text").PlaceHolder = "请输入地址辅助性说明"
End With
With wb.AddInputGroup("form1","ipg22","线索描述*")
With .AddTextArea("bz",5)
.Placeholder = "请准确输入线索描述……"
End With
End With
With wb.AddInputGroup("form1","ipg2","图片或视频上传") '文件上传
With.AddUploader("up1","",True) 'True表示允许上传多个文件
.AllowDelete = True '允许删除
.Incremental = True '允许重复选择文件或连续拍照
.ScaleWidth = 1024
End With
Dim sb As New StringBuilder
sb.appendLine("<div>")
sb.appendLine("单文件上传: <input type='file' name='up1' id='up1'><br/>")
sb.appendLine("多文件上传: <input type='file' name='up2' id='up2' multiple>")
sb.appendLine("</div>")
wb.InsertHTML("form1",sb.ToString)
End With
Dim rdg As ExWeUI.ExRadioGroup = ExWeUI.WebUI.AddRadioGroup("form1","rdg1","是否实名举报</span>")
rdg.add("rd1","实名举报").Attribute = "onch ange='jubaoxianshi()'"
rdg.add("rd2","匿名举报",True).enabled = True
wb.InsertHTML("form1",rdg.BuildHtml)
With wb.AddInputGroup("form1","ipg100","")
With .AddInputCell("ic3") '通过InputCell增加输入框
.AddLabel("ljbr","举报人",0) '增加标签,0显示在左边
.AddInput("jbr","text",1).PlaceHolder = "请输入真实姓名" '增加输入框,1表示显示在中间
End With
End With
With wb.AddInputGroup("form1","ipg12","")
With .AddInputCell("ic6") '通过InputCell增加输入框
.AddLabel("lsj","联系电话",0) '增加标签,0显示在左边
.AddInput("sjh","text",1).PlaceHolder = "请输入联系电话" '增加输入框,1表示显示在中间
.AddVcodeButton("vyz","获取验证码",2).Attribute="on click='getNum()'"
End With
With .AddInputCell("ic7") '通过InputCell增加输入框
.AddLabel("lyzm","验证码",0) '增加标签,0显示在左边
.AddInput("yzm","text",1).PlaceHolder = "请输入短信中的验证码" '增加输入框,1表示显示在中间
End With
End With
Dim rdg1 As ExWeUI.ExRadioGroup = ExWeUI.WebUI.AddRadioGroup("form1","rdg2","是否申请奖励</span>")
rdg1.add("rd11","申请奖励").Attribute = "onc hange='jianglixianshi()'"
rdg1.add("rd21","不申请奖励",True).enabled = True
wb.InsertHTML("form1",rdg1.BuildHtml)
Dim bt As String ="根据《奖励办法(试行)》对符合条件的线索进行奖励,点击获取《奖励办法(试行)》详情.注:领取奖励需要实名"
With wb.AddInputGroup("form1","ipg222","申请奖励须知")
With .AddTextArea("bz1",3)
.Readonly=True
.Value= bt
End With
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "确定", "submit").Attribute= "onc lick='submitForm3()'" '调用js函数上传
End With
'With wb.AddButtonGroup("form1","btg1",False)
'.Add("btn1", "确定上传", "button").Attribute= "onc lick='submitForm3()'" '调用js函数上传
'.Add("btn2", "取消上传", "submit").FormAction = "default.htm"
'wb.InsertHTML("<div id='someelement'></div>")
'End With
With wb.AddDialog("","dlg1", "增加成功","好好学习,天天向上!")
.AddButton("btnOK","继续增加","testyzm.htm")
End With
wb.AddToast("","tst1", "正在上传",1)
wb.AddToast("","tst2", "上传成功",0)
wb.AddToast("","tst3", "上传失败",0).Icon= "warn"
wb.AppendHTML("<script>" & vars("yanzhengma") & "</script>") '引入脚本文件
wb.AppendHTML("<script>" & vars("jubao") & "</script>") '引入脚本文件
e.WriteString(wb.Build) '生成网页
Else
Dim st As New Date(1970,1,1,8,0,0)
Dim d As Date = cdate("2020-02-01")
Dim t As Long = (Date.Now - st).TotalSeconds()
dim a as boolean = e.PostValues.ContainsKey("rd1")
Dim a1 As Boolean=e.PostValues.ContainsKey("rd2") Then
Dim a12 As Boolean=e.PostValues.ContainsKey("rd11") Then
Dim a13 As Boolean=e.PostValues.ContainsKey("rd21") Then
Dim cmd As New SQLC ommand
cmd.Connect ionN ame = "智慧党建"
cmd.CommandText = "Ins ert Into 线索举报 (uuid,举报类型,线索地点,位置描述,线索描述,实名举报,匿名举报,联系人,联系电话,验证码,申请奖励,不申请奖励,举报时间) Values(?,?,?,?,?,?,?,?,?,?,?,?,?)"
cmd.Parameters.Add("@uuid", uuid)
MessageBox.Show(a)
cmd.Parameters.Add("@举报类型", e.PostValues("举报类型"))
cmd.Parameters.Add("@线索地点", e.PostValues("线索地点"))
cmd.Parameters.Add("@位置描述", e.PostValues("位置描述"))
cmd.Parameters.Add("@线索描述", e.PostValues("bz"))
cmd.Parameters.Add("@实名举报", a)
cmd.Parameters.Add("@匿名举报", a1)
cmd.Parameters.Add("@联系人", e.PostValues("jbr"))
cmd.Parameters.Add("@联系电话", e.PostValues("sjh"))
cmd.Parameters.Add("@验证码", e.PostValues("yzm"))
cmd.Parameters.Add("@申请奖励", a12)
cmd.Parameters.Add("@不申请奖励", a13)
cmd.Parameters.Add("@举报时间",Date.now)
cmd.ExecuteNonQuery
For Each key As String In e.Files.Keys
If key = "up1" Then
For Each fln As String In e.Files(key)
Dim wj As String =ProjectPath & "Attachments\" & fln
e.SaveFile(key,fln,wj)
Dim cmd1 As New SQLC ommand
cmd1.ConnectionN ame = "智慧党建"
cmd1.CommandText = "Ins ert Into web上传图片附件 (会议编号,时间戳,图片名称,图片类别,图片) Values(?,?,?,?,?)"
cmd1.Parameters.Add("@会议编号", uuid)
cmd1.Parameters.Add("@时间戳", t)
cmd1.Parameters.Add("@图片名称", FileSys.GetName(wj))
cmd1.Parameters.Add("@图片类别", e.PostValues("举报类型"))
Dim ImageByte() As Byte = System.IO.File.ReadAllBytes(wj) '读取文件流,并将读到的二进制数据放入数组ImageByte中,
cmd1.Parameters.Add("@图片", ImageByte)
cmd1.ExecuteNonQuery
Next
End If
If key = "up2" Then
For Each fln As String In e.Files(key)
Dim wj As String =ProjectPath & "Attachments\" & fln
e.SaveFile(key,fln,wj)
Dim cmd1 As New SQLC ommand
cmd1.Connecti
cmd1.CommandText = "Ins ert Into web上传图片附件 (会议编号,时间戳,图片名称,图片类别,图片) Values(?,?,?,?,?)"
cmd1.Parameters.Add("@会议编号", uuid)
cmd1.Parameters.Add("@时间戳", t)
cmd1.Parameters.Add("@图片名称", FileSys.GetName(wj))
cmd1.Parameters.Add("@图片类别", e.PostValues("举报类型"))
Dim ImageByte() As Byte = System.IO.File.ReadAllBytes(wj) '读取文件流,并将读到的二进制数据放入数组ImageByte中,
cmd1.Parameters.Add("@图片", ImageByte)
cmd1.ExecuteNonQuery
Next
End If
Next
e.WriteString("OK")
'e.WriteString(wb.Build) '生成网页
DataTables("线索举报").load
End If