예제 #1
0
        //Determines if there is an active customer/solution, if not the user is prompted to create a new solution and either create/add a customer to it
        //or continue anonymously
        /// <summary>
        /// Creates the new solution.
        /// </summary>
        /// <returns>Task&lt;System.Boolean&gt;.</returns>
        private async Task <bool> CreateNewSolution()
        {
            bool?proceedWithSolution = await pdvm.CreateASolutionPrompt();

            if (proceedWithSolution.HasValue && proceedWithSolution.Value)
            {
                CustomerDatabaseControl.OpenCustomerSelectBlade();
                return(false);
            }
            if (proceedWithSolution.HasValue && !proceedWithSolution.Value)
            {
                pdvm.ContinueAsAnonymous();
                return(true);
            }
            if (proceedWithSolution == null)
            {
                return(true);
            }
            return(false);
        }
        private async Task CreateNewSolution()
        {
            MessageDialog newSolution = new MessageDialog("Would you like to create a new Solution?");

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

            if ((int)result.Id == 0)
            {
                CustomerDatabaseControl.OpenCustomerSelectBlade();
            }
            else
            {
            }
        }
예제 #3
0
 private void AddCustomerButton_Click(object sender, RoutedEventArgs e)
 {
     CustomerDatabaseControl.OpenCustomerSelectBlade();
 }