上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:31k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  4. Begin VB.Form Xt_Control 
  5.    Caption         =   "桌面"
  6.    ClientHeight    =   8595
  7.    ClientLeft      =   675
  8.    ClientTop       =   1665
  9.    ClientWidth     =   11880
  10.    HelpContextID   =   5
  11.    Icon            =   "系统_主操作桌面.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MDIChild        =   -1  'True
  15.    ScaleHeight     =   8595
  16.    ScaleWidth      =   11880
  17.    WindowState     =   2  'Maximized
  18.    Begin MSComctlLib.ListView lvListView 
  19.       Height          =   3375
  20.       Left            =   2100
  21.       TabIndex        =   5
  22.       Top             =   720
  23.       Width           =   2295
  24.       _ExtentX        =   4048
  25.       _ExtentY        =   5953
  26.       Arrange         =   2
  27.       LabelEdit       =   1
  28.       LabelWrap       =   -1  'True
  29.       HideSelection   =   -1  'True
  30.       OLEDragMode     =   1
  31.       OLEDropMode     =   1
  32.       PictureAlignment=   1
  33.       _Version        =   393217
  34.       Icons           =   "ImageList2"
  35.       SmallIcons      =   "ImageList1"
  36.       ColHdrIcons     =   "ImageList1"
  37.       ForeColor       =   -2147483640
  38.       BackColor       =   -2147483643
  39.       BorderStyle     =   1
  40.       Appearance      =   1
  41.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  42.          Name            =   "宋体"
  43.          Size            =   9
  44.          Charset         =   134
  45.          Weight          =   400
  46.          Underline       =   0   'False
  47.          Italic          =   0   'False
  48.          Strikethrough   =   0   'False
  49.       EndProperty
  50.       OLEDragMode     =   1
  51.       OLEDropMode     =   1
  52.       NumItems        =   0
  53.    End
  54.    Begin VB.PictureBox picSplitter 
  55.       BackColor       =   &H00808080&
  56.       BorderStyle     =   0  'None
  57.       FillColor       =   &H00808080&
  58.       BeginProperty Font 
  59.          Name            =   "MS Sans Serif"
  60.          Size            =   8.25
  61.          Charset         =   0
  62.          Weight          =   400
  63.          Underline       =   0   'False
  64.          Italic          =   0   'False
  65.          Strikethrough   =   0   'False
  66.       EndProperty
  67.       Height          =   4800
  68.       Left            =   4740
  69.       ScaleHeight     =   2090.126
  70.       ScaleMode       =   0  'User
  71.       ScaleWidth      =   780
  72.       TabIndex        =   0
  73.       Top             =   780
  74.       Visible         =   0   'False
  75.       Width           =   72
  76.    End
  77.    Begin MSComctlLib.ImageList ImageList1 
  78.       Left            =   5220
  79.       Top             =   2340
  80.       _ExtentX        =   1005
  81.       _ExtentY        =   1005
  82.       BackColor       =   -2147483643
  83.       ImageWidth      =   16
  84.       ImageHeight     =   16
  85.       MaskColor       =   12632256
  86.       _Version        =   393216
  87.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  88.          NumListImages   =   5
  89.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  90.             Picture         =   "系统_主操作桌面.frx":1042
  91.             Key             =   "stb"
  92.          EndProperty
  93.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  94.             Picture         =   "系统_主操作桌面.frx":2094
  95.             Key             =   "xttb"
  96.          EndProperty
  97.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  98.             Picture         =   "系统_主操作桌面.frx":30E6
  99.             Key             =   "szk"
  100.          EndProperty
  101.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  102.             Picture         =   "系统_主操作桌面.frx":3480
  103.             Key             =   "kpgl"
  104.          EndProperty
  105.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  106.             Picture         =   "系统_主操作桌面.frx":44D2
  107.             Key             =   "gnqx"
  108.          EndProperty
  109.       EndProperty
  110.    End
  111.    Begin MSComDlg.CommonDialog dlgCommonDialog 
  112.       Left            =   3360
  113.       Top             =   2160
  114.       _ExtentX        =   847
  115.       _ExtentY        =   847
  116.       _Version        =   393216
  117.    End
  118.    Begin MSComctlLib.TreeView tvTreeView 
  119.       Height          =   4800
  120.       Left            =   0
  121.       TabIndex        =   4
  122.       Top             =   705
  123.       Width           =   2010
  124.       _ExtentX        =   3545
  125.       _ExtentY        =   8467
  126.       _Version        =   393217
  127.       Indentation     =   564
  128.       Style           =   7
  129.       ImageList       =   "ImageList1"
  130.       Appearance      =   1
  131.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  132.          Name            =   "宋体"
  133.          Size            =   9
  134.          Charset         =   134
  135.          Weight          =   400
  136.          Underline       =   0   'False
  137.          Italic          =   0   'False
  138.          Strikethrough   =   0   'False
  139.       EndProperty
  140.    End
  141.    Begin MSComctlLib.Toolbar tbToolBar 
  142.       Align           =   1  'Align Top
  143.       Height          =   420
  144.       Left            =   0
  145.       TabIndex        =   6
  146.       Top             =   0
  147.       Width           =   11880
  148.       _ExtentX        =   20955
  149.       _ExtentY        =   741
  150.       ButtonWidth     =   609
  151.       ButtonHeight    =   582
  152.       AllowCustomize  =   0   'False
  153.       Appearance      =   1
  154.       ImageList       =   "imlToolbarIcons"
  155.       _Version        =   393216
  156.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  157.          NumButtons      =   10
  158.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  159.             Style           =   3
  160.          EndProperty
  161.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  162.             Key             =   "返回"
  163.             Object.ToolTipText     =   "返回"
  164.             ImageKey        =   "xq"
  165.          EndProperty
  166.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  167.             Key             =   "向前"
  168.             Object.ToolTipText     =   "向前"
  169.             ImageKey        =   "xh"
  170.          EndProperty
  171.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  172.             Style           =   3
  173.          EndProperty
  174.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  175.             Style           =   3
  176.          EndProperty
  177.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  178.             Style           =   3
  179.          EndProperty
  180.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  181.             Key             =   "大图标"
  182.             Object.ToolTipText     =   "大图标"
  183.             ImageKey        =   "dtb"
  184.             Style           =   2
  185.             Value           =   1
  186.          EndProperty
  187.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  188.             Key             =   "小图标"
  189.             Object.ToolTipText     =   "小图标"
  190.             ImageKey        =   "xtb"
  191.             Style           =   2
  192.          EndProperty
  193.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  194.             Key             =   "列表"
  195.             Object.ToolTipText     =   "列表"
  196.             ImageKey        =   "lb"
  197.             Style           =   2
  198.          EndProperty
  199.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  200.             Key             =   "详细资料"
  201.             Object.ToolTipText     =   "详细资料"
  202.             ImageKey        =   "xxzl"
  203.             Style           =   2
  204.          EndProperty
  205.       EndProperty
  206.    End
  207.    Begin MSComctlLib.ImageList imlToolbarIcons 
  208.       Left            =   4710
  209.       Top             =   840
  210.       _ExtentX        =   1005
  211.       _ExtentY        =   1005
  212.       BackColor       =   -2147483643
  213.       ImageWidth      =   16
  214.       ImageHeight     =   16
  215.       MaskColor       =   12632256
  216.       _Version        =   393216
  217.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  218.          NumListImages   =   6
  219.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  220.             Picture         =   "系统_主操作桌面.frx":486C
  221.             Key             =   "xq"
  222.          EndProperty
  223.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  224.             Picture         =   "系统_主操作桌面.frx":4C06
  225.             Key             =   "xh"
  226.          EndProperty
  227.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  228.             Picture         =   "系统_主操作桌面.frx":4FA0
  229.             Key             =   "dtb"
  230.          EndProperty
  231.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  232.             Picture         =   "系统_主操作桌面.frx":533A
  233.             Key             =   "xtb"
  234.          EndProperty
  235.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  236.             Picture         =   "系统_主操作桌面.frx":56D4
  237.             Key             =   "lb"
  238.          EndProperty
  239.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  240.             Picture         =   "系统_主操作桌面.frx":5A6E
  241.             Key             =   "xxzl"
  242.          EndProperty
  243.       EndProperty
  244.    End
  245.    Begin MSComctlLib.ImageList ImageList2 
  246.       Left            =   6210
  247.       Top             =   2370
  248.       _ExtentX        =   1005
  249.       _ExtentY        =   1005
  250.       BackColor       =   -2147483643
  251.       ImageWidth      =   32
  252.       ImageHeight     =   32
  253.       MaskColor       =   12632256
  254.       _Version        =   393216
  255.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  256.          NumListImages   =   3
  257.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  258.             Picture         =   "系统_主操作桌面.frx":5E08
  259.             Key             =   ""
  260.          EndProperty
  261.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  262.             Picture         =   "系统_主操作桌面.frx":6128
  263.             Key             =   "i"
  264.          EndProperty
  265.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  266.             Picture         =   "系统_主操作桌面.frx":717A
  267.             Key             =   "y"
  268.          EndProperty
  269.       EndProperty
  270.    End
  271.    Begin VB.PictureBox picTitles 
  272.       Align           =   1  'Align Top
  273.       Appearance      =   0  'Flat
  274.       BorderStyle     =   0  'None
  275.       BeginProperty Font 
  276.          Name            =   "MS Sans Serif"
  277.          Size            =   8.25
  278.          Charset         =   0
  279.          Weight          =   400
  280.          Underline       =   0   'False
  281.          Italic          =   0   'False
  282.          Strikethrough   =   0   'False
  283.       EndProperty
  284.       ForeColor       =   &H80000008&
  285.       Height          =   300
  286.       Left            =   0
  287.       ScaleHeight     =   300
  288.       ScaleWidth      =   11880
  289.       TabIndex        =   1
  290.       TabStop         =   0   'False
  291.       Top             =   420
  292.       Width           =   11880
  293.       Begin VB.Label lblTitle 
  294.          BorderStyle     =   1  'Fixed Single
  295.          Caption         =   "百利/ERP5.0"
  296.          Height          =   270
  297.          Index           =   0
  298.          Left            =   0
  299.          TabIndex        =   3
  300.          Tag             =   " 树形视图:"
  301.          Top             =   12
  302.          Width           =   2016
  303.       End
  304.       Begin VB.Label lblTitle 
  305.          BorderStyle     =   1  'Fixed Single
  306.          Caption         =   " 列表视图:"
  307.          Height          =   270
  308.          Index           =   1
  309.          Left            =   2078
  310.          TabIndex        =   2
  311.          Tag             =   " 列表视图:"
  312.          Top             =   12
  313.          Width           =   3216
  314.       End
  315.    End
  316.    Begin VB.Image imgSplitter 
  317.       Height          =   4785
  318.       Left            =   4230
  319.       MousePointer    =   9  'Size W E
  320.       Top             =   750
  321.       Width           =   150
  322.    End
  323. End
  324. Attribute VB_Name = "Xt_Control"
  325. Attribute VB_GlobalNameSpace = False
  326. Attribute VB_Creatable = False
  327. Attribute VB_PredeclaredId = True
  328. Attribute VB_Exposed = False
  329. '***********************************************
  330. '*    模 块 名 称 :系统主操作桌面
  331. '*    功 能 描 述 :
  332. '*    程序员姓名  :徐衍民
  333. '*    最后修改人  :徐衍民
  334. '*    最后修改时间:2001/11/15
  335. '*    备        注:
  336. '***********************************************
  337. Const NAME_COLUMN = 0
  338. Const TYPE_COLUMN = 1
  339. Const SIZE_COLUMN = 2
  340. Const DATE_COLUMN = 3
  341. Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
  342.   
  343. Dim rstemp As ADODB.Recordset            '打开数据集临时变量
  344. Dim Rs_Temp As ADODB.Recordset            '打开数据集临时变量
  345. Dim mbMoving As Boolean
  346. Const sglSplitLimit = 1000
  347. Dim sjgnbmStr As String                      '上级编码
  348. Dim nodX As Node
  349. Dim mitem As ListItem
  350. Dim Ztxxrec As New ADODB.Recordset           '帐套信息动态集
  351. Dim Xtgnbrec As New ADODB.Recordset          '系统功能表
  352. Dim Xtqxxzrec As New ADODB.Recordset         '系统权限限制动态集
  353. Dim Tsxx As String                           '系统提示信息
  354. Dim gnsyte As String                         '系统功能项索引
  355. Dim Xtrlrec As New ADODB.Recordset           '系统日历动态集
  356. Dim Ctsfscdr As Boolean                      '窗体是否首次读入
  357. Private Sub lvListView_DblClick()            '点击ListView执行相应功能
  358.     
  359.     If lvListView.ListItems.count > 0 Then
  360.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(lvListView.SelectedItem.Key), 2, Len(Trim(lvListView.SelectedItem.Key)) - 1) + "'")
  361.         If Not Xtgnbrec.EOF Then
  362.             If Xtgnbrec.Fields("mjbz") = True Then
  363.                 gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  364.                 Call Zxxymk(gnsyte)
  365.             Else
  366.                 '---------------
  367.                 Dim Ssql As String
  368.                 sjgnbmStr = ""
  369.                 lvListView.ColumnHeaders.Clear
  370.                 lvListView.ListItems.Clear
  371.                 Ssql = "SELECT * FROM xt_xtgnb where sjgnbm='" + Xtgnbrec.Fields("gnbm") + "' and MenuList=1 order by gnbm"
  372.                 Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  373.                 lvListView.ColumnHeaders.Add 1, "rcsw", tvTreeView.SelectedItem.Text, 3000, , "stb"
  374.                 Do While Not Xtgnbrec.EOF
  375.                     Set mitem = lvListView.ListItems.Add()
  376.                     mitem.Text = Trim(Xtgnbrec!gnmc)
  377.                     If Xtgnbrec.Fields("mjbz") Then
  378.                         mitem.SmallIcon = "gnqx"
  379.                         mitem.Icon = "y"
  380.                     Else
  381.                         mitem.Icon = "i"
  382.                         mitem.SmallIcon = "stb"
  383.                     End If
  384.                     mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  385.                     Xtgnbrec.MoveNext
  386.                 Loop
  387.                 '---------------
  388.             End If
  389.         End If
  390.     End If
  391.     
  392. End Sub
  393. Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
  394.     
  395.     Dim Ssql As String
  396.     
  397.     If Node.Tag <> "" Then
  398.         If Node.Tag = False Then
  399.             Ssql = "SELECT * FROM xt_xtgnb where sjgnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "' and MenuList=1 order by gnbm"
  400.             If sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) Then
  401.                 Exit Sub
  402.             Else
  403.                 sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1)
  404.             End If
  405.         Else
  406.             Ssql = "SELECT * FROM xt_xtgnb a," _
  407.                     & "(SELECT sjgnbm FROM xt_xtgnb where gnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "')b" & " where a.sjgnbm=b.sjgnbm and MenuList=1 order by gnbm"
  408.         End If
  409.         
  410.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  411.         If Node.Tag = True Then
  412.             If sjgnbmStr = Trim(Xtgnbrec!sjgnbm) Then
  413.                 Exit Sub
  414.             Else
  415.                 sjgnbmStr = Trim(Xtgnbrec!sjgnbm)
  416.             End If
  417.         End If
  418.         lvListView.ColumnHeaders.Clear
  419.         lvListView.ListItems.Clear
  420.         lvListView.ColumnHeaders.Add 1, "rcsw", "明细", 3000, , "stb"
  421.         Do While Not Xtgnbrec.EOF
  422.             Set mitem = lvListView.ListItems.Add()
  423.             mitem.Text = Trim(Xtgnbrec!gnmc)
  424.             If Xtgnbrec.Fields("mjbz") Then
  425.                 mitem.SmallIcon = "gnqx"
  426.                 mitem.Icon = "y"
  427.             Else
  428.                 mitem.Icon = "i"
  429.                 mitem.SmallIcon = "stb"
  430.             End If
  431.             mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  432.             Xtgnbrec.MoveNext
  433.         Loop
  434.     End If
  435.     
  436. End Sub
  437. Public Sub Cshgns()                                                    '初始化系统功能树
  438.   
  439.     Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm like '05%' and MenuList=1 order by gnbm")
  440.     tvTreeView.Nodes.Add , 4, "T", "百利/ERP5.0", "xttb"
  441.     With Xtgnbrec
  442.         Do While Not .EOF
  443.             If .Fields("mjbz") Then
  444.                 Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "gnqx")
  445.             Else
  446.                 If Trim(.Fields("sjgnbm")) = "" Then
  447.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "kpgl")
  448.                 Else
  449.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "stb")
  450.                 End If
  451.             End If
  452.             nodX.Tag = Xtgnbrec!mjbz
  453.             If Len(Trim(.Fields("sjgnbm"))) <= 2 Then
  454.                 nodX.EnsureVisible
  455.             End If
  456.             .MoveNext
  457.         Loop
  458.     End With
  459. End Sub
  460. '系统功能树操作
  461. Private Sub tvTreeView_BeforeLabelEdit(Cancel As Integer)                     '屏蔽编辑
  462.     Cancel = 1
  463. End Sub
  464. Private Sub tvTreeView_Collapse(ByVal Node As MSComctlLib.Node)               '功能树收缩
  465.     
  466.     If Node.Index <> 1 And Node.Key <> "T05" Then
  467.         Node.Image = "stb"
  468.     End If
  469.  
  470. End Sub
  471. Private Sub tvTreeView_Expand(ByVal Node As MSComctlLib.Node)                 '功能树展开
  472.     
  473.     If Node.Index <> 1 And Node.Key <> "T05" Then
  474.         Node.Image = "szk"
  475.     End If
  476. End Sub
  477. Private Sub tvTreeView_KeyPress(KeyAscii As Integer)                          '用户按回车键执行相应功能
  478.     
  479.     If KeyAscii = vbKeyReturn Then
  480.         Call tvTreeView_DblClick
  481.     End If
  482. End Sub
  483. Private Sub tvTreeView_DblClick()                                             '选择功能
  484.     
  485.     If tvTreeView.SelectedItem.Children = 0 Then
  486.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "'")
  487.         If Not Xtgnbrec.EOF Then
  488.             gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  489.             Call Zxxymk(gnsyte)
  490.         End If
  491.     End If
  492. End Sub
  493. Public Sub Zxxymk(gnsy As String)                                            '根据用户选择执行相应程序
  494.   
  495.     Dim RecTemp As New ADODB.Recordset          '临时使用动态集
  496.     Dim Sqlstr As String                        '临时查询字符串
  497.   
  498.     If Len(Trim(gnsy)) = 0 Then
  499.         Exit Sub
  500.     End If
  501.     
  502.     On Error GoTo Cwcl:
  503.     
  504.     Select Case gnsy
  505.         
  506.         '系统操作
  507.         Case "Gdzc_Redit"                       '用户重新注册
  508.             XT_login.Show 1
  509.         Case "Gdzc_LedgerManage"                '帐簿清理
  510.             ZbqlFrm.Show 1
  511.         Case "Gdzc_Quit"                        '退出系统
  512.             Unload XT_Main
  513.         Case "Gdzc_AddSet"                      '辅助项目设置
  514.             
  515.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  516.             If Not Security_Log("Gdzc_AddSet_Edit", Xtczybm, 1) Then
  517.                 Exit Sub
  518.             End If
  519.             
  520.             Jcsz_Custom.Show 1
  521.             
  522.             Security_Log "Gdzc_AddSet", Xtczybm, 2, False  '用户退出时写上机日志
  523.         
  524.         Case "Gdzc_FaSort"                      '资产类别设置
  525.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  526.             If Not Security_Log("Gdzc_FaSort_Edit", Xtczybm, 1) Then
  527.                 Exit Sub
  528.             End If
  529.             
  530.             Jcsz_FASort.Show 1
  531.             
  532.             Security_Log "Gdzc_FaSort", Xtczybm, 2, False  '用户退出时写上机日志
  533.             
  534.         Case "Gdzc_Variation"                   '变动方式设置
  535.         
  536.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  537.             If Not Security_Log("Gdzc_Variation_Edit", Xtczybm, 1) Then
  538.                 Exit Sub
  539.             End If
  540.             
  541.             Jcsz_VariationMode.Show 1
  542.             Security_Log "Gdzc_Variation", Xtczybm, 2, False  '用户退出时写上机日志
  543.        
  544.         Case "Gdzc_FAUseState"                  '使用状况设置
  545.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  546.             If Not Security_Log("Gdzc_FAUseState_Edit", Xtczybm, 1) Then
  547.                 Exit Sub
  548.             End If
  549.             
  550.             Jcsz_State.Show 1
  551.             Security_Log "Gdzc_FAUseState", Xtczybm, 2, False  '用户退出时写上机日志
  552.         
  553.         Case "Gdzc_Jbcz"                        '资产卡片操作
  554.             
  555.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  556.             If Not Security_Log("Gdzc_Jbcz_Edit", Xtczybm, 1) Then
  557.                 Exit Sub
  558.             End If
  559.             
  560.             Kpgl_CardList.Show
  561.             Kpgl_Search.Show 1
  562.             Security_Log "Gdzc_Jbcz", Xtczybm, 2, False  '用户退出时写上机日志
  563.         
  564.         Case "Gdzc_Activities"                  '本期工作量录入
  565.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  566.             If Not Security_Log("Gdzc_Activities_Edit", Xtczybm, 1) Then
  567.                 Exit Sub
  568.             End If
  569.             
  570.             Oper_Bqgzllr.Show 1
  571.                         
  572.             Security_Log "Gdzc_Activities", Xtczybm, 2, False  '用户退出时写上机日志
  573.         
  574.         Case "Gdzc_Depr"                        '本期计提折旧
  575.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  576.             If Not Security_Log("Gdzc_Depr_Edit", Xtczybm, 1) Then
  577.                 Exit Sub
  578.             End If
  579.             
  580.             Set Rs_Temp = New ADODB.Recordset
  581.             Rs_Temp.Open "select * from gdzc_card", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  582.             If Rs_Temp.EOF Then
  583.                 Tsxx = "资产卡片数目为零!"
  584.                 Call Xtxxts(Tsxx, 0, 1)
  585.                 Exit Sub
  586.             End If
  587.             Rs_Temp.Close
  588.             Set Rs_Temp = Nothing
  589.             
  590.             Set Rs_Temp = New ADODB.Recordset
  591.             Rs_Temp.Open "select * from gdzc_card where DeprFlag='1'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  592.             If Not Rs_Temp.EOF Then
  593.                 Tsxx = "本月已经计提折旧,请先恢复计提折旧,或执行月末结帐!"
  594.                 Call Xtxxts(Tsxx, 0, 4)
  595.                 Exit Sub
  596.             Else
  597.                 Oper_Depr.Show 1
  598.             End If
  599.             Rs_Temp.Close
  600.             Set Rs_Temp = Nothing
  601.             
  602.             Security_Log "Gdzc_Depr", Xtczybm, 2, False  '用户退出时写上机日志
  603.         
  604.         Case "Gdzc_ReSet"                       '恢复计提折旧
  605.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  606.             If Not Security_Log("Gdzc_ReSet_Edit", Xtczybm, 1) Then
  607.                 Exit Sub
  608.             End If
  609.             
  610.             Set Rs_Temp = New ADODB.Recordset
  611.             Rs_Temp.Open "select * from gdzc_card where DeprFlag='0' and [Check-outFlag]='0'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  612.             If Not Rs_Temp.EOF Then
  613.                 Tsxx = "本月未计提折旧,不用恢复计提折旧!"
  614.                 Call Xtxxts(Tsxx, 0, 4)
  615.                 Exit Sub
  616.             Else
  617.                 Oper_DeprBack.Show 1
  618.             End If
  619.             Security_Log "Gdzc_ReSet", Xtczybm, 2, False  '用户退出时写上机日志
  620.         
  621.         Case "Gdzc_Check-Out"                   '月末结帐
  622.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  623.             If Not Security_Log("Gdzc_Check-Out_edit", Xtczybm, 1) Then
  624.                 Exit Sub
  625.             End If
  626.             
  627.             Set Rs_Temp = New ADODB.Recordset
  628.             Rs_Temp.Open "select * from gdzc_card", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  629.             If Rs_Temp.EOF Then
  630.                 Tsxx = "资产卡片数目为零!"
  631.                 Call Xtxxts(Tsxx, 0, 1)
  632.                 Exit Sub
  633.             End If
  634.             Rs_Temp.Close
  635.             Set Rs_Temp = Nothing
  636.             
  637.             Set rstemp = New ADODB.Recordset
  638.             rstemp.Open "select top 1 * from gy_kjrlb where gdzcjzbz='0' ", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  639.             If rstemp.EOF Then
  640.                 Tsxx = "没有新一年的会计日历表!"
  641.                 Call Xtxxts(Tsxx, 0, 4)
  642.                 Exit Sub
  643.             End If
  644.             rstemp.Close
  645.             Set rstemp = Nothing
  646.             
  647.             Set Rs_Temp = New ADODB.Recordset
  648.             Rs_Temp.Open "select * from gdzc_card where DeprFlag='0' and [Check-outFlag]='0'", Cw_DataEnvi.DataConnect, adOpenDynamic, adLockOptimistic
  649.             If Not Rs_Temp.EOF Then
  650.                 Tsxx = "本月未计提折旧,请先执行计提折旧!"
  651.                 Call Xtxxts(Tsxx, 0, 4)
  652.                 Exit Sub
  653.             Else
  654.                 Oper_CheckOut.Show 1
  655.             End If
  656.             Security_Log "Gdzc_Check-Out", Xtczybm, 2, False  '用户退出时写上机日志
  657.         
  658.         Case "Gdzc_FAList"                      '资产清单列表
  659.             Book_CardList.Show
  660.             Book_CardList_Search.Show 1
  661.         Case "Gdzc_VariaList"                   '资产变动报表
  662.             Book_VariList.Show
  663.             Book_Vari_Search.Show 1
  664.         Case "Gdzc_OverList"                    '超龄资产报表
  665.             Book_OverList.Show
  666.         Case "Gdzc_Zz"                          '固定资产总帐
  667.             Book_CheckList.Show
  668.             Book_Check_Search.Show 1
  669.         Case "Gdzc_Part"                        '资产明细报表
  670.             Book_Parti.Show
  671.             Book_Parti_Search.Show 1
  672.         Case "Gdzc_Total"                       '资产统计报表
  673.             Book_Total.Show
  674.             Book_Total_Search.Show 1
  675.         Case "Gdzc_DeprComput"                  '折旧计算报表
  676.             Book_Depr.Show
  677.             Book_Depr_Search.Show 1
  678.         Case "Gdzc_Stru"                        '价值结构分析
  679.             Book_Value.Show
  680.             Book_Value_Search.Show 1
  681.         Case "Gdzc_Kjrl"                        '会计日历
  682.             XT_kjrlFrm.Show 1
  683.         Case "Gdzc_Computer"                    '计算器
  684.             Shell App.Path & "calc.exe", vbNormalFocus
  685.         Case "Gdzc_SysHelp"                     '系统帮助
  686.             Call F1bz
  687.         Case "Gdzc_Internet"                    '网上华夏新达
  688.             XT_frmBrowser.Show 1
  689.         Case "Gdzc_About"                       '关于我们
  690.             XT_frmAbout.Show
  691.         
  692.     End Select
  693.     
  694.     '用户退出时写上机日志
  695.     Security_Log gnsy, Xtczybm, 2, False
  696.    
  697.     Exit Sub
  698. Cwcl:
  699.     Tsxx = "此项系统功能有待完善!"
  700.     Call Xtxxts(Tsxx, 0, 4)
  701.     Exit Sub
  702. End Sub
  703. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)        '用户关闭窗体
  704.   
  705.     If Unload_TF = False Then
  706.         Cancel = 1
  707.         Me.WindowState = 1
  708.     End If
  709. End Sub
  710. Private Sub Form_Load()
  711.     
  712.     '设置窗体图标
  713.     Me.Icon = XT_Main.Icon
  714.     
  715.     '设置窗体位置大小,并调入系统功能树
  716.     Me.Left = 0
  717.     Me.Top = 0
  718.     Me.Width = XT_Main.Width - 60
  719.     Me.Height = XT_Main.Height - 760 - 690
  720.     Call Cshgns
  721.     
  722.     '启动调入数据等待提示
  723.     Load Xt_Wait
  724.     
  725. End Sub
  726. Private Sub Form_Unload(Cancel As Integer)
  727.     
  728.     On Error Resume Next
  729.     
  730.     Dim i As Integer
  731.     For i = Forms.count - 1 To 1 Step -1
  732.         Unload Forms(i)
  733.     Next
  734.     If Me.WindowState <> vbMinimized Then
  735.         SaveSetting App.Title, "Settings", "MainLeft", Me.Left
  736.         SaveSetting App.Title, "Settings", "MainTop", Me.Top
  737.         SaveSetting App.Title, "Settings", "MainWidth", Me.Width
  738.         SaveSetting App.Title, "Settings", "MainHeight", Me.Height
  739.     End If
  740.     SaveSetting App.Title, "Settings", "ViewMode", lvListView.View
  741. End Sub
  742. Private Sub Form_Resize()
  743.     
  744.     On Error Resume Next
  745.     If Me.Width < 3000 Then Me.Width = 3000
  746.     SizeControls imgSplitter.Left
  747. End Sub
  748. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  749.     
  750.     With imgSplitter
  751.         picSplitter.Move .Left, .Top, .Width  2, .Height - 20
  752.     End With
  753.     picSplitter.Visible = True
  754.     mbMoving = True
  755. End Sub
  756. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  757.     
  758.     Dim sglPos As Single
  759.     If mbMoving Then
  760.         sglPos = x + imgSplitter.Left
  761.         If sglPos < sglSplitLimit Then
  762.             picSplitter.Left = sglSplitLimit
  763.         ElseIf sglPos > Me.Width - sglSplitLimit Then
  764.             picSplitter.Left = Me.Width - sglSplitLimit
  765.         Else
  766.             picSplitter.Left = sglPos
  767.         End If
  768.     End If
  769. End Sub
  770. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  771.     
  772.     SizeControls picSplitter.Left
  773.     picSplitter.Visible = False
  774.     mbMoving = False
  775.     lvListView.Refresh
  776. End Sub
  777. Private Sub TreeView1_DragDrop(Source As Control, x As Single, y As Single)
  778.     
  779.     If Source = imgSplitter Then
  780.         SizeControls x
  781.     End If
  782. End Sub
  783. Sub SizeControls(x As Single)
  784.     
  785.     On Error Resume Next
  786.     '设置 Width 属性
  787.     If x < 3500 Then x = 3500
  788.     If x > (Me.Width - 1500) Then x = Me.Width - 1500
  789.     tvTreeView.Width = x
  790.     imgSplitter.Left = x
  791.     lvListView.Left = x + 40
  792.     lvListView.Width = Me.Width - (tvTreeView.Width + 140)
  793.     lblTitle(0).Width = tvTreeView.Width
  794.     lblTitle(1).Left = lvListView.Left + 20
  795.     lblTitle(1).Width = lvListView.Width - 40
  796.     '设置 Top 属性
  797.     tvTreeView.Top = tbToolBar.Height + picTitles.Height
  798.     lvListView.Top = tvTreeView.Top
  799.     '设置 height 属性
  800.     tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
  801.     
  802.     lvListView.Height = tvTreeView.Height
  803.     imgSplitter.Top = tvTreeView.Top
  804.     imgSplitter.Height = tvTreeView.Height
  805. End Sub
  806. Private Sub tbToolBar_ButtonClick(ByVal Button As MSComctlLib.Button)
  807.     
  808.     On Error Resume Next
  809.     
  810.     Select Case Button.Key
  811.         Case "返回"
  812.             tvTreeView.SetFocus
  813.               SendKeys "{up}", True
  814.         Case "向前"
  815.              tvTreeView.SetFocus
  816.               SendKeys "{DOWN}", True
  817.         Case "大图标"
  818.             lvListView.View = lvwIcon
  819.         Case "小图标"
  820.             lvListView.View = lvwSmallIcon
  821.         Case "列表"
  822.             lvListView.View = lvwList
  823.         Case "详细资料"
  824.             lvListView.View = lvwReport
  825.     End Select
  826. End Sub
  827. Private Sub lvListView_KeyPress(KeyAscii As Integer)
  828.     
  829.     If KeyAscii = vbKeyReturn Then
  830.         Call lvListView_DblClick
  831.     End If
  832.     
  833. End Sub