Exemple #1
0
        public PartialViewResult OldWords()
        {
            _viewModel = new OldWordsViewModel();
            var listIDWord = _detailOutWordService.listOutWord(User.Identity.GetUserId(), -1);

            foreach (var idWord in listIDWord)
            {
                OldWordViewModelItem item = new OldWordViewModelItem();
                var tempWord = _dictCache.GetById(idWord.Id_OurWord);
                var infoVoca = _dictCache.findWordCache(tempWord.VocaID);

                item.Id      = tempWord.Id;
                item.Learned = idWord.Learned;
                item.m_Voca  = tempWord.VocaID;
                OldWordsViewModel.ListOldWords.Add(item);
            }
            return(PartialView("_OldWords", OldWordsViewModel));
        }
Exemple #2
0
        public ActionResult Index(string option)
        {
            if (option != null)
            {
                switch (option.ToLower())
                {
                case "dictionaries":
                {
                    _viewModel = new DictionariesViewModel();
                    CreateLayoutView("Từ điển");
                    break;
                }

                case "oldwords":
                {
                    _viewModel = new OldWordsViewModel();
                    CreateLayoutView("Danh sách từ yêu thích");
                    break;
                }

                default:
                {
                    _viewModel = new DictionariesViewModel();
                    CreateLayoutView("Từ điển");
                    break;
                }
                }
            }
            else
            {
                _viewModel = new DictionariesViewModel();
                CreateLayoutView("Từ điển");
            }

            return(View(_viewModel));
        }