#include <Constants.au3>
#include <GDIPlusConstants.au3>
#include <StructureConstants.au3>
#include <ListBoxConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <GUIListView.au3>
#include <Access.au3>
#include <Excel.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <TabConstants.au3>
#include <GuiIPAddress.au3>
#include <EditConstants.au3>
#include <TreeViewConstants.au3>
#include <TabConstants.au3>
#include <GuiTreeView.au3>
#include <GuiImageList.au3>
;防止程序被重复运行
If WinExists("Outsourcing Tools") Then Exit
AutoItWinSetTitle("Outsourcing Tools")
#CS
全局参数设置
#CE
;版权信息
Global $Program_name = "外包人员管理工具(单机版)"
Global $Program_desc = "外包人员管理工具(单机版)。"
Global $Program_ver = "版本:1.0"
Global $Program_copyright = "版权所有:查明胜 Mason@zhenhao.me"
Global $dirData = @ScriptDir & "\data"
Global $adSource = $dirData & "\Outsourcing.MDB"
Global $psTable = 'personal';人员信息
Global $coTable = 'company';公司信息
Global $usTable = 'user';用户
Global $paTable = 'parameter';参数
Global $T = '*'
Global $ID = ''
Global $Key_Word = " WHERE 1=1"
If Not FileExists($dirData) Then DirCreate($dirData)
#region ### START Koda GUI section ### Form=c:\users\mason-home\desktop\外包人员管理软件单机版\公司管理.kxf
$Main = GUICreate($Program_name, 785, 563, 499, 142)
$MenuItem1 = GUICtrlCreateMenu("设置(&O)")
$MenuItem3 = GUICtrlCreateMenuItem("用户管理", $MenuItem1)
$MenuItem4 = GUICtrlCreateMenuItem("参数设置", $MenuItem1)
$MenuItem2 = GUICtrlCreateMenu("帮助(&H)")
$MenuItem5 = GUICtrlCreateMenuItem("关于(&A)", $MenuItem2)
$MenuItem6 = GUICtrlCreateMenuItem("退出(&Q)", $MenuItem2)
$StatusBar = _GUICtrlStatusBar_Create($Main)
Dim $StatusBar_PartsWidth[2] = [400, -1]
_GUICtrlStatusBar_SetParts($StatusBar, $StatusBar_PartsWidth)
_GUICtrlStatusBar_SetText($StatusBar, "", 0)
_GUICtrlStatusBar_SetText($StatusBar, "", 1)
$Button1 = GUICtrlCreateButton("Button1", 56, 8, 70, 70)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
;公司信息维护窗口
#region ### START Koda GUI section ### Form=C:\Users\Mason-Home\Desktop\外包人员管理软件单机版\Company.kxf
$Company = GUICreate("公司信息维护", 785, 563, 418, 179)
$TreeView_co = GUICtrlCreateTreeView(10, 18, 160, 524, BitOR($GUI_SS_DEFAULT_TREEVIEW, $WS_BORDER))
;$TreeView_co_0 = GUICtrlCreateTreeViewItem("全部", $TreeView_co)
;$TreeView_co_1 = GUICtrlCreateTreeViewItem("AA公司", $TreeView_co_0)
$Group_co = GUICtrlCreateGroup("公司基本信息", 188, 18, 569, 436)
$Input_co_1 = GUICtrlCreateInput("", 256, 48, 121, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button_addco = GUICtrlCreateButton("新增", 232, 488, 120, 40)
$Button_savco = GUICtrlCreateButton("保存", 399, 488, 120, 40)
$Button_delco = GUICtrlCreateButton("删除", 567, 488, 120, 40)
;GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
While 1
$nMsg = GUIGetMsg(1)
Switch $nMsg[0]
Case $GUI_EVENT_CLOSE
Switch $nMsg[1]
Case $Main
Exit
Case $Company
GUISetState(@SW_HIDE, $Company)
EndSwitch
Case $Button1
GUISetState(@SW_SHOW, $Company)
_getCompanyTree()
EndSwitch
WEnd
Func _getCompanyTree()
_GUICtrlTreeView_DeleteAll($TreeView_co)
_GUICtrlTreeView_BeginUpdate($TreeView_co)
$hItem = _GUICtrlTreeView_Add($TreeView_co, 0, "全部")
_GUICtrlTreeView_AddChild($TreeView_co, $hItem, "AAA")
_GUICtrlTreeView_AddChild($TreeView_co, $hItem, "BBB")
_GUICtrlTreeView_Expand($TreeView_co)
_GUICtrlTreeView_EndUpdate($TreeView_co)
EndFunc ;==>_getCompanyTree
Func WM_NOTIFY($hWndGUI, $MsgID, $WParam, $LParam)
Local $tagNMHDR, $Event, $hWndFrom, $IDFrom
Local $tagNMHDR = DllStructCreate("int;int;int", $LParam)
If @error Then Return $GUI_RUNDEFMSG
$IDFrom = DllStructGetData($tagNMHDR, 2)
$Event = DllStructGetData($tagNMHDR, 3)
$tagNMHDR = 0
Switch $IDFrom
Case $TreeView_co
Switch $Event; 选择产生的事件
Case $TVN_SELCHANGEDW
ConsoleWrite($TreeView_co)
;If GUICtrlRead($TreeView_co) > 0 Then
ConsoleWrite(_GUICtrlTreeView_GetText($TreeView_co, GUICtrlRead($TreeView_co)))
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY