コード例 #1
0
        // GET api/summary/GetList
        public IEnumerable <QuestionDataModel> GetList(string value, string value1)
        {
            var settingCategory = value1;
            var searchString    = value;

            var dictionaryObject = JsonConvert.DeserializeObject <Dictionary <string, string> >(searchString);

            // save search filter parameters in user preference
            if (dictionaryObject != null)
            {
                foreach (var searchFilterColumnName in dictionaryObject.Keys)
                {
                    var searchFilterValue = dictionaryObject[searchFilterColumnName];
                    PerferenceUtility.UpdateUserPreference(settingCategory, searchFilterColumnName, dictionaryObject[searchFilterColumnName]);
                }
            }
            var dataQuery = new QuestionDataModel();

            try
            {
                dataQuery = JsonConvert.DeserializeObject <QuestionDataModel>(searchString);
            }
            catch { }

            // igonore when value is -1
            if (dataQuery.QuestionCategoryId == -1)
            {
                dataQuery.QuestionCategoryId = null;
            }
            return(QuestionDataManager.GetEntityDetails(dataQuery, SessionVariables.RequestProfile));
        }
コード例 #2
0
        public void LoadData(int questionId, bool showId)
        {
            Clear();

            var data = new QuestionDataModel();

            data.QuestionId = questionId;
            var items = QuestionDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);


            if (items.Count != 1)
            {
                return;
            }

            var item = items[0];

            QuestionId = item.QuestionId;
            Question   = item.QuestionPhrase;
            Category   = item.QuestionCategoryId;
            SortOrder  = item.SortOrder;

            if (!showId)
            {
                txtQuestionId.Text = item.QuestionId.ToString();
                oHistoryList.Setup(PrimaryEntity, questionId, PrimaryEntityKey);
            }
            else
            {
                txtQuestionId.Text = String.Empty;
            }

            oUpdateInfo.LoadText(item.UpdatedDate, item.UpdatedBy, item.LastAction);
        }
コード例 #3
0
        protected override void ShowData(int questionId)
        {
            base.ShowData(questionId);

            oDetailButtonPanel.SetId = SetId;

            Clear();

            var data = new QuestionDataModel();

            data.QuestionId = questionId;

            var items = QuestionDataManager.GetEntityDetails(data, SessionVariables.RequestProfile);

            if (items.Count == 1)
            {
                var item = items[0];

                lblQuestionId.Text = item.QuestionId.ToString();
                lblQuestion.Text   = item.QuestionPhrase;
                lblCategory.Text   = item.QuestionCategory;
                lblSortOrder.Text  = item.SortOrder.ToString();

                oUpdateInfo.LoadText(item.UpdatedDate, item.UpdatedBy, item.LastAction);

                oHistoryList.Setup(PrimaryEntity, questionId, "Question");
            }
        }