public void GetRowClickedFromCategorySource(Category CategoryRow)
        {
            imageTableViewController.View.Hidden = true;
            SessionCategory = CategoryRow;
            imageTableViewController.setTitle(SessionCategory.CategoryName);
            //**RIGHT HERE

            List <Session> sessionsByProfileCategory          = new DatabaseContext <Session>().GetQuery("SELECT * FROM Session WHERE CategoryID = ? and ParentProfileID = ?", new string[] { SessionCategory.ID.ToString(), CurrentProfile.ID.ToString() });
            List <Session> specificProfileSessionsListTrimmed = new List <Session>();

            if (sessionsByProfileCategory.Count > 0)
            {
                for (int i = 0; i < sessionsByProfileCategory.Count; i++)
                {
                    if (sessionsByProfileCategory[i].CategoryID.Equals(SessionCategory.ID))
                    {
                        specificProfileSessionsListTrimmed.Add(sessionsByProfileCategory[i]);
                    }
                }
            }
            //SessionSource.UpdateTableSource(specificProfileSessionsListTrimmed);
            SessionSource.UpdateTableSource(specificProfileSessionsListTrimmed);
            ranSessions.ReloadSessionTableData(SessionSource);
            imageTableViewController.ReloadRanSessionTableData();
            //RanImagesSource = new TableSourceRanImages();
        }
예제 #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            setPercentageLabel();
            btnYes.TouchUpInside += (sender, e) =>
            {
                if (ReturnSessionData != null && _Session != null)                 //check if delegate has been initialized
                {
                    ReturnSessionData(_Session, _Attempted, _Correct);
                }

                List <Session> sessionsByProfileCategory          = new DatabaseContext <Session>().GetQuery("SELECT * FROM Session WHERE CategoryID = ? and ParentProfileID = ?", new string[] { SessionCategory.ID.ToString(), CurrentProfile.ID.ToString() });
                List <Session> specificProfileSessionsListTrimmed = new List <Session>();
                if (sessionsByProfileCategory.Count > 0)
                {
                    for (int i = 0; i < sessionsByProfileCategory.Count; i++)
                    {
                        if (sessionsByProfileCategory[i].CategoryID.Equals(SessionCategory.ID))
                        {
                            specificProfileSessionsListTrimmed.Add(sessionsByProfileCategory[i]);
                        }
                    }
                }
                //SessionSource.UpdateTableSource(specificProfileSessionsListTrimmed);
                SessionSource.UpdateTableSource(specificProfileSessionsListTrimmed);
                ranSessions.ReloadSessionTableData(SessionSource);
                imageTableViewController.ReloadRanSessionTableData();
                //RanImagesSource = new TableSourceRanImages();

                tabBar.SelectedIndex = 4;
                tabBar.DismissModalViewController(true);
            };

            btnNo.TouchUpInside += (sender, e) =>
            {
                tabBar.SelectedIndex = 4;
                tabBar.DismissModalViewController(true);
            };
        }