Dim e As RequestEventArgs = args(0)
Dim wb As New weui
Dim dr As DataRow = DataTables("用户").sqlfind("身份证号 = '" & e.Cookies("username") & "'")
If e.GetValues.ContainsKey("deldid") Then
DataTables("学生信息").SQLDeleteFor("[_Identify] = " & e.GetValues("deldid"))
End If
'订单编辑
Dim pr As DataRow '订单
Dim srs As List(of DataRow) '订单明细集合
Dim Page As Integer '页码变量
If e.GetValues.ContainsKey("page") Then '如果地址中有page参数
Integer.TryParse(e.GetValues("page"), page) '提取page参数
End If
If e.GetValues.ContainsKey("oid") = False Then '如果没有传递订单编号,则新增与一个订单
pr = DataTables("学生信息").addNew()
pr("状态")="在读原籍在读"
DataTables("学生信息").save
Else '如果传递了订单编号,则找出此订单进行编辑
pr = DataTables("学生信息").SQLFind("_Identify='" & e.GetValues("oid") & "'")
If pr Is Nothing Then '多用户情况下,必须考虑其他用户删除订单的可能.
wb.InSertHtml("该学生信息删除了")
e.WriteString(wb.Build)
Return "" '必须返回
End If
End If
wb.AppendCookie("xssfzh",pr("身份证件号"))
Dim url As String= "edit.htm?page=" & page & "&oid=" & pr("_Identify") '传递页码和订单编号
wb.AddForm("","form1",url)
With wb.AddInputGroup("form1","ipg1","信息修改")
Dim In1 = .AddInput("学生姓名","学生姓名","text")
In1.Value = pr("学生姓名")
in1.attribute ="style='margin-top:5px;color:blue'"
.AddInput("身份证件号","身份证号","text").Value = pr("身份证件号")
.AddInput("学籍号","学 籍","text").Value = pr("学籍号")
.AddInput("联系电话","联系电话","text").Value = pr("联系电话")
.AddInput("家庭住址","家庭住址","text").Value = pr("家庭住址")
If pr.Isnull("民族")
.AddSelect("民族","民 族"," |" & DataTables("民族代码").SQLGetComboListString("民族","","代码"))
Else
.AddSelect("民族","民 族"," |" & DataTables("民族代码").SQLGetComboListString("民族","","代码").replace(pr("民族"), "[" & pr("民族") & "]"))
End If
If pr.Isnull("政治面貌")
.AddSelect("政治面貌","政治面貌"," |" & DataTables("政治面貌").SQLGetComboListString("政治面貌","","代码"))
Else
.AddSelect("政治面貌","政治面貌",pr("政治面貌") & "|" & DataTables("政治面貌").SQLGetComboListString("政治面貌","","代码"))'.replace(pr("政治面貌"), "[" & pr("政治面貌") & "]"))
End If
If pr("户口性质") = "农业户口"
.AddSelect("户口性质","户口性质"," |[农业户口]|非农业户口")
ElseIf pr("户口性质") = "非农业户口"
.AddSelect("户口性质","户口性质"," |农业户口|[非农业户口]")
Else
.AddSelect("户口性质","户口性质"," |农业户口|非农业户口")
End If
If pr.Isnull("健康状况")
.AddSelect("健康状况","健康状况"," |" & DataTables("健康状况").SQLGetComboListString("健康状况"))
Else
.AddSelect("健康状况","健康状况"," |" & DataTables("健康状况").SQLGetComboListString("健康状况").replace(pr("健康状况"), "[" & pr("健康状况") & "]"))
End If
.AddSelect("状态","状 态",pr("状态") & "|在读原籍在读|在读区内转入|在读市内转入|在读省内转入|在读国内转入|转出区内转出|转出市内转出|转出省内转出|转出国内转出|转出毕业转出|转出其他转出")
Dim bj As String = pr("班级")
If bj.Length>=9
Dim xd As String = bj.SubString(0,2)
Dim ji As String = bj.Substring(2,5)
Dim ban As String = bj.split("级")(1)
Dim lb As String = "小学|初中|高中"
lb = lb.replace(xd,"[" & xd & "]")
.AddSelect("学段","学 段",lb)
.AddSelect("学级","学 级"," |" & DataTables("级").SQLGetComboListString("级","","级").replace(ji, "[" & ji & "]"))
.AddSelect("班级","班 级",ban & "|" & DataTables("班").SQLGetComboListString("班","","序"))
Else
.AddSelect("学段","学 段","|小学|初中|高中")
.AddSelect("学级","学 级"," |" & DataTables("级").SQLGetComboListString("级","","级"))
.AddSelect("班级","班 级"," |" & DataTables("班").SQLGetComboListString("班","","序"))
End If
End With
wb.AppendHTML("<script type='text/javascript' src='./lib/common.js'></script>", True)
wb.InsertHTML("form1", "<div id='imgs'></div>")
With wb.AddButtonGroup("form1","btg1",False)
.Add("btn2", "保存", "submit") '正常提交,保存后进入编辑状态
' .Add("btn2", "照相", "button","camera.htm")
.Add("btn1", "拍照", "button").Attribute = """
If e.GetValues.ContainsKey("oid") = True Then '如过是新增订单
If dr("角色").Contains("班主任")=True
.Add("btn3", "返回", "button","xlist.htm?page=" & page & "&oid=" & pr("_Identify")) '删除新增订单后返回列表
End If
If dr("角色").Contains("教务主任")=True
.Add("btn3", "返回", "button","xlist.htm?page=" & page & "&oid=" & pr("_Identify")) '删除新增订单后返回列表
End If
Else
If dr("角色").Contains("班主任")=True
.Add("btn3", "返回", "button","list.htm?page=" & page) '返回列表
End If
If dr("角色").Contains("教务主任")=True
.Add("btn3", "返回", "button","xlist.htm?page=" & page) '返回列表
End If
End If
End With
pr.Save()
If e.PostValues.Count > 0 Then '如果是通过提交按钮访问,则给一个已经保存的提示给用户,时长500毫秒
wb.AddToast("","t1", "已经保存",0).Msec= 500
End If
wb.AppendHTML("<script type='text/javascript' src='./lib/camera.js'></script>")
wb.AppendHTML("<script src='./lib/order.js'></script>") '引入脚本文件
e.WriteString(wb.Build) '生成网页
老师,我加了红色的几句,现在有一个大的进步就是在APP下能调入摄像头了,但拍摄的图片如何保存为当前身份证号的文件名如何做,如何将文件名保存表学生信息表中,功力不够,对你来说易如反掌,对我们初学者难如登天,请帮忙明示,以便慢慢理解来掌握。