private void BtnStartSurvey_Click(object sender, EventArgs e) { Guid currentResponseGuid = GetCurrentResponseGuid(); if (!chkUseOldResponses.Checked) { if (currentResponseGuid != Guid.Empty) { SurveyResponse.Delete(currentResponseGuid); } SurveyResponse response = new SurveyResponse(); response.Complete = false; response.SurveyGuid = survey.SurveyGuid; if (siteUser != null) { response.UserGuid = siteUser.UserGuid; } response.Save(); currentResponseGuid = response.ResponseGuid; } SetCookie(currentResponseGuid); WebUtils.SetupRedirect( this, $"{SiteRoot}/Survey/CompleteSurvey.aspx?SurveyGuid={SurveyGuid.ToString()}&pageid={PageId.ToInvariantString()}&mid={ModuleId.ToInvariantString()}&SurveyPageGuid={surveyPageGuid.ToString()}"); }
private void SubmitResponse() { SurveyResponse response = new SurveyResponse(GetCurrentResponseGuid()); response.SubmissionDate = DateTime.UtcNow; response.Complete = true; SiteUser siteUser = SiteUtils.GetCurrentSiteUser(); if (siteUser != null) { response.UserGuid = siteUser.UserGuid; } response.Save(); SetCookie(Guid.Empty); }