Exemplo n.º 1
0
        public IActionResult Index()
        {
            var model = new AddChatStickerBaseModel
            {
                AddChatStickerInputModel = new AddChatStickerInputModel(),
                AddChatStickerViewModels = this.addChatStickerService.GetAllStickerTypes(),
            };

            return(this.View(model));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> AddNewSticker(AddChatStickerBaseModel model)
        {
            if (this.ModelState.IsValid)
            {
                Tuple <bool, string> result =
                    await this.addChatStickerService.AddNewSticker(model.AddChatStickerInputModel);

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

                this.TempData["Success"] = result.Item2;
                return(this.RedirectToAction("Index", "AddChatSticker"));
            }

            this.TempData["Error"] = ErrorMessages.InvalidInputModel;
            return(this.RedirectToAction("Index", "AddChatSticker", model));
        }