public async Task <ActionResult> Delete(int id) { try { await _categoryRelativiesRepository.DeleteAsync(id); } catch (Exception) { throw; } return(Json(new { isValid = true, html = RenderRazorService.RenderRazorViewToString(this, "_ViewAll", _categoryRelativiesRepository.GetSearchResult(new SearchParamter() { PageSize = 5, Page = 1 })) })); }
public async Task <ActionResult> CreateEdit(BeatyandHealthy healthBeatyandHealthy) { if (ModelState.IsValid) { try { await _categoryRepository.CreateEdit(healthBeatyandHealthy); } catch (Exception) { throw; } return(Json(new { isValid = true, html = RenderRazorService.RenderRazorViewToString(this, "_ViewAll", _categoryRepository.GetSearchResult(new SearchParamter() { PageSize = 5, Page = 1 })) })); } return(Json(new { isValid = false, html = RenderRazorService.RenderRazorViewToString(this, "_CreateEdit", healthBeatyandHealthy) })); }