public virtual ActionResult QuestStatePreaction(int Id, int QuestStateId, int QuestId)
        {
            IQuestRepository repo = new EFQuestRepository();

            var questStatePreaction = repo.QuestStatePreactions.FirstOrDefault(q => q.Id == Id);
            var state = repo.QuestStates.FirstOrDefault(q => q.Id == QuestStateId);

            if (questStatePreaction == null)
            {
                questStatePreaction = new QuestStatePreaction
                {
                    QuestId = QuestId,
                    QuestStatePreactionName = "[UNNAMED PREACTION]",
                };

                questStatePreaction.QuestStateId = state;
            }
            else
            {
            }

            var output = new QuestStatePreactionFormViewModel();

            output.QuestStatePreaction = questStatePreaction;
            output.ParentQuestState    = state;

            return(PartialView(MVC.QuestWriter.Views.QuestStatePreaction, output));
        }
        public virtual ActionResult QuestStatePreactionSend(QuestStatePreactionFormViewModel input)
        {
            IQuestRepository repo = new EFQuestRepository();
            var state             = repo.QuestStates.FirstOrDefault(q => q.Id == input.ParentQuestState.Id);

            var savedId = QuestWriterProcedures.SaveQuestStatePreaction(input.QuestStatePreaction, state);

            QuestWriterProcedures.LogQuestWriterAction(User.Identity.Name, state.QuestId, " saved quest state preaction Id <b>" + savedId + "</b>.");

            return(RedirectToAction(MVC.QuestWriter.QuestStatePreaction(savedId, state.Id, input.QuestStatePreaction.QuestId)));
        }