Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
88
Server/ToolProject/AuthDBManager/AuthDBManager.cpp
Normal file
88
Server/ToolProject/AuthDBManager/AuthDBManager.cpp
Normal file
@@ -0,0 +1,88 @@
|
||||
// AuthDBManager.cpp : Defines the class behaviors for the application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "AuthDBManager.h"
|
||||
#include "AuthDBManagerDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAuthDBManagerApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAuthDBManagerApp, CWinApp)
|
||||
//{{AFX_MSG_MAP(CAuthDBManagerApp)
|
||||
// NOTE - the ClassWizard will add and remove mapping macros here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code!
|
||||
//}}AFX_MSG
|
||||
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAuthDBManagerApp construction
|
||||
|
||||
CAuthDBManagerApp::CAuthDBManagerApp()
|
||||
{
|
||||
// TODO: add construction code here,
|
||||
// Place all significant initialization in InitInstance
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The one and only CAuthDBManagerApp object
|
||||
|
||||
CAuthDBManagerApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAuthDBManagerApp initialization
|
||||
|
||||
BOOL CAuthDBManagerApp::InitInstance()
|
||||
{
|
||||
// ¾ð¾î DLL
|
||||
GET_PLUGIN_INFO hGet_PlugIn_Info;
|
||||
|
||||
if((m_Language = LoadLibrary("language.dll")) != NULL)
|
||||
{
|
||||
AfxSetResourceHandle(m_Language);
|
||||
|
||||
hGet_PlugIn_Info = (GET_PLUGIN_INFO)GetProcAddress(m_Language, "Get_PlugIn_Info");
|
||||
if(hGet_PlugIn_Info != NULL)
|
||||
{
|
||||
m_PlugInInfo = hGet_PlugIn_Info();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Language = m_hInstance;
|
||||
|
||||
ZeroMemory(&m_PlugInInfo, sizeof(PLUGININFO));
|
||||
}
|
||||
|
||||
AfxEnableControlContainer();
|
||||
|
||||
// Standard initialization
|
||||
// If you are not using these features and wish to reduce the size
|
||||
// of your final executable, you should remove from the following
|
||||
// the specific initialization routines you do not need.
|
||||
|
||||
CAuthDBManagerDlg dlg;
|
||||
m_pMainWnd = &dlg;
|
||||
int nResponse = dlg.DoModal();
|
||||
if (nResponse == IDOK)
|
||||
{
|
||||
// TODO: Place code here to handle when the dialog is
|
||||
// dismissed with OK
|
||||
}
|
||||
else if (nResponse == IDCANCEL)
|
||||
{
|
||||
// TODO: Place code here to handle when the dialog is
|
||||
// dismissed with Cancel
|
||||
}
|
||||
|
||||
// Since the dialog has been closed, return FALSE so that we exit the
|
||||
// application, rather than start the application's message pump.
|
||||
return FALSE;
|
||||
}
|
||||
56
Server/ToolProject/AuthDBManager/AuthDBManager.h
Normal file
56
Server/ToolProject/AuthDBManager/AuthDBManager.h
Normal file
@@ -0,0 +1,56 @@
|
||||
// AuthDBManager.h : main header file for the AuthDBManager application
|
||||
//
|
||||
|
||||
#if !defined(AFX_AuthDBManager_H__EA33128C_6CFB_48FD_9E36_85366557E0D2__INCLUDED_)
|
||||
#define AFX_AuthDBManager_H__EA33128C_6CFB_48FD_9E36_85366557E0D2__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error include 'stdafx.h' before including this file for PCH
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
#include "plugin.h"
|
||||
|
||||
#include <RylServerLibrary/DB/DBComponent.h>
|
||||
#include "AuthDef.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAuthDBManagerApp:
|
||||
// See AuthDBManager.cpp for the implementation of this class
|
||||
//
|
||||
|
||||
class CAuthDBManagerApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CAuthDBManagerApp();
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CAuthDBManagerApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
PLUGININFO m_PlugInInfo;
|
||||
HINSTANCE m_Language;
|
||||
|
||||
//{{AFX_MSG(CAuthDBManagerApp)
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_AuthDBManager_H__EA33128C_6CFB_48FD_9E36_85366557E0D2__INCLUDED_)
|
||||
432
Server/ToolProject/AuthDBManager/AuthDBManager.rc
Normal file
432
Server/ToolProject/AuthDBManager/AuthDBManager.rc
Normal file
@@ -0,0 +1,432 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Korean resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
|
||||
#pragma code_page(949)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)\r\n"
|
||||
"#ifdef _WIN32\r\n"
|
||||
"LANGUAGE 18, 1\r\n"
|
||||
"#pragma code_page(949)\r\n"
|
||||
"#endif //_WIN32\r\n"
|
||||
"#include ""res\\AuthDBManager.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"#include ""l.kor\\afxres.rc"" // Standard components\r\n"
|
||||
"#endif\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOGEX 0, 0, 121, 166
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "프로그램 정보"
|
||||
FONT 10, "굴림"
|
||||
BEGIN
|
||||
ICON IDR_MAINFRAME,IDC_STATIC,13,22,20,20,0,WS_EX_STATICEDGE
|
||||
LTEXT "인증 DB 매니저 버전 1.0",IDC_STATIC,35,29,77,8,
|
||||
SS_NOPREFIX
|
||||
DEFPUSHBUTTON "확인",IDOK,35,132,50,14,BS_FLAT | WS_GROUP
|
||||
GROUPBOX "",IDC_STATIC,5,4,110,154
|
||||
CTEXT "플러그 인",IDC_STATIC,13,50,36,12,SS_NOPREFIX |
|
||||
SS_CENTERIMAGE | SS_SUNKEN
|
||||
LISTBOX ID_PLUGIN_LIST,13,63,94,30,LBS_SORT |
|
||||
LBS_NOINTEGRALHEIGHT | NOT WS_BORDER | WS_VSCROLL |
|
||||
WS_TABSTOP,WS_EX_STATICEDGE
|
||||
CTEXT "업데이트",IDC_STATIC,13,94,36,12,SS_NOPREFIX |
|
||||
SS_CENTERIMAGE | SS_SUNKEN
|
||||
CTEXT "",ID_LASTUPDATE,49,94,58,12,SS_NOPREFIX |
|
||||
SS_CENTERIMAGE | SS_SUNKEN
|
||||
CTEXT "제작자",IDC_STATIC,13,107,36,12,SS_NOPREFIX |
|
||||
SS_CENTERIMAGE | SS_SUNKEN
|
||||
CTEXT "",ID_CREATER,49,107,58,12,SS_NOPREFIX | SS_CENTERIMAGE |
|
||||
SS_SUNKEN
|
||||
END
|
||||
|
||||
IDD_AuthDBManager_DIALOG DIALOGEX 0, 0, 418, 398
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
EXSTYLE WS_EX_APPWINDOW
|
||||
CAPTION "인증 DB 매니저"
|
||||
MENU IDR_MENU
|
||||
FONT 10, "굴림"
|
||||
BEGIN
|
||||
CONTROL "List1",ID_USER_LIST,"SysListView32",LVS_REPORT |
|
||||
LVS_EDITLABELS | WS_TABSTOP,7,21,403,218,
|
||||
WS_EX_STATICEDGE
|
||||
LTEXT "",ID_ERROR_LOG,7,350,243,35,0,WS_EX_STATICEDGE
|
||||
GROUPBOX "",IDC_STATIC,0,0,418,397,BS_FLAT
|
||||
CTEXT "",ID_SELECTED_ROW,54,6,28,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "",ID_SELECTED_COUNT,82,6,29,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "아이디",IDC_STATIC,13,258,30,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
GROUPBOX "유저 추가",IDC_STATIC,7,245,243,97,BS_FLAT
|
||||
CTEXT "패스",IDC_STATIC,13,270,30,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "이름",IDC_STATIC,13,283,30,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT ID_ID,43,258,50,12,ES_AUTOHSCROLL | NOT WS_BORDER,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT ID_PASSWORD,43,270,50,12,ES_PASSWORD | ES_AUTOHSCROLL |
|
||||
NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
EDITTEXT ID_NAME,43,283,50,12,ES_AUTOHSCROLL | NOT WS_BORDER,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "성",IDC_STATIC,13,296,30,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
COMBOBOX ID_SEX,43,296,50,54,CBS_DROPDOWN | WS_VSCROLL |
|
||||
WS_TABSTOP
|
||||
CTEXT "생일",IDC_STATIC,13,309,30,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT ID_BIRTH,43,309,50,12,ES_AUTOHSCROLL | NOT WS_BORDER,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "주민등록",IDC_STATIC,13,322,30,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT ID_IDNUMBER,43,322,50,12,ES_AUTOHSCROLL | NOT WS_BORDER,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "우편번호",IDC_STATIC,103,270,30,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT ID_ZIPCODE,133,270,50,12,ES_AUTOHSCROLL | NOT WS_BORDER,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "주소",IDC_STATIC,103,283,30,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT ID_ADDRESS,133,283,109,12,ES_AUTOHSCROLL | ES_OEMCONVERT |
|
||||
ES_WANTRETURN | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
CTEXT "핸드폰",IDC_STATIC,103,296,30,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT ID_MOBILE,133,296,50,12,ES_AUTOHSCROLL | NOT WS_BORDER,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "전화번호",IDC_STATIC,103,309,30,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT ID_PHONE,133,309,50,12,ES_AUTOHSCROLL | NOT WS_BORDER,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "직업",IDC_STATIC,103,258,30,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT ID_JOB,133,258,50,12,ES_AUTOHSCROLL | NOT WS_BORDER,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "메일",IDC_STATIC,103,322,30,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT ID_EMAIL,133,322,109,12,ES_AUTOHSCROLL | NOT WS_BORDER,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "선택 줄 / 개수",IDC_STATIC,7,6,47,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "ID / 아이디",IDC_STATIC,196,6,41,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "",ID_SELECTED_UID,237,6,29,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "",ID_SELECTED_ID,266,6,68,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "총 수",IDC_STATIC,345,6,27,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "",ID_TOTAL_ROW,372,6,38,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "*",ID_CONNECTION_LED,161,7,10,9,SS_CENTERIMAGE
|
||||
CTEXT "*",ID_QEURY_LED,173,7,10,9,SS_CENTERIMAGE
|
||||
CTEXT "연결 / 쿼리",IDC_STATIC,120,6,37,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
CONTROL 133,IDC_STATIC,"Static",SS_BITMAP,272,269,127,86
|
||||
DEFPUSHBUTTON "@.@",IDC_DEFAULT,327,319,26,14,BS_FLAT | NOT WS_VISIBLE
|
||||
END
|
||||
|
||||
IDD_CONNECT DIALOGEX 0, 0, 143, 169
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "DB 연결"
|
||||
FONT 10, "굴림체"
|
||||
BEGIN
|
||||
COMBOBOX ID_SELECT_TYPE,74,7,58,70,CBS_DROPDOWN | CBS_SORT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
CTEXT "접속 방법 선택",IDC_STATIC,9,7,65,13,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
GROUPBOX "ODBC",IDC_STATIC,8,29,124,32,BS_FLAT
|
||||
CTEXT "데이터 소스",IDC_STATIC,15,40,51,13,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT ID_DATASOURCE_NAME,66,40,58,13,ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
GROUPBOX "OLE DB",IDC_STATIC,8,66,124,73,BS_FLAT
|
||||
CTEXT "서버",IDC_STATIC,15,78,51,13,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT ID_SERVER_NAME,66,78,58,13,ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
CTEXT "데이터베이스",IDC_STATIC,15,91,51,13,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT ID_DATABASE_NAME,66,91,58,13,ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
CTEXT "패스워드",IDC_STATIC,15,117,51,13,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT ID_AUTHUSER_NAME,66,104,58,13,ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
CTEXT "계정",IDC_STATIC,15,104,51,13,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
EDITTEXT ID_AUTHUSER_PASS,66,117,58,13,ES_PASSWORD |
|
||||
ES_AUTOHSCROLL | NOT WS_BORDER,WS_EX_STATICEDGE
|
||||
PUSHBUTTON "확인",IDOK,45,145,50,14,BS_FLAT
|
||||
END
|
||||
|
||||
IDD_SEARCH DIALOGEX 0, 0, 138, 146
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "검색 정렬"
|
||||
FONT 10, "굴림체", 0, 0, 0x1
|
||||
BEGIN
|
||||
PUSHBUTTON "확인",IDOK,37,115,50,14,BS_FLAT
|
||||
GROUPBOX "검색",IDC_STATIC,6,7,123,46,BS_FLAT
|
||||
EDITTEXT ID_SEARCH_TEXT,54,32,66,12,ES_AUTOHSCROLL | NOT
|
||||
WS_BORDER,WS_EX_STATICEDGE
|
||||
CTEXT "검색 대상",IDC_STATIC,15,32,39,12,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
COMBOBOX ID_SELECT_SEARCH,54,19,67,95,CBS_DROPDOWN | CBS_SORT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
CTEXT "검색 선택",IDC_STATIC,15,19,39,13,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
GROUPBOX "정렬",IDC_STATIC,6,58,123,46,BS_FLAT
|
||||
COMBOBOX ID_SELECT_ALIGN,54,69,67,95,CBS_DROPDOWN | CBS_SORT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
CTEXT "정렬 선택",IDC_STATIC,15,69,39,13,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
CTEXT "정렬 방식",IDC_STATIC,15,82,39,13,SS_CENTERIMAGE,
|
||||
WS_EX_STATICEDGE
|
||||
COMBOBOX ID_SELECT_ALIGNTYPE,54,82,67,95,CBS_DROPDOWN | CBS_SORT |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "041204B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "\0"
|
||||
VALUE "FileDescription", "AuthDBManager MFC 응용 프로그램\0"
|
||||
VALUE "FileVersion", "1, 0, 0, 1\0"
|
||||
VALUE "InternalName", "AuthDBManager\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2002\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "AuthDBManager.EXE\0"
|
||||
VALUE "ProductName", "AuthDBManager 응용 프로그램\0"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x412, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_ABOUTBOX, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 114
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 159
|
||||
END
|
||||
|
||||
IDD_AuthDBManager_DIALOG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 411
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 391
|
||||
END
|
||||
|
||||
IDD_CONNECT, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 136
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 162
|
||||
END
|
||||
|
||||
IDD_SEARCH, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 131
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 139
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDR_MAINFRAME ICON DISCARDABLE "icon.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDR_MENU MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "연결"
|
||||
BEGIN
|
||||
MENUITEM "연결", ID_CONNECT
|
||||
MENUITEM "끊기", ID_DISCONNECT
|
||||
END
|
||||
POPUP "관리"
|
||||
BEGIN
|
||||
MENUITEM "유저 추가", ID_ADD_USER
|
||||
MENUITEM "유저 삭제", ID_DELETE_USER
|
||||
END
|
||||
POPUP "툴"
|
||||
BEGIN
|
||||
MENUITEM "유저 리스트 업데이트", ID_REFESH
|
||||
MENUITEM "검색 정렬", ID_SEARCH
|
||||
END
|
||||
POPUP "정보"
|
||||
BEGIN
|
||||
MENUITEM "정보", ID_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
IDB_LEDS BITMAP DISCARDABLE "Led\\leds.bmp"
|
||||
IDB_LOGO BITMAP DISCARDABLE "res\\Logo.bmp"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_F1 "ID"
|
||||
IDS_F2 "아이디"
|
||||
IDS_F3 "패스"
|
||||
IDS_F4 "이름"
|
||||
IDS_F5 "성"
|
||||
IDS_F6 "생일"
|
||||
IDS_F7 "주민번호"
|
||||
IDS_F8 "우편번호"
|
||||
IDS_F9 "주소"
|
||||
IDS_F10 "휴대폰"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_F11 "전화"
|
||||
IDS_F12 "메일"
|
||||
IDS_F13 "직업"
|
||||
IDS_F14 "가입날짜"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_S1 "남"
|
||||
IDS_S2 "여"
|
||||
IDS_A1 "오름차순"
|
||||
IDS_A2 "내림차순"
|
||||
END
|
||||
|
||||
#endif // Korean resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 18, 1
|
||||
#pragma code_page(949)
|
||||
#endif //_WIN32
|
||||
#include "res\AuthDBManager.rc2" // non-Microsoft Visual C++ edited resources
|
||||
#include "l.kor\afxres.rc" // Standard components
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
254
Server/ToolProject/AuthDBManager/AuthDBManager.vcproj
Normal file
254
Server/ToolProject/AuthDBManager/AuthDBManager.vcproj
Normal file
@@ -0,0 +1,254 @@
|
||||
<?xml version="1.0" encoding="ks_c_5601-1987"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="AuthDBManager"
|
||||
ProjectGUID="{8832403E-C3A9-419C-832D-0BF8968EA53B}"
|
||||
Keyword="MFCProj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="../DBToolExecutable/$(ConfigurationName)"
|
||||
IntermediateDirectory="../Intermediate/$(ProjectName)/$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="1"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../;./;../../RylServerProject;../../RylServerProject/RylServerLibrary;../../RylServerProject/BaseLibrary"
|
||||
PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib oledb.lib msdasc.lib"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="2"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Debug/AuthDBManager.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1042"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="../DBToolExecutable/$(ConfigurationName)"
|
||||
IntermediateDirectory="../Intermediate/$(ProjectName)/$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="1"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../;./;../../RylServerProject;../../RylServerProject/RylServerLibrary;../../RylServerProject/BaseLibrary"
|
||||
PreprocessorDefinitions="WIN32,NDEBUG,_WINDOWS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/MACHINE:I386"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib oledb.lib msdasc.lib"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
SubSystem="2"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Release/AuthDBManager.tlb"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1042"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath=".\AuthDBManager.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\AuthDBManager.rc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\AuthDBManagerDlg.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ConnectDlg.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\SearchDlg.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\StdAfx.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
PrecompiledHeaderThrough="stdafx.h"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
PrecompiledHeaderThrough="stdafx.h"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\UserList.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath=".\AuthDBManager.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\AuthDBManagerDlg.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="AuthDef.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ConnectDlg.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\plugin.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Resource.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\SearchDlg.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\StdAfx.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\UserList.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
|
||||
<File
|
||||
RelativePath=".\res\AuthDBManager.rc2">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\icon.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Led\leds.bmp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\res\Logo.bmp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Led"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath=".\Led\Led.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Led\Led.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="ListViewControl"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath=".\ListViewControl\InPlaceEdit.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ListViewControl\InPlaceEdit.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ListViewControl\InPlaceList.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ListViewControl\InPlaceList.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ListViewControl\ListViewControl.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ListViewControl\ListViewControl.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
<Global
|
||||
Name="RESOURCE_FILE"
|
||||
Value="AuthDBManager.rc"/>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
640
Server/ToolProject/AuthDBManager/AuthDBManagerDlg.cpp
Normal file
640
Server/ToolProject/AuthDBManager/AuthDBManagerDlg.cpp
Normal file
@@ -0,0 +1,640 @@
|
||||
// AuthDBManagerDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "AuthDBManager.h"
|
||||
#include "AuthDBManagerDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAboutDlg dialog used for App About
|
||||
|
||||
class CAboutDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
CAboutDlg();
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CAboutDlg)
|
||||
enum { IDD = IDD_ABOUTBOX };
|
||||
CListBox m_PlugList;
|
||||
CString m_LastUpdate;
|
||||
CString m_Creater;
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CAboutDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
//{{AFX_MSG(CAboutDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSelchangePluginList();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CAboutDlg)
|
||||
m_LastUpdate = _T("");
|
||||
m_Creater = _T("");
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CAboutDlg)
|
||||
DDX_Control(pDX, ID_PLUGIN_LIST, m_PlugList);
|
||||
DDX_Text(pDX, ID_LASTUPDATE, m_LastUpdate);
|
||||
DDX_Text(pDX, ID_CREATER, m_Creater);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BOOL CAboutDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// TODO: Add extra initialization here
|
||||
CAuthDBManagerApp* pAppWnd = (CAuthDBManagerApp*)AfxGetApp();
|
||||
CString PlugInfoS;
|
||||
|
||||
if(pAppWnd->m_PlugInInfo.PlugInfo)
|
||||
{
|
||||
PlugInfoS.Format("%s %s", pAppWnd->m_PlugInInfo.PlugInName, pAppWnd->m_PlugInInfo.PlugInVer);
|
||||
|
||||
m_PlugList.AddString(PlugInfoS);
|
||||
}
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
void CAboutDlg::OnSelchangePluginList()
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
CAuthDBManagerApp* pAppWnd = (CAuthDBManagerApp*)AfxGetApp();
|
||||
|
||||
int Sel;
|
||||
|
||||
Sel = m_PlugList.GetCurSel();
|
||||
if(Sel == 0)
|
||||
{
|
||||
m_Creater = pAppWnd->m_PlugInInfo.PlugInCreator.CreaterName;
|
||||
m_LastUpdate = pAppWnd->m_PlugInInfo.PlugInLastUpdate;
|
||||
|
||||
UpdateData(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CAboutDlg)
|
||||
ON_LBN_SELCHANGE(ID_PLUGIN_LIST, OnSelchangePluginList)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAuthDBManagerDlg dialog
|
||||
|
||||
CAuthDBManagerDlg::CAuthDBManagerDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CAuthDBManagerDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CAuthDBManagerDlg)
|
||||
m_ErrorLog = _T("");
|
||||
m_SelectedCount = _T("");
|
||||
m_SelectedRow = _T("");
|
||||
m_SelectedUID = _T("");
|
||||
m_SelectedID = _T("");
|
||||
m_TotalRow = _T("");
|
||||
m_Address = _T("");
|
||||
m_Birth = _T("");
|
||||
m_Email = _T("");
|
||||
m_ID = _T("");
|
||||
m_IDNumber = _T("");
|
||||
m_Job = _T("");
|
||||
m_Mobile = _T("");
|
||||
m_Name = _T("");
|
||||
m_Password = _T("");
|
||||
m_Phone = _T("");
|
||||
m_ZipCode = _T("");
|
||||
//}}AFX_DATA_INIT
|
||||
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
|
||||
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
|
||||
}
|
||||
|
||||
void CAuthDBManagerDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CAuthDBManagerDlg)
|
||||
DDX_Control(pDX, ID_SEX, m_Sex);
|
||||
DDX_Control(pDX, ID_CHAR_LIST, m_UserList);
|
||||
DDX_Control(pDX, ID_QEURY_LED, m_QueryLed);
|
||||
DDX_Control(pDX, ID_CONNECTION_LED, m_ConnectionLed);
|
||||
DDX_Text(pDX, ID_ERROR_LOG, m_ErrorLog);
|
||||
DDX_Text(pDX, ID_SELECTED_COUNT, m_SelectedCount);
|
||||
DDX_Text(pDX, ID_SELECTED_ROW, m_SelectedRow);
|
||||
DDX_Text(pDX, ID_SELECTED_UID, m_SelectedUID);
|
||||
DDX_Text(pDX, ID_SELECTED_ID, m_SelectedID);
|
||||
DDX_Text(pDX, ID_TOTAL_ROW, m_TotalRow);
|
||||
DDX_Text(pDX, ID_ADDRESS, m_Address);
|
||||
DDX_Text(pDX, ID_BIRTH, m_Birth);
|
||||
DDX_Text(pDX, ID_EMAIL, m_Email);
|
||||
DDX_Text(pDX, ID_ID, m_ID);
|
||||
DDX_Text(pDX, ID_IDNUMBER, m_IDNumber);
|
||||
DDX_Text(pDX, ID_JOB, m_Job);
|
||||
DDX_Text(pDX, ID_MOBILE, m_Mobile);
|
||||
DDX_Text(pDX, ID_NAME, m_Name);
|
||||
DDX_Text(pDX, ID_PASSWORD, m_Password);
|
||||
DDX_Text(pDX, ID_PHONE, m_Phone);
|
||||
DDX_Text(pDX, ID_ZIPCODE, m_ZipCode);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAuthDBManagerDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CAuthDBManagerDlg)
|
||||
ON_WM_SYSCOMMAND()
|
||||
ON_NOTIFY(LVN_ENDLABELEDIT, ID_USER_LIST, OnEndlabeleditUserList)
|
||||
ON_WM_PAINT()
|
||||
ON_WM_QUERYDRAGICON()
|
||||
ON_COMMAND(ID_ABOUT, OnAbout)
|
||||
ON_COMMAND(ID_CONNECT, OnConnect)
|
||||
ON_COMMAND(ID_DISCONNECT, OnDisconnect)
|
||||
ON_NOTIFY(NM_CLICK, ID_USER_LIST, OnClickUserList)
|
||||
ON_COMMAND(ID_ADD_USER, OnAddUser)
|
||||
ON_COMMAND(ID_DELETE_USER, OnDeleteUser)
|
||||
ON_COMMAND(ID_INIT_LOGINTIME, OnInitLogintime)
|
||||
ON_COMMAND(ID_REFESH, OnRefesh)
|
||||
ON_COMMAND(ID_SEARCH, OnSearch)
|
||||
ON_NOTIFY(LVN_KEYDOWN, ID_USER_LIST, OnKeydownUserList)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAuthDBManagerDlg message handlers
|
||||
|
||||
BOOL CAuthDBManagerDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
char SelectName[256];
|
||||
int Counter;
|
||||
|
||||
// Add "About..." menu item to system menu.
|
||||
|
||||
// IDM_ABOUTBOX must be in the system command range.
|
||||
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
|
||||
ASSERT(IDM_ABOUTBOX < 0xF000);
|
||||
|
||||
CMenu* pSysMenu = GetSystemMenu(FALSE);
|
||||
if (pSysMenu != NULL)
|
||||
{
|
||||
CString strAboutMenu;
|
||||
strAboutMenu.LoadString(IDS_ABOUTBOX);
|
||||
if (!strAboutMenu.IsEmpty())
|
||||
{
|
||||
pSysMenu->AppendMenu(MF_SEPARATOR);
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the icon for this dialog. The framework does this automatically
|
||||
// when the application's main window is not a dialog
|
||||
SetIcon(m_hIcon, TRUE); // Set big icon
|
||||
SetIcon(m_hIcon, FALSE); // Set small icon
|
||||
|
||||
// TODO: Add extra initialization here
|
||||
CAuthDBManagerApp* pAppWnd = (CAuthDBManagerApp*)AfxGetApp();
|
||||
m_UserList.SetColumn();
|
||||
|
||||
for(Counter = 0; Counter < 2; Counter++)
|
||||
{
|
||||
LoadString(pAppWnd->m_Language, IDS_S1 + Counter, SelectName, 256);
|
||||
m_Sex.InsertString(Counter, SelectName);
|
||||
}
|
||||
m_Sex.SetCurSel(0);
|
||||
|
||||
m_ConnectionLed.SetLed(CLed::LED_COLOR_GREEN, CLed::LED_OFF, CLed::LED_ROUND);
|
||||
m_QueryLed.SetLed(CLed::LED_COLOR_RED, CLed::LED_OFF, CLed::LED_ROUND);
|
||||
|
||||
m_Align = 0;
|
||||
m_AlignType = 0;
|
||||
m_SearchType = 0;
|
||||
ZeroMemory(m_Search, sizeof(char) * 256);
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
}
|
||||
|
||||
void CAuthDBManagerDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||
{
|
||||
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
|
||||
{
|
||||
CAboutDlg dlgAbout;
|
||||
dlgAbout.DoModal();
|
||||
}
|
||||
else
|
||||
{
|
||||
CDialog::OnSysCommand(nID, lParam);
|
||||
}
|
||||
}
|
||||
|
||||
// If you add a minimize button to your dialog, you will need the code below
|
||||
// to draw the icon. For MFC applications using the document/view model,
|
||||
// this is automatically done for you by the framework.
|
||||
|
||||
void CAuthDBManagerDlg::OnPaint()
|
||||
{
|
||||
if (IsIconic())
|
||||
{
|
||||
CPaintDC dc(this); // device context for painting
|
||||
|
||||
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
|
||||
|
||||
// Center icon in client rectangle
|
||||
int cxIcon = GetSystemMetrics(SM_CXICON);
|
||||
int cyIcon = GetSystemMetrics(SM_CYICON);
|
||||
CRect rect;
|
||||
GetClientRect(&rect);
|
||||
int x = (rect.Width() - cxIcon + 1) / 2;
|
||||
int y = (rect.Height() - cyIcon + 1) / 2;
|
||||
|
||||
// Draw the icon
|
||||
dc.DrawIcon(x, y, m_hIcon);
|
||||
}
|
||||
else
|
||||
{
|
||||
CDialog::OnPaint();
|
||||
}
|
||||
}
|
||||
|
||||
// The system calls this to obtain the cursor to display while the user drags
|
||||
// the minimized window.
|
||||
HCURSOR CAuthDBManagerDlg::OnQueryDragIcon()
|
||||
{
|
||||
return (HCURSOR) m_hIcon;
|
||||
}
|
||||
|
||||
void CAuthDBManagerDlg::OnAbout()
|
||||
{
|
||||
// TODO: Add your command handler code here
|
||||
CAboutDlg dlgAbout;
|
||||
dlgAbout.DoModal();
|
||||
}
|
||||
|
||||
void CAuthDBManagerDlg::OnConnect()
|
||||
{
|
||||
m_QueryLed.SetLed(CLed::LED_COLOR_RED, CLed::LED_ON, CLed::LED_ROUND);
|
||||
|
||||
if(!CDBSingleObject::GetInstance().Connect(CDBSingleObject::Class_AuthDB))
|
||||
{
|
||||
m_ErrorLog.Format("[연결] 접속에 실패 했습니다. %s", CDBSingleObject::GetInstance().GetErrorString());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ErrorLog.Format("[연결] 접속에 성공 했습니다.");
|
||||
}
|
||||
|
||||
m_QueryLed.SetLed(CLed::LED_COLOR_RED, CLed::LED_OFF, CLed::LED_ROUND);
|
||||
m_ConnectionLed.SetLed(CLed::LED_COLOR_GREEN, CLed::LED_ON, CLed::LED_ROUND);
|
||||
|
||||
UpdateUserTable();
|
||||
}
|
||||
|
||||
void CAuthDBManagerDlg::OnDisconnect()
|
||||
{
|
||||
// TODO: Add your command handler code here
|
||||
m_QueryLed.SetLed(CLed::LED_COLOR_RED, CLed::LED_ON, CLed::LED_ROUND);
|
||||
|
||||
if(CDBSingleObject::GetInstance().DisconnectDataSource())
|
||||
m_ConnectionLed.SetLed(CLed::LED_COLOR_GREEN, CLed::LED_OFF, CLed::LED_ROUND);
|
||||
|
||||
m_QueryLed.SetLed(CLed::LED_COLOR_RED, CLed::LED_OFF, CLed::LED_ROUND);
|
||||
}
|
||||
|
||||
bool CAuthDBManagerDlg::ConnectDB(int Type, CString DataSource, CString Server, CString DataBase, CString User, CString Pass)
|
||||
{
|
||||
m_QueryLed.SetLed(CLed::LED_COLOR_RED, CLed::LED_ON, CLed::LED_ROUND);
|
||||
|
||||
if(Type == 0)
|
||||
{
|
||||
if(!CDBSingleObject::GetInstance().ConnectSQLServer(DataSource.GetBuffer(0), NULL, NULL, NULL, CDBSingleObject::ConnType_ODBC))
|
||||
{
|
||||
m_ErrorLog = CDBSingleObject::GetInstance().GetErrorString();
|
||||
|
||||
UpdateData(FALSE);
|
||||
|
||||
m_QueryLed.SetLed(CLed::LED_COLOR_RED, CLed::LED_OFF, CLed::LED_ROUND);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if(Type == 1)
|
||||
{
|
||||
if(!CDBSingleObject::GetInstance().ConnectSQLServer(Server.GetBuffer(0), DataBase.GetBuffer(0), User.GetBuffer(0), Pass.GetBuffer(0), CDBSingleObject::ConnType_MSSQL))
|
||||
{
|
||||
m_ErrorLog = CDBSingleObject::GetInstance().GetErrorString();
|
||||
|
||||
UpdateData(FALSE);
|
||||
|
||||
m_QueryLed.SetLed(CLed::LED_COLOR_RED, CLed::LED_OFF, CLed::LED_ROUND);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if(Type == 2)
|
||||
{
|
||||
if(!CDBSingleObject::GetInstance().ConnectDataSourcePrompt(m_hWnd))
|
||||
{
|
||||
m_ErrorLog = CDBSingleObject::GetInstance().GetErrorString();
|
||||
|
||||
UpdateData(FALSE);
|
||||
|
||||
m_QueryLed.SetLed(CLed::LED_COLOR_RED, CLed::LED_OFF, CLed::LED_ROUND);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
m_QueryLed.SetLed(CLed::LED_COLOR_RED, CLed::LED_OFF, CLed::LED_ROUND);
|
||||
m_ConnectionLed.SetLed(CLed::LED_COLOR_GREEN, CLed::LED_ON, CLed::LED_ROUND);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const int MaxRow = 200;
|
||||
|
||||
bool CAuthDBManagerDlg::UpdateUserTable(void)
|
||||
{
|
||||
SELECT_AUTHUSER_TABLE LoginTable[MaxRow] = {0,};
|
||||
|
||||
int StartRow;
|
||||
int RowCounter, Rows;
|
||||
|
||||
char Query[256] = "";
|
||||
char Option[256] = "";
|
||||
|
||||
if(m_SearchType != 0)
|
||||
{
|
||||
if(m_SearchType == 1)
|
||||
{
|
||||
sprintf(Option, " where Account='%s'", m_Search);
|
||||
}
|
||||
else if(m_SearchType == 2)
|
||||
{
|
||||
sprintf(Option, " where Name='%s'", m_Search);
|
||||
}
|
||||
}
|
||||
|
||||
if(m_Align == 0)
|
||||
{
|
||||
strcat(Option, " order by UID");
|
||||
}
|
||||
else if(m_Align == 1)
|
||||
{
|
||||
strcat(Option, " order by Account");
|
||||
}
|
||||
else if(m_Align == 2)
|
||||
{
|
||||
strcat(Option, " order by Name");
|
||||
}
|
||||
|
||||
if(m_AlignType == 0)
|
||||
{
|
||||
strcat(Option, " asc");
|
||||
}
|
||||
else if(m_AlignType == 1)
|
||||
{
|
||||
strcat(Option, " desc");
|
||||
}
|
||||
|
||||
m_UserList.DeleteAllItems();
|
||||
|
||||
sprintf(Query, "select * from AuthUser %s", Option);
|
||||
for(StartRow = 0;; StartRow += MaxRow)
|
||||
{
|
||||
if(CDBSingleObject::GetInstance().Select(Query, (void**)&LoginTable, sizeof(SELECT_AUTHUSER_TABLE), StartRow, MaxRow, &Rows))
|
||||
{
|
||||
for(RowCounter = 0; RowCounter < Rows; RowCounter++)
|
||||
m_UserList.AddUserRow(&LoginTable[RowCounter]);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ErrorLog = CDBSingleObject::GetInstance().GetErrorString();
|
||||
|
||||
UpdateData(FALSE);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(Rows < MaxRow)
|
||||
break;
|
||||
}
|
||||
|
||||
m_TotalRow.Format("%d", StartRow + Rows);
|
||||
UpdateData(FALSE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CAuthDBManagerDlg::OnClickUserList(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
POSITION Pos;
|
||||
int Index;
|
||||
|
||||
unsigned long UserUID;
|
||||
char strUserUID[256];
|
||||
char strUserID[256];
|
||||
|
||||
Pos= m_UserList.GetFirstSelectedItemPosition();
|
||||
if(Pos != NULL)
|
||||
{
|
||||
while(Pos)
|
||||
{
|
||||
Index = m_UserList.GetNextSelectedItem(Pos);
|
||||
}
|
||||
|
||||
m_SelectedRow.Format("%d", Index);
|
||||
m_SelectedCount.Format("%d", m_UserList.GetSelectedCount());
|
||||
|
||||
// 캐릭터 아이디 정보 업데이트
|
||||
if(m_UserList.GetItemText(Index, 0, strUserUID, 256))
|
||||
{
|
||||
UserUID = atoi(strUserUID);
|
||||
|
||||
m_SelectedUID.Format("%d", UserUID);
|
||||
|
||||
m_UserList.GetItemText(Index, 1, strUserID, 256);
|
||||
m_SelectedID = strUserID;
|
||||
}
|
||||
|
||||
UpdateData(FALSE);
|
||||
}
|
||||
|
||||
*pResult = 0;
|
||||
}
|
||||
|
||||
void CAuthDBManagerDlg::OnEndlabeleditUserList(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR;
|
||||
|
||||
char Query[256] = "";
|
||||
|
||||
// TODO: Add your control notification handler code here
|
||||
UPDATE_AUTHUSER_TABLE ModifyLoginTable;
|
||||
LV_ITEM *plvItem = &pDispInfo->item;
|
||||
|
||||
ZeroMemory(&ModifyLoginTable, sizeof(UPDATE_AUTHUSER_TABLE));
|
||||
|
||||
if(plvItem->pszText != NULL)
|
||||
{
|
||||
m_UserList.SetItemText(plvItem->iItem, plvItem->iSubItem, plvItem->pszText);
|
||||
|
||||
m_UserList.GetUserRow(plvItem->iItem, &ModifyLoginTable);
|
||||
|
||||
sprintf(Query, "UpdateUser '%d', '%s', '%s', '%s', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s'",
|
||||
ModifyLoginTable.UID, ModifyLoginTable.AuthID, ModifyLoginTable.AuthPW, ModifyLoginTable.Name, ModifyLoginTable.Sex, ModifyLoginTable.Birth,
|
||||
ModifyLoginTable.ZipCode, ModifyLoginTable.Address, ModifyLoginTable.Mobile, ModifyLoginTable.Phone, ModifyLoginTable.Email, ModifyLoginTable.Job,
|
||||
ModifyLoginTable.IDNumber);
|
||||
|
||||
CDBSingleObject::GetInstance().ExecuteQuery(Query);;
|
||||
}
|
||||
|
||||
*pResult = 0;
|
||||
}
|
||||
|
||||
void CAuthDBManagerDlg::OnAddUser()
|
||||
{
|
||||
// TODO: Add your command handler code here
|
||||
INSERT_AUTHUSER_TABLE InsertLoginTable = {0,};
|
||||
char Query[256] = "";
|
||||
|
||||
UpdateData(TRUE);
|
||||
|
||||
strncpy(InsertLoginTable.AuthID, m_ID.GetBuffer(16), 16);
|
||||
strncpy(InsertLoginTable.AuthPW, m_Password.GetBuffer(16), 16);
|
||||
strncpy(InsertLoginTable.Name, m_Name.GetBuffer(16), 16);
|
||||
InsertLoginTable.Sex = m_Sex.GetCurSel();
|
||||
strncpy(InsertLoginTable.Birth, m_Birth.GetBuffer(20), 20);
|
||||
strncpy(InsertLoginTable.IDNumber, m_IDNumber.GetBuffer(14), 14);
|
||||
strncpy(InsertLoginTable.ZipCode, m_ZipCode.GetBuffer(12), 12);
|
||||
strncpy(InsertLoginTable.Address, m_Address.GetBuffer(80), 80);
|
||||
strncpy(InsertLoginTable.Mobile, m_Mobile.GetBuffer(20), 20);
|
||||
strncpy(InsertLoginTable.Phone, m_Phone.GetBuffer(20), 20);
|
||||
strncpy(InsertLoginTable.Email, m_Email.GetBuffer(48), 48);
|
||||
strncpy(InsertLoginTable.Job, m_Job.GetBuffer(20), 20);
|
||||
|
||||
sprintf(Query, "InsertUser '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s'",
|
||||
InsertLoginTable.AuthID, InsertLoginTable.AuthPW, InsertLoginTable.Name, InsertLoginTable.Sex, InsertLoginTable.Birth,InsertLoginTable.ZipCode,
|
||||
InsertLoginTable.Address, InsertLoginTable.Mobile, InsertLoginTable.Phone, InsertLoginTable.Email, InsertLoginTable.Job, InsertLoginTable.IDNumber);
|
||||
|
||||
if(CDBSingleObject::GetInstance().ExecuteQuery(Query))
|
||||
UpdateUserTable();
|
||||
else
|
||||
{
|
||||
m_ErrorLog = CDBSingleObject::GetInstance().GetErrorString();
|
||||
|
||||
UpdateData(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void CAuthDBManagerDlg::OnDeleteUser()
|
||||
{
|
||||
// TODO: Add your command handler code here
|
||||
POSITION Pos;
|
||||
int Index;
|
||||
|
||||
char Query[256] = "";
|
||||
char strUserUID[256] = "";
|
||||
|
||||
Pos= m_UserList.GetFirstSelectedItemPosition();
|
||||
if(Pos != NULL)
|
||||
{
|
||||
while(Pos != NULL)
|
||||
{
|
||||
Index = m_UserList.GetNextSelectedItem(Pos);
|
||||
|
||||
if(m_UserList.GetItemText(Index, 0, strUserUID, 256))
|
||||
{
|
||||
sprintf(Query, "DeleteUserByUID %s", strUserUID);
|
||||
if(!CDBSingleObject::GetInstance().ExecuteQuery(Query))
|
||||
{
|
||||
m_ErrorLog = CDBSingleObject::GetInstance().GetErrorString();
|
||||
|
||||
UpdateData(FALSE);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UpdateUserTable();
|
||||
}
|
||||
|
||||
void CAuthDBManagerDlg::OnInitLogintime()
|
||||
{
|
||||
// TODO: Add your command handler code here
|
||||
}
|
||||
|
||||
void CAuthDBManagerDlg::OnRefesh()
|
||||
{
|
||||
// TODO: Add your command handler code here
|
||||
UpdateUserTable();
|
||||
}
|
||||
|
||||
void CAuthDBManagerDlg::OnSearch()
|
||||
{
|
||||
// TODO: Add your command handler code here
|
||||
CSearchDlg dlgSearch;
|
||||
dlgSearch.DoModal();
|
||||
|
||||
UpdateUserTable();
|
||||
}
|
||||
|
||||
void CAuthDBManagerDlg::OnKeydownUserList(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
NMLVKEYDOWN* pKeyDown = (NMLVKEYDOWN*)pNMHDR;
|
||||
// TODO: Add your control notification handler code here
|
||||
POSITION Pos;
|
||||
int Index;
|
||||
|
||||
char Query[256] = "";
|
||||
char strUserUID[256] = "";
|
||||
|
||||
if(pKeyDown->wVKey == VK_DELETE)
|
||||
{
|
||||
Pos= m_UserList.GetFirstSelectedItemPosition();
|
||||
if(Pos != NULL)
|
||||
{
|
||||
while(Pos)
|
||||
{
|
||||
Index = m_UserList.GetNextSelectedItem(Pos);
|
||||
|
||||
if(m_UserList.GetItemText(Index, 0, strUserUID, 256))
|
||||
{
|
||||
sprintf(Query, "DeleteUserByUID %s", strUserUID);
|
||||
if(!CDBSingleObject::GetInstance().ExecuteQuery(Query))
|
||||
{
|
||||
m_ErrorLog = CDBSingleObject::GetInstance().GetErrorString();
|
||||
|
||||
UpdateData(FALSE);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UpdateUserTable();
|
||||
}
|
||||
}
|
||||
|
||||
*pResult = 0;
|
||||
}
|
||||
98
Server/ToolProject/AuthDBManager/AuthDBManagerDlg.h
Normal file
98
Server/ToolProject/AuthDBManager/AuthDBManagerDlg.h
Normal file
@@ -0,0 +1,98 @@
|
||||
// AuthDBManagerDlg.h : header file
|
||||
//
|
||||
|
||||
#if !defined(AFX_AuthDBManagerDLG_H__E7BBB14C_99A2_40F4_A212_B00B1FF8EEF2__INCLUDED_)
|
||||
#define AFX_AuthDBManagerDLG_H__E7BBB14C_99A2_40F4_A212_B00B1FF8EEF2__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAuthDBManagerDlg dialog
|
||||
#include "AuthDBManager.h"
|
||||
|
||||
#include "Led\Led.h"
|
||||
|
||||
#include "ConnectDlg.h"
|
||||
#include "SearchDlg.h"
|
||||
#include "UserList.h"
|
||||
|
||||
class CAuthDBManagerDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CAuthDBManagerDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CAuthDBManagerDlg)
|
||||
enum { IDD = IDD_AuthDBManager_DIALOG };
|
||||
CComboBox m_Sex;
|
||||
CUserList m_UserList;
|
||||
CLed m_QueryLed;
|
||||
CLed m_ConnectionLed;
|
||||
CString m_ErrorLog;
|
||||
CString m_SelectedCount;
|
||||
CString m_SelectedRow;
|
||||
CString m_SelectedUID;
|
||||
CString m_SelectedID;
|
||||
CString m_TotalRow;
|
||||
CString m_Address;
|
||||
CString m_Birth;
|
||||
CString m_Email;
|
||||
CString m_ID;
|
||||
CString m_IDNumber;
|
||||
CString m_Job;
|
||||
CString m_Mobile;
|
||||
CString m_Name;
|
||||
CString m_Password;
|
||||
CString m_Phone;
|
||||
CString m_ZipCode;
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CAuthDBManagerDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
HICON m_hIcon;
|
||||
char m_Select[2][10];
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CAuthDBManagerDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
||||
afx_msg void OnEndlabeleditUserList(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg HCURSOR OnQueryDragIcon();
|
||||
afx_msg void OnAbout();
|
||||
afx_msg void OnConnect();
|
||||
afx_msg void OnDisconnect();
|
||||
afx_msg void OnClickUserList(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnAddUser();
|
||||
afx_msg void OnDeleteUser();
|
||||
afx_msg void OnInitLogintime();
|
||||
afx_msg void OnRefesh();
|
||||
afx_msg void OnSearch();
|
||||
afx_msg void OnKeydownUserList(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
public:
|
||||
int m_Align; // Á¤·Ä
|
||||
int m_AlignType;
|
||||
int m_SearchType; // °Ë»ö
|
||||
char m_Search[256];
|
||||
|
||||
public:
|
||||
bool ConnectDB(int Type, CString DataSource, CString Server, CString DataBase, CString User, CString Pass);
|
||||
bool UpdateUserTable(void);
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_AuthDBManagerDLG_H__E7BBB14C_99A2_40F4_A212_B00B1FF8EEF2__INCLUDED_)
|
||||
66
Server/ToolProject/AuthDBManager/AuthDef.h
Normal file
66
Server/ToolProject/AuthDBManager/AuthDef.h
Normal file
@@ -0,0 +1,66 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Table Schema Define
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _AuthDBDef
|
||||
#define _AuthDBDef
|
||||
|
||||
#pragma pack(1)
|
||||
typedef struct _INSERT_AUTHUSER_TABLE
|
||||
{
|
||||
char AuthID[16]; // 아이디
|
||||
char AuthPW[16]; // 패스
|
||||
char Name[16]; // 이름
|
||||
char Sex; // 성별
|
||||
char Birth[11]; // 생일
|
||||
char ZipCode[12]; // 우편 번호
|
||||
char Address[80]; // 주소
|
||||
char Mobile[20]; // 휴대폰
|
||||
char Phone[20]; // 전화
|
||||
char Email[50]; // 이메일
|
||||
char Job[20]; // 직업
|
||||
char IDNumber[15]; // 주민등록 번호
|
||||
}INSERT_AUTHUSER_TABLE, *LPINSERT_AUTHUSER_TABLE;
|
||||
#pragma pack()
|
||||
|
||||
#pragma pack(1)
|
||||
typedef struct _SELECT_AUTHUSER_TABLE
|
||||
{
|
||||
unsigned long UID; // 아이디
|
||||
char AuthID[16]; // 아이디
|
||||
char AuthPW[16]; // 패스
|
||||
char Name[16]; // 이름
|
||||
char Sex; // 성별
|
||||
char Birth[11]; // 생일
|
||||
char ZipCode[12]; // 우편 번호
|
||||
char Address[80]; // 주소
|
||||
char Mobile[20]; // 휴대폰
|
||||
char Phone[20]; // 전화
|
||||
char Email[50]; // 이메일
|
||||
char Job[20]; // 직업
|
||||
char IDNumber[15]; // 주민등록 번호
|
||||
TIME Reg_Date; // 등록 일자
|
||||
}SELECT_AUTHUSER_TABLE, *LPSELECT_AUTHUSER_TABLE;
|
||||
#pragma pack()
|
||||
|
||||
#pragma pack(1)
|
||||
typedef struct _UPDATE_AUTHUSER_TABLE
|
||||
{
|
||||
unsigned long UID; // 아이디
|
||||
char AuthID[16]; // 아이디
|
||||
char AuthPW[16]; // 패스
|
||||
char Name[16]; // 이름
|
||||
char Sex; // 성별
|
||||
char Birth[11]; // 생일
|
||||
char ZipCode[12]; // 우편 번호
|
||||
char Address[80]; // 주소
|
||||
char Mobile[20]; // 휴대폰
|
||||
char Phone[20]; // 전화
|
||||
char Email[50]; // 이메일
|
||||
char Job[20]; // 직업
|
||||
char IDNumber[15]; // 주민등록 번호
|
||||
}UPDATE_AUTHUSER_TABLE, *LPUPDATE_AUTHUSER_TABLE;
|
||||
#pragma pack()
|
||||
|
||||
#endif
|
||||
89
Server/ToolProject/AuthDBManager/ConnectDlg.cpp
Normal file
89
Server/ToolProject/AuthDBManager/ConnectDlg.cpp
Normal file
@@ -0,0 +1,89 @@
|
||||
// ConnectDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "AuthDBManager.h"
|
||||
#include "ConnectDlg.h"
|
||||
#include "AuthDBManagerDlg.h"
|
||||
#include ".\connectdlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CConnectDlg dialog
|
||||
|
||||
|
||||
CConnectDlg::CConnectDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CConnectDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CConnectDlg)
|
||||
m_AuthUserName = _T("");
|
||||
m_AuthUserPass = _T("");
|
||||
m_DataBaseName = _T("");
|
||||
m_DataSourceName = _T("");
|
||||
m_ServerName = _T("");
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CConnectDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CConnectDlg)
|
||||
DDX_Control(pDX, ID_SELECT_TYPE, m_SelectControl);
|
||||
DDX_Text(pDX, ID_AUTHUSER_NAME, m_AuthUserName);
|
||||
DDX_Text(pDX, ID_AUTHUSER_PASS, m_AuthUserPass);
|
||||
DDX_Text(pDX, ID_DATABASE_NAME, m_DataBaseName);
|
||||
DDX_Text(pDX, ID_DATASOURCE_NAME, m_DataSourceName);
|
||||
DDX_Text(pDX, ID_SERVER_NAME, m_ServerName);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CConnectDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CConnectDlg)
|
||||
// NOTE: the ClassWizard will add message map macros here
|
||||
//}}AFX_MSG_MAP
|
||||
ON_BN_CLICKED(IDOK, OnBnClickedOk)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CconnectDlg message handlers
|
||||
|
||||
BOOL CConnectDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// TODO: Add extra initialization here
|
||||
m_SelectControl.InsertString(0, "ODBC");
|
||||
m_SelectControl.InsertString(1, "OLE DB");
|
||||
m_SelectControl.InsertString(2, "Source Prompt");
|
||||
|
||||
m_SelectControl.SetCurSel(0);
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
void CConnectDlg::OnOK()
|
||||
{
|
||||
// TODO: Add extra validation here
|
||||
CAuthDBManagerApp* pAppWnd = (CAuthDBManagerApp*)AfxGetApp();
|
||||
CAuthDBManagerDlg* pDlgWnd = (CAuthDBManagerDlg*)pAppWnd->m_pMainWnd;
|
||||
|
||||
UpdateData();
|
||||
|
||||
pDlgWnd->ConnectDB(m_SelectControl.GetCurSel(), m_DataSourceName, m_ServerName, m_DataBaseName, m_AuthUserName, m_AuthUserPass);
|
||||
|
||||
CDialog::OnOK();
|
||||
}
|
||||
|
||||
void CConnectDlg::OnBnClickedOk()
|
||||
{
|
||||
// TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
|
||||
OnOK();
|
||||
}
|
||||
54
Server/ToolProject/AuthDBManager/ConnectDlg.h
Normal file
54
Server/ToolProject/AuthDBManager/ConnectDlg.h
Normal file
@@ -0,0 +1,54 @@
|
||||
#if !defined(AFX_CONNECTDLG_H__815DC394_E827_414B_96D6_30BA20241E8F__INCLUDED_)
|
||||
#define AFX_CONNECTDLG_H__815DC394_E827_414B_96D6_30BA20241E8F__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// ConnectDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CConnectDlg dialog
|
||||
|
||||
class CConnectDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CConnectDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CconnectDlg)
|
||||
enum { IDD = IDD_CONNECT };
|
||||
CComboBox m_SelectControl;
|
||||
CString m_AuthUserName;
|
||||
CString m_AuthUserPass;
|
||||
CString m_DataBaseName;
|
||||
CString m_DataSourceName;
|
||||
CString m_ServerName;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CconnectDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CconnectDlg)
|
||||
virtual void OnOK();
|
||||
virtual BOOL OnInitDialog();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
public:
|
||||
afx_msg void OnBnClickedOk();
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_CONNECTDLG_H__815DC394_E827_414B_96D6_30BA20241E8F__INCLUDED_)
|
||||
238
Server/ToolProject/AuthDBManager/Led/Led.cpp
Normal file
238
Server/ToolProject/AuthDBManager/Led/Led.cpp
Normal file
@@ -0,0 +1,238 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Led.cpp : implementation file
|
||||
// Visual Source Safe: $Revision: 1 $
|
||||
//
|
||||
// Led static control. Will display a LED in 4 different colors and two shapes.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 1998-1999 Monte Variakojis ( monte@apollocom.com )
|
||||
// All rights reserved - not to be sold.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "..\stdafx.h"
|
||||
#include "..\resource.h"
|
||||
#include "Led.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CLed
|
||||
#define TIMER_ID_PING 1 // Timer Ping ID
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
CLed::CLed()
|
||||
{
|
||||
m_LedBitmap.LoadBitmap(IDB_LEDS);
|
||||
m_nLedColor = LED_COLOR_RED;
|
||||
m_nLedMode = LED_OFF;
|
||||
m_nLedShape = LED_ROUND;
|
||||
}
|
||||
|
||||
CLed::~CLed()
|
||||
{
|
||||
VERIFY(m_LedBitmap.DeleteObject());
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CLed, CStatic)
|
||||
//{{AFX_MSG_MAP(CLed)
|
||||
ON_WM_PAINT()
|
||||
ON_WM_TIMER()
|
||||
ON_WM_CREATE()
|
||||
ON_WM_ERASEBKGND()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CLed message handlers
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void CLed::OnPaint()
|
||||
{
|
||||
CPaintDC dc(this); // device context for painting
|
||||
DrawLed(&dc,m_nLedColor,m_nLedMode,m_nLedShape);
|
||||
|
||||
// Do not call CStatic::OnPaint() for painting messages
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: SetLed
|
||||
// Description: This method will draw the LED to the specified DC.
|
||||
//
|
||||
// Entry:
|
||||
// CDC *pDC - DC to draw to
|
||||
//
|
||||
// int iLedColor - Where color is defined by:
|
||||
// LED_COLOR_RED
|
||||
// LED_COLOR_GREEN
|
||||
// LED_COLOR_YELLOW
|
||||
// LED_COLOR_BLUE
|
||||
//
|
||||
// int iMode - where mode is defined by:
|
||||
// LED_ON
|
||||
// LED_OFF
|
||||
// LED_DISABLED
|
||||
//
|
||||
// int iShape - where shape is defined by:
|
||||
// LED_ROUND
|
||||
// LED_SQUARE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void CLed::DrawLed(CDC *pDC,int nLEDColor, int nMode, int nShape)
|
||||
{
|
||||
CRect rect;
|
||||
GetClientRect(&rect);
|
||||
|
||||
//
|
||||
// Center led within an oversized window
|
||||
//
|
||||
if(rect.Width() >= LED_SIZE && rect.Height() >= LED_SIZE)
|
||||
{
|
||||
int nWidth = rect.Width();
|
||||
int nHeight = rect.Height();
|
||||
rect.left += (nWidth - LED_SIZE)/2;
|
||||
rect.right -= (nWidth - LED_SIZE)/2;
|
||||
rect.top += (nHeight - LED_SIZE)/2;
|
||||
rect.bottom -= (nHeight - LED_SIZE)/2;
|
||||
}
|
||||
|
||||
//
|
||||
// Prepare temporary DCs and bitmaps
|
||||
//
|
||||
CBitmap TransBitmap;
|
||||
TransBitmap.CreateBitmap(LED_SIZE,LED_SIZE,1,1,NULL);
|
||||
CBitmap bitmapTemp;
|
||||
CBitmap* pBitmap = &m_LedBitmap;
|
||||
CDC srcDC;
|
||||
CDC dcMask;
|
||||
CDC TempDC;
|
||||
TempDC.CreateCompatibleDC(pDC);
|
||||
srcDC.CreateCompatibleDC(pDC);
|
||||
dcMask.CreateCompatibleDC(pDC);
|
||||
|
||||
CBitmap* pOldBitmap = srcDC.SelectObject(pBitmap);
|
||||
CBitmap* pOldMaskbitmap = dcMask.SelectObject(&TransBitmap);
|
||||
bitmapTemp.CreateCompatibleBitmap(pDC,LED_SIZE,LED_SIZE);
|
||||
|
||||
//
|
||||
// Work with tempDC and bitmapTemp to reduce flickering
|
||||
//
|
||||
CBitmap *pOldBitmapTemp = TempDC.SelectObject(&bitmapTemp);
|
||||
TempDC.BitBlt(0, 0, LED_SIZE, LED_SIZE, pDC, rect.left, rect.top, SRCCOPY);
|
||||
|
||||
//
|
||||
// Create mask
|
||||
//
|
||||
COLORREF OldBkColor = srcDC.SetBkColor(RGB(255,0,255));
|
||||
dcMask.BitBlt(0, 0, LED_SIZE, LED_SIZE,&srcDC, nMode*LED_SIZE, nLEDColor+nShape, SRCCOPY);
|
||||
TempDC.SetBkColor(OldBkColor);
|
||||
|
||||
//
|
||||
// Using the IDB_LEDS bitmap, index into the bitmap for the appropriate
|
||||
// LED. By using the mask color (RGB(255,0,255)) a mask has been created
|
||||
// so the bitmap will appear transparent.
|
||||
//
|
||||
TempDC.BitBlt(0, 0, LED_SIZE, LED_SIZE, &srcDC, nMode*LED_SIZE, nLEDColor+nShape, SRCINVERT);
|
||||
TempDC.BitBlt(0, 0, LED_SIZE, LED_SIZE,&dcMask, 0, 0, SRCAND);
|
||||
TempDC.BitBlt(0, 0, LED_SIZE, LED_SIZE, &srcDC, nMode*LED_SIZE, nLEDColor+nShape, SRCINVERT);
|
||||
|
||||
//
|
||||
// Since the actual minipulation is done to tempDC so there is minimal
|
||||
// flicker, it is now time to draw the result to the screen.
|
||||
//
|
||||
pDC->BitBlt(rect.left, rect.top, LED_SIZE, LED_SIZE, &TempDC, 0, 0, SRCCOPY);
|
||||
|
||||
//
|
||||
// House cleaning
|
||||
//
|
||||
srcDC.SelectObject(pOldBitmap);
|
||||
dcMask.SelectObject(pOldMaskbitmap);
|
||||
TempDC.SelectObject(pOldBitmapTemp);
|
||||
VERIFY(srcDC.DeleteDC());
|
||||
VERIFY(dcMask.DeleteDC());
|
||||
VERIFY(TempDC.DeleteDC());
|
||||
VERIFY(TransBitmap.DeleteObject());
|
||||
VERIFY(bitmapTemp.DeleteObject());
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: SetLed
|
||||
// Description: This method will draw and set led parameters.
|
||||
//
|
||||
// Entry: int iLedColor - Where color is defined by:
|
||||
// LED_COLOR_RED
|
||||
// LED_COLOR_GREEN
|
||||
// LED_COLOR_YELLOW
|
||||
// LED_COLOR_BLUE
|
||||
//
|
||||
// int iMode - where mode is defined by:
|
||||
// LED_ON
|
||||
// LED_OFF
|
||||
// LED_DISABLED
|
||||
//
|
||||
// int iShape - where shape is defined by:
|
||||
// LED_ROUND
|
||||
// LED_SQUARE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void CLed::SetLed(int nLedColor, int nMode, int nShape)
|
||||
{
|
||||
m_nLedColor = nLedColor;
|
||||
m_nLedMode = nMode;
|
||||
m_nLedShape = nShape;
|
||||
|
||||
CDC *pDC;
|
||||
pDC = GetDC();
|
||||
DrawLed(pDC,m_nLedColor,m_nLedMode,m_nLedShape);
|
||||
ReleaseDC(pDC);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: Ping
|
||||
// Description: This method will turn the led on for dwTimeout milliseconds and
|
||||
// then turn it off.
|
||||
//
|
||||
// Entry: DWORD dwTimeout - Time out in milliseconds
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void CLed::Ping(DWORD dwTimeout)
|
||||
{
|
||||
// Return if pinging
|
||||
if(m_bPingEnabled == TRUE)
|
||||
{
|
||||
KillTimer(TIMER_ID_PING);
|
||||
}
|
||||
|
||||
m_bPingEnabled = TRUE;
|
||||
SetLed(m_nLedColor,CLed::LED_ON,m_nLedShape);
|
||||
SetTimer(TIMER_ID_PING,dwTimeout,NULL);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void CLed::OnTimer(UINT nIDEvent)
|
||||
{
|
||||
if(nIDEvent == TIMER_ID_PING)
|
||||
{
|
||||
SetLed(m_nLedColor,CLed::LED_OFF,m_nLedShape);
|
||||
KillTimer(nIDEvent);
|
||||
m_bPingEnabled = FALSE;
|
||||
}
|
||||
|
||||
CStatic::OnTimer(nIDEvent);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
BOOL CLed::OnEraseBkgnd(CDC* pDC)
|
||||
{
|
||||
// No background rendering
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
88
Server/ToolProject/AuthDBManager/Led/Led.h
Normal file
88
Server/ToolProject/AuthDBManager/Led/Led.h
Normal file
@@ -0,0 +1,88 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Led.h : header file
|
||||
// Visual Source Safe: $Revision: 1 $
|
||||
//
|
||||
// Led static control. Will display a LED in 4 different colors and two shapes.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 1998-1999 Monte Variakojis ( monte@apollocom.com )
|
||||
// All rights reserved - not to be sold.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#if !defined(AFX_LEDWND_H__2D837381_FFEC_11D1_A1CE_00A024D311C0__INCLUDED_)
|
||||
#define AFX_LEDWND_H__2D837381_FFEC_11D1_A1CE_00A024D311C0__INCLUDED_
|
||||
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER >= 1000
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define LED_SIZE 16 // Led are 16 X 16 pixels
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CLed window
|
||||
class CLed : public CStatic
|
||||
{
|
||||
|
||||
protected:
|
||||
int m_nLedColor, m_nLedMode, m_nLedShape;
|
||||
DWORD m_dwPingTimeout;
|
||||
BOOL m_bPingEnabled;
|
||||
CBitmap m_LedBitmap;
|
||||
|
||||
public:
|
||||
|
||||
enum {
|
||||
LED_ROUND = 0, // Circle starts at row 0
|
||||
LED_SQUARE = LED_SIZE * 4, // squares start at row 4
|
||||
};
|
||||
enum {
|
||||
LED_COLOR_RED = 0 * LED_SIZE, // Row 0
|
||||
LED_COLOR_GREEN = 1 * LED_SIZE, // Row 1
|
||||
LED_COLOR_YELLOW = 2 * LED_SIZE, // Row 2
|
||||
LED_COLOR_BLUE = 3 * LED_SIZE, // Row 3
|
||||
};
|
||||
enum {
|
||||
LED_ON = 0, // Column 0
|
||||
LED_OFF = 1, // Column 1
|
||||
LED_DISABLED = 2, // Column 2
|
||||
};
|
||||
|
||||
// Construction
|
||||
public:
|
||||
CLed();
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
void SetLed(int nLedColor, int nMode, int nShape);
|
||||
int GetLedMode(){return m_nLedMode;}
|
||||
void Ping(DWORD dwTimeout = 1000);
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CLed)
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
void DrawLed( CDC *pDC, int nLEDColor, int nMode, int nShape );
|
||||
virtual ~CLed();
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CLed)
|
||||
afx_msg void OnPaint();
|
||||
afx_msg void OnTimer(UINT nIDEvent);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_LEDWND_H__2D837381_FFEC_11D1_A1CE_00A024D311C0__INCLUDED_)
|
||||
BIN
Server/ToolProject/AuthDBManager/Led/leds.bmp
Normal file
BIN
Server/ToolProject/AuthDBManager/Led/leds.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
127
Server/ToolProject/AuthDBManager/ListViewControl/InPlaceEdit.cpp
Normal file
127
Server/ToolProject/AuthDBManager/ListViewControl/InPlaceEdit.cpp
Normal file
@@ -0,0 +1,127 @@
|
||||
#include "InPlaceEdit.h"
|
||||
|
||||
CInPlaceEdit::CInPlaceEdit(int iItem, int iSubItem, CString sInitText) :m_sInitText( sInitText )
|
||||
{
|
||||
m_iItem = iItem;
|
||||
m_iSubItem = iSubItem;
|
||||
m_bESC = FALSE;
|
||||
}
|
||||
|
||||
CInPlaceEdit::~CInPlaceEdit()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CInPlaceEdit, CEdit)
|
||||
//{{AFX_MSG_MAP(CInPlaceEdit)
|
||||
ON_WM_KILLFOCUS()
|
||||
ON_WM_NCDESTROY()
|
||||
ON_WM_CHAR()
|
||||
ON_WM_CREATE()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
BOOL CInPlaceEdit::PreTranslateMessage(MSG* pMsg)
|
||||
{
|
||||
if(pMsg->message == WM_KEYDOWN)
|
||||
{
|
||||
if(pMsg->wParam == VK_RETURN || pMsg->wParam == VK_DELETE || pMsg->wParam == VK_ESCAPE || GetKeyState(VK_CONTROL))
|
||||
{
|
||||
::TranslateMessage(pMsg);
|
||||
::DispatchMessage(pMsg);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return CEdit::PreTranslateMessage(pMsg);
|
||||
}
|
||||
|
||||
|
||||
void CInPlaceEdit::OnKillFocus(CWnd* pNewWnd)
|
||||
{
|
||||
CEdit::OnKillFocus(pNewWnd);
|
||||
|
||||
CString str;
|
||||
GetWindowText(str);
|
||||
|
||||
LV_DISPINFO dispinfo;
|
||||
dispinfo.hdr.hwndFrom = GetParent()->m_hWnd;
|
||||
dispinfo.hdr.idFrom = GetDlgCtrlID();
|
||||
dispinfo.hdr.code = LVN_ENDLABELEDIT;
|
||||
|
||||
dispinfo.item.mask = LVIF_TEXT;
|
||||
dispinfo.item.iItem = m_iItem;
|
||||
dispinfo.item.iSubItem = m_iSubItem;
|
||||
dispinfo.item.pszText = m_bESC ? NULL : LPTSTR((LPCTSTR)str);
|
||||
dispinfo.item.cchTextMax = str.GetLength();
|
||||
|
||||
GetParent()->GetParent()->SendMessage(WM_NOTIFY, GetParent()->GetDlgCtrlID(), (LPARAM)&dispinfo);
|
||||
|
||||
DestroyWindow();
|
||||
}
|
||||
|
||||
void CInPlaceEdit::OnNcDestroy()
|
||||
{
|
||||
CEdit::OnNcDestroy();
|
||||
|
||||
delete this;
|
||||
}
|
||||
|
||||
|
||||
void CInPlaceEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
|
||||
{
|
||||
if(nChar == VK_ESCAPE || nChar == VK_RETURN)
|
||||
{
|
||||
if(nChar == VK_ESCAPE)
|
||||
m_bESC = TRUE;
|
||||
|
||||
GetParent()->SetFocus();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
CEdit::OnChar(nChar, nRepCnt, nFlags);
|
||||
|
||||
CString str;
|
||||
|
||||
GetWindowText(str);
|
||||
CWindowDC dc(this);
|
||||
CFont *pFont = GetParent()->GetFont();
|
||||
CFont *pFontDC = dc.SelectObject(pFont);
|
||||
CSize size = dc.GetTextExtent(str);
|
||||
dc.SelectObject(pFontDC);
|
||||
size.cx += 5;
|
||||
|
||||
CRect rect, parentrect;
|
||||
GetClientRect(&rect);
|
||||
GetParent()->GetClientRect(&parentrect);
|
||||
|
||||
ClientToScreen(&rect);
|
||||
GetParent()->ScreenToClient(&rect);
|
||||
|
||||
if(size.cx > rect.Width())
|
||||
{
|
||||
if(size.cx + rect.left < parentrect.right)
|
||||
rect.right = rect.left + size.cx;
|
||||
else
|
||||
rect.right = parentrect.right;
|
||||
|
||||
MoveWindow(&rect);
|
||||
}
|
||||
}
|
||||
|
||||
int CInPlaceEdit::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
||||
{
|
||||
if(CEdit::OnCreate(lpCreateStruct) == -1)
|
||||
return -1;
|
||||
|
||||
CFont* font = GetParent()->GetFont();
|
||||
SetFont(font);
|
||||
|
||||
SetWindowText(m_sInitText);
|
||||
SetFocus();
|
||||
SetSel(0, -1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
|
||||
class CInPlaceEdit : public CEdit
|
||||
{
|
||||
public:
|
||||
CInPlaceEdit(int iItem, int iSubItem, CString sInitText);
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CInPlaceEdit)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CInPlaceEdit();
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CInPlaceEdit)
|
||||
afx_msg void OnKillFocus(CWnd* pNewWnd);
|
||||
afx_msg void OnNcDestroy();
|
||||
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
private:
|
||||
int m_iItem;
|
||||
int m_iSubItem;
|
||||
CString m_sInitText;
|
||||
BOOL m_bESC; // To indicate whether ESC key was pressed
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
126
Server/ToolProject/AuthDBManager/ListViewControl/InPlaceList.cpp
Normal file
126
Server/ToolProject/AuthDBManager/ListViewControl/InPlaceList.cpp
Normal file
@@ -0,0 +1,126 @@
|
||||
// InPlaceList.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "InPlaceList.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CInPlaceList
|
||||
|
||||
CInPlaceList::CInPlaceList(int iItem, int iSubItem, CStringList *plstItems, int nSel)
|
||||
{
|
||||
m_iItem = iItem;
|
||||
m_iSubItem = iSubItem;
|
||||
|
||||
m_lstItems.AddTail( plstItems );
|
||||
m_nSel = nSel;
|
||||
m_bESC = FALSE;
|
||||
}
|
||||
|
||||
CInPlaceList::~CInPlaceList()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CInPlaceList, CComboBox)
|
||||
//{{AFX_MSG_MAP(CInPlaceList)
|
||||
ON_WM_CREATE()
|
||||
ON_WM_KILLFOCUS()
|
||||
ON_WM_CHAR()
|
||||
ON_WM_NCDESTROY()
|
||||
ON_CONTROL_REFLECT(CBN_CLOSEUP, OnCloseup)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CInPlaceList message handlers
|
||||
|
||||
int CInPlaceList::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
||||
{
|
||||
if (CComboBox::OnCreate(lpCreateStruct) == -1)
|
||||
return -1;
|
||||
|
||||
// Set the proper font
|
||||
CFont* font = GetParent()->GetFont();
|
||||
SetFont(font);
|
||||
|
||||
for( POSITION pos = m_lstItems.GetHeadPosition(); pos != NULL; )
|
||||
{
|
||||
AddString( (LPCTSTR) (m_lstItems.GetNext( pos )) );
|
||||
}
|
||||
SetCurSel( m_nSel );
|
||||
SetFocus();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL CInPlaceList::PreTranslateMessage(MSG* pMsg)
|
||||
{
|
||||
if( pMsg->message == WM_KEYDOWN )
|
||||
{
|
||||
if(pMsg->wParam == VK_RETURN
|
||||
|| pMsg->wParam == VK_ESCAPE
|
||||
)
|
||||
{
|
||||
::TranslateMessage(pMsg);
|
||||
::DispatchMessage(pMsg);
|
||||
return TRUE; // DO NOT process further
|
||||
}
|
||||
}
|
||||
|
||||
return CComboBox::PreTranslateMessage(pMsg);
|
||||
}
|
||||
|
||||
void CInPlaceList::OnKillFocus(CWnd* pNewWnd)
|
||||
{
|
||||
CComboBox::OnKillFocus(pNewWnd);
|
||||
|
||||
CString str;
|
||||
GetWindowText(str);
|
||||
|
||||
// Send Notification to parent of ListView ctrl
|
||||
LV_DISPINFO dispinfo;
|
||||
dispinfo.hdr.hwndFrom = GetParent()->m_hWnd;
|
||||
dispinfo.hdr.idFrom = GetDlgCtrlID();
|
||||
dispinfo.hdr.code = LVN_ENDLABELEDIT;
|
||||
|
||||
dispinfo.item.mask = LVIF_TEXT;
|
||||
dispinfo.item.iItem = m_iItem;
|
||||
dispinfo.item.iSubItem = m_iSubItem;
|
||||
dispinfo.item.pszText = m_bESC ? NULL : LPTSTR((LPCTSTR)str);
|
||||
dispinfo.item.cchTextMax = str.GetLength();
|
||||
|
||||
GetParent()->GetParent()->SendMessage( WM_NOTIFY, GetParent()->GetDlgCtrlID(), (LPARAM)&dispinfo );
|
||||
|
||||
PostMessage( WM_CLOSE );
|
||||
}
|
||||
|
||||
void CInPlaceList::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
|
||||
{
|
||||
if( nChar == VK_ESCAPE || nChar == VK_RETURN)
|
||||
{
|
||||
if( nChar == VK_ESCAPE )
|
||||
m_bESC = TRUE;
|
||||
GetParent()->SetFocus();
|
||||
return;
|
||||
}
|
||||
|
||||
CComboBox::OnChar(nChar, nRepCnt, nFlags);
|
||||
}
|
||||
|
||||
void CInPlaceList::OnNcDestroy()
|
||||
{
|
||||
CComboBox::OnNcDestroy();
|
||||
|
||||
delete this;
|
||||
}
|
||||
|
||||
void CInPlaceList::OnCloseup()
|
||||
{
|
||||
GetParent()->SetFocus();
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
// InPlaceList.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CInPlaceList window
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
|
||||
class CInPlaceList : public CComboBox
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CInPlaceList(int iItem, int iSubItem, CStringList *plstItems, int nSel);
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CInPlaceList)
|
||||
public:
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CInPlaceList();
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CInPlaceList)
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnKillFocus(CWnd* pNewWnd);
|
||||
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
|
||||
afx_msg void OnNcDestroy();
|
||||
afx_msg void OnCloseup();
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
private:
|
||||
int m_iItem;
|
||||
int m_iSubItem;
|
||||
CStringList m_lstItems;
|
||||
int m_nSel;
|
||||
BOOL m_bESC; // To indicate whether ESC key was pressed
|
||||
};
|
||||
@@ -0,0 +1,260 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CListViewControl
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#include "ListViewControl.h"
|
||||
|
||||
CListViewControl::CListViewControl()
|
||||
{
|
||||
ZeroMemory(m_ColType, sizeof(unsigned int) * 100);
|
||||
}
|
||||
|
||||
CListViewControl::~CListViewControl()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CListViewControl, CListCtrl)
|
||||
//{{AFX_MSG_MAP(CListViewControl)
|
||||
ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnCustomDraw)
|
||||
ON_WM_LBUTTONDBLCLK()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
void CListViewControl::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)pNMHDR;
|
||||
|
||||
switch(lplvcd->nmcd.dwDrawStage)
|
||||
{
|
||||
case CDDS_PREPAINT:
|
||||
*pResult = CDRF_NOTIFYITEMDRAW;
|
||||
|
||||
break;
|
||||
|
||||
case CDDS_ITEMPREPAINT:
|
||||
if(lplvcd->nmcd.dwItemSpec % 2)
|
||||
lplvcd->clrTextBk = RGB(200, 228, 248);
|
||||
|
||||
*pResult = CDRF_DODEFAULT;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CListViewControl::OnLButtonDblClk(UINT nFlags, CPoint point)
|
||||
{
|
||||
CListCtrl::OnLButtonDblClk(nFlags, point);
|
||||
|
||||
int index, colnum;
|
||||
|
||||
if((index = HitTestEx(point, &colnum)) != -1)
|
||||
{
|
||||
if(m_ColType[colnum] == CT_EDIT)
|
||||
{
|
||||
if(GetWindowLong(m_hWnd, GWL_STYLE) & LVS_EDITLABELS)
|
||||
EditSubLabel(index, colnum);
|
||||
}
|
||||
|
||||
if(m_ColType[colnum] == CT_COMBO)
|
||||
{
|
||||
if(GetWindowLong(m_hWnd, GWL_STYLE) & LVS_EDITLABELS)
|
||||
ShowInPlaceList(index, colnum, m_ColumnStringList[colnum], 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CListViewControl::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
|
||||
{
|
||||
if(GetFocus() != this)
|
||||
SetFocus();
|
||||
|
||||
CListCtrl::OnHScroll(nSBCode, nPos, pScrollBar);
|
||||
}
|
||||
|
||||
void CListViewControl::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
|
||||
{
|
||||
if(GetFocus() != this)
|
||||
SetFocus();
|
||||
|
||||
CListCtrl::OnVScroll(nSBCode, nPos, pScrollBar);
|
||||
}
|
||||
|
||||
bool CListViewControl::SetColumnType(int ColNum, unsigned int Type)
|
||||
{
|
||||
if(ColNum < 0)
|
||||
return false;
|
||||
|
||||
m_ColType[ColNum] = Type;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CListViewControl::SetColumnStringList(int ColNum, CStringList &StringList)
|
||||
{
|
||||
if(ColNum < 0)
|
||||
return false;
|
||||
|
||||
m_ColumnStringList[ColNum].RemoveAll();
|
||||
|
||||
POSITION Pos = StringList.GetHeadPosition();
|
||||
|
||||
while(Pos)
|
||||
m_ColumnStringList[ColNum].AddTail(StringList.GetNext(Pos));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int CListViewControl::HitTestEx(CPoint &point, int *col) const
|
||||
{
|
||||
int colnum = 0;
|
||||
int row = HitTest(point, NULL);
|
||||
|
||||
if(col)
|
||||
*col = 0;
|
||||
|
||||
if((GetWindowLong(m_hWnd, GWL_STYLE) & LVS_TYPEMASK) != LVS_REPORT)
|
||||
return row;
|
||||
|
||||
row = GetTopIndex();
|
||||
int bottom = row + GetCountPerPage();
|
||||
if(bottom > GetItemCount())
|
||||
bottom = GetItemCount();
|
||||
|
||||
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
|
||||
int nColumnCount = pHeader->GetItemCount();
|
||||
|
||||
INT* piColumnArray = new INT[nColumnCount];
|
||||
((CListCtrl*)this)->GetColumnOrderArray(piColumnArray);
|
||||
|
||||
for(;row <=bottom; row++)
|
||||
{
|
||||
CRect rect;
|
||||
GetItemRect(row, &rect, LVIR_BOUNDS);
|
||||
if(rect.PtInRect(point))
|
||||
{
|
||||
for(colnum = 0; colnum < nColumnCount; colnum++)
|
||||
{
|
||||
int colwidth = GetColumnWidth(piColumnArray[colnum]);
|
||||
if(point.x >= rect.left && point.x <= (rect.left + colwidth))
|
||||
{
|
||||
*col = piColumnArray[colnum];
|
||||
|
||||
delete [] piColumnArray;
|
||||
return row;
|
||||
}
|
||||
|
||||
rect.left += colwidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delete [] piColumnArray;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
CEdit* CListViewControl::EditSubLabel(int nItem, int nCol)
|
||||
{
|
||||
if(!EnsureVisible(nItem, TRUE))
|
||||
return NULL;
|
||||
|
||||
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
|
||||
int nColumnCount = pHeader->GetItemCount();
|
||||
if(nCol >= nColumnCount || GetColumnWidth(nCol) < 5)
|
||||
return NULL;
|
||||
|
||||
int offset = 0;
|
||||
|
||||
INT *piColumnArray = new INT[nColumnCount];
|
||||
((CListCtrl*)this)->GetColumnOrderArray(piColumnArray);
|
||||
|
||||
for(int i = 0; nCol != piColumnArray[i]; i++)
|
||||
offset += GetColumnWidth( piColumnArray[i]);
|
||||
|
||||
delete [] piColumnArray;
|
||||
|
||||
CRect rect;
|
||||
GetItemRect(nItem, &rect, LVIR_BOUNDS);
|
||||
|
||||
CRect rcClient;
|
||||
GetClientRect(&rcClient);
|
||||
if(offset + rect.left < 0 || offset + rect.left > rcClient.right)
|
||||
{
|
||||
CSize size;
|
||||
if(offset + rect.left < 0)
|
||||
size.cx = -(offset - rect.left);
|
||||
else
|
||||
size.cx = offset - rect.left;
|
||||
size.cy = 0;
|
||||
Scroll(size);
|
||||
GetItemRect(nItem, &rect, LVIR_BOUNDS);
|
||||
}
|
||||
|
||||
LV_COLUMN lvcol;
|
||||
lvcol.mask = LVCF_FMT;
|
||||
GetColumn(nCol, &lvcol);
|
||||
|
||||
DWORD dwStyle ;
|
||||
if((lvcol.fmt&LVCFMT_JUSTIFYMASK) == LVCFMT_LEFT)
|
||||
dwStyle = ES_LEFT;
|
||||
else if((lvcol.fmt&LVCFMT_JUSTIFYMASK) == LVCFMT_RIGHT)
|
||||
dwStyle = ES_RIGHT;
|
||||
else dwStyle = ES_CENTER;
|
||||
|
||||
rect.left += offset+4;
|
||||
rect.right = rect.left + GetColumnWidth(nCol) - 3 ;
|
||||
if(rect.right > rcClient.right)
|
||||
rect.right = rcClient.right;
|
||||
|
||||
dwStyle |= WS_BORDER|WS_CHILD|WS_VISIBLE|ES_AUTOHSCROLL;
|
||||
CEdit *pEdit = new CInPlaceEdit(nItem, nCol, GetItemText(nItem, nCol));
|
||||
pEdit->Create(dwStyle, rect, this, IDC_IPEDIT);
|
||||
|
||||
return pEdit;
|
||||
}
|
||||
|
||||
CComboBox* CListViewControl::ShowInPlaceList(int nItem, int nCol, CStringList &lstItems, int nSel)
|
||||
{
|
||||
if(!EnsureVisible(nItem, TRUE))
|
||||
return NULL;
|
||||
|
||||
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
|
||||
int nColumnCount = pHeader->GetItemCount();
|
||||
if(nCol >= nColumnCount || GetColumnWidth(nCol) < 10)
|
||||
return NULL;
|
||||
|
||||
int offset = 0;
|
||||
for(int i = 0; i < nCol; i++)
|
||||
offset += GetColumnWidth(i);
|
||||
|
||||
CRect rect;
|
||||
GetItemRect(nItem, &rect, LVIR_BOUNDS);
|
||||
|
||||
CRect rcClient;
|
||||
GetClientRect(&rcClient);
|
||||
if(offset + rect.left < 0 || offset + rect.left > rcClient.right)
|
||||
{
|
||||
CSize size;
|
||||
size.cx = offset + rect.left;
|
||||
size.cy = 0;
|
||||
Scroll( size );
|
||||
rect.left -= size.cx;
|
||||
}
|
||||
|
||||
rect.left += offset+4;
|
||||
rect.right = rect.left + GetColumnWidth(nCol) - 3 ;
|
||||
int height = rect.bottom-rect.top;
|
||||
rect.bottom += 5*height;
|
||||
if(rect.right > rcClient.right) rect.right = rcClient.right;
|
||||
|
||||
DWORD dwStyle = WS_BORDER|WS_CHILD|WS_VISIBLE|CBS_DROPDOWNLIST|CBS_DISABLENOSCROLL;
|
||||
|
||||
CComboBox *pList = new CInPlaceList(nItem, nCol, &lstItems, nSel);
|
||||
pList->Create(dwStyle, rect, this, IDC_IPEDIT);
|
||||
pList->SetItemHeight(-1, height);
|
||||
pList->SetHorizontalExtent(GetColumnWidth(nCol));
|
||||
|
||||
return pList;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// CListViewControl
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _CListViewControl
|
||||
#define _CListViewControl
|
||||
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#include "InPlaceEdit.h"
|
||||
#include "InPlaceList.h"
|
||||
|
||||
#define IDC_IPEDIT 4321
|
||||
|
||||
const unsigned int CT_NORMAL = 0;
|
||||
const unsigned int CT_EDIT = 1;
|
||||
const unsigned int CT_COMBO = 2;
|
||||
|
||||
class CListViewControl : public CListCtrl
|
||||
{
|
||||
public:
|
||||
CListViewControl();
|
||||
virtual ~CListViewControl();
|
||||
|
||||
protected:
|
||||
//{{AFX_MSG(CCharList)
|
||||
afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
|
||||
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
//}}AFX_MSG
|
||||
|
||||
bool SetColumnType(int ColNum, unsigned int Type = CT_EDIT);
|
||||
bool SetColumnStringList(int ColNum, CStringList &StringList);
|
||||
|
||||
int HitTestEx(CPoint &point, int *col) const;
|
||||
CEdit* EditSubLabel(int nItem, int nCol);
|
||||
CComboBox* ShowInPlaceList(int nItem, int nCol, CStringList &lstItems, int nSel);
|
||||
|
||||
private:
|
||||
unsigned int m_ColType[100];
|
||||
CStringList m_ColumnStringList[100];
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
#endif
|
||||
105
Server/ToolProject/AuthDBManager/SearchDlg.cpp
Normal file
105
Server/ToolProject/AuthDBManager/SearchDlg.cpp
Normal file
@@ -0,0 +1,105 @@
|
||||
// SearchDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "AuthDBManager.h"
|
||||
#include "SearchDlg.h"
|
||||
#include "AuthDBManagerDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CSearchDlg dialog
|
||||
|
||||
|
||||
CSearchDlg::CSearchDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CSearchDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CSearchDlg)
|
||||
m_SearchText = _T("");
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
||||
void CSearchDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CSearchDlg)
|
||||
DDX_Control(pDX, ID_SELECT_ALIGNTYPE, m_SelectAlignType);
|
||||
DDX_Control(pDX, ID_SELECT_ALIGN, m_SelectAlign);
|
||||
DDX_Control(pDX, ID_SELECT_SEARCH, m_SelectSearch);
|
||||
DDX_Text(pDX, ID_SEARCH_TEXT, m_SearchText);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CSearchDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CSearchDlg)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CSearchDlg message handlers
|
||||
|
||||
BOOL CSearchDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// TODO: Add extra initialization here
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// TODO: Add extra initialization here
|
||||
CAuthDBManagerApp* pAppWnd = (CAuthDBManagerApp*)AfxGetApp();
|
||||
char FieldName[256];
|
||||
|
||||
m_SelectSearch.InsertString(0, "----------------");
|
||||
LoadString(pAppWnd->m_Language, IDS_F2, FieldName, 256);
|
||||
m_SelectSearch.InsertString(1, FieldName);
|
||||
LoadString(pAppWnd->m_Language, IDS_F4, FieldName, 256);
|
||||
m_SelectSearch.InsertString(2, FieldName);
|
||||
|
||||
m_SelectSearch.SetCurSel(0);
|
||||
|
||||
m_SelectAlign.InsertString(0, "----------------");
|
||||
LoadString(pAppWnd->m_Language, IDS_F1, FieldName, 256);
|
||||
m_SelectAlign.InsertString(1, FieldName);
|
||||
LoadString(pAppWnd->m_Language, IDS_F2, FieldName, 256);
|
||||
m_SelectAlign.InsertString(2, FieldName);
|
||||
LoadString(pAppWnd->m_Language, IDS_F4, FieldName, 256);
|
||||
m_SelectAlign.InsertString(3, FieldName);
|
||||
LoadString(pAppWnd->m_Language, IDS_F14, FieldName, 256);
|
||||
m_SelectAlign.InsertString(4, FieldName);
|
||||
|
||||
m_SelectAlign.SetCurSel(0);
|
||||
|
||||
LoadString(pAppWnd->m_Language, IDS_A1, FieldName, 256);
|
||||
m_SelectAlignType.InsertString(0, FieldName);
|
||||
LoadString(pAppWnd->m_Language, IDS_A2, FieldName, 256);
|
||||
m_SelectAlignType.InsertString(1, FieldName);
|
||||
|
||||
m_SelectAlignType.SetCurSel(0);
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
void CSearchDlg::OnOK()
|
||||
{
|
||||
// TODO: Add extra validation here
|
||||
CAuthDBManagerApp* pAppWnd = (CAuthDBManagerApp*)AfxGetApp();
|
||||
CAuthDBManagerDlg* pDlgWnd = (CAuthDBManagerDlg*)pAppWnd->m_pMainWnd;
|
||||
|
||||
UpdateData();
|
||||
|
||||
pDlgWnd->m_SearchType = m_SelectSearch.GetCurSel();
|
||||
strcpy(pDlgWnd->m_Search, m_SearchText.GetBuffer(0));
|
||||
|
||||
pDlgWnd->m_Align = m_SelectAlign.GetCurSel();
|
||||
pDlgWnd->m_AlignType = m_SelectAlignType.GetCurSel();
|
||||
|
||||
CDialog::OnOK();
|
||||
}
|
||||
50
Server/ToolProject/AuthDBManager/SearchDlg.h
Normal file
50
Server/ToolProject/AuthDBManager/SearchDlg.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#if !defined(AFX_SEARCHDLG_H__A1FDDFCB_DBA3_4CCD_8F91_1E8ABFA035CA__INCLUDED_)
|
||||
#define AFX_SEARCHDLG_H__A1FDDFCB_DBA3_4CCD_8F91_1E8ABFA035CA__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// SearchDlg.h : header file
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CSearchDlg dialog
|
||||
|
||||
class CSearchDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CSearchDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CSearchDlg)
|
||||
enum { IDD = IDD_SEARCH };
|
||||
CComboBox m_SelectAlignType;
|
||||
CComboBox m_SelectAlign;
|
||||
CComboBox m_SelectSearch;
|
||||
CString m_SearchText;
|
||||
//}}AFX_DATA
|
||||
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CSearchDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CSearchDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
virtual void OnOK();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_SEARCHDLG_H__A1FDDFCB_DBA3_4CCD_8F91_1E8ABFA035CA__INCLUDED_)
|
||||
8
Server/ToolProject/AuthDBManager/StdAfx.cpp
Normal file
8
Server/ToolProject/AuthDBManager/StdAfx.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// AuthDBManager.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
|
||||
27
Server/ToolProject/AuthDBManager/StdAfx.h
Normal file
27
Server/ToolProject/AuthDBManager/StdAfx.h
Normal file
@@ -0,0 +1,27 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if !defined(AFX_STDAFX_H__40910505_0D0F_499D_85FE_F0441F208DE9__INCLUDED_)
|
||||
#define AFX_STDAFX_H__40910505_0D0F_499D_85FE_F0441F208DE9__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
#include <afxdisp.h> // MFC Automation classes
|
||||
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__40910505_0D0F_499D_85FE_F0441F208DE9__INCLUDED_)
|
||||
240
Server/ToolProject/AuthDBManager/UserList.cpp
Normal file
240
Server/ToolProject/AuthDBManager/UserList.cpp
Normal file
@@ -0,0 +1,240 @@
|
||||
// UserList.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "AuthDBManager.h"
|
||||
#include "UserList.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CUserList
|
||||
|
||||
CUserList::CUserList()
|
||||
{
|
||||
int Counter;
|
||||
char FieldName[256];
|
||||
CAuthDBManagerApp* pAppWnd = (CAuthDBManagerApp*)AfxGetApp();
|
||||
|
||||
for(Counter = 0; Counter < 14; Counter++)
|
||||
{
|
||||
LoadString(pAppWnd->m_Language, IDS_F1 + Counter, FieldName, 256);
|
||||
strcpy(m_FieldName[Counter], FieldName);
|
||||
}
|
||||
|
||||
for(Counter = 0; Counter < 2; Counter++)
|
||||
{
|
||||
LoadString(pAppWnd->m_Language, IDS_S1 + Counter, FieldName, 256);
|
||||
strcpy(m_Select[Counter], FieldName);
|
||||
}
|
||||
}
|
||||
|
||||
CUserList::~CUserList()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CUserList, CListCtrl)
|
||||
//{{AFX_MSG_MAP(CUserList)
|
||||
ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnCustomDraw)
|
||||
ON_WM_LBUTTONDBLCLK()
|
||||
ON_WM_HSCROLL()
|
||||
ON_WM_VSCROLL()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
void CUserList::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
CListViewControl::OnCustomDraw(pNMHDR, pResult);
|
||||
}
|
||||
|
||||
void CUserList::OnLButtonDblClk(UINT nFlags, CPoint point)
|
||||
{
|
||||
CListViewControl::OnLButtonDblClk(nFlags, point);
|
||||
}
|
||||
|
||||
void CUserList::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
|
||||
{
|
||||
// TODO: Add your message handler code here and/or call default
|
||||
|
||||
CListViewControl::OnHScroll(nSBCode, nPos, pScrollBar);
|
||||
}
|
||||
|
||||
void CUserList::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
|
||||
{
|
||||
// TODO: Add your message handler code here and/or call default
|
||||
|
||||
CListViewControl::OnVScroll(nSBCode, nPos, pScrollBar);
|
||||
}
|
||||
|
||||
//Interface////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// SetColumn [ public ]
|
||||
// - 테이블 컬럼 세팅
|
||||
//
|
||||
// Parameter :
|
||||
// 1st : 컬럼 정보
|
||||
//
|
||||
// Return:
|
||||
// 성공시 true
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
bool CUserList::SetColumn(void)
|
||||
{
|
||||
DWORD ExStyle = LVS_EX_FLATSB | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES;
|
||||
SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, ExStyle);
|
||||
|
||||
DWORD Style = GetWindowLong(m_hWnd, GWL_STYLE);
|
||||
Style |= LVS_EDITLABELS;
|
||||
|
||||
if (!SetWindowLong(m_hWnd, GWL_STYLE, Style))
|
||||
return false;
|
||||
|
||||
CStringList StringList;
|
||||
int IndexCounter = 0;
|
||||
|
||||
SetColumnType(IndexCounter, CT_NORMAL);
|
||||
InsertColumn(IndexCounter, m_FieldName[IndexCounter++], LVCFMT_CENTER, 4 * 10);
|
||||
|
||||
SetColumnType(IndexCounter, CT_EDIT);
|
||||
InsertColumn(IndexCounter, m_FieldName[IndexCounter++], LVCFMT_CENTER, 15 * 10);
|
||||
|
||||
SetColumnType(IndexCounter, CT_EDIT);
|
||||
InsertColumn(IndexCounter, m_FieldName[IndexCounter++], LVCFMT_CENTER, 15 * 10);
|
||||
|
||||
SetColumnType(IndexCounter, CT_EDIT);
|
||||
InsertColumn(IndexCounter, m_FieldName[IndexCounter++], LVCFMT_CENTER, 15 * 10);
|
||||
|
||||
SetColumnType(IndexCounter, CT_COMBO);
|
||||
StringList.AddTail(m_Select[0]);
|
||||
StringList.AddTail(m_Select[1]);
|
||||
SetColumnStringList(IndexCounter, StringList);
|
||||
InsertColumn(IndexCounter, m_FieldName[IndexCounter++], LVCFMT_CENTER, 5 * 10);
|
||||
|
||||
SetColumnType(IndexCounter, CT_EDIT);
|
||||
InsertColumn(IndexCounter, m_FieldName[IndexCounter++], LVCFMT_CENTER, 10 * 10);
|
||||
|
||||
SetColumnType(IndexCounter, CT_EDIT);
|
||||
InsertColumn(IndexCounter, m_FieldName[IndexCounter++], LVCFMT_CENTER, 15 * 10);
|
||||
|
||||
SetColumnType(IndexCounter, CT_EDIT);
|
||||
InsertColumn(IndexCounter, m_FieldName[IndexCounter++], LVCFMT_CENTER, 7 * 10);
|
||||
|
||||
SetColumnType(IndexCounter, CT_EDIT);
|
||||
InsertColumn(IndexCounter, m_FieldName[IndexCounter++], LVCFMT_CENTER, 30 * 10);
|
||||
|
||||
SetColumnType(IndexCounter, CT_EDIT);
|
||||
InsertColumn(IndexCounter, m_FieldName[IndexCounter++], LVCFMT_CENTER, 10 * 10);
|
||||
|
||||
SetColumnType(IndexCounter, CT_EDIT);
|
||||
InsertColumn(IndexCounter, m_FieldName[IndexCounter++], LVCFMT_CENTER, 10 * 10);
|
||||
|
||||
SetColumnType(IndexCounter, CT_EDIT);
|
||||
InsertColumn(IndexCounter, m_FieldName[IndexCounter++], LVCFMT_CENTER, 15 * 10);
|
||||
|
||||
SetColumnType(IndexCounter, CT_EDIT);
|
||||
InsertColumn(IndexCounter, m_FieldName[IndexCounter++], LVCFMT_CENTER, 8 * 10);
|
||||
|
||||
SetColumnType(IndexCounter, CT_EDIT);
|
||||
InsertColumn(IndexCounter, m_FieldName[IndexCounter++], LVCFMT_CENTER, 16 * 10);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//Interface////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// AddUserRow [ public ]
|
||||
// - 줄 추가
|
||||
//
|
||||
// Parameter :
|
||||
// 1st : 컬럼 정보
|
||||
//
|
||||
// Return:
|
||||
// 성공시 true
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
bool CUserList::AddUserRow(LPSELECT_AUTHUSER_TABLE UserTable_In)
|
||||
{
|
||||
CString strItem;
|
||||
int Counter = 1;
|
||||
int Index;
|
||||
|
||||
Index = GetItemCount();
|
||||
|
||||
strItem.Format("%d", UserTable_In->UID);
|
||||
InsertItem(Index, strItem);
|
||||
strItem.Format("%s", UserTable_In->AuthID);
|
||||
SetItemText(Index, Counter++, strItem);
|
||||
strItem.Format("%s", UserTable_In->AuthPW);
|
||||
SetItemText(Index, Counter++, strItem);
|
||||
strItem.Format("%s", UserTable_In->Name);
|
||||
SetItemText(Index, Counter++, strItem);
|
||||
strItem.Format("%s", m_Select[UserTable_In->Sex]);
|
||||
SetItemText(Index, Counter++, strItem);
|
||||
strItem.Format("%s", UserTable_In->Birth);
|
||||
SetItemText(Index, Counter++, strItem);
|
||||
strItem.Format("%s", UserTable_In->IDNumber);
|
||||
SetItemText(Index, Counter++, strItem);
|
||||
strItem.Format("%s", UserTable_In->ZipCode);
|
||||
SetItemText(Index, Counter++, strItem);
|
||||
strItem.Format("%s", UserTable_In->Address);
|
||||
SetItemText(Index, Counter++, strItem);
|
||||
strItem.Format("%s", UserTable_In->Mobile);
|
||||
SetItemText(Index, Counter++, strItem);
|
||||
strItem.Format("%s", UserTable_In->Phone);
|
||||
SetItemText(Index, Counter++, strItem);
|
||||
strItem.Format("%s", UserTable_In->Email);
|
||||
SetItemText(Index, Counter++, strItem);
|
||||
strItem.Format("%s", UserTable_In->Job);
|
||||
SetItemText(Index, Counter++, strItem);
|
||||
strItem.Format("%04d/%02d/%02d %02d:%02d:%02d", UserTable_In->Reg_Date.Year, UserTable_In->Reg_Date.Month, UserTable_In->Reg_Date.Day, UserTable_In->Reg_Date.Hour, UserTable_In->Reg_Date.Minute, UserTable_In->Reg_Date.Second);
|
||||
SetItemText(Index, Counter++, strItem);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CUserList::GetUserRow(unsigned long Item_In, LPUPDATE_AUTHUSER_TABLE Table_Out)
|
||||
{
|
||||
int Counter = 0;
|
||||
char strItemText[256];
|
||||
CString DateText, YearText, MonthText, DayText, HourText, MinuteText, SecondText;
|
||||
|
||||
GetItemText(Item_In, Counter++, strItemText, 256);
|
||||
Table_Out->UID = atoi(strItemText);
|
||||
GetItemText(Item_In, Counter++, strItemText, 256);
|
||||
strncpy(Table_Out->AuthID, strItemText, 16);
|
||||
GetItemText(Item_In, Counter++, strItemText, 256);
|
||||
strncpy(Table_Out->AuthPW, strItemText, 16);
|
||||
GetItemText(Item_In, Counter++, strItemText, 256);
|
||||
strncpy(Table_Out->Name, strItemText, 16);
|
||||
|
||||
GetItemText(Item_In, Counter++, strItemText, 256);
|
||||
if(!strcmp(strItemText, m_Select[0]))
|
||||
Table_Out->Sex = 0;
|
||||
else
|
||||
Table_Out->Sex = 1;
|
||||
|
||||
GetItemText(Item_In, Counter++, strItemText, 256);
|
||||
strncpy(Table_Out->Birth, strItemText, 20);
|
||||
GetItemText(Item_In, Counter++, strItemText, 256);
|
||||
strncpy(Table_Out->IDNumber, strItemText, 15);
|
||||
GetItemText(Item_In, Counter++, strItemText, 256);
|
||||
strncpy(Table_Out->ZipCode, strItemText, 12);
|
||||
GetItemText(Item_In, Counter++, strItemText, 256);
|
||||
strncpy(Table_Out->Address, strItemText, 80);
|
||||
GetItemText(Item_In, Counter++, strItemText, 256);
|
||||
strncpy(Table_Out->Mobile, strItemText, 20);
|
||||
GetItemText(Item_In, Counter++, strItemText, 256);
|
||||
strncpy(Table_Out->Phone, strItemText, 20);
|
||||
GetItemText(Item_In, Counter++, strItemText, 256);
|
||||
strncpy(Table_Out->Email, strItemText, 50);
|
||||
GetItemText(Item_In, Counter++, strItemText, 256);
|
||||
strncpy(Table_Out->Job, strItemText, 20);
|
||||
GetItemText(Item_In, Counter++, strItemText, 256);
|
||||
|
||||
return true;
|
||||
}
|
||||
61
Server/ToolProject/AuthDBManager/UserList.h
Normal file
61
Server/ToolProject/AuthDBManager/UserList.h
Normal file
@@ -0,0 +1,61 @@
|
||||
#if !defined(AFX_USERLIST_H__CA827D8B_2DCE_47F1_8895_25056B67CD92__INCLUDED_)
|
||||
#define AFX_USERLIST_H__CA827D8B_2DCE_47F1_8895_25056B67CD92__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
// UserList.h : header file
|
||||
//
|
||||
|
||||
#include "AuthDBManager.h"
|
||||
#include "ListViewControl\ListViewControl.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CUserList window
|
||||
|
||||
class CUserList : public CListViewControl
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CUserList();
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
// Operations
|
||||
public:
|
||||
char m_FieldName[21][20];
|
||||
char m_Select[2][10];
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CUserList)
|
||||
afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
|
||||
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
|
||||
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
virtual ~CUserList();
|
||||
|
||||
bool SetColumn(void);
|
||||
bool AddUserRow(LPSELECT_AUTHUSER_TABLE UserTable_In);
|
||||
bool GetUserRow(unsigned long Item_In, LPUPDATE_AUTHUSER_TABLE Table_Out);
|
||||
|
||||
// Generated message map functions
|
||||
protected:
|
||||
//{{AFX_MSG(CUserList)
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
//}}AFX_MSG
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_USERLIST_H__CA827D8B_2DCE_47F1_8895_25056B67CD92__INCLUDED_)
|
||||
BIN
Server/ToolProject/AuthDBManager/icon.ico
Normal file
BIN
Server/ToolProject/AuthDBManager/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
25
Server/ToolProject/AuthDBManager/plugin.h
Normal file
25
Server/ToolProject/AuthDBManager/plugin.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <windows.h>
|
||||
|
||||
#if !defined PlugIn_Strunt
|
||||
#define PlugIn_Strunt
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char CreaterName[255];
|
||||
char CreaterEmail[255];
|
||||
char CreaterHomepage[255];
|
||||
}CREATERINFO;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool PlugInfo;
|
||||
char PlugInVer[255];
|
||||
char PlugInName[255];
|
||||
char PlugInLastUpdate[255];
|
||||
CREATERINFO PlugInCreator;
|
||||
}PLUGININFO;
|
||||
|
||||
#endif
|
||||
|
||||
typedef PLUGININFO (*GET_PLUGIN_INFO) (void);
|
||||
|
||||
13
Server/ToolProject/AuthDBManager/res/AuthDBManager.rc2
Normal file
13
Server/ToolProject/AuthDBManager/res/AuthDBManager.rc2
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// AuthDBManager.RC2 - resources Microsoft Visual C++ does not edit directly
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Add manually edited resources here...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
BIN
Server/ToolProject/AuthDBManager/res/Logo.bmp
Normal file
BIN
Server/ToolProject/AuthDBManager/res/Logo.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 104 KiB |
89
Server/ToolProject/AuthDBManager/resource.h
Normal file
89
Server/ToolProject/AuthDBManager/resource.h
Normal file
@@ -0,0 +1,89 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by AuthDBManager.rc
|
||||
//
|
||||
#define IDM_ABOUTBOX 0x0010
|
||||
#define IDD_ABOUTBOX 100
|
||||
#define IDS_ABOUTBOX 101
|
||||
#define IDD_AuthDBManager_DIALOG 102
|
||||
#define IDS_F1 102
|
||||
#define IDS_F2 103
|
||||
#define IDS_F3 104
|
||||
#define IDS_F4 105
|
||||
#define IDS_F5 106
|
||||
#define IDS_F6 107
|
||||
#define IDS_F7 108
|
||||
#define IDS_F8 109
|
||||
#define IDS_F9 110
|
||||
#define IDS_F10 111
|
||||
#define IDS_F11 112
|
||||
#define IDS_F12 113
|
||||
#define IDS_F13 114
|
||||
#define IDS_F14 115
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDR_MENU 130
|
||||
#define IDD_CONNECT 131
|
||||
#define IDB_LEDS 132
|
||||
#define IDB_LOGO 133
|
||||
#define IDD_SEARCH 134
|
||||
#define IDS_S1 150
|
||||
#define IDS_S2 151
|
||||
#define IDS_A1 152
|
||||
#define IDS_A2 153
|
||||
#define ID_USER_LIST 1000
|
||||
#define ID_CHAR_LIST 1000
|
||||
#define ID_ERROR_LOG 1001
|
||||
#define ID_SELECT_TYPE 1002
|
||||
#define ID_ID 1002
|
||||
#define ID_DATASOURCE_NAME 1003
|
||||
#define ID_PASSWORD 1003
|
||||
#define ID_SERVER_NAME 1004
|
||||
#define ID_CONNECTION_LED 1004
|
||||
#define ID_DATABASE_NAME 1005
|
||||
#define ID_QEURY_LED 1005
|
||||
#define ID_AUTHUSER_NAME 1006
|
||||
#define ID_SELECTED_ROW 1006
|
||||
#define ID_AUTHUSER_PASS 1007
|
||||
#define ID_SELECTED_COUNT 1007
|
||||
#define ID_SELECTED_UID 1008
|
||||
#define ID_SEX 1009
|
||||
#define ID_NAME 1011
|
||||
#define ID_PLUGIN_LIST 1011
|
||||
#define ID_LASTUPDATE 1012
|
||||
#define ID_BIRTH 1013
|
||||
#define ID_CREATER 1013
|
||||
#define ID_SEARCH_TEXT 1013
|
||||
#define ID_IDNUMBER 1014
|
||||
#define ID_SELECT_SEARCH 1014
|
||||
#define ID_ZIPCODE 1015
|
||||
#define ID_SELECT_ALIGN 1015
|
||||
#define ID_ADDRESS 1016
|
||||
#define ID_SELECT_ALIGNTYPE 1016
|
||||
#define IDC_DEFAULT 1017
|
||||
#define IDC_BUTTON1 1018
|
||||
#define ID_MOBILE 1019
|
||||
#define ID_PHONE 1020
|
||||
#define ID_JOB 1021
|
||||
#define ID_EMAIL 1022
|
||||
#define ID_SELECTED_ID 1024
|
||||
#define ID_TOTAL_ROW 1025
|
||||
#define ID_CONNECT 32771
|
||||
#define ID_DISCONNECT 32772
|
||||
#define ID_ABOUT 32773
|
||||
#define ID_ADD_USER 32774
|
||||
#define ID_DELETE_USER 32775
|
||||
#define ID_INIT_LOGINTIME 32776
|
||||
#define ID_REFESH 32777
|
||||
#define ID_SEARCH 32778
|
||||
#define ID_AUTHTEST 32779
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 135
|
||||
#define _APS_NEXT_COMMAND_VALUE 32780
|
||||
#define _APS_NEXT_CONTROL_VALUE 1020
|
||||
#define _APS_NEXT_SYMED_VALUE 102
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user