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