Ejemplo n.º 1
0
        public int InsertDirectComment(DirectCommentRequest directCommentRequest)
        {
            var parameterList = new List <SqlParameter>();

            parameterList.Add(new SqlParameter("@SurveyId", directCommentRequest.SurveyId));
            parameterList.Add(new SqlParameter("@InputSource", 3));
            parameterList.Add(new SqlParameter("@CompletionDate", DateTime.Now));
            parameterList.Add(new SqlParameter("@TextResponse", directCommentRequest.Comment));
            var parameters   = parameterList.ToArray();
            var respondentId = HaloDatabase.ExecuteNonQuery("dbo.InsertDirectComment", parameters);

            return(respondentId);
        }
Ejemplo n.º 2
0
        public IHttpActionResult PostInsertDirectComment(DirectCommentRequest directCommentRequest)
        {
            dynamic responseJson = new ExpandoObject();

            try
            {
                var respondentId = _reportsServices.InsertDirectComment(directCommentRequest);
                if (respondentId > 0)
                {
                    responseJson.Message = "Comment recorded successfully";
                    return(Content(HttpStatusCode.OK, responseJson));
                }
            }
            catch (Exception ex)
            {
                _fileLogger.LogError(ex);
            }
            responseJson.Message = "Comment recorded successfully";
            return(Content(HttpStatusCode.OK, responseJson));
        }