public HttpResponseMessage Get()
        {
            HttpResponseMessage responseMessage;
            JSend json;
            var   list = _carModel.GetAllCars();

            if (list.Count > 0)
            {
                json            = new JSendData <CarDTO>("success", list);
                responseMessage = Request.CreateResponse(HttpStatusCode.OK, json);
            }
            else
            {
                json            = new JSendMessage("fail", "No items found");
                responseMessage = Request.CreateResponse(HttpStatusCode.NotFound, json);
            }

            return(responseMessage);
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
                AppViewBackButtonVisibility.Collapsed;
            // Carga la lista de ModelView a partir de la lista de Modelo
            if (ListaCoches != null)
            {
                foreach (CarID currCar in CarModel.GetAllCars())
                {
                    VMCar VMitem = new VMCar(currCar);
                    //VMitem.Nombre = logro.Nombre;
                    ListaCoches.Add(VMitem);
                    if (VMitem.Estado == CarID.estados.bloqueado)
                    {
                    }
                }
            }

            listaCoches_.ItemsSource = ListaCoches;

            if (e.Parameter is bool)
            {
                permitirCompra = (bool)e.Parameter;
            }

            if (permitirCompra)
            {
                BotonJugar.Visibility = Visibility.Collapsed;
            }

            DineroText.Text = "DINERO: " + Money.ToString() + "€";

            ActualizaDatos();

            base.OnNavigatedTo(e);
        }
Exemple #3
0
 internal List <Car> GetAllCars()
 {
     return(_carModel.GetAllCars());
 }