public async Task <IActionResult> Details(string id) { if (id == null) { return(NotFound()); } var result = await _services.GetSubordinateSubdivisions(id); var nameMainSubdivision = await _services.GetAsync(id); ViewData["IdMainSubdivision"] = id; ViewData["NameMainSubdivision"] = nameMainSubdivision.Result.Name; return(result.IsValid ? View(result.Result) : _oops.OutPutError("Subdivision", "Index", result.ErrorsList)); }
public async Task <IActionResult> GetSubordinateSubdivisions([Required] string id) { var result = await _services.GetSubordinateSubdivisions(id); if (result.IsValid) { return(Ok(result.Result)); } return(NotFound(result.ErrorsList)); }
public async Task <IActionResult> GetSubordinateSubdivisions([Required] string id) { var result = await _services.GetSubordinateSubdivisions(id); if (result.IsValid && result.Result.Any()) { return(Ok(result)); } return(BadRequest(new ActualResult("Not found subordinate subdivisions!"))); }
public async Task <IActionResult> Details([Required] string id) { var result = await _services.GetSubordinateSubdivisions(id); if (result.IsValid) { return(View(result.Result)); } TempData["ErrorsList"] = result.ErrorsList; return(View()); }
public async Task <List <SubdivisionDTO> > GetSubordinateSubdivisions(string hashId) { var subordinateSubdivision = await _subdivisionsService.GetSubordinateSubdivisions(hashId); List <SubdivisionDTO> listSubordinateSubdivision = null; if (subordinateSubdivision.IsValid && subordinateSubdivision.Result.Any()) { listSubordinateSubdivision = new List <SubdivisionDTO>(); listSubordinateSubdivision.AddRange(subordinateSubdivision.Result); } return(listSubordinateSubdivision); }