134{
137 ) {
138
140 return;
141 }
142
147
148 SQLConnection* pSQLConn = __pSQLConnPool->getConnection();
149 if (!pSQLConn) {
150 printError(ctx, L"데이터베이스 서버에 연결할 수 없습니다.");
151 return;
152 }
153
154 try {
157 }
158
159 Writer& out = ctx.
writer();
160 EShopSession session(ctx, pSQLConn);
161 switch(session.command()) {
163 if (session.login(ctx.__formMap))
165 else
167 break;
168 }
170 session.logout();
172 }
173 }
174
175
176
177 printPageHeader(out, session);
178
179 switch(session.command()) {
181 onViewProduct(ctx, session);
182 break;
183 }
185 printLoginForm(out);
186 break;
187 }
189 onViewShoppingBasket(ctx, session);
190 break;
191 }
194 onViewOrder(ctx, session);
195 break;
196 }
198 VisitorBook vb(
201 L"vcm",
202 *this);
203 if (!vb.onVisitorBook(ctx, out, pSQLConn)) {
204 printFile(out, L"notfound.html");
205 }
206 break;
207 }
209 if (session.isAdmin())
210 onViewSalesReport(ctx, session);
211 else
212 printLoginForm(out);
213 break;
214 }
216 session.onViewSessions(
217 ctx.__queryMap,
218 out,
221 L"vses",
222 *this
223 );
224 break;
225 }
227 printFile(out, L"about.html");
228 break;
229 }
230 default: {
231 printFile(out, L"notfound.html");
232 }
233 }
234
237 }
238 __pSQLConnPool->release(pSQLConn);
240
241 TextTemplate tplFooter = *__pFoot;
242 out << tplFooter;
243
244 ctx.setContentType(L"text/html");
246 }
247 catch (Exception* _e) {
248 if (pSQLConn) {
251 }
252 __pSQLConnPool->release(pSQLConn);
253 }
254 throw _e;
255 }
256}
@ CM_VIEW_SHOPPING_BASKET
@ HTTP_STATUS_METHOD_NOT_ALLOWED
#define __DCL_ASSERT(expr)
void rollbackTrans() __DCL_THROWS1(SQLException *)
bool inTransaction() const
void commitTrans() __DCL_THROWS1(SQLException *)
void startTrans() __DCL_THROWS1(SQLException *)