private void DemandButton_Click(object sender, RoutedEventArgs e) { //Al hacer click redirige a la pagina de denuncias string basecamp; Uri demandUri; if (Current.Instance.Earthwatcher.PlayingRegion == 1) { basecamp = "salta01"; if (selectedLand.BasecampId != null) { basecamp = selectedLand.BasecampId.ToString(); } demandUri = new Uri(string.Format("http://greenpeace.org.ar/denuncias/index.php?id_ciberaccion={0}&mail={1}&area={2}&GeohexKey={3}&prev=0&lat={4}&long={5}", 5157, Current.Instance.Earthwatcher.Name, basecamp, selectedLand.GeohexKey, Math.Round(selectedLand.Latitude, 4), Math.Round(selectedLand.Longitude, 4)), UriKind.Absolute); } else { if (selectedLand.BasecampId != null) { basecamp = selectedLand.BasecampId.ToString(); } basecamp = "chaco01"; demandUri = new Uri(string.Format("http://greenpeace.org.ar/denuncias/index.php?id_ciberaccion={0}&mail={1}&area={2}&GeohexKey={3}&prev=0&lat={4}&long={5}", 0, Current.Instance.Earthwatcher.Name, basecamp, selectedLand.GeohexKey, Math.Round(selectedLand.Latitude, 4), Math.Round(selectedLand.Longitude, 4)), UriKind.Absolute); } this.DemandButton.NavigateUri = demandUri; //Agrega el score de demanda if (!Current.Instance.RegionScores.Any(x => x.Action.Equals(ActionPoints.Action.DemandAuthorities.ToString()) && x.LandId == selectedLand.Id)) { Current.Instance.AddScore.Add(new Score(Current.Instance.Earthwatcher.Id, ActionPoints.Action.DemandAuthorities.ToString(), ActionPoints.Points(ActionPoints.Action.DemandAuthorities), Current.Instance.Earthwatcher.PlayingRegion, Current.Instance.PrecisionScore, selectedLand.Id)); ReportWindowDemand(this, EventArgs.Empty); hexagonLayer.UpdateHexagonsInView(); } //Agrega el score de Share else if (!Current.Instance.RegionScores.Any(x => x.Action.Equals(ActionPoints.Action.Shared.ToString()) && x.LandId == selectedLand.Id)) { Current.Instance.AddScore.Add(new Score(Current.Instance.Earthwatcher.Id, ActionPoints.Action.Shared.ToString(), ActionPoints.Points(ActionPoints.Action.Shared), Current.Instance.Earthwatcher.PlayingRegion, Current.Instance.PrecisionScore, selectedLand.Id)); ReportWindowDemand(this, EventArgs.Empty); } }
private void SetLandStatusStatusChanged(object sender, EventArgs e) { if (status == LandStatus.Alert || status == LandStatus.Ok) { if (!Current.Instance.Scores.Any(x => x.Action.Equals("LandStatusChanged") && x.Published > selectedLand.LastReset)) { Current.Instance.AddScore.Add("LandStatusChanged", 500); } } var alertedLandLayer = Current.Instance.LayerHelper.FindLayer(Constants.AlertedLandLayername) as AlertedLandLayer; if (alertedLandLayer != null) { alertedLandLayer.RequestAlertedAreas(); } hexagonLayer.UpdateHexagonsInView(); this.Close(); }