public async Task <IActionResult> EditUser(EmployeeModel editedUser) { if (!ModelState.IsValid) { return(View(editedUser)); } var response = await GenericGetDataClass <EmployeeModel> .EditData("api/edituser", editedUser); if (response) { TempData["SM"] = "Пользователь успешно отредактирован!"; return(RedirectToAction(nameof(ShowAllUsers))); } else { return(View(editedUser)); } }
public async Task <IActionResult> EditCategory(CategoryModel editedCategory) { if (!ModelState.IsValid) { return(View(editedCategory)); } var response = await GenericGetDataClass <CategoryModel> .EditData("api/editcategory", editedCategory); if (response) { TempData["SM"] = "Категория успешно отредактирована!"; return(RedirectToAction(nameof(ShowAllCategories))); } else { return(View(editedCategory)); } }
public async Task <IActionResult> EditVideo(VideoModel editedVideo) { if (!ModelState.IsValid) { return(View(editedVideo)); } var response = await GenericGetDataClass <VideoModel> .EditData("api/editvideo", editedVideo); if (response) { TempData["SM"] = "Видео успешно отредактировано!"; return(RedirectToAction(nameof(ShowAllVideo))); } else { return(View(editedVideo)); } }