public ActionResult Index(TranslateViewModel tvm)
        {
            tvm.MatchSettings.ShowSentences = false; // required for matching
            _settingsServiceFacade.UpdateSettings(tvm.MatchSettings, tvm.SampleSettings);
            tvm.LastSearch = tvm.Match.TextIn;

            var getmatch = _translateServiceFacade.GetMatchFor(tvm.Match);

            if (getmatch.MatchesSuccessfullyFound)
            {
                var screen = _translateServiceFacade.GetCurrentScreen();
                var clause = screen.ScreenModel as FullClauseScreenModel;

                // let's add to the existing list
                var tp = new TranslatePair
                {
                    Source = tvm.LastSearch,
                    Target = clause.Translation
                };

                tvm.Translations.Add(tp);
            }

            return(View(tvm));
        }
Пример #2
0
        private ActionResult CheckError(TranslateViewModel settings)
        {
            if (!TryUpdateModel(settings))
            {
                {
                    return(View(settings));
                }
            }

            _settingsServiceFacade.UpdateSettings(settings.MatchSettings, settings.SampleSettings);

            return(null);
        }
Пример #3
0
        public ActionResult Index(DemoViewModel viewModel)
        {
            _settingsServiceFacade.UpdateSettings(viewModel.Settings, viewModel.SampleSettings);

            var getmatch = _demoServiceFacade.GetMatchFor(viewModel.Match);

            if (getmatch.MatchesSuccessfullyFound)
            {
                return(RedirectToAction(getmatch.MenuType));
            }

            // no match - display for edit
            ViewBag.ErrorMessage = getmatch.Message;

            return(View(viewModel));
        }
Пример #4
0
 public ActionResult Index(SampleMatchViewModel viewModel)
 {
     _settingsServiceFacade.UpdateSettings(viewModel.Settings, viewModel.SampleSettings);
     return(RedirectToAction("Index"));
 }