public void ClearData() { Device.BeginInvokeOnMainThread(() => { SelectedPartys.Clear(); PartyHistory.Clear(); SelectedPartiesUpdated?.Invoke(this, EventArgs.Empty); HistoryPartisUpdated?.Invoke(this, EventArgs.Empty); }); }
public async Task <Result> ChangeCommitmentState(Guid partyId, PartyCommitmentState commitmentState) { if (!await CheckIfTokenIsValid()) { return new Result { NeedLogin = true } } ; dynamic bodyObject = new ExpandoObject(); bodyObject.eventCommitment = commitmentState; Result result = await _clientService.SendRequest("/api/UserParty/commitmentState", RestType.Put, urlQuery : "?id=" + partyId.ToString("D"), bodyParameter : bodyObject, token : Token.AccessToken); if (result.Success) { foreach (Party interestingParty in InterestingPartys) { if (interestingParty.Id == partyId) { interestingParty.CommitmentState = commitmentState; if (commitmentState == PartyCommitmentState.Noted) { SelectedPartys.Add(interestingParty); } break; } } foreach (Party interestingParty in SelectedPartys) { if (interestingParty.Id == partyId) { interestingParty.CommitmentState = commitmentState; break; } } } return(result); }