Beispiel #1
0
        public ActionResult Feedback(string bookId, string versionId, string entryId, string headword, string dictionary)
        {
            var pageStaticText = m_staticTextManager.GetRenderedHtmlText(StaticTexts.TextHomeFeedback);
            var viewModel      = new HeadwordFeedbackViewModel
            {
                BookXmlId        = bookId,
                BookVersionXmlId = versionId,
                EntryXmlId       = entryId,
                Dictionary       = dictionary,
                Headword         = headword,
                PageStaticText   = pageStaticText
            };

            var username = GetUserName();

            if (string.IsNullOrWhiteSpace(username))
            {
                return(View(viewModel));
            }

            using (var client = GetEncryptedClient())
            {
                var user = client.FindUserByUserName(username);
                viewModel.Name  = string.Format("{0} {1}", user.FirstName, user.LastName);
                viewModel.Email = user.Email;

                return(View(viewModel));
            }
        }
Beispiel #2
0
        public ActionResult Feedback(HeadwordFeedbackViewModel model)
        {
            if (!ModelState.IsValid)
            {
                model.PageStaticText = m_staticTextManager.GetRenderedHtmlText(StaticTexts.TextHomeFeedback, "home");
                return(View(model));
            }

            if (model.BookId == null || model.HeadwordVersionId == null)
            {
                m_feedbacksManager.CreateFeedback(model, FeedbackCategoryEnumContract.Dictionaries, PortalTypeValue, IsUserLoggedIn());
            }
            else
            {
                AddHeadwordFeedback(model.Text, model.HeadwordVersionId.Value, model.Name, model.Email);
            }

            return(View("Feedback/FeedbackSuccess"));
        }
Beispiel #3
0
        public ActionResult Feedback(HeadwordFeedbackViewModel model)
        {
            if (!ModelState.IsValid)
            {
                model.PageStaticText = m_staticTextManager.GetRenderedHtmlText(StaticTexts.TextHomeFeedback);
                return(View(model));
            }

            if (model.BookXmlId == null || model.BookVersionXmlId == null || model.EntryXmlId == null)
            {
                m_feedbacksManager.CreateFeedback(model, FeedbackCategoryEnumContract.Dictionaries, GetMainServiceClient(), IsUserLoggedIn(), GetUserName());
            }
            else
            {
                AddHeadwordFeedback(model.Text, model.BookXmlId, model.BookVersionXmlId, model.EntryXmlId, model.Name, model.Email);
            }

            return(View("Feedback/FeedbackSuccess"));
        }
Beispiel #4
0
        public ActionResult Feedback(long?bookId, long?headwordVersionId, string headword, string dictionary)
        {
            var pageStaticText = m_staticTextManager.GetRenderedHtmlText(StaticTexts.TextHomeFeedback, "home");
            var viewModel      = new HeadwordFeedbackViewModel
            {
                BookId            = bookId,
                HeadwordVersionId = headwordVersionId,
                Dictionary        = dictionary,
                Headword          = headword,
                PageStaticText    = pageStaticText
            };

            if (!IsUserLoggedIn())
            {
                return(View(viewModel));
            }

            viewModel.Name  = $"{User.GetFirstName()} {User.GetLastName()}";
            viewModel.Email = User.GetEmail();

            return(View(viewModel));
        }