Engage.Survey.Entities.SurveyRepository.CreateResponseHeader C# (CSharp) Method

CreateResponseHeader() public method

Creates a new ResponseHeader instance, to be persisted when SubmitChanges is called.
public CreateResponseHeader ( int userId ) : ResponseHeader
userId int The ID of the user creating the instance.
return ResponseHeader
        public ResponseHeader CreateResponseHeader(int userId)
        {
            var header = new ResponseHeader
                             {
                                     CreatedBy = userId,
                                     RevisingUser = userId,
                                     UserId = userId,
                                     RevisionDate = DateTime.Now,
                                     CreationDate = DateTime.Now
                             };

            this.Context.ResponseHeaders.InsertOnSubmit(header);

            return header;
        }

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        /// Creates the response header.
        /// </summary>
        /// <param name="userId">The user id.</param>
        /// <returns>The ID of the created <see cref="ResponseHeader"/></returns>
        private static int CreateResponseHeader(int userId)
        {
            var surveyRepository = new SurveyRepository();
            var header           = surveyRepository.CreateResponseHeader(userId);

            surveyRepository.SubmitChanges();

            return(header.ResponseHeaderId);
        }
All Usage Examples Of Engage.Survey.Entities.SurveyRepository::CreateResponseHeader