public IActionResult Create(WordData model, string returnController, string returnAction)
        {
            int langId = returnController.Equals("Languages") ? model.LanguageId : 0;

            FillReturnPath(returnController, returnAction);
            FillSelectLists(langId);

            if (IsDuplicate(model))
            {
                ModelState.AddModelError("Translation", ERR_REC_EXISTS);
            }

            if (ModelState.IsValid)
            {
                _helper.CreateWord(model, out int wordId);
                _helper.CreateCatWord(model, wordId, out int catWordId);
                _helper.CreateTranslations(model, catWordId, out bool commaError);

                if (_helper.ValidateComma(commaError, wordId))
                {
                    return(RedirectToAction("Create", new { langId = langId, returnController = returnController, returnAction = returnAction }));
                }

                ModelState.AddModelError("Translation", ERR_INPUT);
            }

            return(View(model));
        }
        private bool ParseRow(IXLRow row, out string error)
        {
            var word        = row.Cell(WORD_IND).Value.ToString();
            var lang        = row.Cell(LANG_IND).Value.ToString();
            var cat         = row.Cell(CAT_IND).Value.ToString();
            var translation = row.Cell(TRAN_IND).Value.ToString();
            var model       = new WordData {
                Word = word, Language = lang, Category = cat, Translation = translation
            };

            if (IsRowErronous(model, out error))
            {
                return(false);
            }

            CreateNewLangAndCatIfNeeded(model);
            _helper.CreateWord(model, out int wordId);
            _helper.CreateCatWord(model, wordId, out int catWordId);
            _helper.CreateTranslations(model, catWordId, out bool commaError);

            if (!_helper.ValidateComma(commaError, wordId))
            {
                error = ERR_TRAN + ERR_END;
                return(false);
            }

            return(true);
        }