137{
140 {
141
143 return;
144 }
145
150
151 SQLConnection* pSQLConn = m_pSQLConnPool->getConnection();
152 if (!pSQLConn) {
153 printError(ctx, L"데이터베이스 서버에 연결할 수 없습니다.");
154 return;
155 }
156
157 try {
160 }
161
162 Writer& out = ctx.
writer();
163 EShopSession session(ctx, pSQLConn);
164 switch(session.command())
165 {
167 if (session.login(ctx.__formMap))
169 else
171 break;
173 session.logout();
175 }
176
177
178
179 printPageHeader(out, session);
180
181 switch(session.command()) {
183 onViewProduct(ctx, session);
184 break;
185 }
187 printLoginForm(out);
188 break;
189 }
191 onViewShoppingBasket(ctx, session);
192 break;
193 }
196 onViewOrder(ctx, session);
197 break;
198 }
200 VisitorBook vb(
203 L"vcm",
204 *this);
205 if (!vb.onVisitorBook(ctx, out, pSQLConn)) {
206 printFile(out, L"notfound.html");
207 }
208 break;
209 }
211 if (session.isAdmin())
212 onViewSalesReport(ctx, session);
213 else
214 printLoginForm(out);
215 break;
216 }
218 session.onViewSessions(
219 ctx.__queryMap,
220 out,
223 L"vses",
224 *this
225 );
226 break;
227 }
229 printFile(out, L"about.html");
230 break;
231 }
232 default: {
233 printFile(out, L"notfound.html");
234 }
235 }
236
239 }
240 m_pSQLConnPool->release(pSQLConn);
242
243 TextTemplate tplFooter = *m_pFoot;
244 out << tplFooter;
245
246 ctx.setContentType(L"text/html");
248 }
249 catch (Exception* _e) {
250 if (pSQLConn) {
253 }
254 m_pSQLConnPool->release(pSQLConn);
255 }
256 throw _e;
257 }
258}
@ CM_VIEW_SHOPPING_BASKET
@ HTTP_STATUS_METHOD_NOT_ALLOWED
#define __DCL_ASSERT(expr)
String CharsetConvertException *bool canTransact() const
void rollbackTrans() __DCL_THROWS1(SQLException *)
bool inTransaction() const
void commitTrans() __DCL_THROWS1(SQLException *)
void CharsetConvertException *void startTrans() __DCL_THROWS1(SQLException *)