Example #1
0
        /// <summary>
        /// Permet de rafraichir la liste des commentaires.
        /// </summary>
        /// <returns>void.</returns>
        private void RefreshCommentsItems()
        {
            try
            {
                if (NetworkInterface.GetIsNetworkAvailable())
                { 

                    // On interroge ici la tale commentTable pour sortir les élements voulus.
                    // La requete trie les CommentItems par Id
                    items = commentTable
                        .OrderByDescending(x => x.Id)
                        .ToCollectionView();
                    ListItems.ItemsSource = items;
                }
                else
                {
                    MessageBox.Show("Cette application a besoin d'un accès internet.");
                }

                
            }
            catch (Exception)
            {
                MessageBox.Show("Cette application nécessite un accès internet.");
            }
            
        }
Example #2
0
 /// <summary>
 /// Permet de rafraichir la liste de commentaires.
 /// </summary>
 /// <returns>void.</returns>
 private void RefreshComments()
 {
     // This code refreshes the entries in the list view be querying the TodoItems table.
     items = commentTable
         .OrderByDescending(x => x.Id)
         .ToCollectionView();
     ListItems.ItemsSource = items;
 }
 public SearchDonorDetails()
 {
     this.InitializeComponent();
     this.DataContext = new RegisterDonorViewModel();
     //donnerList.ItemsSource = App.MobileService.GetTable<BloodDonors>();
     items = donorTableList.ToCollectionView();
     donorList.ItemsSource = items;
 }
Example #4
0
 /// <summary>
 /// Invoked when this page is about to be displayed in a Frame.
 /// </summary>
 /// <param name="e">Event data that describes how this page was reached.  The Parameter
 /// property is typically used to configure the page.</param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     updates = updatesTable
         .OrderByDescending(u => u.Date)
         .Take(10)
         .ToCollectionView();
     items.ItemsSource = updates;
 }
Example #5
0
 private void RefreshBloodDonors()
 {
     // This code refreshes the entries in the list view be querying the BloodDonors table.
     // The query excludes completed BloodDonors
     donors = bloodDonorTable
              //.Where(bloodDonor => bloodDonor.NevenDonated == false)
              .ToCollectionView();
 }
Example #6
0
 public SearchDonorDetails()
 {
     this.InitializeComponent();
     this.DataContext = new RegisterDonorViewModel();
     //donnerList.ItemsSource = App.MobileService.GetTable<BloodDonors>();
     items = donorTableList.ToCollectionView();
     donorList.ItemsSource = items;
 }
Example #7
0
 /// <summary>
 /// Invoked when this page is about to be displayed in a Frame.
 /// </summary>
 /// <param name="e">Event data that describes how this page was reached.  The Parameter
 /// property is typically used to configure the page.</param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     updates = updatesTable
               .OrderByDescending(u => u.Date)
               .Take(10)
               .ToCollectionView();
     items.ItemsSource = updates;
 }
Example #8
0
 private void RefreshTodoItems()
 {
     // This code refreshes the entries in the list view be querying the TodoItems table.
     // REMOVED the filter on completed items, so they're all dislpayed
     items = todoTable
         //.Where(todoItem => todoItem.Complete == false)
         .ToCollectionView();
     ListItems.ItemsSource = items;
 }
Example #9
0
 private void RefreshTodoItems()
 {
     // This code refreshes the entries in the list view be querying the TodoItems table.
     // The query excludes completed TodoItems
     items = todoTable
             .Where(todoItem => todoItem.Complete == false)
             .ToCollectionView();
     ListItems.ItemsSource = items;
 }
Example #10
0
 private void RefreshTodoItems()
 {
     // This code refreshes the entries in the list view be querying the TodoItems table.
     // The query excludes completed TodoItems
     items = todoTable
         .Where(todoItem => todoItem.Complete == false)
         .ToCollectionView();
     ListItems.ItemsSource = ListItems1.ItemsSource = items;
 }
Example #11
0
 private void RefreshTodoItems()
 {
     // This code refreshes the entries in the list view be querying the TodoItems table.
     // REMOVED the filter on completed items, so they're all dislpayed
     items = todoTable
             //.Where(todoItem => todoItem.Complete == false)
             .ToCollectionView();
     ListItems.ItemsSource = items;
 }
        private void RefreshTodoItems()
        {
            //// TODO #1: Defines a simple query for all items. 
            items = todoTable.ToCollectionView();

            //// TODO #2: More advanced query that filters out completed items. 
            //items = todoTable
            //   .Where(todoItem => todoItem.Complete == false)
            //   .ToCollectionView();
           
            ListItems.ItemsSource = items;
        }
        public async Task SimpleDataSourceWithTotalCount()
        {
            // Get the Books table
            IMobileServiceTable <Book> table = GetClient().GetTable <Book>();

            // Create a new CollectionView
            Log("Creating DataSource");
            MobileServiceCollectionView <Book> dataSource =
                table.Take(5).IncludeTotalCount().ToCollectionView();

            // Spin until the data finishes loading on another thread
            Log("Waiting for population");
            while (dataSource.Count <= 0)
            {
                await Task.Delay(500);
            }

            Log("Verifying loaded");
            Assert.AreEqual(5, dataSource.Count);
            Assert.AreEqual((long)18, ((ITotalCountProvider)dataSource).TotalCount);
        }
Example #14
0
        public async Task SimpleDataSource()
        {
            // Get the Books table
            IMobileServiceTable <Book> table = GetClient().GetTable <Book>();

            // Create a new CollectionView
            Log("Creating DataSource");
            MobileServiceCollectionView <Book> dataSource =
                table.OrderByDescending(b => b.Price).ToCollectionView();

            // Spin until the data finishes loading on another thread
            Log("Waiting for population");
            while (dataSource.Count <= 0)
            {
                await Task.Delay(500);
            }

            Log("Verifying loaded");
            Assert.AreEqual(18, dataSource.Count);
            Assert.AreEqual(22.95, dataSource[0].Price);
        }
Example #15
0
 private void Search_Click(object sender, RoutedEventArgs e)
 {
     if (cbCity.SelectedValue != null && cbBloodGroup.SelectedValue != null)
     {
         items = donorTableList
                 .Where(d => d.City == cbCity.SelectedValue && d.BloodGroup == cbBloodGroup.SelectedValue)
                 .ToCollectionView();
     }
     else if (cbCity.SelectedValue != null && cbBloodGroup.SelectedValue == null)
     {
         items = donorTableList
                 .Where(d => d.City == cbCity.SelectedValue)
                 .ToCollectionView();
     }
     else
     {
         items = donorTableList
                 .Where(d => d.BloodGroup == cbBloodGroup.SelectedValue)
                 .ToCollectionView();
     }
     donorList.ItemsSource = items;
 }
 private void Search_Click(object sender, RoutedEventArgs e)
 {
     if (cbCity.SelectedValue != null && cbBloodGroup.SelectedValue != null)
     {
         items = donorTableList
             .Where(d => d.City == cbCity.SelectedValue && d.BloodGroup == cbBloodGroup.SelectedValue)
             .ToCollectionView();
     }
     else if (cbCity.SelectedValue != null && cbBloodGroup.SelectedValue == null)
     {
         items = donorTableList
             .Where(d => d.City == cbCity.SelectedValue)
             .ToCollectionView();
     }
     else
     {
         items = donorTableList
             .Where(d => d.BloodGroup == cbBloodGroup.SelectedValue)
             .ToCollectionView();
     }
     donorList.ItemsSource = items;
 }
Example #17
0
        private void RefreshTodoItems()
        {
            // Unanswered questions.
            items = questionTable
                .Where(todoItem => todoItem.UserId == userId && todoItem.Answer.Length == 0)
                .ToCollectionView();

            PendingQuestions.ItemsSource = items;

            // Answered questions.
            items = questionTable
                .Where(todoItem => todoItem.UserId == userId && todoItem.Answer.Length != 0)
                .ToCollectionView();

            AnsweredQuestions.ItemsSource = items;

            // Questions we've been asked.
            items = questionTable
                .Where(todoItem => todoItem.Friend == userId)
                .ToCollectionView();

            FriendsQuestions.ItemsSource = items;
        }
Example #18
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            Loaded += MainPage_Loaded;
            items = itemTable.ToCollectionView();
            MessageBox.Show("Itemtable: " + itemTable.ToString());
            add = new Item();
            GridAdd.DataContext = add;
            
            //Get today as default
            selectedDate = new DateTime();
            selectedDate = DateTime.Today;
            SelectedDay = new Day();
            SelectedDay.Date = selectedDate;
            SelectedDay = App.ViewModel.AddDay(SelectedDay);
   
            if (SelectedDay.Intakes != null) LongListDiary.ItemsSource = SelectedDay.Intakes;

            Diary.DataContext = SelectedDay;
            
            MessageBox.Show("Itemcount" + items.Count);
            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
        }
        private void RefreshTodoItems()
        {
            // This code refreshes the entries in the list view be querying the TodoItems table.
            // The query excludes completed TodoItems

            ppp = Table.OrderBy(a => a.City).IncludeTotalCount().ToCollectionView();

            itemListView.ItemsSource = ppp;
            itemGridView.ItemsSource = ppp;
            //ListEvent.ItemsSource = ppp;
        }
Example #20
0
 /// <summary>
 /// Searches from mobileservice table for items containing
 /// searchcriteria
 /// </summary>
 /// <param name="hakusana"></param>
 private void Haku(string hakusana)
 {
    TextBlockHakusana.Text = hakusana + " ...";
  
    search = App.MobileService.GetTable<Item>().Where(item => item.Name.Contains(hakusana))
        .ToCollectionView();
    
    ListHakutulokset.ItemsSource = search;
    
    Progressbar.IsVisible = false;
 }
 private void RefreshBloodDonors()
 {
     // This code refreshes the entries in the list view be querying the BloodDonors table.
     // The query excludes completed BloodDonors
     donors = bloodDonorTable
         //.Where(bloodDonor => bloodDonor.NevenDonated == false)
         .ToCollectionView();
 }
Example #22
0
        private void CommentsFunctionOn(string currentRestaurant)
        {
            //上传数据餐厅选择
            CommentRestaurantTextBlock.Text = "对\" " + currentRestaurant + "\"的评价:";
            //获取评价
            try
            {
                items = commentTable
                .Where(dinnerdecisioncomments => dinnerdecisioncomments.Location.Trim() == currentRestaurant.Trim())
                .ToCollectionView();

                timer1.Start();
                timer2.Start();
            }
            catch (Exception)
            {
                timer1.Stop();
                timer2.Stop();
            }
        }
        private void RefreshTodoItems()
        {
            // This code refreshes the entries in the list view be querying the TodoItems table.
            // The query excludes completed TodoItems                     

            LocalUser = UsersTable.Where(a => a.User == UserID).IncludeTotalCount().ToCollectionView();   
            ListEvent.ItemsSource = LocalUser;

        }