/// <summary> /// Resolves a damage history case that is open. /// </summary> /// <param name="damageModel">Damage model from user selection</param> /// <returns></returns> public async Task <IActionResult> ResolveDamages(DamageHistoryModel damageModel) { //Flip resolved to true so in future will only be viewable damageModel.resolved = true; //Update the db string response = await _beService.UpdateDamageHistoryAsync(DamageHistoryDTO.CreateDTO(damageModel)); if (response != "Success") { return(RedirectToAction("ViewDamageImages", damageModel)); } //Set the vehicle state to in so can be used again VehicleDTO veh = await _beService.GetVehicleAsync(damageModel.lplateNum); veh.state = "In"; response = await _beService.UpdateVehicleAsync(veh); if (response != "Success") { return(RedirectToAction("Index")); } return(RedirectToAction("Details", damageModel.lplateNum)); }