private async void ConfigureSource(bool isSubscibed)
        {
            if (isSubscibed)
            {
                //get selected kid , first time we will continue with  Announcements
                List <KidDetail> selectedkid = await SecureStorage.GetAsync <List <KidDetail> >(Enums.SecureStorageKey.SelectedKids);

                _selectedKidId = selectedkid.Select(x => x.Id).ToList();
                //gets ids in form of string
                string kidIds = GetKidsIsAsString(_selectedKidId);

                //parentkid detail

                ParentkidsDetails = await SecureStorage.GetAsync <Parent>(Enums.SecureStorageKey.AuthorizedUserInfo);

                ParentkidsDetails.kids.FirstOrDefault().IsHighlighted = true.ToString();
                //var aaa = ParentkidsDetails.SelectedKid.Id;


                await GetDashBoardData(kidIds);

                isVisibleAll = ParentkidsDetails.kids.Count > 1;
                MessagingCenter.Unsubscribe <DashboardView, FilterSelection>(this, Enums.MessageCenterAuthenticator.FeedFilter.ToString());
                MessagingCenter.Subscribe <DashboardView, FilterSelection>(this, Enums.MessageCenterAuthenticator.FeedFilter.ToString(), async(sender, arg) =>
                {
                    if (arg != null)
                    {
                        NewsFeedBoxCollectionData   = new List <FeedResponseData>();
                        MealComponentCollectionData = new List <MealChartData>();


                        if (arg.FilteType == "Daily Chart")
                        {
                            await GetMealChart(kidIds, arg.FilterDate);
                        }
                        else if (arg.FilteType != "All")
                        {
                            await GetNewFeeds(kidIds, arg.FilterDate, arg.FilteType);
                        }
                        else
                        {
                            await GetMealChart(kidIds, arg.FilterDate);
                            await GetNewFeeds(kidIds, arg.FilterDate);
                        }

                        filterSelection = arg;
                    }
                });
            }
        }
        private async Task <AuthorizedToken> GetTokenAsync()
        {
            SecureStorageService secureStorageService = new SecureStorageService();
            AuthorizedToken      response             = await secureStorageService.GetAsync <AuthorizedToken>(Enums.SecureStorageKey.AuthorizedToken);

            return(response);
        }
예제 #3
0
        public static async Task <KidDetail> GetKidDetailsFromStorage(int kidId)
        {
            SecureStorageService secureStorageService = new SecureStorageService();
            Parent userInfo = await secureStorageService.GetAsync <Parent>(Enums.SecureStorageKey.AuthorizedUserInfo);

            KidDetail kidDetail = userInfo.kids.Where(x => x.Id == kidId).FirstOrDefault();

            return(kidDetail);
        }
        private async void PostComment_Clicked(object sender, EventArgs e)
        {
            Parent parent = await secureStorageService.GetAsync <Parent>(Enums.SecureStorageKey.AuthorizedUserInfo);

            PostCommentResponseModel responseModel = await DashBoardService.AddComment(parent.id, Feed_Id, Comment);

            //  PostCommentResponseModel responseModel = await DashBoardService.AddComment(1005890, 971363, "test");
            if (responseModel.Code == 200)
            {
                await PopupNavigation.Instance.PopAllAsync();
            }
            MessagingCenter.Send <ToolbarComponent, int>(new ToolbarComponent(), MessageCenterAuthenticator.CommentResponseCode.ToString(), responseModel.Code);
        }