以文本方式查看主题
- Foxtable(狐表) (http://foxtable.net/bbs/index.asp)
-- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2)
---- 编译通不过 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=148906)
|
-- 作者:nxqtxwz
-- 发布时间:2020/4/18 12:04:00
-- 编译通不过
请老师给看看,为什么编译通不过呢。
Case "addsjjl.htm" If e.PostValues.Count = 0 Then wb.AddForm("","form1","addnew.htm") With wb.AddInputGroup("form1","ipg1","送教信息") .AddSelect("学生姓名","学生姓名","|靳晓飞|鲁宁|王瑞玉|康龙|马瑞|耿佳乐|潘慧|黄哲|冯婷婷|田彦学|白明花|白振辉|俞鑫") \'前一个"姓名"是ID,后一个"姓名"是标题 .AddInput("送教日期","送教日期","date") .AddInput("送教地点","送教地点","text") .AddInput("送教内容","送教内容","text") .AddInput("送教人","送教人","text") End With With wb.AddInputGroup("form2","ipg21","送教资料") With .AddUploader("up1","资料",True) \'True表示可上传多个文件 .Accept = "image/*" \'允许使用相册和相机 .AllowDelete = True \'允许删除 .Incremental = True \'允许重复选择文件或连续拍照 For Each s1 As String In dr.Lines("资料") .AddImage("./学校档案/送教记录/" & s1) Next End With End With With wb.AddDialog("","dlg2", "增加成功","谢谢您!") .AddButton("btn1","返回主菜单","default.htm") End With wb.AddToast("","tst1", "正在上传",1) wb.AddToast("","tst3", "上传失败",0).Icon= "warn" With wb.AddButtonGroup("form1","btg1",False) .Add("btn1", "确定", "button").Attribute= "" .Add("btn2", "放弃", "button", "default.htm").Kind = 2 End With wb.AppendHTML("<script src=\'./lib/ajaxform.js\'></script>") \'引入脚本文件 Else With wb.AddMsgPage("","msgpage","增加失败", "此信息可能已经被删除!") \'提示 .icon= "Warn" .AddButton("btn1","返回",PageURL) \'生成返回原来页面的按钮 End With End If e.WriteString(wb.Build) Else \'保存编辑结果 Dim dr1 As DataRow = DataTables("送教记录").AddNew() If dr1 IsNot Nothing Then Dim nms() As String = {"学生姓名","送教日期","送教时间","送教地点","送教内容","送教人"} For Each nm As String In nms dr1(nm) = e.PostValues(nm) Next Dim lst As List(of String) = dr1.Lines("资料") For Each key As String In e.Files.Keys If key = "up1" Then For Each fln As String In e.Files(key) e.SaveFile(key, fln,"D:\\xxsjk(学校数据库)\\web\\学校档案\\送教记录\\" & fln)\'ftp和web尽量共用一个图片目录,否则页面无法正常显示图片 lst.Add(fln) Next End If Next dr1.Lines("资料") = lst \'\'\' \'保存并生成增加成功提示页面 dr1.save() End If e.WriteString("OK") End If
|
-- 作者:有点蓝
-- 发布时间:2020/4/18 14:15:00
--
没有dr这个变量
With wb.AddInputGroup("form2","ipg21","送教资料") With .AddUploader("up1","资料",True) \'True表示可上传多个文件 .Accept = "image/*" \'允许使用相册和相机 .AllowDelete = True \'允许删除 .Incremental = True \'允许重复选择文件或连续拍照 For Each s1 As String In dr.Lines("资料") .AddImage("./学校档案/送教记录/" & s1) Next End With End With
|
-- 作者:nxqtxwz
-- 发布时间:2020/4/18 15:58:00
--
请问老师,总是上传失败,请老师修改。对上传多张照片还是搞不懂。
Case "addsjjl.htm" Dim dr As DataRow = DataTables("送教记录").AddNew() If e.PostValues.Count = 0 Then If e.PostValues.Count = 0 Then wb.AddForm("","form1","addnew.htm") With wb.AddInputGroup("form1","ipg1","送教信息") .AddSelect("学生姓名","学生姓名","|靳晓飞|鲁宁|王瑞玉|康龙|马瑞|耿佳乐|潘慧|黄哲|冯婷婷|田彦学|白明花|白振辉|俞鑫") \'前一个"姓名"是ID,后一个"姓名"是标题 .AddInput("送教日期","送教日期","date") .AddInput("送教地点","送教地点","text") .AddInput("送教内容","送教内容","text") .AddInput("送教人","送教人","text") End With With wb.AddInputGroup("form1","ipg21","送教资料") With .AddUploader("up1","资料",True) \'True表示可上传多个文件 .Accept = "image/*" \'允许使用相册和相机 .AllowDelete = True \'允许删除 .Incremental = True \'允许重复选择文件或连续拍照 For Each s1 As String In dr.Lines("资料") .AddImage("./学校档案/送教记录/" & s1) Next End With End With With wb.AddDialog("","dlg2", "增加成功","谢谢您!") .AddButton("btn1","返回主菜单","default.htm") End With wb.AddToast("","tst1", "正在上传",1) wb.AddToast("","tst3", "上传失败",0).Icon= "warn" With wb.AddButtonGroup("form1","btg1",False) .Add("btn1", "确定", "button").Attribute= "" .Add("btn2", "放弃", "button", "default.htm").Kind = 2 End With wb.AppendHTML("<script src=\'./lib/ajaxform.js\'></script>") \'引入脚本文件 Else With wb.AddMsgPage("","msgpage","增加失败", "此信息可能已经被删除!") \'提示 .icon= "Warn" \' .AddButton("btn1","返回",PageURL) \'生成返回原来页面的按钮 End With End If e.WriteString(wb.Build)
Else \'保存编辑结果 If dr IsNot Nothing Then Dim nms() As String = {"学生姓名","送教日期","送教时间","送教地点","送教内容","送教人"} For Each nm As String In nms dr(nm) = e.PostValues(nm) Next Dim lst As List(of String) = dr.Lines("资料") For Each key As String In e.Files.Keys If key = "up1" Then For Each fln As String In e.Files(key) e.SaveFile(key, fln,"D:\\xxsjk(学校数据库)\\web\\学校档案\\送教记录\\" & fln)\'ftp和web尽量共用一个图片目录,否则页面无法正常显示图片 lst.Add(fln) Next End If Next dr.Lines("资料") = lst \'\'\' \'保存并生成增加成功提示页面 dr.save() End If e.WriteString("OK") End If
[此贴子已经被作者于2020/4/18 16:15:38编辑过]
|
-- 作者:有点蓝
-- 发布时间:2020/4/18 16:49:00
--
http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=148902&authorid=0&page=0&star=1,仔细看9楼项目
[此贴子已经被作者于2020/4/18 16:49:25编辑过]
|
-- 作者:有点蓝
-- 发布时间:2020/4/18 16:51:00
--
1、Dim dr As DataRow = DataTables("控缀保学").SQLFind("[_Identify]=" & PrimaryKey)
2、 e.SaveFile(key, fln,"D:\\xxsjk(学校数据库)\\web\\学校档案\\控辍保学\\" & fln) \'附件保存路径和web尽量共用一个图片目录,否则页面无法正常显示图片
|
-- 作者:nxqtxwz
-- 发布时间:2020/4/18 17:42:00
--
请老师给看看,我感觉没有错呀,为什么点确定按钮后就停住了,没有将要写的信息和图片写入表中。
Case "addsjjl.htm" Dim dr As DataRow = DataTables("送教记录").AddNew() If e.PostValues.Count = 0 Then wb.AddForm("","form1","addnew.htm") With wb.AddInputGroup("form1","ipg1","送教信息") .AddSelect("学生姓名","学生姓名","|靳晓飞|鲁宁|王瑞玉|康龙|马瑞|耿佳乐|潘慧|黄哲|冯婷婷|田彦学|白明花|白振辉|俞鑫") \'前一个"姓名"是ID,后一个"姓名"是标题 .AddInput("送教日期","送教日期","date") .AddInput("送教地点","送教地点","text") .AddInput("送教内容","送教内容","text") .AddInput("送教人","送教人","text") With wb.AddInputGroup("form1","ipg21","送教资料") With .AddUploader("up1","资料",True) \'True表示可上传多个文件 .Accept = "image/*" \'允许使用相册和相机 .AllowDelete = True \'允许删除 .Incremental = True \'允许重复选择文件或连续拍照 For Each s1 As String In dr.Lines("资料") .AddImage("./学校档案/送教记录/" & s1) Next End With End With End With With wb.AddButtonGroup("form1","btg1",False) .Add("btn1", "确定", "submit").Attribute= "" .Add("btn2", "放弃", "button", "default.htm").Kind = 2 End With wb.AppendHTML("<script src=\'./lib/ajaxform.js\'></script>") \'引入脚本文件 e.WriteString(wb.Build) Return Else \'保存编辑结果 \' If dr IsNot Nothing Then Dim nms() As String = {"学生姓名","送教日期","送教时间","送教地点","送教内容","送教人"} For Each nm As String In nms dr(nm) = e.PostValues(nm) Next For Each key As String In e.Files.Keys If key = "up1" Then Dim lst As List(of String) = dr.Lines("资料") For Each fln As String In e.Files(key) e.SaveFile(key, fln,"D:\\xxsjk(学校数据库)\\web\\学校档案\\送教记录\\" & fln) \'ftp和web尽量共用一个图片目录,否则页面无法正常显示图片 lst.Add(fln) Next dr.Lines("资料") = lst End If Next \'\'\' \'保存并生成增加成功提示页面 dr.save() With wb.AddMsgPage("","msgpage","增加成功", "谢谢您的支持!") \'生成成功提示页 .AddButton("btn1","继续增加","xxlr.htm") .AddButton("btn2","返回首页","default.htm").kind = 2 End With e.WriteString(wb.Build) Return End If
|
-- 作者:有点蓝
-- 发布时间:2020/4/19 20:20:00
--
肯定有错,如果没有,为什么不起作用?请认真看4楼,5楼
Case "addsjjl.htm" Dim dr As DataRow = DataTables("送教记录").AddNew() 这里是新增,也就是不会有任何数据 If e.PostValues.Count = 0 Then wb.AddForm("","form1","addnew.htm") With wb.AddInputGroup("form1","ipg1","送教信息") .AddSelect("学生姓名","学生姓名","|靳晓飞|鲁宁|王瑞玉|康龙|马瑞|耿佳乐|潘慧|黄哲|冯婷婷|田彦学|白明花|白振辉|俞鑫") \'前一个"姓名"是ID,后一个"姓名"是标题 .AddInput("送教日期","送教日期","date") .AddInput("送教地点","送教地点","text") .AddInput("送教内容","送教内容","text") .AddInput("送教人","送教人","text") With wb.AddInputGroup("form1","ipg21","送教资料") With .AddUploader("up1","资料",True) \'True表示可上传多个文件 .Accept = "image/*" \'允许使用相册和相机 .AllowDelete = True \'允许删除 .Incremental = True \'允许重复选择文件或连续拍照 For Each s1 As String In dr.Lines("资料")同理新增的行不会有任何数据,就算有数据也未必能够显示,请仔细看看:http://www.foxtable.com/mobilehelp/topics/0044.htm .AddImage("./学校档案/送教记录/" & s1) Next End With End With End With With wb.AddButtonGroup("form1","btg1",False) .Add("btn1", "确定", "submit").Attribute= "" .Add("btn2", "放弃", "button", "default.htm").Kind = 2 End With wb.AppendHTML("<script src=\'./lib/ajaxform.js\'></script>") \'引入脚本文件 e.WriteString(wb.Build) Return Else \'保存编辑结果 \' If dr IsNot Nothing Then Dim nms() As String = {"学生姓名","送教日期","送教时间","送教地点","送教内容","送教人"} For Each nm As String In nms dr(nm) = e.PostValues(nm) Next For Each key As String In e.Files.Keys If key = "up1" Then Dim lst As List(of String) = dr.Lines("资料") For Each fln As String In e.Files(key) e.SaveFile(key, fln,"D:\\xxsjk(学校数据库)\\web\\学校档案\\送教记录\\" & fln) \'ftp和web尽量共用一个图片目录,否则页面无法正常显示图片,同理,请仔细看看:http://www.foxtable.com/mobilehelp/topics/0044.htm lst.Add(fln) Next dr.Lines("资料") = lst 这样用法会完全覆盖旧数据 End If Next \'\'\' \'保存并生成增加成功提示页面 dr.save() With wb.AddMsgPage("","msgpage","增加成功", "谢谢您的支持!") \'生成成功提示页 .AddButton("btn1","继续增加","xxlr.htm") .AddButton("btn2","返回首页","default.htm").kind = 2 End With e.WriteString(wb.Build) 这里必须返回OK,因为js里是通过OK判断是否成功。 Return End If
|
|
-- 作者:nxqtxwz
-- 发布时间:2020/4/19 21:22:00
--
还是请老师给改一下吧,图片这块真是搞不懂。有个例子以后套用就行了。谢谢。
Case "addsjjl.htm" Dim dr As DataRow = DataTables("送教记录").AddNew() 这里是新增,也就是不会有任何数据 因为是新增,我看新增的例子都是这样定义的,不懂应如何定义,请老师指导。 If e.PostValues.Count = 0 Then wb.AddForm("","form1","addnew.htm") With wb.AddInputGroup("form1","ipg1","送教信息") .AddSelect("学生姓名","学生姓名","|靳晓飞|鲁宁|王瑞玉|康龙|马瑞|耿佳乐|潘慧|黄哲|冯婷婷|田彦学|白明花|白振辉|俞鑫") \'前一个"姓名"是ID,后一个"姓名"是标题 .AddInput("送教日期","送教日期","date") .AddInput("送教地点","送教地点","text") .AddInput("送教内容","送教内容","text") .AddInput("送教人","送教人","text") With wb.AddInputGroup("form1","ipg21","送教资料") With .AddUploader("up1","资料",True) \'True表示可上传多个文件 .Accept = "image/*" \'允许使用相册和相机 .AllowDelete = True \'允许删除 .Incremental = True \'允许重复选择文件或连续拍照 For Each s1 As String In dr.Lines("资料")同理新增的行不会有任何数据,就算有数据也未必能够显示,请仔细看看:http://www.foxtable.com/mobilehelp/topics/0044.htm 此处我看例子主要是讲路径,我把web放在了SQL的根目录下。就是:D:\\xxsjk(学校数据库)\\web\\,这样web和ftp就都在一个目录里了。
.AddImage("./学校档案/送教记录/" & s1) 此处绝对路径是:D:\\xxsjk(学校数据库)\\web\\学校档案\\送教记录\\
Next End With End With End With With wb.AddButtonGroup("form1","btg1",False) .Add("btn1", "确定", "submit").Attribute= "" .Add("btn2", "放弃", "button", "default.htm").Kind = 2 End With wb.AppendHTML("<script src=\'./lib/ajaxform.js\'></script>") \'引入脚本文件 e.WriteString(wb.Build) Return Else \'保存编辑结果 \' If dr IsNot Nothing Then Dim nms() As String = {"学生姓名","送教日期","送教时间","送教地点","送教内容","送教人"} For Each nm As String In nms dr(nm) = e.PostValues(nm) Next For Each key As String In e.Files.Keys If key = "up1" Then Dim lst As List(of String) = dr.Lines("资料") For Each fln As String In e.Files(key) e.SaveFile(key, fln,"D:\\xxsjk(学校数据库)\\web\\学校档案\\送教记录\\" & fln) web和ftp已处于同一目录
lst.Add(fln) Next \' dr.Lines("资料") = lst 这样用法会完全覆盖旧数据 End If Next dr.Lines("资料") = lst 是否放在此处呢 \'\'\' \'保存并生成增加成功提示页面 dr.save() With wb.AddMsgPage("","msgpage","增加成功", "谢谢您的支持!") \'生成成功提示页 .AddButton("btn1","继续增加","xxlr.htm") .AddButton("btn2","返回首页","default.htm").kind = 2 End With e.WriteString(ok) 这里必须返回OK,因为js里是通过OK判断是否成功。 Return End If
|
-- 作者:有点蓝
-- 发布时间:2020/4/19 23:01:00
--
还是看另外一个贴把,这里的用法就是正确的:http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=148902&page=2&star=2
这是一个账户2个不同的马甲使用的吗,一段代码还分开2种用法分别问?
|
-- 作者:nxqtxwz
-- 发布时间:2020/4/19 23:41:00
--
是不一样的两段代码,这个是新增记录,那个是编辑记录,因为这个差别代码应该是不一样的。
|