コード例 #1
0
        public IActionResult Index()
        {
            var model = new EditChatThemeBaseModel
            {
                EditChatThemeInput      = new EditChatThemeInputModel(),
                EditChatThemeViewModels = this.editChatThemeService.GetAllThemes(),
            };

            return(this.View(model));
        }
コード例 #2
0
        public async Task <IActionResult> EditChatTheme(EditChatThemeBaseModel model)
        {
            if (this.ModelState.IsValid)
            {
                Tuple <bool, string> result =
                    await this.editChatThemeService.EditChatTheme(model.EditChatThemeInput);

                if (!result.Item1)
                {
                    this.TempData["Error"] = result.Item2;
                    return(this.RedirectToAction("Index", "EditChatTheme", model));
                }

                this.TempData["Success"] = result.Item2;
                return(this.RedirectToAction("Index", "EditChatTheme"));
            }
            else
            {
                this.TempData["Error"] = ErrorMessages.InvalidInputModel;
                return(this.RedirectToAction("Index", "EditChatTheme", model));
            }
        }