Ejemplo n.º 1
0
        /// <summary>
        /// Post the results of the JSI quiz.
        /// </summary>
        /// <param name="jsiQuizModel">single JSIQuizModel object</param>
        /// <returns>?</returns>
        public JSIQuizListModel PostJSIResponse(JSIQuizModel jsiQuizModel)
        {
            const string logMethodName = ".PostJSIResponse(JSIQuizModel jsiQuizModel) - ";

            Log.Info(logMethodName + "Begin Method");

            var jList = new JSIQuizListModel();

            try
            {
                var jsiQuizResult = IntegrationLoader.LoadDependency <ISaltServiceAgent>("saltServiceAgent").PostJSIResponse(jsiQuizModel.ToDataContract()).ToDomainObject();
                jList = new JSIQuizListModel(jsiQuizResult);
            }
            catch (Exception ex)
            {
                Log.Error(logMethodName + "Exception =>" + ex.ToString());
                throw new SurveyOperationException("Web Survey Service - ASA.Web.Services.SurveyService.SurveyAdapter.GetJSISchoolList()", ex);
            }

            Log.Info(logMethodName + "End Method");
            return(jList);
        }
Ejemplo n.º 2
0
        public JSIQuizListModel PostJSIResponse(JSIQuizModel jsiQuizModel)
        {
            const string logMethodName = ".PostJSIResponse(JSIQuizModel jsiQuizModel) - ";

            _log.Debug(logMethodName + "Begin Method");

            JSIQuizListModel jList = null;

            try
            {
                if (_surveyAdapter == null)
                {
                    _log.Error(logMethodName + _surveyAdapterExceptionMessage);
                    throw new SurveyBadDataException("Null adapter in ASA.Web.Services.SurveyService.PostJSIResponse()");
                }

                if (string.IsNullOrEmpty(jsiQuizModel.MajorId) || string.IsNullOrEmpty(jsiQuizModel.SchoolId))
                {
                    _log.Info(logMethodName + "MajorId or SchoolId was not provided to access PostJSIResponse");
                    jList = new JSIQuizListModel();
                    var error = new ErrorModel("MajorId or SchoolId was not provided to access PostJSIResponse", "Web Survey Service");
                    jList.ErrorList.Add(error);
                }
                else
                {
                    jList = _surveyAdapter.PostJSIResponse(jsiQuizModel);
                }

                return(jList);
            }
            catch (Exception ex)
            {
                _log.Error(logMethodName + ": Exception => " + ex.ToString());
                return(new JSIQuizListModel());
                //return false;
                //throw new SurveyOperationException("Web Survey Service - Exception in ASA.Web.Services.SurveyService.PostJellyVisionQuizResponse()", ex);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Get JSI state list.
        /// </summary>
        /// <returns>JSIQuizListModel</returns>
        /// <exception cref="SurveyOperationException">Web Survey Service - ASA.Web.Services.SurveyService.SurveyAdapter.GetJSIStateList()</exception>
        public JSIQuizListModel GetJSIStateList()
        {
            const string logMethodName = ".GetJSIStateList() - ";

            Log.Info(logMethodName + "Begin Method");

            var jList = new JSIQuizListModel();

            try
            {
                var jsiState = IntegrationLoader.LoadDependency <ISaltServiceAgent>("saltServiceAgent").GetJSIState().ToDomainObject();
                jList = new JSIQuizListModel(jsiState);
            }

            catch (Exception ex)
            {
                Log.Error(logMethodName + "Exception =>" + ex.ToString());
                throw new SurveyOperationException("Web Survey Service - ASA.Web.Services.SurveyService.SurveyAdapter.GetJSIStateList()", ex);
            }

            Log.Info(logMethodName + "End Method");
            return(jList);
        }
Ejemplo n.º 4
0
        public JSIQuizListModel GetJSISchoolList(string majorId, string stateId)
        {
            const string logMethodName = ".GetJSISchoolList(int majorId, int stateId) - ";

            _log.Info(logMethodName + "Begin Method");

            JSIQuizListModel jList = null;

            try
            {
                if (_surveyAdapter == null)
                {
                    _log.Error(logMethodName + _surveyAdapterExceptionMessage);
                    throw new SurveyBadDataException("Null adapter in ASA.Web.Services.SurveyService.GetJSISchoolList()");
                }

                if (string.IsNullOrEmpty(majorId) || string.IsNullOrEmpty(stateId))
                {
                    _log.Info(logMethodName + "Major Id or State Id was not provided to access GetJSISchoolList");
                    jList = new JSIQuizListModel();
                    var error = new ErrorModel("Major Id or State Id was not provided to access GetJSISchoolList", "Web Survey Service");
                    jList.ErrorList.Add(error);
                }
                else
                {
                    jList = _surveyAdapter.GetJSISchoolList(Convert.ToInt32(majorId), Convert.ToInt32(stateId));
                }
            }
            catch (Exception ex)
            {
                _log.Error(logMethodName + "Exception => " + ex.ToString());
                throw new SurveyOperationException("Web Survey Service - Exception in ASA.Web.Services.SurveyService.GetJSISchoolList()", ex);
            }

            _log.Info(logMethodName + "End Method");
            return(jList);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Get JSI school list.
        /// </summary>
        /// <param name="majorId">JSI RefMajorId</param>
        /// <param name="stateId">JSI RefStateId</param>
        /// <returns>JSIQuizListModel</returns>
        /// <exception cref="SurveyOperationException">Web Survey Service - ASA.Web.Services.SurveyService.SurveyAdapter.GetJSISchoolList()</exception>
        public JSIQuizListModel GetJSISchoolList(int majorId, int stateId)
        {
            const string logMethodName = ".GetJSISchoolList(int majorId, int stateId) - ";

            Log.Info(logMethodName + "Begin Method");
            Log.Debug(logMethodName + string.Format("input majorId={0}, stateId={1}", majorId, stateId));

            var jList = new JSIQuizListModel();

            try
            {
                var jsiSchool = IntegrationLoader.LoadDependency <ISaltServiceAgent>("saltServiceAgent").GetJSISchoolMajor(majorId, stateId).ToDomainObject();
                jList = new JSIQuizListModel(jsiSchool);
            }

            catch (Exception ex)
            {
                Log.Error(logMethodName + "Exception =>" + ex.ToString());
                throw new SurveyOperationException("Web Survey Service - ASA.Web.Services.SurveyService.SurveyAdapter.GetJSISchoolList()", ex);
            }

            Log.Info(logMethodName + "End Method");
            return(jList);
        }
Ejemplo n.º 6
0
        public JSIQuizListModel GetJSIStateList()
        {
            const string logMethodName = ".GetJSIStateList() - ";

            _log.Info(logMethodName + "Begin Method");

            JSIQuizListModel jList = null;

            try
            {
                if (_surveyAdapter == null)
                {
                    _log.Error(logMethodName + _surveyAdapterExceptionMessage);
                    throw new SurveyBadDataException("Null adapter in ASA.Web.Services.SurveyService.GetJSIStateList()");
                }
                //else if (string.IsNullOrEmpty(surveyId))
                //{
                //    _log.Info(logMethodName + "Survey Id was not provided to access GetJSIStateList");
                //    sList = new SurveyListModel();
                //    var error = new ErrorModel("Survey Id was not provided to access GetJSIStateList", "Web Survey Service");
                //    sList.ErrorList.Add(error);
                //}
                else
                {
                    jList = _surveyAdapter.GetJSIStateList();
                }
            }
            catch (Exception ex)
            {
                _log.Error(logMethodName + "Exception => " + ex.ToString());
                throw new SurveyOperationException("Web Survey Service - Exception in ASA.Web.Services.SurveyService.GetJSIStateList()", ex);
            }

            _log.Info(logMethodName + "End Method");
            return(jList);
        }