async private void More_Click(object sender, RoutedEventArgs e)
 {
     moreInfo             = new DetailsDialog();
     this.vm              = this.DataContext as PreferredSupplierPageViewModel;
     moreInfo.DataContext = vm.SelectedTask;
     await moreInfo.ShowAsync();
 }
Beispiel #2
0
        protected virtual void ApplyDefaultSettings()
        {
            // Apply default values from the registered options.
            // This works best by making a DetailsDialog apply its default settings.
            DetailsDialog d = new DetailsDialog(this.AriadneSettingsSource);

            d.OnSet(null, null);
        }
Beispiel #3
0
        private void SearchPanel_ViewDetailsClicked(object sender, DeletedStudyViewDetailsClickedEventArgs e)
        {
            var dialogViewModel = new DeletedStudyDetailsDialogViewModel {
                DeletedStudyRecord = e.DeletedStudyInfo
            };

            DetailsDialog.ViewModel = dialogViewModel;
            DetailsDialog.Show();
        }
        public object GetDetails()
        {
            var dialog = new DetailsDialog();

            if (dialog.ShowDialog() == true)
            {
                return(new { Name = dialog.SongName, Artist = dialog.SongArtist, Genre = dialog.SongGenre });
            }
            return(null);
        }
Beispiel #5
0
        private async void ContactListView_ItemClick(object sender, ItemClickEventArgs e)
        {
            var contactImformation = e.ClickedItem as Contact;

            ContentDialog dialog = new ContentDialog()
            {
                Content             = $"You are about to call {contactImformation.Name}",
                PrimaryButtonText   = "Call",
                SecondaryButtonText = "Edit Information"
            };

            var res = await dialog.ShowAsync();

            switch (res)
            {
            case ContentDialogResult.None:
                break;

            case ContentDialogResult.Primary:
                await Launcher.LaunchUriAsync(new Uri($"tel:+1{contactImformation.Phone}"));

                break;

            case ContentDialogResult.Secondary:
                if (contactImformation != null)
                {
                    ContentDialog contentDialog = new DetailsDialog(contactImformation)
                    {
                        MaxHeight = ActualHeight,
                        MaxWidth  = ActualWidth
                    };
                    var result = await contentDialog.ShowAsync();

                    switch (result)
                    {
                    case ContentDialogResult.None:
                        break;

                    case ContentDialogResult.Primary:
                        ReadDB();
                        break;

                    case ContentDialogResult.Secondary:
                        ReadDB();
                        break;

                    default:
                        break;
                    }
                }
                break;
            }
        }
        private void NewDetailsDialog_Click(Object sender, RoutedEventArgs e)
        {
            var Details = new DetailsDialog();

            if (Details.ShowDialog() == true)
            {
                Revenue.Text = String.Format("{0}", Details.Revenue);
                CGOS.Text    = String.Format("{0}", Details.CGOS);
                Percent.Text = String.Format("{0}", Details.Percent);
                Result.Text  = String.Format("{0}", AC.GrossMargin(Convert.ToDecimal(Details.Revenue), Convert.ToDecimal(Details.CGOS), Convert.ToDecimal(Details.Percent)));
            }
        }
Beispiel #7
0
        /// <summary>
        /// Opens a Details dialog.
        /// </summary>
        private void OnDetails(object sender, EventArgs e)
        {
            // This is not allowed while the Solver is busy.
            if (State != SolverState.Ready && State != SolverState.Finished)
            {
                return;
            }

            DetailsDialog form = new DetailsDialog(this.AriadneSettingsSource);

            form.ShowDialog(this);
        }
Beispiel #8
0
        public TechnicalInspectionPageViewModel(INavigationService navigationService, ITaskService taskService)
        {
            _navigationService         = navigationService;
            this._taskService          = taskService;
            MaintenanceRepairKVPair    = new Dictionary <long, MaintenanceRepair>();
            this.MaintenanceRepairList = new ObservableCollection <MaintenanceRepair>();

            this.NextCommand = new DelegateCommand(async() =>
            {
                try
                {
                    await UpdateCacheOnCaptureImageAsync();

                    List <Eqstra.BusinessLogic.Portable.TIModels.ImageCapture> imageCaptureList = new List <Eqstra.BusinessLogic.Portable.TIModels.ImageCapture>();
                    foreach (var item in this.MaintenanceRepairList)
                    {
                        if (item.MajorComponentImgList.Any())
                        {
                            imageCaptureList.AddRange(item.MajorComponentImgList);
                        }
                        if (item.SubComponentImgList.Any())
                        {
                            imageCaptureList.AddRange(item.SubComponentImgList);
                        }
                    }
                    await Util.WriteToDiskAsync <List <Eqstra.BusinessLogic.Portable.TIModels.ImageCapture> >(imageCaptureList, "ImageCaptureList");


                    _navigationService.Navigate("InspectionDetail", string.Empty);
                }
                catch (Exception ex)
                {
                }
            }, () =>
            {
                return(this.SelectedTask.ComponentList != null && this.SelectedTask.ComponentList.Any());
            });

            this.DetailCommand = new DelegateCommand(async() =>
            {
                dd             = new DetailsDialog();
                dd.DataContext = this.SelectedTask;
                await dd.ShowAsync();
            });
        }
Beispiel #9
0
        public ServiceSchedulingPageViewModel(INavigationService navigationService, IEventAggregator eventAggregator, ILocationService locationService, IServiceDetailService serviceDetailService, ISupplierService supplierService, ITaskService taskService)
        {
            this._navigationService    = navigationService;
            this._serviceDetailService = serviceDetailService;
            this._taskService          = taskService;
            this._eventAggregator      = eventAggregator;
            this._locationService      = locationService;
            this._supplierService      = supplierService;
            this.Model            = new ServiceSchedulingDetail();
            _busyIndicator        = new BusyIndicator();
            IsEnabledDesType      = true;
            this.Address          = new BusinessLogic.Portable.SSModels.Address();
            this.applicationTheme = Application.Current.RequestedTheme;
            this.SpBorderBrush    = this.applicationTheme == ApplicationTheme.Dark ? new SolidColorBrush(Colors.White) : new SolidColorBrush(Colors.Black);
            this.LtBorderBrush    = this.applicationTheme == ApplicationTheme.Dark ? new SolidColorBrush(Colors.White) : new SolidColorBrush(Colors.Black);
            this.DtBorderBrush    = this.applicationTheme == ApplicationTheme.Dark ? new SolidColorBrush(Colors.White) : new SolidColorBrush(Colors.Black);
            this.StBorderBrush    = this.applicationTheme == ApplicationTheme.Dark ? new SolidColorBrush(Colors.White) : new SolidColorBrush(Colors.Black);
            this.IsLiftRequired   = false;
            this.AddVisibility    = Visibility.Collapsed;
            BoundWidth            = Window.Current.Bounds.Width - 30;
            BoundMinWidth         = Window.Current.Bounds.Width - 80;

            this.NextPageCommand = DelegateCommand.FromAsyncHandler(
                async() =>
            {
                try
                {
                    if (this.Validate())
                    {
                        _busyIndicator.Open("Please wait, Saving ...");

                        this.Model.ServiceDateOption1 = this.Model.ServiceDateOpt1.ToString("MM/dd/yyyy HH:mm");
                        this.Model.ServiceDateOption2 = this.Model.ServiceDateOpt2.ToString("MM/dd/yyyy HH:mm");
                        this.Model.ODOReadingDate     = this.Model.ODOReadingDt.ToString("MM/dd/yyyy HH:mm");
                        bool response = await _serviceDetailService.InsertServiceDetailsAsync(this.Model, this.Address, this.UserInfo);
                        if (response)
                        {
                            var caseStatus = await this._taskService.UpdateStatusListAsync(this.SelectedTask, this.UserInfo);
                            var supplier   = new SupplierSelection()
                            {
                                CaseNumber = this.SelectedTask.CaseNumber, CaseServiceRecID = this.SelectedTask.CaseServiceRecID, SelectedSupplier = this.SelectedSupplier
                            };
                            var res = await this._supplierService.InsertSelectedSupplierAsync(supplier, this.UserInfo);
                            if (res)
                            {
                                this.SelectedTask.Status = caseStatus.Status;
                                await this._taskService.UpdateStatusListAsync(this.SelectedTask, this.UserInfo);
                                PersistentData.RefreshInstance();
                                navigationService.Navigate("Main", string.Empty);
                            }
                        }
                        _busyIndicator.Close();
                    }
                }
                catch (Exception ex)
                {
                    _busyIndicator.Close();
                }
                finally
                {
                }
            },

                () => { return(this.Model != null); });


            this.TakePictureCommand = DelegateCommand <ImageCapture> .FromAsyncHandler(async (param) =>
            {
                FileOpenPicker openPicker = new FileOpenPicker();
                openPicker.ViewMode       = Windows.Storage.Pickers.PickerViewMode.Thumbnail;
                openPicker.FileTypeFilter.Add(".bmp");
                openPicker.FileTypeFilter.Add(".png");
                openPicker.FileTypeFilter.Add(".jpeg");
                openPicker.FileTypeFilter.Add(".jpg");
                PersistentData.Instance.ServiceSchedulingDetail = this.Model;

                openPicker.PickSingleFileAndContinue();

                this._eventAggregator.GetEvent <ServiceSchedulingDetailEvent>().Subscribe(model =>
                {
                    this.Model = model;
                });
                this._eventAggregator.GetEvent <ImageCaptureEvent>().Subscribe(imageCapture =>
                {
                    this.Model.OdoReadingImageCapture = imageCapture;
                });
            });

            this.OpenImageViewerCommand = new DelegateCommand(
                async() =>
            {
                if (_imageViewer == null)
                {
                    _imageViewer = new ImageViewerPopup(this._eventAggregator, this.Model);
                }
                else
                {
                    _imageViewer      = null;
                    this._imageViewer = new ImageViewerPopup(this._eventAggregator, this.Model);
                }

                _imageViewer.DataContext = this.Model.OdoReadingImageCapture;
                await _imageViewer.ShowAsync();
            });


            this.VoiceCommand = new DelegateCommand(async() =>
            {
                try
                {
                    SpeechRecognizer recognizer = new SpeechRecognizer();

                    SpeechRecognitionTopicConstraint topicConstraint = new SpeechRecognitionTopicConstraint(SpeechRecognitionScenario.Dictation, "Development");

                    recognizer.Constraints.Add(topicConstraint);
                    await recognizer.CompileConstraintsAsync();

                    var results = await recognizer.RecognizeWithUIAsync();
                    if (results != null & (results.Confidence != SpeechRecognitionConfidence.Rejected))
                    {
                        this.Model.AdditionalWork = results.Text;
                    }
                    else
                    {
                        await new MessageDialog("Sorry, I did not get that.").ShowAsync();
                    }
                }
                catch (Exception)
                {
                }
            });


            this.AddCommand = new DelegateCommand(async() =>
            {
                _addressDialog = new AddressDialog(this._locationService, this._eventAggregator, this.Address);
                this.Model.SelectedDestinationType = new DestinationType();
                await _addressDialog.ShowAsync();
            });

            this.DetailCommand = new DelegateCommand(async() =>
            {
                moreInfo             = new DetailsDialog();
                moreInfo.DataContext = this.SelectedTask;
                await moreInfo.ShowAsync();
            });

            this.SupplierFilterCommand = new DelegateCommand(async() =>
            {
                sp = new SearchSupplierDialog(this._locationService, this._eventAggregator, this._supplierService);
                await sp.ShowAsync();
            });

            this._eventAggregator.GetEvent <AddressFilterEvent>().Subscribe((address) =>
            {
                if (address != null)
                {
                    this.Address     = address;
                    StringBuilder sb = new StringBuilder();

                    sb.Append(address.Street).Append(",").Append(Environment.NewLine);

                    if ((address.SelectedSuburb != null) && !String.IsNullOrEmpty(address.SelectedSuburb.Name))
                    {
                        sb.Append(address.SelectedSuburb.Name).Append(",").Append(Environment.NewLine);
                    }
                    if (address.SelectedRegion != null)
                    {
                        sb.Append(address.SelectedRegion.Name).Append(",").Append(Environment.NewLine);
                    }
                    if ((address.SelectedCity != null) && !String.IsNullOrEmpty(address.SelectedCity.Name))
                    {
                        sb.Append(address.SelectedCity.Name).Append(",").Append(Environment.NewLine);
                    }
                    if ((address.Selectedprovince != null) && !String.IsNullOrEmpty(address.Selectedprovince.Name))
                    {
                        sb.Append(address.Selectedprovince.Name).Append(",").Append(Environment.NewLine);
                    }

                    if ((address.SelectedCountry != null) && !String.IsNullOrEmpty(address.SelectedCountry.Name))
                    {
                        sb.Append(address.SelectedCountry.Name).Append(",").Append(Environment.NewLine);
                    }

                    sb.Append(address.SelectedZip);


                    this.Model.Address = sb.ToString();
                }
            });

            _eventAggregator.GetEvent <SupplierFilterEvent>().Subscribe(poolofSupplier =>
            {
                this.PoolofSupplier = poolofSupplier;
            });
        }
 async private void Details_Click(object sender, RoutedEventArgs e)
 {
     dd             = new DetailsDialog();
     dd.DataContext = this.vm.InspectionTask;
     await dd.ShowAsync();
 }