Exemplo n.º 1
0
        public async Task UpdateLink(string operationId, string linkId)
        {
            var linkData = await _wasabeeApiV1Service.Operations_GetLink(operationId, linkId);

            if (linkData != null)
            {
                await _linksDatabase.SaveLinkModel(linkData, operationId);

                _mvxMessenger.Publish(new LinkDataChangedMessage(this, linkData, operationId));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Local data updates to ensure Operation is always up-to-date, even if FCM is not working.
        /// </summary>
        /// <returns></returns>
        private async Task UpdateLinkAndNotify()
        {
            if (LinkAssignment != null && Link != null)
            {
                var updated = await _wasabeeApiV1Service.Operations_GetLink(LinkAssignment.OpId, Link.Id);

                if (updated != null)
                {
                    Link             = updated;
                    IsSelfAssignment = _userSettingsService.GetLoggedUserGoogleId().Equals(Link.AssignedTo);

                    UpdateButtonsState();

                    await _linksDatabase.SaveLinkModel(Link, LinkAssignment.OpId);

                    _messenger.Publish(new LinkDataChangedMessage(this, Link, LinkAssignment.OpId));
                }
                else
                {
                    IsBusy = false;
                    CloseCommand.Execute();
                }
            }
        }