View Single Post
  #5 (permalink)  
Old 04-30-2008, 06:15 PM
ncushing ncushing is offline
Administrator
 
Join Date: Mar 2007
Location: Prezza Technologies
Posts: 171
Default

Sorry for the delay...we've been busy working on getting 4.5 out the door.

To create a response, you'll first need to load the response template:

Code:
ResponseTemplate rt = ResponseTemplateManager.GetResponseTemplate(1234);
Next, you'll create an instance of a response and initialize it:

Code:
//Create a response object
Response response = rt.CreateResponse("en-US");

//Initialize the new response
ExtendedPrincipal respondent = (ExtendedPrincipal)UserManager.GetCurrentPrincipal();
string userIp = "198.168.0.1";
string userNTLoginName = string.Empty;

//Initialize is done only one time per response
response.Initialize(userIp, userNTLoginName, "en-US", respondent);

//After initialize, the response ID and GUID are available
Guid responseGuid = response.GUID;
long responseId = response.ID;

//To load an existing response:
ResponseTemplate rt = ResponseTemplateManager.GetResponseTemplate(1234);

Response response = rt.CreateResponse("en-US");
response.Restore(responseGuid);
...to be continued
Reply With Quote