コード例 #1
0
        private void Get_CallUser()
        {
            try
            {
                var dbDatabase = new SqLiteDatabase();
                var localList  = dbDatabase.Get_CallUserList();
                if (localList?.Count > 0)
                {
                    int countList = MAdapter.MCallUser.Count;
                    if (countList > 0)
                    {
                        foreach (var item in from item in localList let check = MAdapter.MCallUser.FirstOrDefault(a => a.Id == item.Id) where check == null select item)
                        {
                            MAdapter.MCallUser.Insert(0, item);
                        }
                    }
                    else
                    {
                        MAdapter.MCallUser = new ObservableCollection <Classes.CallUser>(localList.OrderBy(a => a.Id));
                    }

                    MAdapter.NotifyDataSetChanged();
                }


                ShowEmptyPage();
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }