private void SetCookieToLearnNextCard(Flashcard flashcard)
 {
     var newIndex = int.Parse(_cookies.Get(CookieKeys.IndexCard)) + 1;
     newIndex = newIndex < _db.Flashcards.Count(fc => fc.PackId == flashcard.PackId) ? 0 : newIndex;
     _cookies.Set(CookieKeys.IndexCard, newIndex.ToString());
 }
        public ActionResult DynamicPage(Flashcard flashcard, string ButtonType)
        {
            InitCookies();

            if (ButtonType == "Next")
            {
                SetCookieToLearnNextCard(flashcard);
            }
            else if (ButtonType == "Previous")
            {
                SetCookieToLearnPreviousCard();
            }
            else if (ButtonType == "Reverse")
            {
                SetCookieToReverseCard();
            }
            return RedirectToAction("Learn");
        }