我查看了所有代码,有可能出现问题的地方有3个:
1、全局表事件:CurrentChanged
Select Case e.Table.Name
Case "主窗口_Table1","主窗口_Table2"
Tables("主窗口_Table1").Grid.ScrollBars = 0 '0 无 1 横向 2 纵向 3 横向纵向
Tables("主窗口_Table2").Grid.ScrollBars = 0 '0 无 1 横向 2 纵向 3 横向纵向
Case Else '其他所有表显示纵横向滚动条
For Each t As Table In Tables
t.Grid.ScrollBars = 3 '0 无 1 横向 2 纵向 3 横向纵向
t.Grid.ScrollOptions = 1
't.Grid.Styles.EmptyArea.Border.Style = 0 '去表格边框
't.Grid.Styles.EmptyArea.backcolor = color.white '空白区白色背景
Next
End Select
2、项目事件:ystemIdle
Dim str2 As String = " 屏幕最佳显示分辨率:1920*1080"
StatusBar.Message2 = str2
'自动计算
Dim str1 As String = ""
Dim t As Table = CurrentTable
If t.Name <> "主窗口_Table1" AndAlso t.Name <> "主窗口_Table2" Then
Str1 = Str1 & "计数:" & t.Aggregate(AggregateEnum.Count, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & ""
Str1 = Str1 & " 累计:" & t.Aggregate(AggregateEnum.Sum, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & ""
Str1 = Str1 & " 平均:" & t.Aggregate(AggregateEnum.Average, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & ""
'Str1 = Str1 & " 最大:" & t.Aggregate(AggregateEnum.Max, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
'Str1 = Str1 & " 最小:" & t.Aggregate(AggregateEnum.Min, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
'Str1 = Str1 & "标准差:" & t.Aggregate(AggregateEnum.Std, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
'Str1 = Str1 & "总体标准差:" & t.Aggregate(AggregateEnum.StdPop, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
'Str1 = Str1 & "方差:" & t.Aggregate(AggregateEnum.Var, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
'Str1 = Str1 & "总体方差:" & t.Aggregate(AggregateEnum.VarPop, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
End If
StatusBar.Message3 = Str1
3、当前表的CellButtonClick事件
e.cancel = True
Select Case e.Col.Name
Case "中标通知书"
Dim dlg As New openFileDialog '定义一个新的SaveFileDialog
dlg.MultiSelect = True
If dlg.showDialog = DialogResult.Ok Then '如果用户单击了确定按钮
Dim ftp1 As new ftpclient
ftp1.host="*********"
ftp1.Account = "*******1"
ftp1.password = "1*****19"
Dim r As Row = Tables("业绩管理").Current
Dim ls = r.DataRow.Lines("中标通知书")
For Each f As String In dlg.FileNames
Dim file = "/公司业绩/" & r("项目名称") & "/" & filesys.GetName(f)
If ftp1.DirExists("/公司业绩/" & r("项目名称")) = False Then
ftp1.MakeDir("/公司业绩/" & r("项目名称"))
End If
Dim Result As DialogResult
If ftp1.FileExists(file) Then
Result = MessageBox.Show("文件已经存在,是否覆盖?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
End If
If result = Nothing OrElse result = DialogResult.Yes Then
If ftp1.Upload(f,file,True) = True Then
If ls.contains(file) = False Then
ls.add(file)
End If
Else
MessageBox.Show( f & "上传失败" ,"提示" ,MessageBoxButtons.OK,MessageBoxIcon.Question)
End If
End If
Next
r.DataRow.lines("中标通知书") = ls
ftp1.Close
r.save
End If
End Select
Select Case e.Col.Name
Case "合同协议书"
Dim dlg As New openFileDialog '定义一个新的SaveFileDialog
dlg.MultiSelect = True
If dlg.showDialog = DialogResult.Ok Then '如果用户单击了确定按钮
Dim ftp1 As new ftpclient
ftp1.host="*****0"
ftp1.Account = "ft****"
ftp1.password = "1*******9"
Dim r As Row = Tables("业绩管理").Current
Dim ls = r.DataRow.Lines("合同协议书")
For Each f As String In dlg.FileNames
Dim file = "/公司业绩/" & r("项目名称") & "/" & filesys.GetName(f)
If ftp1.DirExists("/公司业绩/" & r("项目名称")) = False Then
ftp1.MakeDir("/公司业绩/" & r("项目名称"))
End If
Dim Result As DialogResult
If ftp1.FileExists(file) Then
Result = MessageBox.Show("文件已经存在,是否覆盖?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
End If
If result = Nothing OrElse result = DialogResult.Yes Then
If ftp1.Upload(f,file,True) = True Then
If ls.contains(file) = False Then
ls.add(file)
End If
Else
MessageBox.Show( f & "上传失败" ,"提示" ,MessageBoxButtons.OK,MessageBoxIcon.Question)
End If
End If
Next
r.DataRow.lines("合同协议书") = ls
ftp1.Close
r.save
End If
End Select
Select Case e.Col.Name
Case "竣工验收报告"
Dim dlg As New openFileDialog '定义一个新的SaveFileDialog
dlg.MultiSelect = True
If dlg.showDialog = DialogResult.Ok Then '如果用户单击了确定按钮
Dim ftp1 As new ftpclient
ftp1.host="****0"
ftp1.Account = "f*1"
ftp1.password = "19***9"
Dim r As Row = Tables("业绩管理").Current
Dim ls = r.DataRow.Lines("竣工验收报告")
For Each f As String In dlg.FileNames
Dim file = "/公司业绩/" & r("项目名称") & "/" & filesys.GetName(f)
If ftp1.DirExists("/公司业绩/" & r("项目名称")) = False Then
ftp1.MakeDir("/公司业绩/" & r("项目名称"))
End If
Dim Result As DialogResult
If ftp1.FileExists(file) Then
Result = MessageBox.Show("文件已经存在,是否覆盖?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
End If
If result = Nothing OrElse result = DialogResult.Yes Then
If ftp1.Upload(f,file,True) = True Then
If ls.contains(file) = False Then
ls.add(file)
End If
Else
MessageBox.Show( f & "上传失败" ,"提示" ,MessageBoxButtons.OK,MessageBoxIcon.Question)
End If
End If
Next
r.DataRow.lines("竣工验收报告") = ls
ftp1.Close
r.save
End If
End Select