示例#1
0
 public int CompareTo(KnownAs other)
 {
     if (CohortId == other.CohortId)
     {
         return(EntityId.CompareTo(other.EntityId));
     }
     else
     {
         return(CohortId.CompareTo(other.CohortId));
     }
 }
        private async void LoadClients()
        {
            IsBusy = true;

            var clients = _registryService.GetAllCohortClients(CohortId).ToList();

            if (clients.Count == 0)
            {
                _dialogService.ShowWait("Downloading,Please wait...");

                var remoteData = await _chohortClientsSyncService.GetClients(Address, CohortId.ToString(), AppPracticeId);

                if (remoteData.Count > 0)
                {
                    Clients = remoteData.Select(x => x.Client).ToList();
//                    foreach (var c in clients)
//                    {
//                        _registryService.Save(c,CohortId);
//                    }
//
//                    Clients = _registryService.GetAllCohortClients(CohortId).ToList();
                }
                else
                {
                    Clients = new List <Client>();
                    _dialogService.HideWait();
                    _dialogService.ShowToast("No data found!");
                    IsBusy = false; return;
                }
                _dialogService.HideWait();
            }
            else
            {
                Clients = clients;
            }
            IsBusy = false;
        }