Foxtable(狐表)用户栏目专家坐堂 → 信息写入表


  共有4376人关注过本帖树形打印复制链接

主题:信息写入表

帅哥哟,离线,有人找我吗?
nxqtxwz
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1495 积分:12175 威望:0 精华:0 注册:2013/3/19 16:41:00
信息写入表  发帖心情 Post By: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
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 一级勋章
等级:版主 帖子:1993 积分:19409 威望:0 精华:20 注册:2008/9/2 10:09:00
  发帖心情 Post By:2020/3/11 11:53:00 [只看该作者]

关于weui方面的使用,建议还是发到专家坐堂吧。
我很少使用weui,代码看起来很陌生。我给你转过去吧

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:111393 积分:567029 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By: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
  4楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1495 积分:12175 威望:0 精华:0 注册:2013/3/19 16:41:00
  发帖心情 Post By:2020/3/11 14:15:00 [只看该作者]

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

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


 回到顶部