以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  关于文件管理模块无数据加载是出现的错误  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=50213)

--  作者:wealthwind
--  发布时间:2014/5/1 18:51:00
--  关于文件管理模块无数据加载是出现的错误
如果项目无数据加载就会出现AFTERLOAD错误对话框

代码如下“

Dim web As WinForm.WebBrowser = e.Form.Controls("WebBrowser1")
\'web.OfficeToolBar = True
web.Address = ProjectPath & "kindeditor\\e.html"
If Tables("文件管理").current IsNot Nothing Then
    If Tables("文件管理").current.IsNull("审核") = False Then
        Do until e.form.controls("WebBrowser1").basecontrol.ReadyState = 4
            Application.DoEvents
        Loop
        Dim editor As Object = e.form.controls("WebBrowser1").basecontrol.Document.GetElementsByTagName("div")(0)
        editor.InnerHtml = "<div id=\'mymask\' style=\'position:absolute;width:100%;height:100%;z-index:99999\'></div>" & editor.InnerHtml
    End If
    
    Vars("编辑器校验")=0
    e.Form.Controls("TextBox1").text = Tables("文件管理").current("内容")
    e.Form.TimerEnabled = True
    e.Form.TimerInterval = 500
End If

Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree("文件管理","文件类型|文件名称")
For Each n As WinForm.TreeNode In trv.Nodes
         Dim flag As Boolean = False
        For Each cn As WinForm.TreeNode In n.Nodes
            If cn.DataRow("日期") = Date.Today Then
                cn.Text = cn.Text & "(新)"
cn.Ic
                flag = True
            Else
cn.Ic
            End If
        Next
If flag Then
    n.Text = n.Text & "(新)"
n.ic
Else
    n.ic
End If
Next


For Each s As String In "ComboBox1|TextBox4|Button3|Button1|Button4|TextBox5|DateTimePicker2|Button6|Button7|TextBox6|DateTimePicker3|Button8|Button9|GroupBox5|GroupBox6".Split("|")
     e.Form.Controls(s).Enabled = Tables("文件管理").current.IsNull("审核")
Next
For Each s As String In "ComboBox1|TextBox4|Button3|Button1|Button4".Split("|")
    e.Form.Controls(s).Enabled = (User.roles = "日常事务")
Next
For Each s As String In "TextBox5|DateTimePicker2|Button6|Button7|GroupBox5".Split("|")
    e.Form.Controls(s).Enabled = (User.Roles = "行销部主管")
Next
For Each s As String In "TextBox6|DateTimePicker3|Button8|Button9|GroupBox6".Split("|")
    e.Form.Controls(s).Enabled = (User.Roles = "行销部经理")
Next

--  作者:lsy
--  发布时间:2014/5/1 19:14:00
--  

Dim web As WinForm.WebBrowser = e.Form.Controls("WebBrowser1")
\'web.OfficeToolBar = True
web.Address = ProjectPath & "kindeditor\\e.html"
If Tables("文件管理").current IsNot Nothing Then
    If Tables("文件管理").current.IsNull("审核") = False Then
        Do until e.form.controls("WebBrowser1").basecontrol.ReadyState = 4
            Application.DoEvents
        Loop
        Dim editor As Object = e.form.controls("WebBrowser1").basecontrol.Document.GetElementsByTagName("div")(0)
        editor.InnerHtml = "<div id=\'mymask\' style=\'position:absolute;width:100%;height:100%;z-index:99999\'></div>" & editor.InnerHtml
    End If
   
    Vars("编辑器校验")=0
    e.Form.Controls("TextBox1").text = Tables("文件管理").current("内容")
    e.Form.TimerEnabled = True
    e.Form.TimerInterval = 500
End If
Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1")
trv.BuildTree("文件管理","文件类型|文件名称")
For Each n As WinForm.TreeNode In trv.Nodes
    Dim flag As Boolean = False
    For Each cn As WinForm.TreeNode In n.Nodes
        If cn.DataRow("日期") = Date.Today Then
            cn.Text = cn.Text & "(新)"
            cn.Ic
            flag = True
        Else
            cn.Ic
        End If
    Next
    If flag Then
        n.Text = n.Text & "(新)"
        n.ic
    Else
        n.ic
    End If
Next

For Each s As String In "ComboBox1|TextBox4|Button3|Button1|Button4|TextBox5|DateTimePicker2|Button6|Button7|TextBox6|DateTimePicker3|Button8|Button9|GroupBox5|GroupBox6".Split("|")
    If Tables("文件管理").current IsNot Nothing Then
        e.Form.Controls(s).Enabled = Tables("文件管理").current.IsNull("审核")
    End If
Next
For Each s As String In "ComboBox1|TextBox4|Button3|Button1|Button4".Split("|")
    e.Form.Controls(s).Enabled = (User.roles = "日常事务")
Next
For Each s As String In "TextBox5|DateTimePicker2|Button6|Button7|GroupBox5".Split("|")
    e.Form.Controls(s).Enabled = (User.Roles = "行销部主管")
Next
For Each s As String In "TextBox6|DateTimePicker3|Button8|Button9|GroupBox6".Split("|")
    e.Form.Controls(s).Enabled = (User.Roles = "行销部经理")
Next