Case "jihuo.htm" '激活卡号
If e.PostValues.Count = 0 Then
wb.AddTopTips("", "toptip1", "") '用于显示动态错误提示
wb.AddForm("", "form1", "jihuo.htm").Attribute = ""
UserName = e.Cookies("username")
OpenID = e.Cookies("openid")
KHID = e.Cookies("KHID")
Dim dr2 As DataRow = DataTables("会员充值").SQLFind("openid ='" & Openid & "'")
If dr2 Is Nothing Then
With wb.AddInputGroup("form1", "ipg1", "客户资料") '空行时候,从客户信息里引来的数据
.AddHiddenValue("openid", dr1("openid"))
.AddHiddenValue("KHID", dr1("KHID"))
.AddHiddenValue("nickname", dr1("nickname"))
.AddInput("姓名", "姓名", "Text").value = dr1("客户名") '前一个"姓名"是ID,后一个"姓名"是标题
.AddInput("电话", "电话", "number").value = dr1("电话")
With .AddInput("地址", "地址", "Text")
.value = dr1("客户住址_蓝牌地址")
.PlaceHolder = "唯一地址,不可更改"
End With
End With
With wb.AddInputGroup("form1", "ipg2", "会员类型")
With .AddSelect("类别", "类别", "|" & DataTables("会员类型").GetComboListString("类别"))
.Attribute = """
End With
.AddSelect("会员类型", "会员类型", "")
.AddHiddenValue("入会日期", Date.Today)
.AddInput("年费", "售价", "Text")
.AddInput("卡号", "卡号", "Text")
.AddInput("激活码", "密码", "password")
.AddInput("销售人", "推荐人", "Text")
End With
With wb.AddButtonGroup("form1", "btg1", True)
.Add("btn3", "提交绑卡信息", "submit")
End With
wb.AppendHTML("<script src='./lib/jhyztk.js'></script>") '引入脚本文件 判断数据
e.WriteString(wb.Build)
Else
Dim nms() As String = {"openid", "姓名", "电话", "入会日期", "地址", "类别", "会员类型", "卡号", "年费", "销售人", "激活码"} '不能为空的列名数组
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) = False Then '生成错误提示页
With wb.AddMsgPage("", "msgpage", "增加失败", nm & "不能为空!")
.icon = "Warn" '改变图标
.AddButton("btn1", "返回").Attribute = ""
End With
e.WriteString(wb.Build)
Return '必须返回
End If
Next
nms = New String() {"openid", "nickname", "KHID", "姓名", "电话", "入会日期", "类别", "地址", "会员类型", "卡号", "年费", "销售人"} '重新定义了nms数组,增加了两列.
Dim dr3 As DataRow = DataTables("会员充值").AddNew()
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) Then
dr3(nm) = e.PostValues(nm)
End If
Next
dr3.save()
With wb.AddMsgPage("", "msgpage", "增加成功", "用心服务好每一个家庭") '生成成功提示页
' .AddButton("btn1", "继续修改", "jihuo.htm").Kind = 1
.AddButton("btn2", "返回首页", "default.htm")
End With
e.WriteString(wb.Build)
End If