Пример #1
0
        public ActionResult Delete(string responseId)
        {
            var rootFormId      = GetStringSessionValue(UserSession.Key.RootFormId);
            int userId          = GetIntSessionValue(UserSession.Key.UserId);
            int orgId           = GetIntSessionValue(UserSession.Key.CurrentOrgId);
            var responseContext = new ResponseContext
            {
                ResponseId     = responseId,
                RootResponseId = responseId,
                FormId         = rootFormId,
                UserOrgId      = orgId,
                UserId         = userId
            }.ResolveMetadataDependencies() as ResponseContext;

            SurveyAnswerRequest surveyAnswerRequest = responseContext.ToSurveyAnswerRequest();

            surveyAnswerRequest.SurveyAnswerList.Add(responseContext.ToSurveyAnswerDTOLite());
            surveyAnswerRequest.Criteria.UserOrganizationId = orgId;
            surveyAnswerRequest.Criteria.UserId             = userId;
            surveyAnswerRequest.Criteria.IsSqlProject       = GetBoolSessionValue(UserSession.Key.IsSqlProject);
            surveyAnswerRequest.Criteria.SurveyId           = rootFormId;
            surveyAnswerRequest.Criteria.StatusChangeReason = RecordStatusChangeReason.DeleteResponse;
            surveyAnswerRequest.Action = RequestAction.Delete;
            SurveyAnswerResponse surveyAnswerResponse = _surveyFacade.DeleteResponse(surveyAnswerRequest);

            return(Json(string.Empty));
        }