Exemplo n.º 1
0
        public IActionResult SaveDynamicText(DynamicTextSaveViewModel dynamicText)
        {
            if (ModelState.IsValid)
            {
                m_dynamicTextService.SaveDynamicText(new DynamicText
                {
                    Culture         = dynamicText.Culture.Name,
                    DictionaryScope = dynamicText.Scope ?? "global",
                    FallBack        = false,
                    Text            = dynamicText.Text,
                    Name            = dynamicText.Name
                }, dynamicText.IfDefaultNotExistAction);
            }

            return(View("Index"));
        }
Exemplo n.º 2
0
        public ModificationUpdateViewModel SaveText(string name, string scope, string text, string culture, StaticTextFormatType format,
                                                    string username)
        {
            //scope = m_dictionaryScopeResolver.GetDictionaryScope(scope);
            var dynamicText = new DynamicText
            {
                Culture          = culture,
                DictionaryScope  = scope,
                Format           = (short)format,
                ModificationUser = username,
                Name             = name,
                Text             = text
            };

            m_dynamicTextService.SaveDynamicText(dynamicText);

            var result = new ModificationUpdateViewModel
            {
                ModificationTime = DateTime.Now.ToString(m_localizationService.GetRequestCulture()),
                User             = username
            };

            return(result);
        }