public IActionResult Index() { var model = new DeleteChatThemeBaseViewModel { DeleteChatThemeInputModel = new DeleteChatThemeInputModel(), DeleteChatThemeViewModels = this.removeChatThemeService.GetAllChatThemes(), }; return(this.View(model)); }
public async Task <IActionResult> DeleteChatTheme(DeleteChatThemeBaseViewModel model) { if (this.ModelState.IsValid) { Tuple <bool, string> result = await this.removeChatThemeService.DeleteChatTheme(model.DeleteChatThemeInputModel); if (!result.Item1) { this.TempData["Error"] = result.Item2; return(this.RedirectToAction("Index", "DeleteChatTheme", model)); } this.TempData["Success"] = result.Item2; return(this.RedirectToAction("Index", "DeleteChatTheme")); } else { this.TempData["Error"] = ErrorMessages.InvalidInputModel; return(this.RedirectToAction("Index", "DeleteChatTheme", model)); } }