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

企业管理

开发平台:

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    =   5850
  7.    ClientLeft      =   675
  8.    ClientTop       =   1665
  9.    ClientWidth     =   9240
  10.    Icon            =   "系统_主操作桌面.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   5850
  14.    ScaleWidth      =   9240
  15.    WindowState     =   2  'Maximized
  16.    Begin VB.PictureBox picSplitter 
  17.       BackColor       =   &H00808080&
  18.       BorderStyle     =   0  'None
  19.       FillColor       =   &H00808080&
  20.       BeginProperty Font 
  21.          Name            =   "MS Sans Serif"
  22.          Size            =   8.25
  23.          Charset         =   0
  24.          Weight          =   400
  25.          Underline       =   0   'False
  26.          Italic          =   0   'False
  27.          Strikethrough   =   0   'False
  28.       EndProperty
  29.       Height          =   4800
  30.       Left            =   4740
  31.       ScaleHeight     =   2090.126
  32.       ScaleMode       =   0  'User
  33.       ScaleWidth      =   780
  34.       TabIndex        =   0
  35.       Top             =   780
  36.       Visible         =   0   'False
  37.       Width           =   72
  38.    End
  39.    Begin MSComctlLib.ImageList ImageList1 
  40.       Left            =   5220
  41.       Top             =   2340
  42.       _ExtentX        =   1005
  43.       _ExtentY        =   1005
  44.       BackColor       =   -2147483643
  45.       ImageWidth      =   16
  46.       ImageHeight     =   16
  47.       MaskColor       =   12632256
  48.       _Version        =   393216
  49.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  50.          NumListImages   =   7
  51.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  52.             Picture         =   "系统_主操作桌面.frx":1042
  53.             Key             =   "stb"
  54.          EndProperty
  55.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  56.             Picture         =   "系统_主操作桌面.frx":2094
  57.             Key             =   "xttb"
  58.          EndProperty
  59.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  60.             Picture         =   "系统_主操作桌面.frx":30E6
  61.             Key             =   "gnqx"
  62.          EndProperty
  63.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  64.             Picture         =   "系统_主操作桌面.frx":3480
  65.             Key             =   "szk"
  66.          EndProperty
  67.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  68.             Picture         =   "系统_主操作桌面.frx":381A
  69.             Key             =   "gnqx1"
  70.          EndProperty
  71.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  72.             Picture         =   "系统_主操作桌面.frx":3C6C
  73.             Key             =   "kpgl2"
  74.          EndProperty
  75.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  76.             Picture         =   "系统_主操作桌面.frx":4546
  77.             Key             =   "kpgl"
  78.          EndProperty
  79.       EndProperty
  80.    End
  81.    Begin MSComctlLib.ListView lvListView 
  82.       Height          =   3375
  83.       Left            =   2175
  84.       TabIndex        =   5
  85.       Top             =   705
  86.       Width           =   2295
  87.       _ExtentX        =   4048
  88.       _ExtentY        =   5953
  89.       Arrange         =   2
  90.       LabelEdit       =   1
  91.       LabelWrap       =   -1  'True
  92.       HideSelection   =   -1  'True
  93.       OLEDragMode     =   1
  94.       OLEDropMode     =   1
  95.       PictureAlignment=   1
  96.       _Version        =   393217
  97.       Icons           =   "ImageList2"
  98.       SmallIcons      =   "ImageList1"
  99.       ColHdrIcons     =   "ImageList1"
  100.       ForeColor       =   -2147483640
  101.       BackColor       =   -2147483643
  102.       BorderStyle     =   1
  103.       Appearance      =   1
  104.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  105.          Name            =   "宋体"
  106.          Size            =   9
  107.          Charset         =   134
  108.          Weight          =   400
  109.          Underline       =   0   'False
  110.          Italic          =   0   'False
  111.          Strikethrough   =   0   'False
  112.       EndProperty
  113.       OLEDragMode     =   1
  114.       OLEDropMode     =   1
  115.       NumItems        =   0
  116.    End
  117.    Begin VB.PictureBox picTitles 
  118.       Align           =   1  'Align Top
  119.       Appearance      =   0  'Flat
  120.       BorderStyle     =   0  'None
  121.       BeginProperty Font 
  122.          Name            =   "MS Sans Serif"
  123.          Size            =   8.25
  124.          Charset         =   0
  125.          Weight          =   400
  126.          Underline       =   0   'False
  127.          Italic          =   0   'False
  128.          Strikethrough   =   0   'False
  129.       EndProperty
  130.       ForeColor       =   &H80000008&
  131.       Height          =   300
  132.       Left            =   0
  133.       ScaleHeight     =   300
  134.       ScaleWidth      =   9240
  135.       TabIndex        =   1
  136.       TabStop         =   0   'False
  137.       Top             =   420
  138.       Width           =   9240
  139.       Begin VB.Label lblTitle 
  140.          BorderStyle     =   1  'Fixed Single
  141.          Caption         =   "百利/ERP"
  142.          Height          =   270
  143.          Index           =   0
  144.          Left            =   0
  145.          TabIndex        =   3
  146.          Tag             =   " 树形视图:"
  147.          Top             =   12
  148.          Width           =   2016
  149.       End
  150.       Begin VB.Label lblTitle 
  151.          BorderStyle     =   1  'Fixed Single
  152.          Caption         =   " 列表视图:"
  153.          Height          =   270
  154.          Index           =   1
  155.          Left            =   2078
  156.          TabIndex        =   2
  157.          Tag             =   " 列表视图:"
  158.          Top             =   12
  159.          Width           =   3216
  160.       End
  161.    End
  162.    Begin MSComDlg.CommonDialog dlgCommonDialog 
  163.       Left            =   3360
  164.       Top             =   2160
  165.       _ExtentX        =   847
  166.       _ExtentY        =   847
  167.       _Version        =   393216
  168.    End
  169.    Begin MSComctlLib.TreeView tvTreeView 
  170.       Height          =   4800
  171.       Left            =   0
  172.       TabIndex        =   4
  173.       Top             =   705
  174.       Width           =   2010
  175.       _ExtentX        =   3545
  176.       _ExtentY        =   8467
  177.       _Version        =   393217
  178.       Indentation     =   564
  179.       Style           =   7
  180.       ImageList       =   "ImageList1"
  181.       Appearance      =   1
  182.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  183.          Name            =   "宋体"
  184.          Size            =   9
  185.          Charset         =   134
  186.          Weight          =   400
  187.          Underline       =   0   'False
  188.          Italic          =   0   'False
  189.          Strikethrough   =   0   'False
  190.       EndProperty
  191.    End
  192.    Begin MSComctlLib.Toolbar tbToolBar 
  193.       Align           =   1  'Align Top
  194.       Height          =   420
  195.       Left            =   0
  196.       TabIndex        =   6
  197.       Top             =   0
  198.       Width           =   9240
  199.       _ExtentX        =   16298
  200.       _ExtentY        =   741
  201.       ButtonWidth     =   609
  202.       ButtonHeight    =   582
  203.       AllowCustomize  =   0   'False
  204.       Appearance      =   1
  205.       ImageList       =   "imlToolbarIcons"
  206.       _Version        =   393216
  207.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  208.          NumButtons      =   10
  209.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  210.             Style           =   3
  211.          EndProperty
  212.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  213.             Key             =   "返回"
  214.             Object.ToolTipText     =   "返回"
  215.             ImageKey        =   "xq"
  216.          EndProperty
  217.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  218.             Key             =   "向前"
  219.             Object.ToolTipText     =   "向前"
  220.             ImageKey        =   "xh"
  221.          EndProperty
  222.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  223.             Style           =   3
  224.          EndProperty
  225.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  226.             Style           =   3
  227.          EndProperty
  228.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  229.             Style           =   3
  230.          EndProperty
  231.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  232.             Key             =   "大图标"
  233.             Object.ToolTipText     =   "大图标"
  234.             ImageKey        =   "dtb"
  235.             Style           =   2
  236.             Value           =   1
  237.          EndProperty
  238.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  239.             Key             =   "小图标"
  240.             Object.ToolTipText     =   "小图标"
  241.             ImageKey        =   "xtb"
  242.             Style           =   2
  243.          EndProperty
  244.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  245.             Key             =   "列表"
  246.             Object.ToolTipText     =   "列表"
  247.             ImageKey        =   "lb"
  248.             Style           =   2
  249.          EndProperty
  250.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  251.             Key             =   "详细资料"
  252.             Object.ToolTipText     =   "详细资料"
  253.             ImageKey        =   "xxzl"
  254.             Style           =   2
  255.          EndProperty
  256.       EndProperty
  257.    End
  258.    Begin MSComctlLib.ImageList imlToolbarIcons 
  259.       Left            =   4710
  260.       Top             =   840
  261.       _ExtentX        =   1005
  262.       _ExtentY        =   1005
  263.       BackColor       =   -2147483643
  264.       ImageWidth      =   16
  265.       ImageHeight     =   16
  266.       MaskColor       =   12632256
  267.       _Version        =   393216
  268.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  269.          NumListImages   =   6
  270.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  271.             Picture         =   "系统_主操作桌面.frx":5598
  272.             Key             =   "xq"
  273.          EndProperty
  274.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  275.             Picture         =   "系统_主操作桌面.frx":5932
  276.             Key             =   "xh"
  277.          EndProperty
  278.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  279.             Picture         =   "系统_主操作桌面.frx":5CCC
  280.             Key             =   "dtb"
  281.          EndProperty
  282.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  283.             Picture         =   "系统_主操作桌面.frx":6066
  284.             Key             =   "xtb"
  285.          EndProperty
  286.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  287.             Picture         =   "系统_主操作桌面.frx":6400
  288.             Key             =   "lb"
  289.          EndProperty
  290.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  291.             Picture         =   "系统_主操作桌面.frx":679A
  292.             Key             =   "xxzl"
  293.          EndProperty
  294.       EndProperty
  295.    End
  296.    Begin MSComctlLib.ImageList ImageList2 
  297.       Left            =   6210
  298.       Top             =   2370
  299.       _ExtentX        =   1005
  300.       _ExtentY        =   1005
  301.       BackColor       =   -2147483643
  302.       ImageWidth      =   32
  303.       ImageHeight     =   32
  304.       MaskColor       =   12632256
  305.       _Version        =   393216
  306.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  307.          NumListImages   =   4
  308.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  309.             Picture         =   "系统_主操作桌面.frx":6B34
  310.             Key             =   "y1"
  311.          EndProperty
  312.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  313.             Picture         =   "系统_主操作桌面.frx":6F88
  314.             Key             =   ""
  315.          EndProperty
  316.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  317.             Picture         =   "系统_主操作桌面.frx":72A8
  318.             Key             =   "i"
  319.          EndProperty
  320.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  321.             Picture         =   "系统_主操作桌面.frx":82FA
  322.             Key             =   "y"
  323.          EndProperty
  324.       EndProperty
  325.    End
  326.    Begin VB.Image imgSplitter 
  327.       Height          =   4785
  328.       Left            =   4230
  329.       MousePointer    =   9  'Size W E
  330.       Top             =   750
  331.       Width           =   150
  332.    End
  333. End
  334. Attribute VB_Name = "Xt_Control"
  335. Attribute VB_GlobalNameSpace = False
  336. Attribute VB_Creatable = False
  337. Attribute VB_PredeclaredId = True
  338. Attribute VB_Exposed = False
  339. '***********************************************
  340. '*    模 块 名 称 :系统主操作桌面
  341. '*    功 能 描 述 :
  342. '*    程序员姓名  :李建伟
  343. '*    最后修改人  :李建伟
  344. '*    最后修改时间:2001/06/21
  345. '*    备        注:封版
  346. '***********************************************
  347. Const NAME_COLUMN = 0
  348. Const TYPE_COLUMN = 1
  349. Const SIZE_COLUMN = 2
  350. Const DATE_COLUMN = 3
  351. Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)
  352.   
  353. Dim mbMoving As Boolean
  354. Const sglSplitLimit = 1000
  355. Dim nodX As Node
  356. Dim mitem As ListItem
  357. Dim Ztxxrec As New ADODB.Recordset           '帐套信息动态集
  358. Dim Xtgnbrec As New ADODB.Recordset          '系统功能表
  359. Dim Xtqxxzrec As New ADODB.Recordset         '系统权限限制动态集
  360. Dim Tsxx As String                           '系统提示信息
  361. Dim gnsyte As String                         '系统功能项索引
  362. Dim Xtrlrec As New ADODB.Recordset           '系统日历动态集
  363. Dim Ctsfscdr As Boolean                      '窗体是否首次读入
  364. Private Sub lvListView_DblClick()            '点击ListView执行相应功能
  365.     If lvListView.ListItems.count > 0 Then
  366.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(lvListView.SelectedItem.Key), 2, Len(Trim(lvListView.SelectedItem.Key)) - 1) + "'")
  367.         If Not Xtgnbrec.EOF Then
  368.             If Xtgnbrec.Fields("mjbz") = True Then
  369.                 gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  370.                 Call Zxxymk(gnsyte)
  371.             Else
  372.                 '---------------
  373.                 Dim Ssql As String
  374.                 sjgnbmStr = ""
  375.                 lvListView.ColumnHeaders.Clear
  376.                 lvListView.ListItems.Clear
  377.                 Ssql = "SELECT * FROM xt_xtgnb where sjgnbm='" + Xtgnbrec.Fields("gnbm") + "' and MenuList=1 order by gnbm"
  378.                 Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  379.                 lvListView.ColumnHeaders.Add 1, "rcsw", tvTreeView.SelectedItem.Text, 3000, , "stb"
  380.                 Do While Not Xtgnbrec.EOF
  381.                     Set mitem = lvListView.ListItems.Add()
  382.                     mitem.Text = Trim(Xtgnbrec!gnmc)
  383.                     If Xtgnbrec.Fields("mjbz") Then
  384.                         mitem.SmallIcon = "gnqx"
  385.                         mitem.Icon = "y"
  386.                     Else
  387.                         mitem.Icon = "i"
  388.                         mitem.SmallIcon = "stb"
  389.                     End If
  390.                     mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  391.                     Xtgnbrec.MoveNext
  392.                 Loop
  393.                 '---------------
  394.             End If
  395.         End If
  396.     End If
  397. End Sub
  398. Private Sub tvTreeView_NodeClick(ByVal Node As MSComctlLib.Node)
  399.     Dim Ssql As String
  400.     If Node.Tag <> "" Then
  401.         If Node.Tag = False Then
  402.             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"
  403.             If sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) Then
  404.                 Exit Sub
  405.             Else
  406.                 sjgnbmStr = Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1)
  407.             End If
  408.         Else
  409.             Ssql = "SELECT * FROM xt_xtgnb a," _
  410.                     & "(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"
  411.         End If
  412.         
  413.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute(Ssql)
  414.         If Node.Tag = True Then
  415.             If sjgnbmStr = Trim(Xtgnbrec!sjgnbm) Then
  416.                 Exit Sub
  417.             Else
  418.                 sjgnbmStr = Trim(Xtgnbrec!sjgnbm)
  419.             End If
  420.         End If
  421.         lvListView.ColumnHeaders.Clear
  422.         lvListView.ListItems.Clear
  423.         lvListView.ColumnHeaders.Add 1, "rcsw", "明细", 3000, , "stb"
  424.         Do While Not Xtgnbrec.EOF
  425.             Set mitem = lvListView.ListItems.Add()
  426.             mitem.Text = Trim(Xtgnbrec!gnmc)
  427.             If Xtgnbrec.Fields("mjbz") Then
  428.                 mitem.SmallIcon = "gnqx"
  429.                 mitem.Icon = "y"
  430.             Else
  431.                 mitem.Icon = "i"
  432.                 mitem.SmallIcon = "stb"
  433.             End If
  434.             mitem.Key = "T" & Trim(Xtgnbrec!gnbm)
  435.             Xtgnbrec.MoveNext
  436.         Loop
  437.     End If
  438. End Sub
  439. Private Sub lvListView_KeyPress(KeyAscii As Integer)
  440.     If KeyAscii = vbKeyReturn Then
  441.         Call lvListView_DblClick
  442.     End If
  443. End Sub
  444. Public Sub Cshgns()                                                    '初始化系统功能树
  445.   
  446.     Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm like '14%' and MenuList=1 order by gnbm")
  447.     tvTreeView.Nodes.Add , 4, "T", "百利/ERP5.0", "xttb"
  448.     With Xtgnbrec
  449.         Do While Not .EOF
  450.             If .Fields("mjbz") Then
  451.                 Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "gnqx")
  452.             Else
  453.                 If Trim(.Fields("sjgnbm")) = "" Then
  454.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "kpgl")
  455.                 Else
  456.                     Set nodX = tvTreeView.Nodes.Add("T" + Trim(.Fields("sjgnbm")), 4, "T" + Trim(.Fields("gnbm")), Trim(.Fields("gnmc")), "stb")
  457.                 End If
  458.             End If
  459.             nodX.Tag = Xtgnbrec!mjbz
  460.             If Len(Trim(.Fields("sjgnbm"))) <= 2 Then
  461.                 nodX.EnsureVisible
  462.             End If
  463.             .MoveNext
  464.         Loop
  465.     End With
  466. End Sub
  467. '系统功能树操作
  468. Private Sub tvTreeView_BeforeLabelEdit(Cancel As Integer)                     '屏蔽编辑
  469.   Cancel = 1
  470. End Sub
  471. Private Sub tvTreeView_Collapse(ByVal Node As MSComctlLib.Node)               '功能树收缩
  472.     
  473.     If Node.Index <> 1 And Node.Key <> "T14" Then
  474.         Node.Image = "stb"
  475.     End If
  476.  
  477. End Sub
  478. Private Sub tvTreeView_Expand(ByVal Node As MSComctlLib.Node)                 '功能树展开
  479.     
  480.     If Node.Index <> 1 And Node.Key <> "T14" Then
  481.         Node.Image = "szk"
  482.     End If
  483. End Sub
  484. Private Sub tvTreeView_KeyPress(KeyAscii As Integer)                          '用户按回车键执行相应功能
  485.     
  486.     If KeyAscii = vbKeyReturn Then
  487.         Call tvTreeView_DblClick
  488.     End If
  489. End Sub
  490. Private Sub tvTreeView_DblClick()                                             '选择功能
  491.     
  492.     If tvTreeView.SelectedItem.Children = 0 Then
  493.         Set Xtgnbrec = Cw_DataEnvi.DataConnect.Execute("SELECT * FROM xt_xtgnb where gnbm='" + Mid(Trim(tvTreeView.SelectedItem.Key), 2, Len(Trim(tvTreeView.SelectedItem.Key)) - 1) + "'")
  494.         If Not Xtgnbrec.EOF Then
  495.             gnsyte = Trim(Xtgnbrec.Fields("gnsy"))
  496.             Call Zxxymk(gnsyte)
  497.         End If
  498.     End If
  499. End Sub
  500. Public Sub Zxxymk(gnsy As String)                                            '根据用户选择执行相应程序
  501.   
  502.     Dim RecTemp As New ADODB.Recordset     '临时使用动态集
  503.     Dim Sqlstr As String                   '临时查询字符串
  504.   
  505.     If Len(Trim(gnsy)) = 0 Then
  506.         Exit Sub
  507.     End If
  508.     
  509. '    '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  510. '    If Not Security_Log(gnsy, Xtczybm, 1, True) Then
  511. '        Exit Sub
  512. '    End If
  513.     
  514.     On Error GoTo Cwcl:
  515.     Xtcdcs = "1"
  516.     Select Case gnsy
  517.         '销售管理系统
  518.         '文件
  519.         Case "Xs_Register"                      '用户重新注册
  520.             XT_login.HelpContextID = 1401007
  521.             XT_login.Show 1
  522.         Case "Xs_SysControl"                    '系统参数设置
  523.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  524.             If Not Security_Log("Xs_SysControl", Xtczybm, 1, True) Then
  525.                 Exit Sub
  526.             End If
  527.             Xs_SysControl.HelpContextID = 1402012
  528.             Xs_SysControl.Show 1
  529.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  530.         Case "c_quit"
  531.             Unload XT_Main
  532.         
  533.         'B 基础设置
  534.         Case "Xs_B_AreaSet"                     '地区设置
  535.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  536.             If Not Security_Log("Xs_B_AreaSet", Xtczybm, 1, True) Then
  537.                 Exit Sub
  538.             End If
  539.             Xs_B_AreaSet.HelpContextID = 1402001
  540.             Xs_B_AreaSet.Show 1
  541.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  542.         Case "Xs_B_TradeSet"                    '行业设置
  543.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  544.             If Not Security_Log("Xs_B_TradeSet", Xtczybm, 1, True) Then
  545.                 Exit Sub
  546.             End If
  547.             Xs_B_TradeSet.HelpContextID = 1402002
  548.             Xs_B_TradeSet.Show 1
  549.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  550.         Case "Xs_B_SellType"                    '销售类型设置
  551.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  552.             If Not Security_Log("Xs_B_SellType", Xtczybm, 1, True) Then
  553.                 Exit Sub
  554.             End If
  555.             Xs_B_SellType.HelpContextID = 1402003
  556.             Xs_B_SellType.Show 1
  557.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  558.         Case "Xs_B_Custmer"                   '客户设置
  559.             Gy_Customer.HelpContextID = 1402004
  560.             Gy_Customer.Show
  561.             Gy_CustomerQuery.Show 1
  562.         Case "Xs_B_Deptset"                   '部门设置
  563.             Gy_Department.HelpContextID = 1402005
  564.             Gy_Department.Show 1
  565.         Case "Xs_B_Person"                    '职员设置"
  566.             Gy_Person.HelpContextID = 1402006
  567.             Gy_Person.Show 1
  568.         Case "Xs_B_trans"                     '运输方式"
  569.            With Gy_BaseSet
  570.                 XtReportCode = "Gy_TransferWay"
  571.                 .ReportTitle = "运输方式设置"
  572.                 .TextGroupCode = "Gy_TransferWay"
  573.                 .GridCode = "Gy_TransferWay"
  574.                 .Str_RightEdit = "Gy_TransferWay_Edit"
  575.                 .str_TableName = "Gy_TransferWay"
  576.                 .str_FieldCode = "TransferWayCode"
  577.                 .str_FieldName = "TransferWayName"
  578.                 .str_Label = "运输方式"
  579.                 .Caption = "运输方式设置"
  580.                 .HelpContextID = 1402007
  581.                 .Show 1
  582.             End With
  583.         Case "Xs_B_TransferCompany"           '承运单位设置
  584.             Gy_TransferCompany.HelpContextID = 1402008
  585.             Gy_TransferCompany.Show 1
  586.         Case "Xs_B_ReturnMoneyType"           '回款类型设置
  587.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  588.             If Not Security_Log("Xs_B_ReturnMoneyType", Xtczybm, 1, True) Then
  589.                 Exit Sub
  590.             End If
  591.             Xs_B_ReturnMoneyType.HelpContextID = 1402009
  592.             Xs_B_ReturnMoneyType.Show 1
  593.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  594.         Case "Xs_B_ContractType"              '合同类型设置
  595.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  596.             If Not Security_Log("Xs_B_ContractType", Xtczybm, 1, True) Then
  597.                 Exit Sub
  598.             End If
  599.             Xs_B_ContractType.HelpContextID = 1402010
  600.             Xs_B_ContractType.Show 1
  601.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  602.         Case "Xs_B_PriceList"                 '价格清单设置
  603.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  604.             If Not Security_Log("Xs_B_PriceList", Xtczybm, 1, True) Then
  605.                 Exit Sub
  606.             End If
  607.             Xs_B_PriceList.HelpContextID = 1402011
  608.             Xs_B_PriceList.Show
  609.             Xs_B_PriceListQuery.Show 1
  610.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  611.         Case "Xs_Q_Quotation"                 '报价单编制"
  612.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  613.             If Not Security_Log("Xs_Q_QuotationEdit", Xtczybm, 1, True) Then
  614.                 Exit Sub
  615.             End If
  616.             Xs_Q_Quotation.HelpContextID = 1405001
  617.             Xs_Q_Quotation.Show 1
  618.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  619.         Case "Xs_Q_QuotationList"             '报价单列表"
  620.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  621.             If Not Security_Log("Xs_Q_QuotationList", Xtczybm, 1, True) Then
  622.                 Exit Sub
  623.             End If
  624.             Xs_Q_QuotationList.HelpContextID = 1405002
  625.             Xs_Q_QuotationList.Show
  626.             Xs_Q_QuotationQuery.Show 1
  627.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  628.         Case "Xs_C_Contract"                    '合同编制"
  629.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  630.             If Not Security_Log("Xs_C_ContractEdit", Xtczybm, 1, True) Then
  631.                 Exit Sub
  632.             End If
  633.             Xs_C_Contract.HelpContextID = 1406001
  634.             Xs_C_Contract.Show 1
  635.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  636.         Case "Xs_C_ContractList"                 '合同列表"
  637.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  638.             If Not Security_Log("Xs_C_ContractList", Xtczybm, 1, True) Then
  639.                 Exit Sub
  640.             End If
  641.             Xs_C_ContractList.HelpContextID = 1406002
  642.             Xs_C_ContractList.Show
  643.             Xs_C_ContractQuery.Show 1
  644.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  645.         'P 销售计划
  646.         Case "Xs_P_DeptPlan"                  '部门销售计划编制
  647.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  648.             If Not Security_Log("Xs_P_DeptPlan", Xtczybm, 1, True) Then
  649.                 Exit Sub
  650.             End If
  651.             Xs_P_DeptPlan.HelpContextID = 1404001
  652.             Xs_P_DeptPlanQuery.Show 1
  653.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  654.         Case "Xs_P_PersonPlan"                '销售员/货物销售计划编制"
  655.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  656.             If Not Security_Log("Xs_P_PersonPlan", Xtczybm, 1, True) Then
  657.                 Exit Sub
  658.             End If
  659.             FrmString = "Xs_P_PersonPlan"
  660.             Xs_P_PersonPlan.HelpContextID = 1404002
  661.             Xs_P_PersonPlanQuery.Show
  662.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  663.         Case "Xs_P_WarePlan"                  '货物销售计划编制"
  664.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  665.             If Not Security_Log("Xs_P_WarePlan", Xtczybm, 1, True) Then
  666.                 Exit Sub
  667.             End If
  668.             FrmString = "Xs_P_WarePlan"
  669.             Xs_P_WarePlan.HelpContextID = 1404003
  670.             Xs_P_PersonPlanQuery.Show
  671.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  672.         Case "Xs_P_CustPlan"                  '客户销售计划编制"
  673.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  674.             If Not Security_Log("Xs_P_CustPlan", Xtczybm, 1, True) Then
  675.                 Exit Sub
  676.             End If
  677.             FrmString = "Xs_P_CusPlan"
  678.             Xs_P_CusPlan.HelpContextID = 1404004
  679.             Xs_P_PersonPlanQuery.Show
  680.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  681.         Case "Xs_P_DepExecute"                '部门销售计划执行情况"
  682.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  683.             If Not Security_Log("Xs_P_DepExecute", Xtczybm, 1, True) Then
  684.                 Exit Sub
  685.             End If
  686.             Xs_P_DepExecute.HelpContextID = 1404005
  687.             Xs_P_DepExecute.Show
  688.             Xs_P_DepExecuteQuery.Show 1
  689.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  690.         Case "Xs_P_PersonExecute"             '销售员/货物销售计划执行情况"
  691.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  692.             If Not Security_Log("Xs_P_PersonExecute", Xtczybm, 1, True) Then
  693.                 Exit Sub
  694.             End If
  695.             Xs_P_PersonExecute.HelpContextID = 1404006
  696.             Xs_P_PersonExecute.Show
  697.             Xs_P_PersonExecuteQuery.Show 1
  698.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  699.         Case "Xs_P_WareExecute"               '货物销售计划执行情况"
  700.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  701.             If Not Security_Log("Xs_P_WareExecute", Xtczybm, 1, True) Then
  702.                 Exit Sub
  703.             End If
  704.             Xs_P_WareExecute.HelpContextID = 1404007
  705.             Xs_P_WareExecute.Show
  706.             Xs_P_WareExecuteQuery.Show 1
  707.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  708.         Case "Xs_P_CustplanExecute"           '客户销售计划执行情况"
  709.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  710.             If Not Security_Log("Xs_P_CustplanExecute", Xtczybm, 1, True) Then
  711.                 Exit Sub
  712.             End If
  713.             Xs_P_CusExecute.HelpContextID = 1404008
  714.             Xs_P_CusExecute.Show
  715.             Xs_P_CusExecuteQuery.Show 1
  716.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  717.         
  718.         'O 订单
  719.         Case "Xs_O_OrderBill"                 '订单编制"
  720.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  721.             If Not Security_Log("Xs_O_OrderBillEdit", Xtczybm, 1, True) Then
  722.                 Exit Sub
  723.             End If
  724.             Xs_O_OrderBill.HelpContextID = 1407001
  725.             Xs_O_OrderBill.Show 1
  726.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  727.         Case "Xs_O_OrderList"                 '订单列表"
  728.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  729.             If Not Security_Log("Xs_O_OrderList", Xtczybm, 1, True) Then
  730.                 Exit Sub
  731.             End If
  732.             Xs_O_OrderList.HelpContextID = 1407002
  733.             Xs_O_OrderList.Show
  734.             Xs_O_OrderQuery.Show 1
  735.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  736.         Case "Xs_O_OrderExec"                 '订单执行情况"
  737.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  738.             If Not Security_Log("Xs_O_OrderExec", Xtczybm, 1, True) Then
  739.                 Exit Sub
  740.             End If
  741.             Xs_O_OrderExec.HelpContextID = 1407003
  742.             Xs_O_OrderExec.Show
  743.             Xs_O_OrderExecQuery.Show 1
  744.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  745.         'C 发货单
  746.         Case "Xs_C_ConsignBill"               '发货单编制"
  747.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  748.             If Not Security_Log("Xs_C_ConsignBillEdit", Xtczybm, 1, True) Then
  749.                 Exit Sub
  750.             End If
  751.             Xs_C_ConsignBill.HelpContextID = 1408001
  752.             Xs_C_ConsignBill.Show 1
  753.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  754.         Case "Xs_C_ConsignList"               '发货单列表"
  755.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  756.             If Not Security_Log("Xs_C_ConsignList", Xtczybm, 1, True) Then
  757.                 Exit Sub
  758.             End If
  759.             Xs_C_ConsignList.HelpContextID = 1408002
  760.             Xs_C_ConsignList.Show
  761.             Xs_Ccx_ConsignList.Show 1
  762.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  763.         Case "Xs_C_ConsignDisp"               '发货单回执处理"
  764.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  765.             If Not Security_Log("Xs_C_ConsignDisp", Xtczybm, 1, True) Then
  766.                 Exit Sub
  767.             End If
  768.             Xs_C_ConsignDisp.HelpContextID = 1408003
  769.             Xs_C_ConsignDisp.Show
  770.             Xs_Ccx_ConsignDisp.Show 1
  771.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  772.         
  773.         'Q 退货单
  774.         Case "Xs_Q_QuitWare"                  '退货单编制"
  775.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  776.             If Not Security_Log("Xs_Q_QuitWareEdit", Xtczybm, 1, True) Then
  777.                 Exit Sub
  778.             End If
  779.             Xs_Q_QuitWare.HelpContextID = 1409001
  780.             Xs_Q_QuitWare.Show 1
  781.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  782.         Case "Xs_Q_QuitWareList"              '退货单列表"
  783.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  784.             If Not Security_Log("Xs_Q_QuitWareList", Xtczybm, 1, True) Then
  785.                 Exit Sub
  786.             End If
  787.             Xs_Q_QuitWareList.HelpContextID = 1409002
  788.             Xs_Q_QuitWareList.Show
  789.             Xs_Qcx_QuitWareList.Show 1
  790.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  791.         
  792.         'I 发票
  793.         Case "Xs_I_InvoiceBill"               '普通发票编制"
  794.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  795.             If Not Security_Log("Xs_I_InvoiceBillEdit", Xtczybm, 1, True) Then
  796.                 Exit Sub
  797.             End If
  798.             Xs_I_InvoiceBill.HelpContextID = 1410001
  799.             Xs_I_InvoiceBill.Show 1
  800.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  801.         Case "Xs_I_RedInvoice"                '普通红字发票编制"
  802.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  803.             If Not Security_Log("Xs_I_RedInvoiceEdit", Xtczybm, 1, True) Then
  804.                 Exit Sub
  805.             End If
  806.             Xs_I_RedInvoice.HelpContextID = 1410002
  807.             Xs_I_RedInvoice.Show 1
  808.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  809.         Case "Xs_I_InvoiceList"               '普通发票列表"
  810.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  811.             If Not Security_Log("Xs_I_InvoiceList", Xtczybm, 1, True) Then
  812.                 Exit Sub
  813.             End If
  814.             Xs_I_InvoiceList.HelpContextID = 1410003
  815.             Xs_I_InvoiceList.Show
  816.             Xs_Icx_InvoiceList.Show 1
  817.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  818.         Case "Xs_I_UseInvoice"                '专用发票编制"
  819.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  820.             If Not Security_Log("Xs_I_UseInvoiceEdit", Xtczybm, 1, True) Then
  821.                 Exit Sub
  822.             End If
  823.             Xs_I_UseInvoice.HelpContextID = 1410004
  824.             Xs_I_UseInvoice.Show 1
  825.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  826.         Case "Xs_I_UseRedInvoice"             '专用红字发票编制"
  827.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  828.             If Not Security_Log("Xs_I_UseRedInvoiceEdit", Xtczybm, 1, True) Then
  829.                 Exit Sub
  830.             End If
  831.             Xs_I_UseRedInvoice.HelpContextID = 1410005
  832.             Xs_I_UseRedInvoice.Show 1
  833.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  834.         Case "Xs_I_UseInvoicelist"            '专用发票列表"
  835.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  836.             If Not Security_Log("Xs_I_UseInvoicelist", Xtczybm, 1, True) Then
  837.                 Exit Sub
  838.             End If
  839.             Xs_I_UseInvoicelist.HelpContextID = 1410006
  840.             Xs_I_UseInvoicelist.Show
  841.             Xs_Icx_UseInvoicelist.Show 1
  842.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  843.         
  844.         'M 回款
  845.         Case "Xs_M_ReturnMoney"               '回款处理"
  846.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  847.             If Not Security_Log("Xs_M_ReturnMoneyEdit", Xtczybm, 1, True) Then
  848.                 Exit Sub
  849.             End If
  850.             Xs_M_ReturnMoney.HelpContextID = 1411001
  851.             Xs_M_ReturnMoney.Show 1
  852.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  853.         Case "Xs_M_ReturnMoneyList"           '回款列表"
  854.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  855.             If Not Security_Log("Xs_M_ReturnMoneyList", Xtczybm, 1, True) Then
  856.                 Exit Sub
  857.             End If
  858.             Xs_M_ReturnMoneyList.HelpContextID = 1411002
  859.             Xs_M_ReturnMoneyList.Show
  860.             Xs_Mcx_ReturnMoneyList.Show 1
  861.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  862.         Case "Xs_M_MoneyWareList"             '回款核销明细"
  863.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  864.             If Not Security_Log("Xs_M_MoneyWareList", Xtczybm, 1, True) Then
  865.                 Exit Sub
  866.             End If
  867.             Xs_M_MoneyWareList.HelpContextID = 1411003
  868.             Xs_M_MoneyWareList.Show
  869.             Xs_Mcx_MoneyWareList.Show 1
  870.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  871.         
  872.             
  873.         '成品库存查询
  874.         Case "Xs_StockQuery"                  '成品库存查询"
  875.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  876.             If Not Security_Log("Xs_StockQuery", Xtczybm, 1, True) Then
  877.                 Exit Sub
  878.             End If
  879.             KF_FrmNowQuan.HelpContextID = 1412001
  880.             KF_FrmNowQuan.Show
  881.             KF_FrmNowQuanCxtj.Show 1
  882.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  883.         
  884.         'C 结帐
  885.         Case "Xs_Z_MonthAccount"              '月末结帐"
  886.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  887.             If Not Security_Log("Xs_Z_MonthAccount", Xtczybm, 1, True) Then
  888.                 Exit Sub
  889.             End If
  890.             Xs_Z_MonthAccount.BlTemp = True
  891.             Xs_Z_MonthAccount.HelpContextID = 1415001
  892.             Xs_Z_MonthAccount.Show
  893.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  894.             
  895.         Case "Xs_Z_UnMonthAccount"            '取消结帐"
  896.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  897.             If Not Security_Log("Xs_Z_UnMonthAccount", Xtczybm, 1, True) Then
  898.                 Exit Sub
  899.             End If
  900.             Xs_Z_MonthAccount.BlTemp = False
  901.             Xs_Z_MonthAccount.HelpContextID = 1415002
  902.             Xs_Z_MonthAccount.Show
  903.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  904.         
  905.         'R 统计报表
  906.         Case "Xs_R_GeneralAccount"            '销售总帐"
  907.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  908.             If Not Security_Log("Xs_R_GeneralAccount", Xtczybm, 1, True) Then
  909.                 Exit Sub
  910.             End If
  911.             Xs_R_GeneralAccount.HelpContextID = 1413001
  912.             Xs_R_GeneralAccount.Show
  913.             Xs_R_GeneralAccountQuery.Show 1
  914.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  915.         Case "Xs_R_SaleAccount"               '销售明细帐"
  916.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  917.             If Not Security_Log("Xs_R_SaleAccount", Xtczybm, 1, True) Then
  918.                 Exit Sub
  919.             End If
  920.             Xs_R_SaleAccount.HelpContextID = 1413002
  921.             Xs_R_SaleAccount.Show
  922.             Xs_R_SaleAccountQuery.Show 1
  923.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  924.         Case "Xs_R_SaleThing"                 '销售执行情况报表
  925.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  926.             If Not Security_Log("Xs_R_SaleThing", Xtczybm, 1, True) Then
  927.                 Exit Sub
  928.             End If
  929.             Xs_R_SaleThing.HelpContextID = 1413003
  930.             Xs_R_SaleThing.Show
  931.             Xs_R_SaleThingQuery.Show 1
  932.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  933.         Case "Xs_R_ConsignThing"              '发货单执行情况"
  934.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  935.             If Not Security_Log("Xs_R_ConsignThing", Xtczybm, 1, True) Then
  936.                 Exit Sub
  937.             End If
  938.             Xs_R_ConsignThing.HelpContextID = 1413004
  939.             Xs_R_ConsignThing.Show
  940.             Xs_R_ConsignThingQuery.Show 1
  941.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  942.         Case "Xs_R_consignlist"               '发货明细表"
  943.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  944.             If Not Security_Log("Xs_R_consignlist", Xtczybm, 1, True) Then
  945.                 Exit Sub
  946.             End If
  947.             Xs_R_consignlist.HelpContextID = 1413005
  948.             Xs_R_consignlist.Show
  949.             Xs_R_ConsignListQuery.Show 1
  950.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  951.         Case "Xs_R_SaleList"                  '销售明细表"
  952.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  953.             If Not Security_Log("Xs_R_SaleList", Xtczybm, 1, True) Then
  954.                 Exit Sub
  955.             End If
  956.             Xs_R_SaleList.HelpContextID = 1413006
  957.             Xs_R_SaleList.Show
  958.             Xs_R_SaleListQuery.Show 1
  959.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  960.         Case "Xs_R_returnlist"                '回款明细表"
  961.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  962.             If Not Security_Log("Xs_R_returnlist", Xtczybm, 1, True) Then
  963.                 Exit Sub
  964.             End If
  965.             Xs_R_returnlist.HelpContextID = 1413007
  966.             Xs_R_returnlist.Show
  967.             Xs_R_ReturnListQuery.Show 1
  968.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  969.         
  970.         'A 分析
  971.         Case "Xs_A_FlowAnalysis"              '货物流向分析"
  972.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  973.             If Not Security_Log("Xs_A_FlowAnalysis", Xtczybm, 1, True) Then
  974.                 Exit Sub
  975.             End If
  976.             Xs_A_FlowAnalysis.HelpContextID = 1414001
  977.             Xs_A_FlowAnalysis.Show
  978.             Xs_A_FlowAnalysisQuery.Show 1
  979.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  980.         Case "Xs_A_FrameAnalysis"                '销售结构分析"
  981.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  982.             If Not Security_Log("Xs_A_FrameAnalysis", Xtczybm, 1, True) Then
  983.                 Exit Sub
  984.             End If
  985.             Xs_A_FrameAnalysis.HelpContextID = 1414002
  986.             Xs_A_FrameAnalysis.Show
  987.             Xs_A_FrameAnalysisQuery.Show 1
  988.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  989.         Case "Xs_A_MarketAnalysis"              '市场分析"
  990.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  991.             If Not Security_Log("Xs_A_MarketAnalysis", Xtczybm, 1, True) Then
  992.                 Exit Sub
  993.             End If
  994.             Xs_A_MarketAnalysis.HelpContextID = 1414003
  995.             Xs_A_MarketAnalysis.Show
  996.             Xs_A_MarketAnalysisQuery.Show 1
  997.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  998.         Case "Xs_A_WareAnalysis"                '货龄分析"
  999.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1000.             If Not Security_Log("Xs_A_WareAnalysis", Xtczybm, 1, True) Then
  1001.                 Exit Sub
  1002.             End If
  1003.             Xs_A_WareAnalysis.HelpContextID = 1414004
  1004.             Xs_A_WareAnalysis.Show
  1005.             Xs_A_WareAnalysisQuery.Show 1
  1006.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  1007.         Case "Xs_A_RiseAnalysis"               '销售增长分析"
  1008.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1009.             If Not Security_Log("Xs_A_RiseAnalysis", Xtczybm, 1, True) Then
  1010.                 Exit Sub
  1011.             End If
  1012.             Xs_A_RiseAnalysis.HelpContextID = 1414005
  1013.             Xs_A_RiseAnalysis.Show
  1014.             Xs_A_RiseAnalysisQuery.Show 1
  1015.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  1016.         
  1017.         'D 数据
  1018.         Case "Xs_PreDataInput"                '期初数据"
  1019.             '判断用户是否有此功能执行权限,如有则写上机日志(进入)
  1020.             If Not Security_Log("Xs_PreDataInput", Xtczybm, 1, True) Then
  1021.                 Exit Sub
  1022.             End If
  1023.             Xtcdcs = "5"
  1024.             Set RecTemp = Cw_DataEnvi.DataConnect.Execute("select consignbillmainid from Xs_ConsignBillMain Where AccountOpt<>''")
  1025.             If RecTemp.RecordCount > 0 Then
  1026.                 Tsxx = "期初已结帐,不能再录入期初数据!"
  1027.                 Call Xtxxts(Tsxx, 0, 4)
  1028.                 Exit Sub
  1029.             End If
  1030.             Xs_C_ConsignBill.HelpContextID = 1403001
  1031.             Xs_C_ConsignBill.Show 1
  1032.             Security_Log gnsy, Xtczybm, 2, False  '用户退出时写上机日志
  1033.         Case "Xs_DataOut"                     '数据导出"
  1034.         '工具
  1035.         Case "c_gnbmjsq"                        '计算器
  1036.             Shell App.Path & "calc.exe", vbNormalNoFocus
  1037.         Case "c_gnbmkmrl"                       '会计日历
  1038.             XT_kjrlFrm.HelpContextID = 1416001
  1039.             XT_kjrlFrm.Show 1
  1040.         '帮助
  1041.         Case "c_xtbz"                           '系统帮助
  1042.             Call F1bz
  1043.         Case "c_gy"                             '关于
  1044.             XT_frmAbout.Show 1
  1045.     End Select
  1046.    
  1047.     '用户退出时写上机日志
  1048.    Security_Log gnsy, Xtczybm, 2, False
  1049.    
  1050.     Exit Sub
  1051. Cwcl:
  1052.     Tsxx = "此项系统功能有待完善!"
  1053.     Call Xtxxts(Tsxx, 0, 4)
  1054.     Exit Sub
  1055. End Sub
  1056. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)        '用户关闭窗体
  1057.   
  1058.     If Unload_TF = False Then
  1059.         Cancel = 1
  1060.         Me.WindowState = 1
  1061.     End If
  1062. End Sub
  1063. Private Sub Form_Load()
  1064.     
  1065.     '设置窗体图标
  1066.     Me.Icon = XT_Main.Icon
  1067.     
  1068.     '设置窗体位置大小,并调入系统功能树
  1069.     Me.Left = 0
  1070.     Me.Top = 0
  1071.     Me.Width = XT_Main.Width - 60
  1072.     Me.Height = XT_Main.Height - 760 - 690
  1073.     Call Cshgns
  1074.     
  1075.     '启动调入数据等待提示
  1076.     Load Xt_Wait
  1077.     
  1078. End Sub
  1079. Private Sub Form_Unload(Cancel As Integer)
  1080.     
  1081.     On Error Resume Next
  1082.     
  1083.     Dim i As Integer
  1084.     For i = Forms.count - 1 To 1 Step -1
  1085.         Unload Forms(i)
  1086.     Next
  1087.     If Me.WindowState <> vbMinimized Then
  1088.         SaveSetting App.Title, "Settings", "MainLeft", Me.Left
  1089.         SaveSetting App.Title, "Settings", "MainTop", Me.Top
  1090.         SaveSetting App.Title, "Settings", "MainWidth", Me.Width
  1091.         SaveSetting App.Title, "Settings", "MainHeight", Me.Height
  1092.     End If
  1093.     SaveSetting App.Title, "Settings", "ViewMode", lvListView.View
  1094. End Sub
  1095. Private Sub Form_Resize()
  1096.     
  1097.     On Error Resume Next
  1098.     If Me.Width < 3000 Then Me.Width = 3000
  1099.     SizeControls imgSplitter.Left
  1100. End Sub
  1101. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1102.     
  1103.     With imgSplitter
  1104.         picSplitter.Move .Left, .Top, .Width  2, .Height - 20
  1105.     End With
  1106.     picSplitter.Visible = True
  1107.     mbMoving = True
  1108. End Sub
  1109. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1110.     
  1111.     Dim sglPos As Single
  1112.     If mbMoving Then
  1113.         sglPos = X + imgSplitter.Left
  1114.         If sglPos < sglSplitLimit Then
  1115.             picSplitter.Left = sglSplitLimit
  1116.         ElseIf sglPos > Me.Width - sglSplitLimit Then
  1117.             picSplitter.Left = Me.Width - sglSplitLimit
  1118.         Else
  1119.             picSplitter.Left = sglPos
  1120.         End If
  1121.     End If
  1122. End Sub
  1123. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  1124.     
  1125.     SizeControls picSplitter.Left
  1126.     picSplitter.Visible = False
  1127.     mbMoving = False
  1128.     lvListView.Refresh
  1129. End Sub
  1130. Private Sub TreeView1_DragDrop(Source As Control, X As Single, Y As Single)
  1131.     
  1132.     If Source = imgSplitter Then
  1133.         SizeControls X
  1134.     End If
  1135. End Sub
  1136. Sub SizeControls(X As Single)
  1137.     
  1138.     On Error Resume Next
  1139.     '设置 Width 属性
  1140.     If X < 3500 Then X = 3500
  1141.     If X > (Me.Width - 1500) Then X = Me.Width - 1500
  1142.     tvTreeView.Width = X
  1143.     imgSplitter.Left = X
  1144.     lvListView.Left = X + 40
  1145.     lvListView.Width = Me.Width - (tvTreeView.Width + 140)
  1146.     lblTitle(0).Width = tvTreeView.Width
  1147.     lblTitle(1).Left = lvListView.Left + 20
  1148.     lblTitle(1).Width = lvListView.Width - 40
  1149.     '设置 Top 属性
  1150.     tvTreeView.Top = tbToolBar.Height + picTitles.Height
  1151.     lvListView.Top = tvTreeView.Top
  1152.     '设置 height 属性
  1153.     tvTreeView.Height = Me.ScaleHeight - (picTitles.Top + picTitles.Height)
  1154.     
  1155.     lvListView.Height = tvTreeView.Height
  1156.     imgSplitter.Top = tvTreeView.Top
  1157.     imgSplitter.Height = tvTreeView.Height
  1158. End Sub
  1159. Private Sub tbToolBar_ButtonClick(ByVal Button As MSComctlLib.Button)
  1160.     
  1161.     On Error Resume Next
  1162.     
  1163.     Select Case Button.Key
  1164.         Case "返回"
  1165.             tvTreeView.SetFocus
  1166.               SendKeys "{up}", True
  1167.         Case "向前"
  1168.              tvTreeView.SetFocus
  1169.               SendKeys "{DOWN}", True
  1170.         Case "大图标"
  1171.             lvListView.View = lvwIcon
  1172.         Case "小图标"
  1173.             lvListView.View = lvwSmallIcon
  1174.         Case "列表"
  1175.             lvListView.View = lvwList
  1176.         Case "详细资料"
  1177.             lvListView.View = lvwReport
  1178.     End Select
  1179. End Sub