有两张表 一张 客户资料表 一张 客户明细表
下面这个把客户资料表 做了录入 我想做一个展开建(显示
此主题相关图片如下:微信图片_20180110212950.jpg
更多字段) 展开 客户明细表 输入明细数据 关联的是 客户ID 字段
Select Case e.Path
Case "kfbb.htm"
wb.AddPageTitle("","pageheader","渠道客户报备","艾迪尔木作事业部")
If e.PostValues.Count = 0 Then
wb.AddForm("","form1","kfbb.htm")
With wb.AddInputGroup("form1","ipg1","基础信息:")
.AddInput("日期","报备时间:","date")
.AddInput("建档人","报备人:","Text")
.AddSelect("客户类别","客户类别","请选择|高端肄业|设计师|终端用户|内部职员|销售经营|其他")
.AddInput("客户姓名","客户姓名:","Text")
.AddInput("单位名称","单位名称:","Text")
.AddInput("职务","职务:","Text")
.AddInput("电话","手机:","Text")
.AddInput("QQ","QQ:","Text")
.AddInput("微信","微信:","Text")
.AddInput("邮箱","邮箱:","Text")
End With
With wb.AddInputGroup("form1","ipg7","备注")
.AddTextArea("备注",5).Placeholder = "其他描述!"
End With
With wb.AddButtonGroup("form1","btg8",True)
.Add("btn1", "提交资料", "submit")
End With
e.WriteString(wb.Build)
Else
Dim nms() As String = {"客户姓名","职务","电话","微信","单位名称","建档人"} '不能为空的列名数组
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() {"日期","客户姓名","电话","微信","单位名称","备注","客户类别","职务","建档人","邮箱","QQ" } '重新定义了nms数组,增加了两列.
Dim dr As DataRow = DataTables("客户资料库").AddNew()
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) Then
dr(nm) = e.PostValues(nm)
End If
Next
wb.InsertHTML("您的报备如下,请注意我们的确认信息:<br/>")
For Each key As String In e.PostValues.Keys
wb.InsertHTML(key & ":" & e.PostValues(key) & "<br/>")
Next
'保存并生成增加成功提示页面
dr.save()
With wb.AddMsgPage("","msgpage","增加成功", "感谢您的付出,艾迪尔的发展离不开您的付出") '生成成功提示页
.AddButton("btn1","继续添加","xckc51.htm")
End With
e.WriteString(wb.Build)
End If
End Select