public static QA_VM GetQA(string lang, string category, int bookId, int chapterNumber = 0)
        {
            var cacheKey = string.Format("QAList_{0}_{1}_{2}_{3}", lang, category, bookId, chapterNumber);
            var data     = new QA_VM();

            //if (HttpContext.Current.Cache[cacheKey] != null && HttpContext.Current.Cache[cacheKey] is QA_VM)
            //{
            //    data = HttpContext.Current.Cache[cacheKey] as QA_VM;
            //}

            if (quaAnsDictionary.ContainsKey(cacheKey) && quaAnsDictionary[cacheKey] != null)
            {
                data = quaAnsDictionary[cacheKey];
            }
            else
            {
                data = QA_List(new QA_Filter_Parameters {
                    Lang = lang, BookId = bookId, Category = category, ChapterNumber = chapterNumber
                });

                data.QARecords.ToList().ForEach(c =>
                {
                    if (!string.IsNullOrEmpty(c.Exams))
                    {
                        var exams = string.Empty;
                        c.Exams.Split(new char[] { '|' }).ToList().ForEach(e =>
                        {
                            //exams += "<span class='examIcon' title='" + e + "' >&nbsp;&nbsp;</span>";
                            exams += "<i class='examIcon glyphicon glyphicon-calendar'></i>" + e;
                        });

                        c.Que = string.Format("{0} {1}", c.Que, exams);
                    }
                });

                if (quaAnsDictionary.ContainsKey(cacheKey))
                {
                    quaAnsDictionary.Remove(cacheKey);
                }

                quaAnsDictionary.Add(cacheKey, data);

                //HttpContext.Current.Cache.Insert(cacheKey,
                //                    data,
                //                    null,
                //                    System.Web.Caching.Cache.NoAbsoluteExpiration,
                //                    TimeSpan.FromDays(10));//Data will be cached for 10 day;
            }

            return(data);
        }
        private static QA_VM QA_List(QA_Filter_Parameters filter)
        {
            var qa_vm     = new QA_VM();
            var qaRecords = new List <QARecord>();

            using (var context = new YogiApekshitContext())
            {
                if (filter.BookId > 0)
                {
                    var book = context.Books.Where(c => c.Id == filter.BookId).FirstOrDefault();
                    qa_vm.BookTitle = book != null
                                        ? filter.Lang == "Guj" ? book.Name_Guj : book.Name_Eng
                                        : string.Empty;
                }

                if (filter.ChapterNumber > 0)
                {
                    var chapter = context.BookChapters.Where(c => c.Id == filter.ChapterNumber).FirstOrDefault();
                    qa_vm.ChapterTitle = chapter != null
                                        ? filter.Lang == "Guj" ? chapter.Name_Guj : chapter.Name_Eng
                                        : string.Empty;
                }
            }

            var category = (Constants.Que_Categories)Enum.Parse(typeof(Constants.Que_Categories), filter.Category);

            switch (category)
            {
            case Constants.Que_Categories.One_Sentence:
                qa_vm.Color = "#16a085";
                qaRecords   = QA_OneSentence(filter); break;

            case Constants.Que_Categories.Correct_Option:
                qa_vm.Color = "#e05d6f";
                qaRecords   = QA_CorrectOption(filter); break;

            case Constants.Que_Categories.Correct_Sentence:
                qa_vm.Color = "#418bca";
                qaRecords   = QA_CorrectSentence(filter); break;

            case Constants.Que_Categories.Correct_Sequence:
                qa_vm.Color = "#56b1bf";
                qaRecords   = QA_CorrectSequence(filter); break;

            case Constants.Que_Categories.Fill_In_Blank:
                qa_vm.Color = "#5cb85c";
                qaRecords   = QA_FillInBlank(filter); break;

            case Constants.Que_Categories.Kirtan:
                qa_vm.Color = "#f0ad4e";
                qaRecords   = QA_Kirtan(filter); break;

            case Constants.Que_Categories.Reason:
                qa_vm.Color = "#d9534f";
                qaRecords   = QA_Reason(filter); break;

            case Constants.Que_Categories.Short_Note:
                qa_vm.Color = "#afae8b";
                qaRecords   = QA_ShortNote(filter); break;

            case Constants.Que_Categories.Swamini_Vaato:
                qa_vm.Color = "#116f7d";
                qaRecords   = QA_SwaminiVat(filter); break;

            case Constants.Que_Categories.Who_Whom_When:
                qa_vm.Color = "#d0aa90";
                qaRecords   = QA_WhoWhomWhen(filter); break;

            default:
                qaRecords = new List <QARecord>(); break;
            }

            qa_vm.QARecords = qaRecords;
            return(qa_vm);
        }