Ejemplo n.º 1
0
        private void updateButton_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            string[] customerDetails = new string[3];
            string[] addressDetails  = new string[4];

            if (DetailsVerification())
            {
                customerDetails[0] = firstNameTextBox.Text;
                customerDetails[1] = lastNameTextBox.Text;
                customerDetails[2] = phoneNumberTextBox.Text;
                addressDetails[0]  = streetTextBox.Text;
                addressDetails[1]  = houseNumberTextBox.Text;
                addressDetails[2]  = zipCodeTextBox.Text;
                addressDetails[3]  = cityTextBox.Text;

                Connection      connection      = new Connection("ConnectionFile.xml");
                EditCustomerSql editCustomerSql = new EditCustomerSql(connection.EstablishSqlConnection(), _customerId, addressDetails, customerDetails);
                editCustomerSql.UpdateAddress();
                editCustomerSql.UpdateCustomer();
                updateInfo.Visibility = Visibility.Visible;
            }
            else
            {
                MessageBox.Show("Please fulfill data corrrectly");
            }
        }
Ejemplo n.º 2
0
        private void deleteButton_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            Connection      connection      = new Connection("ConnectionFile.xml");
            EditCustomerSql editCustomerSql = new EditCustomerSql(connection.EstablishSqlConnection(), _customerId);

            editCustomerSql.GetValuesFromCustomers();
            editCustomerSql.DeleteCustomer();
        }
Ejemplo n.º 3
0
        private void FulfillTextBoxes()
        {
            Connection      connection      = new Connection("ConnectionFile.xml");
            EditCustomerSql editCustomerSql = new EditCustomerSql(connection.EstablishSqlConnection(), _customerId);

            editCustomerSql.GetValuesFromCustomers();
            string[] addressDetails  = editCustomerSql.GetAddressDetails();
            string[] customerDetails = editCustomerSql.GetCustomerDetails();

            firstNameTextBox.Text   = customerDetails[0];
            lastNameTextBox.Text    = customerDetails[1];
            phoneNumberTextBox.Text = customerDetails[2];
            streetTextBox.Text      = addressDetails[0];
            houseNumberTextBox.Text = addressDetails[1];
            zipCodeTextBox.Text     = addressDetails[2];
            cityTextBox.Text        = addressDetails[3];
        }