Ejemplo n.º 1
0
        public IActionResult Index()
        {
            var model = new DeleteChatStickerTypeBaseModel
            {
                DeleteChatStickerTypeInputModel = new DeleteChatStickerTypeInputModel(),
                DeleteChatStickerTypeViewModel  = this.deleteChatStickerTypeService.GetAllStickersTypes(),
            };

            return(this.View(model));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> DeleteChatStickerType(DeleteChatStickerTypeBaseModel model)
        {
            if (this.ModelState.IsValid)
            {
                Tuple <bool, string> result =
                    await this.deleteChatStickerTypeService
                    .DeleteChatStickerType(model.DeleteChatStickerTypeInputModel);

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

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