public void AddCompleteToSolution(bool addComplete)
 {
     if (addComplete)
     {
         SolutionHelper.AddProductToCurrentSolution(XboxComplete);
     }
 }
Exemple #2
0
        private void AddToSolution(Product item)
        {
            Product productToAdd = item as Product;

            SolutionHelper.AddProductToCurrentSolution(productToAdd);
            Messenger.Default.Send <NotificationMessage>(new NotificationMessage(this, "CloseWindowsBoundToMe")); //Send message back to SelecSleeveView.xaml.cs to navigate to the SolutionView
        }
Exemple #3
0
 public void AddPerpetualOfficeToSolution(string studentOrBusiness)
 {
     officeProducts.ToList().ForEach(x => { if (x.Name.Contains(studentOrBusiness))
                                            {
                                                SolutionHelper.AddProductToCurrentSolution(x);
                                            }
                                     });
 }
Exemple #4
0
 public void AddOffice365ToSolution(string personalOrHome, int subLength)
 {
     for (int i = 0; i < subLength; i++)
     {
         officeProducts.ToList().ForEach(x => { if (x.Name.Contains(personalOrHome) && x.Name.Contains("365"))
                                                {
                                                    SolutionHelper.AddProductToCurrentSolution(x);
                                                }
                                         });
     }
 }
        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);
            }
        }
Exemple #6
0
        public async Task <bool> AddCompleteToSolution(string completeType)
        {
            switch (completeType)
            {
            case "Consumer":
                SolutionHelper.AddProductToCurrentSolution(ConsumerComplete);
                break;

            case "Commercial3":
                SolutionHelper.AddProductToCurrentSolution(CommercialCompleteThreeYear);
                break;

            case "Commercial4":
                SolutionHelper.AddProductToCurrentSolution(CommercialCompleteFourYear);
                break;

            case "None":
                break;
            }
            MessageDialog addOffice = new MessageDialog("Would you like to add Office?");

            addOffice.Commands.Add(new UICommand("Yes")
            {
                Id = 0
            });
            addOffice.Commands.Add(new UICommand("No")
            {
                Id = 1
            });
            var result = await addOffice.ShowAsync();

            if ((int)result.Id == 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #7
0
        //private void SetPrice()
        //{
        //    try
        //    {
        //        price = SelectedSurface.Price;
        //        if (SelectedAccessory != null)
        //        {
        //            price += SelectedAccessory.Price;
        //        }
        //        SurfacePrice = SelectedSurface.Price.ToString();
        //    }
        //    catch
        //    {


        //    }

        //}
        //private void ClearPRice()
        //{
        //    price = 0;
        //    SurfacePrice = string.Empty;
        //}

        public async Task <bool> AddProductsToSolution() //Return bool to determine if the program should remain on the current page to add an accessory
        {
            if (SelectedSurface != null)
            {
                if (addAccessory)
                {
                    SolutionHelper.AddProductToCurrentSolution(SelectedSurface);
                    SolutionHelper.AddProductToCurrentSolution(SelectedAccessory);
                    return(true);
                }
                else
                {
                    if (SelectedDeviceClass == GuidedSolutionDevices.SurfacePro)
                    {
                        MessageDialog noAccessory = new MessageDialog("Are you sure you don't want to add a Type Cover?");
                        noAccessory.Commands.Add(new UICommand("Yes, I'm sure")
                        {
                            Id = 0
                        });
                        noAccessory.Commands.Add(new UICommand("Actually, let's add one")
                        {
                            Id = 1
                        });
                        var result = await noAccessory.ShowAsync();

                        if ((int)result.Id == 0)
                        {
                            SolutionHelper.AddProductToCurrentSolution(SelectedSurface);
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    if (SelectedDeviceClass == GuidedSolutionDevices.SurfaceStudio)
                    {
                        MessageDialog noAccessory = new MessageDialog("Are you sure you don't want to add a Sruface Dial?");
                        noAccessory.Commands.Add(new UICommand("Yes, I'm sure")
                        {
                            Id = 0
                        });
                        noAccessory.Commands.Add(new UICommand("Actually, let's add one")
                        {
                            Id = 1
                        });
                        var result = await noAccessory.ShowAsync();

                        if ((int)result.Id == 0)
                        {
                            SolutionHelper.AddProductToCurrentSolution(SelectedSurface);
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        SolutionHelper.AddProductToCurrentSolution(SelectedSurface);
                        return(true);
                    }
                }
            }
            return(false);
        }
        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();
            }
        }