4 |
#include "stdafx.h" |
#include "stdafx.h" |
5 |
#include "h6-udlånssystem.h" |
#include "h6-udlånssystem.h" |
6 |
#include "h6-udlånssystemDlg.h" |
#include "h6-udlånssystemDlg.h" |
7 |
|
#include ".\h6-udlånssystemdlg.h" |
8 |
|
|
9 |
|
#include "commonstorage.h" |
10 |
|
#include "databaselayer.h" |
11 |
|
|
12 |
#ifdef _DEBUG |
#ifdef _DEBUG |
13 |
#define new DEBUG_NEW |
#define new DEBUG_NEW |
58 |
void Ch6udlnssystemDlg::DoDataExchange(CDataExchange* pDX) |
void Ch6udlnssystemDlg::DoDataExchange(CDataExchange* pDX) |
59 |
{ |
{ |
60 |
CDialog::DoDataExchange(pDX); |
CDialog::DoDataExchange(pDX); |
61 |
|
DDX_Control(pDX, IDC_TAB, m_tabs); |
62 |
} |
} |
63 |
|
|
64 |
BEGIN_MESSAGE_MAP(Ch6udlnssystemDlg, CDialog) |
BEGIN_MESSAGE_MAP(Ch6udlnssystemDlg, CDialog) |
66 |
ON_WM_PAINT() |
ON_WM_PAINT() |
67 |
ON_WM_QUERYDRAGICON() |
ON_WM_QUERYDRAGICON() |
68 |
//}}AFX_MSG_MAP |
//}}AFX_MSG_MAP |
69 |
|
ON_COMMAND(ID_HELP_ABOUT, OnHelpAbout) |
70 |
|
ON_COMMAND(ID_FILE_EXIT, OnFileExit) |
71 |
END_MESSAGE_MAP() |
END_MESSAGE_MAP() |
72 |
|
|
73 |
|
|
76 |
BOOL Ch6udlnssystemDlg::OnInitDialog() |
BOOL Ch6udlnssystemDlg::OnInitDialog() |
77 |
{ |
{ |
78 |
CDialog::OnInitDialog(); |
CDialog::OnInitDialog(); |
79 |
|
CWaitCursor wait; |
80 |
|
|
81 |
// Add "About..." menu item to system menu. |
// Add "About..." menu item to system menu. |
82 |
|
|
101 |
SetIcon(m_hIcon, TRUE); // Set big icon |
SetIcon(m_hIcon, TRUE); // Set big icon |
102 |
SetIcon(m_hIcon, FALSE); // Set small icon |
SetIcon(m_hIcon, FALSE); // Set small icon |
103 |
|
|
104 |
|
m_tabs.InsertItem(0,"Search"); |
105 |
|
m_tabs.InsertItem(1,"Result"); |
106 |
|
m_tabs.InsertItem(2,"Administration"); |
107 |
|
m_tabs.Init(); |
108 |
|
m_tabs.SetCurSel(0); |
109 |
|
|
110 |
|
|
111 |
|
try { |
112 |
|
DatabaseLayer *dbl = new DatabaseLayer; |
113 |
|
CommonStorage::Instance()->setDBLayer(dbl); |
114 |
|
} catch (...) { |
115 |
|
MessageBox(CString("Could not establish connection to the database server\r\n") + |
116 |
|
"Please contact your network administrator\r\n" + |
117 |
|
"(This application shuts down automatically)"); |
118 |
|
OnOK(); |
119 |
|
} |
120 |
|
|
121 |
|
|
122 |
// TODO: Add extra initialization here |
// TODO: Add extra initialization here |
123 |
|
|
124 |
return TRUE; // return TRUE unless you set the focus to a control |
return TRUE; // return TRUE unless you set the focus to a control |
172 |
{ |
{ |
173 |
return static_cast<HCURSOR>(m_hIcon); |
return static_cast<HCURSOR>(m_hIcon); |
174 |
} |
} |
175 |
|
|
176 |
|
void Ch6udlnssystemDlg::OnHelpAbout() |
177 |
|
{ |
178 |
|
MessageBox("DA6H :: Udlånssystem\r\nLavet af:\r\nKevin, Hedin & Torben"); |
179 |
|
} |
180 |
|
|
181 |
|
void Ch6udlnssystemDlg::OnFileExit() |
182 |
|
{ |
183 |
|
// TODO: Add your command handler code here |
184 |
|
OnOK(); |
185 |
|
} |