private void btnStartBuilding_OnClick(object sender, RoutedEventArgs e) { var building = lbNewBuildings.pnlBuildings.SelectedItem as Building; if (building != null) { BuildingInCity buildingInCity = new BuildingInCity(); buildingInCity.Status = BuildingStatuses.InQuery; buildingInCity.BuildingId = building.Id; buildingInCity.Building = building; AppCache.ApplicationViewModel.UserProfile.City.BuildingsInCity.Add(buildingInCity); AppCache.ApplicationViewModel.UserProfile.City.BuildingInCityIds.Add(building.Id); var client = new GameServiceClient(); client.SaveBuildingInCityCompleted += client_SaveBuildingInCityCompleted; client.SaveBuildingInCityAsync("", buildingInCity); buildingViewModel.initGetNewBuildings(); lbNewBuildings.pnlBuildings.ItemsSource = buildingViewModel.GetNewBuildings; } }
public bool SaveBuildingInCity(string authToken, BuildingInCity buildingInCity) { return(MongoHelpers.SaveData(buildingInCity).Ok); }
private bool GetBuildingsCompletedFilter(BuildingInCity x) { return(x.Status == BuildingStatuses.Completed); }
private bool GetBuildingsInQueryFilter(BuildingInCity x) { return(x.Status == BuildingStatuses.InQuery); }
private bool GetBuildingsInQueryFilter(BuildingInCity x) { return x.Status == BuildingStatuses.InQuery; }
private bool GetBuildingsCompletedFilter(BuildingInCity x) { return x.Status == BuildingStatuses.Completed; }