public IActionResult Index() { var model = new AddChatStickersBaseModel { AddChatStickersInputModel = new AddChatStickersInputModel(), AddChatStickersViewModels = this.addChatStickersService.GetAllStickersTypes(), }; return(this.View(model)); }
public async Task <IActionResult> AddChatStickers(AddChatStickersBaseModel model) { if (this.ModelState.IsValid) { Tuple <bool, string> result = await this.addChatStickersService.AddChatStickers(model.AddChatStickersInputModel); if (!result.Item1) { this.TempData["Error"] = result.Item2; return(this.RedirectToAction("Index", "AddChatStickers", model)); } this.TempData["Success"] = result.Item2; return(this.RedirectToAction("Index", "AddChatStickers")); } else { this.TempData["Error"] = ErrorMessages.InvalidInputModel; return(this.RedirectToAction("Index", "AddChatStickers", model)); } }