public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TipoDeMascotaEditDto tipoMasDto = _servicio.GetipoDeMascotaPorId(id); if (tipoMasDto == null) { return(HttpNotFound("Còdigo de Tipo de Mascota inexistente...")); } TipoDeMascotaEditViewModel tipoMasVm = _mapper.Map <TipoDeMascotaEditViewModel>(tipoMasDto); return(View(tipoMasVm)); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var razaDto = _servicio.GetRazaPorId(id); if (razaDto == null) { return(HttpNotFound("Còdigo de Raza inexistente...")); } RazaListViewModel razaVm = _mapper.Map <RazaListViewModel>(razaDto); razaVm.TipoDeMascota = (_serviciosTipoDeMascota.GetipoDeMascotaPorId(razaDto.TipoDeMascotaId)).Descripcion; return(View(razaVm)); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var mascotaDto = _servicio.GetMascotaPorId(id); if (mascotaDto == null) { return(HttpNotFound("Còdigo de Mascota inexistente")); } MascotaListViewModel mascotaVm = _mapper.Map <MascotaListViewModel>(mascotaDto); mascotaVm.TipoDeMascota = (_serviciosTipoDeMascota.GetipoDeMascotaPorId(mascotaDto.TipoDeMascotaId)).Descripcion; mascotaVm.Raza = (_serviciosRaza.GetRazaPorId(mascotaDto.RazaId)).Descripcion; mascotaVm.Cliente = (_serviciosCliente.GetClientePorId(mascotaDto.ClienteId)).Apellido; return(View(mascotaVm)); }