示例#1
0
        private void PopulateNotes()
        {
            int.TryParse(NavigationContext.QueryString["catID"], out categoryListID);

            Debug.WriteLine("CategoryID at category page =  " + categoryListID);
            Debug.Assert(categoryListID != -1, "TaskId should not be null");



            string orderValue;

            if (IsolatedStorageSettings.ApplicationSettings.Contains("orderByName"))
            {
                orderValue = IsolatedStorageSettings.ApplicationSettings["orderByName"].ToString();

                Debug.WriteLine("orderVAlue = " + orderValue);

                if (orderValue == "True")
                {
                    Debug.WriteLine("Order by Namechecked");
                    var noteList = (from k in SterlingService.Current.Database.Query <Notes, int, int>("CategoryID")
                                    where k.Index == categoryListID
                                    orderby k.LazyValue.Value.noteName
                                    select k.LazyValue.Value);

                    this.MainListBox.ItemsSource = noteList;
                }
                else
                {
                    Debug.WriteLine("Order by Datechecked");
                    var noteList = (from k in SterlingService.Current.Database.Query <Notes, int, int>("CategoryID")
                                    where k.Index == categoryListID
                                    orderby k.LazyValue.Value.createDate
                                    select k.LazyValue.Value);

                    this.MainListBox.ItemsSource = noteList;
                }
            }
            else
            {
                Debug.WriteLine("Order by Datechecked");
                var noteList = (from k in SterlingService.Current.Database.Query <Notes, int, int>("CategoryID")
                                where k.Index == categoryListID
                                orderby k.LazyValue.Value.createDate
                                select k.LazyValue.Value);

                this.MainListBox.ItemsSource = noteList;
            }



            CountThis myCount = new CountThis();

            string countNo;

            countNo = myCount.countItem(categoryListID).ToString();

            noOfItems = int.Parse(countNo);
        }
示例#2
0
        private void PopulateCategories()
        {
            this.MainListBox.ItemsSource = from k in SterlingService.Current.Database.Query <Category, int>()
                                           orderby k.LazyValue.Value.categoryName
                                           select k.LazyValue.Value;

            foreach (Category o in MainListBox.Items)
            {
                CountThis myCount = new CountThis();

                string countNo;

                countNo = myCount.countItem(o.Id).ToString();

                o.noItems = int.Parse(countNo);
            }
        }
示例#3
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            CountThis noNotes = new CountThis();

            string noNotesString;

            noNotesString = noNotes.countAllItem().ToString();

            this.AllNo.Text = noNotesString;

            string noDueString;

            noDueString = noNotes.countOverItem().ToString();

            this.DueNo.Text = noDueString;
        }
示例#4
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            CountThis noNotes = new CountThis();

            string noNotesString;

            noNotesString = noNotes.countAllItem().ToString();

            this.AllNo.Text = noNotesString;

            string noDueString;

            noDueString = noNotes.countOverItem().ToString();

            this.DueNo.Text = noDueString;
        }
示例#5
0
        private void PopulateCategories()
        {
            
            this.MainListBox.ItemsSource = from k in SterlingService.Current.Database.Query<Category, int>()
                                           orderby k.LazyValue.Value.categoryName
                                           select k.LazyValue.Value;

            foreach (Category o in MainListBox.Items)
            {
                CountThis myCount = new CountThis();

                string countNo;

                countNo = myCount.countItem(o.Id).ToString();

                o.noItems = int.Parse(countNo);

            }
         }
示例#6
0
        private void PopulateNotes()
        {


            int.TryParse(NavigationContext.QueryString["catID"], out categoryListID);

            Debug.WriteLine("CategoryID at category page =  " + categoryListID);
            Debug.Assert(categoryListID != -1, "TaskId should not be null");



            string orderValue;

            if (IsolatedStorageSettings.ApplicationSettings.Contains("orderByName"))
            {
                orderValue = IsolatedStorageSettings.ApplicationSettings["orderByName"].ToString();

                Debug.WriteLine("orderVAlue = " + orderValue);

                if (orderValue == "True")
                {
                    Debug.WriteLine("Order by Namechecked");
                    var noteList = (from k in SterlingService.Current.Database.Query<Notes, int, int>("CategoryID")
                                    where k.Index == categoryListID
                                    orderby k.LazyValue.Value.noteName
                                    select k.LazyValue.Value);

                    this.MainListBox.ItemsSource = noteList;
                }
                else
                {
                    Debug.WriteLine("Order by Datechecked");
                    var noteList = (from k in SterlingService.Current.Database.Query<Notes, int, int>("CategoryID")
                                    where k.Index == categoryListID
                                    orderby k.LazyValue.Value.createDate
                                    select k.LazyValue.Value);

                    this.MainListBox.ItemsSource = noteList;
                }

            }
            else
            {
                Debug.WriteLine("Order by Datechecked");
                var noteList = (from k in SterlingService.Current.Database.Query<Notes, int, int>("CategoryID")
                                where k.Index == categoryListID
                                orderby k.LazyValue.Value.createDate
                                select k.LazyValue.Value);

                this.MainListBox.ItemsSource = noteList;
            }
      


            CountThis myCount = new CountThis();

            string countNo;

            countNo = myCount.countItem(categoryListID).ToString();

            noOfItems = int.Parse(countNo);


        }