public IActionResult Index() { var model = new AddChatStickerBaseModel { AddChatStickerInputModel = new AddChatStickerInputModel(), AddChatStickerViewModels = this.addChatStickerService.GetAllStickerTypes(), }; return(this.View(model)); }
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)); }