📄 oamain.frm
字号:
Next
Set rstflow = New Recordset
rstflow.Open "Select * from v_DrawFlow ", GetCNClient, adOpenForwardOnly
Me.lblNode(0).Visible = False
Line1(0).Visible = False
Do Until rstflow.EOF
strNode = rstflow![FlowExplain] & "/" & rstflow![PowerExplain]
strNextNode = rstflow![NextFlowExplain] & "/" & rstflow![NextPowerExplain]
IsLoad = 0
i = lblNode.Count
For j = 1 To i - 1
If lblNode(j).Caption = strNode Or lblNode(j).Caption = strNextNode Then
IsLoad = j
Exit For
End If
Next
If IsLoad = 0 Then
Load Me.lblNode(i)
lblNode(i).Visible = True
lblNode(i).Left = rstflow![NodeLeft]
lblNode(i).Top = rstflow![NodeTop]
lblNode(i).Caption = strNode
IsLoad = i
End If
k = lblNode.Count
NextIsLoad = 0
For j = 1 To k - 1
If lblNode(j).Caption = strNode Or lblNode(j).Caption = strNextNode Then
IsLoad = j
Exit For
End If
Next
If NextIsLoad = 0 Then
Load Me.lblNode(k)
lblNode(k).Visible = True
lblNode(k).Left = rstflow![NextNodeLeft]
lblNode(k).Top = rstflow![NextNodeTop]
lblNode(k).Caption = strNextNode
NextIsLoad = k
End If
j = Line1.Count
Load Me.Line1(j)
Line1(j).Visible = True
Line1(j).x1 = lblNode(IsLoad).Left + lblNode(IsLoad).Width / 2
Line1(j).Y1 = lblNode(IsLoad).Top + lblNode(IsLoad).Height / 2
Line1(j).x2 = lblNode(NextIsLoad).Left + lblNode(NextIsLoad).Width / 2
Line1(j).Y2 = lblNode(NextIsLoad).Top + lblNode(NextIsLoad).Height / 2
Load Me.Line2(j)
Load Me.Line3(j)
ArrowLine Line1(j), Line2(j), Line3(j), lblNode(j).Height / 2, lblNode(j).Width / 2
Me.Line2(j).Visible = True
Me.Line3(j).Visible = True
rstflow.MoveNext
Loop
DrawFlow = 1
End Function
Private Sub LoadEmail()
On Error Resume Next
Me.Picture1.Visible = True
Me.Picture2.Visible = False
Me.TDBGrid1.Visible = True
Me.lblSend.Visible = True
Me.lblTopic.Visible = True
Me.RTxtSummary.Visible = True
Me.RtxtSend.Visible = False
Me.cmdLink.Visible = False
Me.cmdSend.Visible = False
Me.TDBGrid1.Width = Me.Picture1.Width
Me.TDBGrid1.Height = Me.Picture1.Height / 3
Me.lblSend.Top = Me.TDBGrid1.Height + 200
Me.lblTopic.Top = Me.TDBGrid1.Height + Me.lblSend.Height + 200
Me.RTxtSummary.Top = Me.lblTopic.Top + Me.lblTopic.Height + 200
Me.RTxtSummary.Width = Me.Picture1.Width
Me.RTxtSummary.Height = Me.Picture1.Height - Me.RTxtSummary.Top - 400
End Sub
Private Sub LoadTalk()
On Error Resume Next
Me.Picture1.Visible = True
Me.Picture2.Visible = False
Me.TDBGrid1.Visible = True
Me.lblSend.Visible = True
Me.lblTopic.Visible = True
Me.RTxtSummary.Visible = True
Me.RtxtSend.Visible = True
Me.cmdLink.Visible = True
Me.cmdSend.Visible = True
Me.TDBGrid1.Width = Me.Picture1.Width - 1200
Me.TDBGrid1.Height = Me.Picture1.Height / 4
Me.lblTopic.Top = Me.TDBGrid1.Top + Me.TDBGrid1.Height + 100
Me.cmdLink.Left = Me.TDBGrid1.Width + 100
Me.RTxtSummary.Top = Me.lblTopic.Top + Me.lblTopic.Height + 100
Me.RTxtSummary.Width = Me.Picture1.Width
Me.RTxtSummary.Height = Me.Picture1.Height / 4 + 300
Me.lblSend.Top = Me.RTxtSummary.Top + Me.RTxtSummary.Height + 100
Me.lblSend.Width = Me.Picture1.Width - 1200
Me.cmdSend.Top = lblSend.Top - 30
Me.cmdSend.Left = Me.Picture1.Width - 1000
Me.RtxtSend.Top = Me.lblSend.Top + Me.lblSend.Height + 100
Me.RtxtSend.Width = Me.Picture1.Width
Me.RtxtSend.Height = Me.Picture1.Height / 4 + 300
End Sub
Private Sub WorkFlow()
Me.Picture1.Visible = False
Me.Picture2.Visible = True
Me.Picture2.Top = Me.Picture1.Top
Me.Picture2.Width = Me.Width - Me.Picture1.Left - 200
Me.Picture2.Height = Me.Height - Me.Picture1.Top - 800
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim i As Integer
GetCNClient.Execute "Delete from OAOnlineUser where LoginName= '" & LoginName & "' and ComputerName ='" & LocalComputerName & "' "
GetCNClient.Close
GetCNServer.Close
tcpClient.Close
For i = 0 To intMax
tcpServer(i).Close
Next
DoEvents
End Sub
Private Sub Label1_Click()
End Sub
Private Sub lblNode_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
IsDown = 1
Else
IsDown = 0
End If
Me.lblMove.Visible = True
Me.lblMove.Left = Me.lblNode(Index).Left
Me.lblMove.Top = Me.lblNode(Index).Top
cx = X
cy = Y
End Sub
Private Sub lblNode_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If IsDown = 1 Then
Me.lblMove.Left = X + Me.lblNode(Index).Left - cx
Me.lblMove.Top = Y + Me.lblNode(Index).Top - cy
End If
End Sub
Private Sub lblNode_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
IsDown = 0
Me.lblNode(Index).Left = Me.lblMove.Left
Me.lblNode(Index).Top = Me.lblMove.Top
Dim rstNode As Recordset
Set rstNode = New Recordset
rstNode.Open "Select NodeLeft,NodeTop From v_DrawFlow Where FlowExplain +'/'+ PowerExplain='" & lblNode(Index).Caption & "'", GetCNClient, adOpenStatic, adLockOptimistic
Do Until rstNode.EOF
rstNode![NodeLeft] = Me.lblMove.Left
rstNode![NodeTop] = Me.lblMove.Top
rstNode.Update
rstNode.MoveNext
Loop
Set rstNode = New Recordset
rstNode.Open "Select NextNodeLeft,NextNodeTop From v_DrawFlow Where NextFlowExplain +'/'+ NextPowerExplain='" & lblNode(Index).Caption & "'", GetCNClient, adOpenStatic, adLockOptimistic
Do Until rstNode.EOF
rstNode![NextNodeLeft] = Me.lblMove.Left
rstNode![NextNodeTop] = Me.lblMove.Top
rstNode.Update
rstNode.MoveNext
Loop
Set rstNode = Nothing
IsDown = DrawFlow()
Me.lblMove.Visible = False
End Sub
Private Sub SaveNode(NodeName As String)
End Sub
Private Sub menuAnalyzerItem_Click(Index As Integer)
On Error GoTo Err_menuAnalyzerItem
Dim strFuncID As String
strFuncID = UCase(DLookUp("FunctionID", "PubOAPower", "Explain='" & Me.menuAnalyzerItem(Index).Caption & "'"))
AddForm strFuncID
Exit Sub
Err_menuAnalyzerItem:
MisMsg "menuAnalyzerItem Error : " & Err.Description
Exit Sub
End Sub
Private Sub menuBasicItem_Click(Index As Integer)
On Error GoTo Err_menuBasicItem
Dim strFuncID As String
strFuncID = UCase(DLookUp("FunctionID", "PubOAPower", "Explain='" & Me.menuBasicItem(Index).Caption & "'"))
AddForm strFuncID
Exit Sub
Err_menuBasicItem:
MisMsg "menuBasicItem Error : " & Err.Description
Exit Sub
End Sub
Private Sub menuFinanceItem_Click(Index As Integer)
On Error GoTo Err_menuFinanceItem
Dim strFuncID As String
strFuncID = UCase(DLookUp("FunctionID", "PubOAPower", "Explain='" & menuFinanceItem(Index).Caption & "'"))
AddForm strFuncID
Exit Sub
Err_menuFinanceItem:
MisMsg "menuFinanceItem Error : " & Err.Description
Exit Sub
End Sub
Private Sub menuPower_Click()
frmPubOAPower.Show
End Sub
Private Sub menuPurchaseItem_Click(Index As Integer)
On Error GoTo Err_menuPurchaseItem
Dim strFuncID As String
strFuncID = UCase(DLookUp("FunctionID", "PubOAPower", "Explain='" & Me.menuPurchaseItem(Index).Caption & "'"))
AddForm strFuncID
Exit Sub
Err_menuPurchaseItem:
MisMsg "menuPurchaseItem Error : " & Err.Description
Exit Sub
End Sub
Private Sub menuSellItem_Click(Index As Integer)
On Error GoTo Err_menuSellItem
Dim strFuncID As String
strFuncID = UCase(DLookUp("FunctionID", "PubOAPower", "Explain='" & Me.menuSellItem(Index).Caption & "'"))
AddForm strFuncID
Exit Sub
Err_menuSellItem:
MisMsg "menuSellItem Error : " & Err.Description
Exit Sub
End Sub
Private Sub menuStockItem_Click(Index As Integer)
On Error GoTo Err_menuStockItem
Dim strFuncID As String
strFuncID = UCase(DLookUp("FunctionID", "PubOAPower", "Explain='" & Me.menuStockItem(Index).Caption & "'"))
AddForm strFuncID
Exit Sub
Err_menuStockItem:
MisMsg "menuStockItem Error : " & Err.Description
Exit Sub
End Sub
Private Sub meunExit_Click()
Unload Me
End Sub
Private Sub meunPower_Click()
frmPubOAPower.Show
End Sub
Private Sub Picture1_Resize()
' LoadEmail
Me.TDBGrid1.Width = Me.Picture1.Width
Me.TDBGrid1.Height = Me.Picture1.Height / 3
Me.lblSend.Top = Me.TDBGrid1.Height + 200
Me.lblTopic.Top = Me.TDBGrid1.Height + Me.lblSend.Height + 200
Me.RTxtSummary.Top = Me.lblTopic.Top + Me.lblTopic.Height + 200
Me.RTxtSummary.Width = Me.Picture1.Width
Me.RTxtSummary.Height = Me.Picture1.Height - Me.RTxtSummary.Top - 400
End Sub
Private Sub StatusBar1_PanelClick(ByVal Panel As MSComctlLib.Panel)
End Sub
'Private Sub RtxtSend_KeyPress(KeyAscii As Integer)
' If KeyAscii = 13 Then
' If Asc(Right(Me.RtxtSend.Text, 1)) = 10 Then
' cmdSend_Click
' End If
' End If
'End Sub
Private Sub tcpServer_ConnectionRequest(Index As Integer, ByVal requestID As Long)
If Index = 0 Then
intMax = intMax + 1
Load tcpServer(intMax)
tcpServer(intMax).LocalPort = 0
tcpServer(intMax).Accept requestID
'Load txtData(intMax)
End If
End Sub
Private Sub tcpServer_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim strData As String
If Me.TDBGrid1.Columns.Count > 2 Then Exit Sub
tcpServer(Index).GetData strData
If strData <> "" Then
Beep
'MisMsg "你有新信息。"
Warning "1"
End If
Me.RTxtSummary.Text = Me.RTxtSummary.Text & strData & Chr(13) & Chr(10)
End Sub
Private Sub TDBGrid1_DblClick()
If Me.TDBGrid1.Columns.Count > 2 Then
frmPubOAEMail.Show 1
Else
If tcpClient.State = 0 Then tcpClient.Connect
End If
End Sub
Private Sub FormatTDGrid()
Me.TDBGrid1.MarqueeStyle = 4
Me.TDBGrid1.Columns(0).Caption = "发件人"
Me.TDBGrid1.Columns(1).Caption = "主题"
Me.TDBGrid1.Columns(2).Caption = "发送日期"
Me.TDBGrid1.Columns(0).Width = 2000
Me.TDBGrid1.Columns(1).Width = 2000
Me.TDBGrid1.Columns(2).Width = 2000
Me.TDBGrid1.Columns(3).Visible = False
Me.TDBGrid1.Columns(4).Visible = False
Me.TDBGrid1.Columns(5).Visible = False
Me.TDBGrid1.Columns(6).Visible = False
End Sub
Private Sub TDBGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
If Me.TDBGrid1.Columns.Count > 2 Then Me.lblSend.Caption = "发件人:" & Me.TDBGrid1.Columns(0).Value & " 收件人:" & Me.TDBGrid1.Columns(3).Value
If Me.TDBGrid1.Columns.Count > 2 Then Me.lblTopic.Caption = "主题:" & Me.TDBGrid1.Columns(1).Value
If Me.TDBGrid1.Columns.Count > 2 Then Me.RTxtSummary.Text = Me.TDBGrid1.Columns(5).Value & ""
End Sub
Private Sub UnRead()
Dim rstEmail As Recordset
Set rstEmail = New Recordset
rstEmail.Open "Select SendMen, Topic, SendDate, Addressee, KeyWord, Summary, DraftID from PubOAData Where addressee='" & LoginName & "' ", GetCNClient, adOpenStatic, adLockReadOnly
If rstEmail.RecordCount = 0 Then
Warning "0"
' Me.VtlMenu.MenuCur = 1
Else
Warning "1"
' Me.VtlMenu.MenuCur = 3
End If
Set Me.TDBGrid1.DataSource = rstEmail
FormatTDGrid
LoadEmail
Me.Toolbar1.Buttons(2).Enabled = True
Me.Toolbar1.Buttons(3).Enabled = False
Me.Toolbar1.Buttons(4).Enabled = True
Me.Toolbar1.Buttons(5).Enabled = False
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -