public PartialViewResult Find(string nomeMapa, FormCollection form) { ViewBag.Title = Resources.MapaController_HttpGet_Action_List_ViewBag_Title;//"Mapas Cadastrados" var request = new EncontrarTodosMapasPorRequest() { Mapa = new MapaDto() { NomeMapa = nomeMapa } }; var response = _mapaServices.EncontrarTodosMapasPor(request); if (response.Success) { ViewBag.MessageType = "alert-info"; ViewBag.Message = response.Message; var model = response.Mapas.ConvertToListMapaViewModel(); return(PartialView("ListaMapasPartialView", model)); } else { ViewBag.MessageType = "alert-warning"; ViewBag.Message = response.Message; var model = new List <MapaViewModel>(); return(PartialView("ListaMapasPartialView", model)); } }
public EncontrarTodosMapasPorResponse EncontrarTodosMapasPor(EncontrarTodosMapasPorRequest request) { var response = new EncontrarTodosMapasPorResponse(); try { var nomeMapa = request.Mapa.NomeMapa; var mapas = _mapaRepository.FindAllByName(nomeMapa); if (mapas != null) { response.Success = true; response.Message = Resources.MapaServices_EncontrarTodosMapasPor_Success_Message; response.Mapas = mapas.ConvertToListMapasDto(); } else { response.Success = false; response.Message = Resources.MapaServices_EncontrarTodosMapasPor_Fail_Message; } } catch (Exception ex) { response.Success = false; response.Message = Resources.MapaServices_EncontrarTodosMapasPor_Error_Message + ex.Message; } return(response); }