예제 #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
        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);

            }
         }
예제 #4
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);


        }