以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  信息写入表  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=147151)

--  作者:nxqtxwz
--  发布时间:2020/3/10 22:04:00
--  信息写入表

请问老师,我下面的代码为什么:

1、信息写不到“职工信息总表”中;

2、如何把照片写入照片列呢?

3、想用照相和照片代码怎么写。

 

 

 Case "zgxxlr.htm"
        If e.PostValues.Count = 0 Then
            wb.AddForm("","form1","addnew.htm")
            With wb.AddInputGroup("form1","ipg1","教职工信息")
                .AddInput("姓名","姓名","Text") \'前一个"姓名"是ID,后一个"姓名"是标题
                .AddInput("性别","性别","男|女")
                .AddInput("出生日期","出生日期","date")
                .AddInput("籍贯","籍贯","Text")
                .AddSelect("民族","民族","汉族|回族|其它")
                .AddSelect("编制","编制","农村初中|农村小学|无编制")
                .AddSelect("任教学科","任教学科","语文|数学|英语|物理|化学|生物|政治|历史|地理|体育|美术|音乐|信息技术|科学|综合实践")
                .AddInput("政治面貌","政治面貌","TEXT")
                .AddSelect("职称_职级","最高职称","副高级教师|一级教师|二级教师")
                .AddSelect("最高学历","最高学历","中专|大专|本科|硕士")
                .AddUploader("up1","照片",True) \'True表示允许上传多个文件
            End With
            With wb.AddButtonGroup("form1","btg1",True)
                .Add("btn1", "确定", "submit")
            End With
            e.WriteString(wb.Build)
        Else
            Dim nms() As String = {"姓名","性别","出生日期","籍贯","民族","编制","任教学科","政治面貌","职称_职级","最高学历"}
            Dim dr As DataRow = DataTables("职工信息总表").AddNew()
            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
                    For Each fln As String In e.Files(key)
                        e.SaveFile(key, fln, "D:\\xxsjk(学校数据库)\\学校档案\\教师照片\\" & fln)
                    Next
                    dr.Lines("照片") = e.Files(key)
                End If
            Next
            \'保存并生成增加成功提示页面
            dr.save()
            With wb.AddMsgPage("","msgpage","增加成功") \'生成成功提示页
                .AddButton("btn1","继续增加","addnew.htm")
            End With
            e.WriteString(wb.Build)
        End If
       


--  作者:reachtone
--  发布时间:2020/3/11 11:53:00
--  
关于weui方面的使用,建议还是发到专家坐堂吧。
我很少使用weui,代码看起来很陌生。我给你转过去吧

--  作者:有点蓝
--  发布时间:2020/3/11 12:19:00
--  
Case "zgxxlr.htm"
        If e.PostValues.Count = 0 Then
            wb.AddForm("","form1","zgxxlr.htm")
            With wb.AddInputGroup("form1","ipg1","教职工信息")
                .AddInput("姓名","姓名","Text") \'前一个"姓名"是ID,后一个"姓名"是标题
                .AddInput("性别","性别","男|女")
                .AddInput("出生日期","出生日期","date")
                .AddInput("籍贯","籍贯","Text")
                .AddSelect("民族","民族","汉族|回族|其它")
                .AddSelect("编制","编制","农村初中|农村小学|无编制")
                .AddSelect("任教学科","任教学科","语文|数学|英语|物理|化学|生物|政治|历史|地理|体育|美术|音乐|信息技术|科学|综合实践")
                .AddInput("政治面貌","政治面貌","TEXT")
                .AddSelect("职称_职级","最高职称","副高级教师|一级教师|二级教师")
                .AddSelect("最高学历","最高学历","中专|大专|本科|硕士")
                .AddUploader("up1","照片",True) \'True表示允许上传多个文件
            End With
            With wb.AddButtonGroup("form1","btg1",True)
                .Add("btn1", "确定", "submit")
            End With
            e.WriteString(wb.Build)
        Else
            Dim nms() As String = {"姓名","性别","出生日期","籍贯","民族","编制","任教学科","政治面貌","职称_职级","最高学历"}
            Dim dr As DataRow = DataTables("职工信息总表").AddNew()
            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
                    For Each fln As String In e.Files(key)
                        e.SaveFile(key, fln, "D:\\xxsjk(学校数据库)\\学校档案\\教师照片\\" & fln)
                    Next
                    dr.Lines("照片") = e.Files(key)
                End If
            Next
            \'保存并生成增加成功提示页面
            dr.save()
            With wb.AddMsgPage("","msgpage","增加成功") \'生成成功提示页
                .AddButton("btn1","继续增加","zgxxlr.htm")
            End With
            e.WriteString(wb.Build)
        End If
--  作者:nxqtxwz
--  发布时间:2020/3/11 14:15:00
--  
以下是引用reachtone在2020/3/11 11:53:00的发言:
关于weui方面的使用,建议还是发到专家坐堂吧。
我很少使用weui,代码看起来很陌生。我给你转过去吧

好的,谢谢您。初学,不知道怎么办。weui简单,上手快,不知还有哪种框架好学好用呢。