1 |
// h6-udlånssystemDlg.cpp : implementation file |
/* |
2 |
// |
* Developed by Torben H. Nielsen |
3 |
|
*/ |
4 |
|
|
5 |
|
|
6 |
#include "stdafx.h" |
#include "stdafx.h" |
7 |
#include "h6-udlånssystem.h" |
#include "h6-udlånssystem.h" |
8 |
#include "h6-udlånssystemDlg.h" |
#include "h6-udlånssystemDlg.h" |
9 |
#include ".\h6-udlånssystemdlg.h" |
#include ".\h6-udlånssystemdlg.h" |
10 |
|
|
11 |
|
#include "commonstorage.h" |
12 |
|
#include "databaselayer.h" |
13 |
|
#include "microsoftdblayer.h" |
14 |
|
#include "mysqllayer.h" |
15 |
|
|
16 |
#ifdef _DEBUG |
#ifdef _DEBUG |
17 |
#define new DEBUG_NEW |
#define new DEBUG_NEW |
18 |
#endif |
#endif |
62 |
void Ch6udlnssystemDlg::DoDataExchange(CDataExchange* pDX) |
void Ch6udlnssystemDlg::DoDataExchange(CDataExchange* pDX) |
63 |
{ |
{ |
64 |
CDialog::DoDataExchange(pDX); |
CDialog::DoDataExchange(pDX); |
65 |
|
DDX_Control(pDX, IDC_TAB, m_tabs); |
66 |
} |
} |
67 |
|
|
68 |
BEGIN_MESSAGE_MAP(Ch6udlnssystemDlg, CDialog) |
BEGIN_MESSAGE_MAP(Ch6udlnssystemDlg, CDialog) |
71 |
ON_WM_QUERYDRAGICON() |
ON_WM_QUERYDRAGICON() |
72 |
//}}AFX_MSG_MAP |
//}}AFX_MSG_MAP |
73 |
ON_COMMAND(ID_HELP_ABOUT, OnHelpAbout) |
ON_COMMAND(ID_HELP_ABOUT, OnHelpAbout) |
74 |
|
ON_COMMAND(ID_FILE_EXIT, OnFileExit) |
75 |
END_MESSAGE_MAP() |
END_MESSAGE_MAP() |
76 |
|
|
77 |
|
|
80 |
BOOL Ch6udlnssystemDlg::OnInitDialog() |
BOOL Ch6udlnssystemDlg::OnInitDialog() |
81 |
{ |
{ |
82 |
CDialog::OnInitDialog(); |
CDialog::OnInitDialog(); |
83 |
|
CWaitCursor wait; |
84 |
|
|
85 |
// Add "About..." menu item to system menu. |
// Add "About..." menu item to system menu. |
86 |
|
|
105 |
SetIcon(m_hIcon, TRUE); // Set big icon |
SetIcon(m_hIcon, TRUE); // Set big icon |
106 |
SetIcon(m_hIcon, FALSE); // Set small icon |
SetIcon(m_hIcon, FALSE); // Set small icon |
107 |
|
|
108 |
|
m_tabs.InsertItem(0,"Search"); |
109 |
|
m_tabs.InsertItem(1,"Result"); |
110 |
|
m_tabs.InsertItem(2,"Administration"); |
111 |
|
m_tabs.Init(); |
112 |
|
m_tabs.SetCurSel(0); |
113 |
|
|
114 |
|
|
115 |
|
try { |
116 |
|
//DatabaseLayer *dbl = new DatabaseLayer; |
117 |
|
DatabaseLayer *dbl = new MySQLLayer; |
118 |
|
CommonStorage::Instance()->setDBLayer(dbl); |
119 |
|
} catch (...) { |
120 |
|
MessageBox(CString("Could not establish connection to the database server\r\n") + |
121 |
|
"Please contact your network administrator\r\n" + |
122 |
|
"(This application shuts down automatically)"); |
123 |
|
OnOK(); |
124 |
|
} |
125 |
|
|
126 |
|
|
127 |
// TODO: Add extra initialization here |
// TODO: Add extra initialization here |
128 |
|
|
129 |
return TRUE; // return TRUE unless you set the focus to a control |
return TRUE; // return TRUE unless you set the focus to a control |
180 |
|
|
181 |
void Ch6udlnssystemDlg::OnHelpAbout() |
void Ch6udlnssystemDlg::OnHelpAbout() |
182 |
{ |
{ |
183 |
MessageBox("DA6H :: Udlånssystem\r\nLavet af:\r\nKevin, Hedin & Torben"); |
CAboutDlg about; |
184 |
|
about.DoModal(); |
185 |
|
} |
186 |
|
|
187 |
|
void Ch6udlnssystemDlg::OnFileExit() |
188 |
|
{ |
189 |
|
// TODO: Add your command handler code here |
190 |
|
OnOK(); |
191 |
} |
} |