SecretAction.js
Summary
Contains SecretAction class.
This is part of Troika.ASP Framework - web development MVC framework for ASP 3.0.
Please visit www.troika-asp.com for more details.
Version: $Revision: 1.3 $
Author: Pavel Chuchev pav@troika-asp.com
|
Class Summary
|
| SecretAction |
This is SecretAction class command implementation. |
SecretAction.prototype = new Command();
SecretAction.prototype.constructor = SecretAction;
SecretAction.prototype.init = function (config) {
Command.prototype.init.call(this, config);
return this;
};
function SecretAction(config) {
if (arguments.length) {
this.init(config);
}
}
SecretAction.prototype.execute = function (environment, secretForm) {
function saveData(connStr, loginVO, secretForm) {
var dao = new LoginDAO(connStr);
loginVO.assign(secretForm);
dao.update(loginVO);
}
function getLoginVO(connStr, loginId) {
var dao = new LoginDAO(connStr);
return dao.findByLoginId(loginId);
}
function getMemberVO(connStr, memberId) {
var dao = new MemberDAO(connStr);
return dao.findByMemberId(memberId);
}
var result = new ResponseContext(this.findForward(secretForm, "success"));
var connStr = this.getConnectionString("helloworld-db");
var loginVO = getLoginVO(connStr, environment.session.get("loginId"));
if (environment.request.get("submit")) {
saveData(connStr, loginVO, secretForm);
}
result.models.put("loginVO", loginVO);
result.models.put("memberVO", getMemberVO(connStr, environment.session.get("memberId")));
return result;
};
www.troika-asp.com
Documentation generated on Sun Jun 15 17:59:32 2008