Пример #1
0
        private async void DoSearch(object obj)
        {
            WorkInProgress = true;
            BatchSummaries.Clear();
            TANs = new ObservableCollection <DeliveryTanVM>();
            try
            {
                var result = await RestHub.DeliveryBatchSummary();

                if (result.HttpCode == System.Net.HttpStatusCode.OK)
                {
                    List <DeliveryBatchDTO> dtos = (List <DeliveryBatchDTO>)result.UserObject;
                    foreach (var dto in dtos)
                    {
                        BatchSummaries.Add(new BatchSummaryVM
                        {
                            Id          = dto.Id,
                            BatchNumber = dto.BatchNumber,
                            TansCount   = dto.TansCount
                        });
                    }
                }
                else
                {
                    AppErrorBox.ShowErrorMessage("Error While Batches . .", result.StatusMessage);
                }
            }
            catch (Exception ex)
            {
                AppErrorBox.ShowErrorMessage("Error While Batches . .", ex.ToString());
            }
            finally
            {
                WorkInProgress = false;
            }
        }