コード例 #1
0
        async Task ExecLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;
            Stolies.Clear();
            var items = await Stolyies.GetItemsAsync(true);

            try
            {
                foreach (var item in items)
                {
                    Stolies.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
コード例 #2
0
        /// <summary>
        /// Vrat objednávku a stůl
        /// </summary>
        /// <param name="table"></param>
        /// <returns></returns>
        public async Task <Tables> PutTask(Tables table)
        {
            OrderInfoServices orderInfoServices = new OrderInfoServices();



            IsBusy = true;
            Stolies.Clear();

            var result = await StolyDataService.UpdateItemAsync(table);


            Orders dataStore = new Orders()
            {
                tableId = table.id, startTime = DateTime.Now,
            };
            var s = await orderInfoServices.AddItemAsync(dataStore);

            table.orders = new ObservableCollection <Orders>();


            table.orders.Add(s);

            IsBusy = false;
            return(table);
        }
コード例 #3
0
        public async Task AddTableAsync(Tables table, bool IsAvailable = false)

        {
            table.isAvailable = IsAvailable;
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;
            Stolies.Clear();
            await StolyDataService.AddItemAsync(table);

            var items = await StolyDataService.GetItemsAsync(true);

            try
            {
                foreach (var item in items)
                {
                    Stolies.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
コード例 #4
0
        public async Task GetTask()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;
            Stolies.Clear();
            var items = await StolyDataService.GetItemsAsync(true);

            try
            {
                foreach (var item in items)
                {
                    Stolies.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }