Dim e As RequestEventArgs = args(0)
Dim wb As New weui
wb.AddPageTitle("","ph1","<lable style='font-size:30px'>下单-复核</lable>","用户名:" & DecryptText(e.Cookies("username"),"123","123"))
Dim PageNumber As Integer = e.GetValues("page")
Dim PrimaryKey As Integer = e.GetValues("key")
Dim PageURL = "Xddfh.htm?page=" & PageNumber
If e.PostValues.Count = 0 Then '生成编辑页面
Dim dr As DataRow = _dt生产任务通知.SQLFind("[_Identify]=" & PrimaryKey & " And 复核意见 Is NULL And 下单作废 = 0 And 录入人 <> '" & DecryptText(e.Cookies("username"),"123","123") & "'")
If dr IsNot Nothing Then
wb.AddForm("","form1","Xdfh.htm?key=" & PrimaryKey & "&page=" & PageNumber)
With wb.AddInputGroup("form1","ipg1","")
With .AddInput("合同类型","合同类型","text")
.Value = dr("合同类型")
.Readonly= True
End With
。。。此处省略各种网页控件
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "提交", "submit").Value = "提交"
.Add("btn2", "返回", "submit").Value = "返回"
End With
End With
Else
Dim dr1 As DataRow = _dt生产任务通知.SQLFind("[_Identify]=" & PrimaryKey)
Dim fk As String
If dr1("下单作废") = True Then
fk = "此下单已经被作废"
End If
If dr1("复核意见") <> Nothing Then
If fk > "" Then
fk = fk & "并且此单已经复核"
Else
fk = "此单已经复核"
End If
End If
If dr1("录入人") = DecryptText(e.Cookies("username"),"123","123") Then
If fk > "" Then
fk = fk & "并且你不能复核自己下的单"
Else
fk = "你不能复核自己下的单"
End If
End If
With wb.AddMsgPage("","msgpage","复核失败",fk) '提示用户下单不可复核
.icon= "Warn"
.AddButton("btn1","返回",PageURL) '生成返回原来页面的按钮
End With
End If
ElseIf e.PostValues("btn2") = "返回" Then
e.Redirect(PageURL)
ElseIf e.PostValues("复核意见") = "驳回" And e.PostValues("复核备注") = "" Then
With wb.AddMsgPage("","msgpage","提交失败", "当驳回时复核备注不能为空!")
.icon = "Warn" '改变图标
.AddButton("btn1","返回").Attribute = ""
End With
e.WriteString(wb.Build)
Return "" '必须返回
Else '保存编辑结果
Dim dr As DataRow = _dt生产任务通知.SQLFind("[_Identify]=" & PrimaryKey & " And 复核意见 Is NULL")
If dr IsNot Nothing Then
dr("复核意见") = e.PostValues("复核意见")
dr("复核备注") = e.PostValues("复核备注")
dr("复核人") = DecryptText(e.Cookies("username"),"123","123")
dr("复核时间") = Date.Now
dr.Save()
'显示完成提示,2妙手自动返回原来的页面
wb.AppendHtml("<meta http-equiv='refresh' c>",True)
wb.AddToast("","t1", "下单复核成功",0).Visible = True
Else
With wb.AddMsgPage("","msgpage","保存失败", "此下单已经被复核!") '提示用户下单不可作废
.icon= "Warn"
.AddButton("btn1","返回",PageURL) '生成返回原来页面的按钮
End With
End If
End If
e.WriteString(wb.Build) '生成网页