Beispiel #1
0
        private DataTable GetQuestionData(int?QuestionCategoryId)
        {
            QuestionCategoryDataModel data = new QuestionCategoryDataModel();

            data.QuestionCategoryId = QuestionCategoryId;
            var dt         = QuestionCategoryDataManager.GetDetails(data, SessionVariables.RequestProfile);
            var Questiondt = QuestionDataManager.GetList(SessionVariables.RequestProfile);
            var resultdt   = Questiondt.Clone();

            foreach (DataRow row in dt.Rows)
            {
                var rows = Questiondt.Select("QuestionId = " + row[QuestionDataModel.DataColumns.QuestionId]);
                resultdt.ImportRow(rows[0]);
            }

            return(resultdt);
        }
Beispiel #2
0
        protected override DataTable GetData()
        {
            try
            {
                SuperKey = ApplicationCommon.GetSuperKey();
                SetId    = ApplicationCommon.GetSetId();

                var selectedrows         = new DataTable();
                var questionCategorydata = new QuestionCategoryDataModel();

                selectedrows = QuestionCategoryDataManager.GetDetails(questionCategorydata, SessionVariables.RequestProfile).Clone();
                if (!string.IsNullOrEmpty(SuperKey))
                {
                    var systemEntityTypeId = (int)PrimaryEntity;
                    var lstEntityKeys      = ApplicationCommon.GetSuperKeyDetails(systemEntityTypeId, SuperKey);

                    foreach (var entityKey in lstEntityKeys)
                    {
                        questionCategorydata.QuestionCategoryId = entityKey;
                        var result = QuestionCategoryDataManager.GetDetails(questionCategorydata, SessionVariables.RequestProfile);
                        selectedrows.ImportRow(result.Rows[0]);
                    }
                }
                else
                {
                    questionCategorydata.QuestionCategoryId = SetId;
                    var result = QuestionCategoryDataManager.GetDetails(questionCategorydata, SessionVariables.RequestProfile);
                    selectedrows.ImportRow(result.Rows[0]);
                }
                return(selectedrows);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }

            return(null);
        }