Exemplo n.º 1
0
        public IActionResult Index()
        {
            var model = new EditChatStickerBaseModel
            {
                EditChatStickerInputModel = new EditChatStickerInputModel(),
                AllStikersTypes           = this.editChatStickerService.GetAllStikersTypes(),
                EditChatStickerViewModels = this.editChatStickerService.GetAllStickers(),
            };

            return(this.View(model));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> EditSticker(EditChatStickerBaseModel model)
        {
            if (this.ModelState.IsValid)
            {
                Tuple <bool, string> result =
                    await this.editChatStickerService.EditSticker(model.EditChatStickerInputModel);

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

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

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