Example #1
0
        public async Task <ObservableCollection <Course> > GetCourses()
        {
            await Initialize();

            //await SyncCourses();

            return(await tableCourse
                   .OrderBy(x => x.CourseName)
                   .ToCollectionAsync());
        }
Example #2
0
 public async Task <ICollection <T> > ReadAllItemsOrderedAsync <TKey>(Expression <Func <T, TKey> > orderbyExpression = null, bool descending = false)
 {
     if (descending)
     {
         return(await table.OrderByDescending(orderbyExpression).ToListAsync());
     }
     else
     {
         return(await table.OrderBy(orderbyExpression).ToListAsync());
     }
 }
Example #3
0
        public async Task <IEnumerable> GetBooking()
        {
            await Initialize();
            await SyncBooking();

            return(await bookingTable.OrderBy(c => c.Date).ToEnumerableAsync());
        }
Example #4
0
        public async Task <IEnumerable <PlayerInfo> > GetPlayersInfo()
        {
            await Initialize();
            await SyncPlayerInfo();

            return(await playerInfoTable.OrderBy(c => c.DateUtc).ToEnumerableAsync());;
        }
Example #5
0
        public async Task RefreshVehiclesAsync()
        {
            MobileServiceInvalidOperationException exception = null;

            try
            {
                // This code refreshes the entries in the list view by querying the TodoItems table.
                // The query excludes completed TodoItems
                Items = await vehicles
                        .OrderBy(x => x.Name)
                        .ToCollectionAsync();
            }
            catch (MobileServiceInvalidOperationException e)
            {
                exception = e;
            }

            if (exception != null)
            {
                await new MessageDialog(exception.Message, "Error loading items").ShowAsync();
            }
            else
            {
            }
        }
        private async Task RefreshTodoItems()
        {
            MobileServiceInvalidOperationException exception = null;

            try
            {
                // This code refreshes the entries in the list view by querying the TodoItems table.
                // The query excludes completed TodoItems
                items = await todoTable
                        .OrderBy(todoItem => todoItem.Text)
                        .ToCollectionAsync();
            }
            catch (MobileServiceInvalidOperationException e)
            {
                exception = e;
            }

            if (exception != null)
            {
                await new MessageDialog(exception.Message, "Error loading items").ShowAsync();
            }
            else
            {
                ListItems.ItemsSource     = items;
                this.ButtonSave.IsEnabled = true;
            }
        }
Example #7
0
        public async Task <IEnumerable <USUARIO> > GetUsers()
        {
            await Initialize();
            await SyncUsers();

            return(await userTable.OrderBy(c => c.DateUtc).ToEnumerableAsync());
        }
Example #8
0
        //////////////////////////////////Tabla Platillos//////////////////////////////
        public async Task <IEnumerable <Platillos> > ObtenerPlatillos()
        {
            await Initialize();
            await SyncPlatillos();

            return(await tablaPlatillos.OrderBy(a => a.Nombre).ToEnumerableAsync());
        }
Example #9
0
        //////////////////////////////////Tabla RESERVACIONES//////////////////////////////
        public async Task <IEnumerable <Reservaciones> > ObtenerReservaciones()
        {
            await Initialize();
            await SyncReservaciones();

            return(await tablaReservacions.OrderBy(a => a.Fecha).ToEnumerableAsync());
        }
Example #10
0
        public async Task <ObservableCollection <TodoItem> > GetTodoItemsAsync(bool syncItems = false)
        {
            try
            {
#if OFFLINE_SYNC_ENABLE
                if (syncItems)
                {
                    await this.SyncAsync();
                }
#endif
                IEnumerable <TodoItem> items = await todoTable
                                               .OrderBy(todoItem => todoItem.Name) //orders table by item name
                                               .ToEnumerableAsync();               //gets elements of table asynchronously

                return(new ObservableCollection <TodoItem>(items));
            }
            catch (MobileServiceInvalidOperationException msioe)
            {
                Debug.WriteLine(@"Invalid sync operation: {0}", msioe.Message);
            }
            catch (Exception e)
            {
                Debug.WriteLine(@"Sync error: {0}", e.Message);
                throw new Exception();
            }
            return(null);
        }
        public async Task <IEnumerable> GetIProducts()
        {
            await Intialize();
            await LoadPersons();

            return(await personTable.OrderBy(c => c.LastName).ToEnumerableAsync());
        }
Example #12
0
        public async Task <IEnumerable <Listado> > GetListado()
        {
            await Initialize();
            await SyncListado();

            return(await table.OrderBy(s => s.Name).ToEnumerableAsync());
        }
        public async Task <IList <LocalModel> > GetLocais()
        {
            await Initialize();
            await SyncLocais();

            return(await _localModel.OrderBy(a => a.Nome).ToListAsync());
        }
Example #14
0
        public async Task <IEnumerable <Photo> > GetPhotos()
        {
            await Initialize();
            await SyncPhotos();

            return(await table.OrderBy(s => s.Name).ToEnumerableAsync());
        }
Example #15
0
        public async Task <IEnumerable <Transactions> > GetTransactions()
        {
            await Initialize();
            await SyncTransaction();

            return(await transactionTable.OrderBy(c => c.TransDate).ToEnumerableAsync());
        }
        public async Task <ObservableCollection <T> > RefreshAsync(bool syncItems = true)
        {
            Debug.WriteLine($"[AzureDataTable$RefreshAsync] Entry");
            try
            {
                if (syncItems && isSyncTable)
                {
                    Debug.WriteLine($"[AzureDataTable$RefreshAsync] Updating Offline Sync Cache");
                    await this.SyncOfflineCacheAsync();
                }
                Debug.WriteLine($"[AzureDataTable$RefreshAsync] Requesting Items");
                if (isSyncTable)
                {
                    List <T> items = await syncTable.OrderBy(item => item.UpdatedAt).ToListAsync();

                    dataView = new ObservableCollection <T>(items);
                }
                else
                {
                    List <T> items = await dataTable.OrderBy(item => item.UpdatedAt).ToListAsync();

                    dataView = new ObservableCollection <T>(items);
                }
                Debug.WriteLine($"[AzureDataTable$RefreshAsync] {dataView.Count} items available");
                return(dataView);
            }
            catch (MobileServiceInvalidOperationException exception)
            {
                throw new CloudTableOperationFailed(exception.Message, exception);
            }
        }
Example #17
0
        public async Task <IEnumerable <Galeria> > ObtenerFotosdeGaleria()
        {
            await Initialize();
            await SyncGaleria();

            return(await tablaGaleria.OrderBy(a => a.urlimagen).ToEnumerableAsync());
        }
Example #18
0
        public async Task <IEnumerable <Event> > GetEvents()
        {
            await Initialize();
            await SyncEvent();

            return(await eventTable.OrderBy(c => c.Date).ToEnumerableAsync());
        }
Example #19
0
        //////////////////////////////////Tabla Usuarios//////////////////////////////
        public async Task <IEnumerable <Usuarios> > ObtenerUsuarios()
        {
            await Initialize();
            await SyncUsuarios();

            return(await tablaUsuario.OrderBy(a => a.Nombre).ToEnumerableAsync());
        }
Example #20
0
        public async Task <IEnumerable <Item> > GetBooks()
        {
            await Initialize();
            await SyncBooks();

            return(await table.OrderBy(s => s.Name).ToEnumerableAsync());
        }
Example #21
0
        ////////////////////////////////Tabla Categoria/////////////////////////////////////
        public async Task <IEnumerable <Categorias> > ObtenerCategorias()
        {
            await Initialize();
            await SyncCategorias();

            return(await tablaCategorias.OrderBy(a => a.Nombre).ToEnumerableAsync());
        }
Example #22
0
        /// <summary>
        /// Gets all sycned lunches orderd by <see cref="Lunch.OfficeLeftDate"/>
        /// </summary>
        /// <returns>All, sorted lunches</returns>
        public async Task <IEnumerable <Lunch> > GetLunches()
        {
            await Initialize();
            await SyncLunches();

            return(await table.OrderBy(s => s.OfficeLeftDate).ToEnumerableAsync());
        }
Example #23
0
        //////////////////////////////////////////Promociones///////////////////////////////////
        public async Task <IEnumerable <Promociones> > ObtenerPromociones()
        {
            await Initialize();
            await SyncPromociones();

            return(await tablaPromocines.OrderBy(a => a.Nombre).ToEnumerableAsync());
        }
Example #24
0
        public async Task <IEnumerable <Speaker> > GetSpeakers()
        {
            await Initialize();
            await SyncSpeakers();

            return(await table.OrderBy(s => s.Name).ToEnumerableAsync());
        }
        public async Task <IList <Movie> > GetMoviesAsync()
        {
            await InitAndSync();

            return(await _moviesTable.OrderBy(m => m.Genre).
                   ToListAsync());
        }
Example #26
0
        public async Task <IEnumerable <RATING> > GetRatings()
        {
            await Initialize();
            await SyncRatings();

            return(await ratingsTable.OrderBy(c => c.DateUtc).ToEnumerableAsync());;
        }
        public async Task <IList <AttendeeModel> > GetAttendees()
        {
            await Initialize();
            await SyncAttendees();

            return(await _attendee.OrderBy(a => a.Name).ToListAsync());
        }
        public async Task <IEnumerable> GetForms()
        {
            await Initialize();
            await SyncForm();

            return(await formTable.OrderBy(c => c.EnteredDateUTC).ToEnumerableAsync());
        }
Example #29
0
        public async Task <IEnumerable <Coffee> > GetCoffees()
        {
            await Initialize();
            await SyncCoffee();

            return(await coffeeTable.OrderBy(c => c.Name).ToEnumerableAsync());
        }
        private async Task RefreshTodoItems()
        {
            MobileServiceInvalidOperationException exception = null;

            try
            {
                items = await todoTable
                        .OrderBy(todoItem => todoItem.Text)
                        .ToCollectionAsync();
            }
            catch (MobileServiceInvalidOperationException e)
            {
                exception = e;
            }

            if (exception != null)
            {
                await new MessageDialog(exception.Message, "Error loading items").ShowAsync();
            }
            else
            {
                ListItems.ItemsSource     = items;
                this.ButtonSave.IsEnabled = true;
            }
        }