コード例 #1
0
        public async void BusinessCustomerDialog()
        {
            MessageDialog businessDialogueBox = new MessageDialog("Is the device for personal or business use?");

            businessDialogueBox.Commands.Add(new UICommand("Business")
            {
                Id = 0
            });
            businessDialogueBox.Commands.Add(new UICommand("Personal")
            {
                Id = 1
            });
            //showDialog.DefaultCommandIndex = 0;
            //showDialog.CancelCommandIndex = 1;
            var result = await businessDialogueBox.ShowAsync();

            if ((int)result.Id == 0)
            {
                SolutionHelper.CreateNewSolution(new Customer(true, false));
            }
            else
            {
                SolutionHelper.CreateNewSolution(new Customer());
            }
        }
コード例 #2
0
        public async void AddCustomer(Customer customerToAdd)
        {
            await AddNewCustomer(customerToAdd);

            if (SolutionHelper.CurrentSolution == null)
            {
                SolutionHelper.CreateNewSolution(customerToAdd);
            }
        }
コード例 #3
0
        private async void ClaimCustomer(QueueCustomer queueCustomer)
        {
            if (!queueCustomer.CustomerHelped)
            {
                queueCustomer.ClaimCustomer("Dynamic Users Not Implimented");
                await AddQueueCustomer(queueCustomer);

                ;                if (SolutionHelper.CurrentSolution == null)
                {
                    SolutionHelper.CreateNewSolution(queueCustomer);
                }
            }
        }
コード例 #4
0
        private void AddToProductSolution(Product product)
        {
            Product productToAdd = product as Product;

            if (SolutionHelper.CurrentSolution != null)
            {
                SolutionHelper.AddProductToCurrentSolution(productToAdd);
            }
            else
            {
                SolutionHelper.CreateNewSolution(new Customer(true));
                SolutionHelper.AddProductToCurrentSolution(productToAdd);
            }
        }
コード例 #5
0
        private async void AddToSolution(Product item)
        {
            Product productToAdd = item as Product;

            SolutionHelper.AddProductToCurrentSolution(productToAdd);

            if (SolutionHelper.CurrentSolutionStage == GuidedSolutionStages.SelectAccessoryXbox)
            {
                MessageDialog addAnotherAccy = new MessageDialog("Would you like to add another accessory?");
                addAnotherAccy.Commands.Add(new UICommand("Yes")
                {
                    Id = 0
                });
                addAnotherAccy.Commands.Add(new UICommand("No")
                {
                    Id = 1
                });
                var result = await addAnotherAccy.ShowAsync();

                if ((int)result.Id == 0)
                {
                    return;
                }
                else
                {
                    Messenger.Default.Send <NotificationMessage>(new NotificationMessage(this, "MoveToSolutionView")); //Send message back to XboxView.xaml.cs to navigate to the solutionview
                    SolutionHelper.CreateNewSolution(new Customer());
                }
            }

            if (SolutionHelper.CurrentSolutionStage == GuidedSolutionStages.SelectGameXbox)
            {
                MessageDialog addAnotherGame = new MessageDialog("Would you like to add another game?");
                addAnotherGame.Commands.Add(new UICommand("Yes")
                {
                    Id = 0
                });
                addAnotherGame.Commands.Add(new UICommand("No")
                {
                    Id = 1
                });
                var result = await addAnotherGame.ShowAsync();

                switch ((int)result.Id)
                {
                case 0:
                    return;

                case 1:

                    MessageDialog addAnotherAccy = new MessageDialog("Would you like to add any accessories?");
                    addAnotherAccy.Commands.Add(new UICommand("Yes")
                    {
                        Id = 0
                    });
                    addAnotherAccy.Commands.Add(new UICommand("No")
                    {
                        Id = 1
                    });
                    var result1 = await addAnotherAccy.ShowAsync();

                    if ((int)result1.Id == 0)
                    {
                        SolutionHelper.CurrentSolutionStage = GuidedSolutionStages.SelectAccessoryXbox;
                        XboxListToDisplay.Clear();
                        Products.ToList().ForEach(x => { if (!x.SKU.Contains("QH4") && x.SubCategory.Contains("Xbox Accessory"))
                                                         {
                                                             XboxListToDisplay.Add(x);
                                                         }
                                                  });
                    }
                    else
                    {
                        Messenger.Default.Send <NotificationMessage>(new NotificationMessage(this, "MoveToSolutionView"));    //Send message back to XboxView.xaml.cs to navigate to the solutionview
                        SolutionHelper.CreateNewSolution(new Customer());
                    }

                    break;
                }
            }

            if (SolutionHelper.CurrentSolutionStage == GuidedSolutionStages.SelectDeviceXbox)
            {
                Messenger.Default.Send <NotificationMessage>(new NotificationMessage(this, "OpenCompleteBlades")); //Send message back to XboxView.xaml.cs to open the complete select blade
                SolutionHelper.CurrentSolutionStage = GuidedSolutionStages.SelectGameXbox;
                XboxListToDisplay.Clear();
                Products.ToList().ForEach(x => { if (x.SKU.Contains("QH4"))
                                                 {
                                                     XboxListToDisplay.Add(x);
                                                 }
                                          });
                Products.ToList().ForEach(x => { if (x.Price.Equals(59.99) && !(x.Name.Contains("Controller")))
                                                 {
                                                     XboxListToDisplay.Add(x);
                                                 }
                                          });

                MessageDialog selectFreeGame = new MessageDialog("Select free game.");
                await selectFreeGame.ShowAsync();
            }
        }
コード例 #6
0
        public async void NavigateToNextStage()
        {
            if (SolutionHelper.CurrentSolution == null)
            {
                MessageDialog businessDialogueBox = new MessageDialog("Is the device for personal or business use?");
                businessDialogueBox.Commands.Add(new UICommand("Business")
                {
                    Id = 0
                });
                businessDialogueBox.Commands.Add(new UICommand("Personal")
                {
                    Id = 1
                });
                //showDialog.DefaultCommandIndex = 0;
                //showDialog.CancelCommandIndex = 1;
                var result = await businessDialogueBox.ShowAsync();

                if ((int)result.Id == 0)
                {
                    SolutionHelper.CreateNewSolution(new Models.Customer(true));
                    //frame.Navigate(typeof(Views.SurfaceProView));
                }
                else
                {
                    SolutionHelper.CreateNewSolution(new Models.Customer(false));
                    // frame.Navigate(typeof(Views.SurfaceProView));
                }
            }
            else
            {
                MessageDialog dialogueBox = new MessageDialog("You currenty have an active solution what would you like to do with it?");
                dialogueBox.Commands.Add(new UICommand("Continue it")
                {
                    Id = 0
                });
                dialogueBox.Commands.Add(new UICommand("Throw it away")
                {
                    Id = 1
                });
                dialogueBox.Commands.Add(new UICommand("Save it for later")
                {
                    Id = 2
                });
                //showDialog.DefaultCommandIndex = 0;
                //showDialog.CancelCommandIndex = 1;
                var result = await dialogueBox.ShowAsync();

                if ((int)result.Id == 0)
                {
                    switch (SolutionHelper.CurrentSolutionStage)
                    {
                    case GuidedSolutionStages.SelectCategory:
                        switch (SolutionHelper.CurrentSolutionDevice)
                        {
                        case GuidedSolutionDevices.SurfacePro:
                            //       frame.Navigate(typeof(Views.SurfaceProView));
                            break;

                        case GuidedSolutionDevices.SurfaceBook:
                            break;

                        case GuidedSolutionDevices.SurfaceLaptop:
                            break;

                        case GuidedSolutionDevices.SurfaceStudio:
                            break;

                        case GuidedSolutionDevices.Xbox:
                            break;

                        case GuidedSolutionDevices.OEM:
                            break;

                        default:
                            break;
                        }
                        break;

                    case GuidedSolutionStages.AddOffice:
                        //   frame.Navigate(typeof(OfficePage));
                        break;

                    case GuidedSolutionStages.AddCase:
                        switch (SolutionHelper.CurrentSolutionDevice)
                        {
                        case GuidedSolutionDevices.SurfacePro:
                            //    frame.Navigate(typeof(Views.SelectSleeveView));
                            break;

                        case GuidedSolutionDevices.SurfaceBook:
                            break;

                        case GuidedSolutionDevices.SurfaceLaptop:
                            break;
                        }
                        break;

                    case GuidedSolutionStages.AddAccessories:
                        switch (SolutionHelper.CurrentSolutionDevice)
                        {
                        case GuidedSolutionDevices.SurfacePro:
                            break;

                        case GuidedSolutionDevices.SurfaceBook:
                            break;

                        case GuidedSolutionDevices.SurfaceLaptop:
                            break;

                        case GuidedSolutionDevices.SurfaceStudio:
                            break;

                        case GuidedSolutionDevices.Xbox:
                            break;

                        case GuidedSolutionDevices.OEM:
                            break;

                        default:
                            break;
                        }
                        break;
                    }
                }
                if ((int)result.Id == 0)
                {
                    MessageDialog busDiaBox = new MessageDialog("Is the device for personal or business use?");
                    busDiaBox.Commands.Add(new UICommand("Business")
                    {
                        Id = 0
                    });
                    busDiaBox.Commands.Add(new UICommand("Personal")
                    {
                        Id = 1
                    });
                    //showDialog.DefaultCommandIndex = 0;
                    //showDialog.CancelCommandIndex = 1;
                    var result2 = await dialogueBox.ShowAsync();

                    if ((int)result2.Id == 0)
                    {
                        SolutionHelper.CreateNewSolution(new Models.Customer(true));
                    }
                    else
                    {
                        SolutionHelper.CreateNewSolution(new Models.Customer(false));
                    }
                }
            }
        }