Exemplo n.º 1
0
        private void addCustomer_Click(object sender, RoutedEventArgs e)
        {
            string name = "";

            name = this.accountNameBox.Text;
            long ssn;

            ssn = Convert.ToInt64(this.accountSSNBox.Text);
            CustomerLogic.AddCustomer(name, ssn);
        }
        private async void addCustomer_Click(object sender, RoutedEventArgs e)
        {
            bool success = false;

            if (long.TryParse(accountSSNBox.Text, out long ssn))
            {
                success = CustomerLogic.AddCustomer(accountNameBox.Text, ssn);
            }
            MessageDialog customerCreation;

            if (success)
            {
                customerCreation = new MessageDialog($"Name: {accountNameBox.Text}\nSSN: {ssn}", "Customer Created Successfully!");
            }
            else
            {
                customerCreation = new MessageDialog("Customer creation failed...");
            }
            await customerCreation.ShowAsync();
        }