public ActionResult GetPlace(int id) { placeClass place = placeClass.ConvertToObject(DB.Places.Where(p => p.ID == id).SingleOrDefault()); place.Reviews = DB.PlaceReviews.Where(r => r.PlaceID == id).ToList(); place.WorkingDays = DB.PlaceDays.Where(r => r.PlaceID == id).ToList(); place.Images = DB.PlaceImages.Where(r => r.PlaceID == id).ToList(); return(View(place)); }
public int checkPlace(int _valueInRace, int _startingPlace, bool _isPlayerFL) { int tmpReturnIndex; //Debug.Log("<<<... CHECK PLACE ...>>>"); //Debug.Log("_valueInRace: " + _valueInRace + "_startingPlace: " + _startingPlace + "_isPlayerFL: " + _isPlayerFL); int tmpActualIndex = placeList.FindIndex(L => L.startingNr == _startingPlace); placeClass tmpPlaceListObj = placeList[tmpActualIndex]; tmpPlaceListObj.valueInRace = _valueInRace; placeList.RemoveAt(tmpActualIndex); //Debug.Log("tmpActualIndex: " + tmpActualIndex); //Debug.Log("tmpActualIndex: " + tmpActualIndex); int tmpNewIndex = placeList.FindIndex(L => L.valueInRace < _valueInRace); //Debug.Log("tmpNewIndex: " + tmpNewIndex + "placeList[tmpNewIndex].startingNr: " + placeList[tmpNewIndex].startingNr); //Debug.Log("tmpNewIndex: " + tmpNewIndex); if (tmpNewIndex > -1 && tmpActualIndex > tmpNewIndex) { /*placeList[tmpActualIndex].valueInRace = _valueInRace; * placeList.Insert(tmpNewIndex, placeList[tmpActualIndex]); * placeList.RemoveAt(tmpActualIndex+1);*/ //placeClass tmpPlaceListObj = placeList[tmpActualIndex]; //placeList.RemoveAt(tmpActualIndex); placeList.Insert(tmpNewIndex, tmpPlaceListObj); //placeList[tmpNewIndex].valueInRace = _valueInRace; tmpReturnIndex = tmpNewIndex; } else { placeList.Insert(tmpActualIndex, tmpPlaceListObj); //placeList[tmpActualIndex].valueInRace = _valueInRace; tmpNewIndex = tmpActualIndex; } textPositionInfoActualObj.GetComponent <Text>().text = checkPlayerPlace().ToString(); //Debug.Log("checkPlayerPlace(): " + checkPlayerPlace()); //debugList(); return(tmpNewIndex); }