示例#1
0
        public async Task <IActionResult> Create(CreateTypiconModel model)
        {
            if (ModelState.IsValid)
            {
                var user = await _userManager.GetUserAsync(User);

                if (user == null)
                {
                    throw new ApplicationException($"Невозможно найти Пользователя с Id = '{_userManager.GetUserId(User)}'.");
                }

                var command = new CreateTypiconCommand(model.Name, model.Description, model.SystemName, model.DefaultLanguage, model.TemplateId, user.Id);

                await CommandProcessor.ExecuteAsync(command);

                return(RedirectToAction(nameof(Index)));
            }

            ViewBag.Typicons = QueryProcessor.GetPublicTypicons(withTemplates: true);

            return(View(model));
        }
示例#2
0
        public IActionResult Create()
        {
            ViewBag.Typicons = QueryProcessor.GetPublicTypicons(withTemplates: true);

            return(View(new CreateTypiconModel()));
        }