예제 #1
0
        /// <returns>A task that represents the asynchronous operation</returns>
        public virtual async Task <IActionResult> Create()
        {
            if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManageLanguages))
            {
                return(AccessDeniedView());
            }

            //prepare model
            var model = await _languageModelFactory.PrepareLanguageModelAsync(new LanguageModel(), null);

            return(View(model));
        }
예제 #2
0
        public virtual async Task <ActionResult> Editor(int?id)
        {
            if (id != null)
            {
                var record = await LanguagesService.FindByIdAsync(id.Value);

                if (record != null)
                {
                    return(View(await _languageModelFactory.PrepareLanguageModelAsync(record)));
                }
            }

            return(View(await _languageModelFactory.PrepareLanguageModelAsync(null)));
        }