private void DeleteButton_Click(object sender, RoutedEventArgs e)
        {
            string result = customer.DeleteCustomer(customer.Id);

            if (result.Contains("Success"))
            {
                this.Frame.Navigate(typeof(MainPage));
            }
        }
예제 #2
0
        private void DeleteButton_Click(object sender, RoutedEventArgs e)
        {
            if (NameTextBox.Text == " ")
            {
                MessageDialog msgDialog = new MessageDialog("Cant be deleted");
                //OK Button

                //Show message
                msgDialog.ShowAsync();
            }

            else if (CityTextBox.Text == "")
            {
                MessageDialog msgDialog = new MessageDialog("Cant be deleted");
                //OK Button

                //Show message
                msgDialog.ShowAsync();
            }
            //Phone Number Length Validation
            else if (ContactTextBox.Text.Length != 10)
            {
                MessageDialog msgDialog = new MessageDialog("Cant be deleted");
                //OK Button

                //Show message
                msgDialog.ShowAsync();
            }
            else
            {
                string result = customer.DeleteCustomer(customer.Id);
                if (result.Contains("Success"))
                {
                    this.Frame.Navigate(typeof(CustomersInfo));
                }
            }
        }