Exemplo n.º 1
0
        private void BtnManage_Click(object sender, RoutedEventArgs e)
        {
            if (lvGridCarOwner.SelectedIndex == -1)
            {
                MessageBox.Show("Please choose an owner.");
                return;
            }
            CarOwner   coToManage = (CarOwner)lvGridCarOwner.SelectedItem;
            CarsDialog cd         = new CarsDialog(coToManage);

            cd.Owner = this;
            bool?result = cd.ShowDialog();

            if (result == true)
            {
                lvGridCarOwner.Items.Refresh();
            }
        }
Exemplo n.º 2
0
        private void btnManageCars_Click(object sender, RoutedEventArgs e)
        {
            if (lvOwners.SelectedIndex == -1)
            {
                MessageBox.Show("You need to select an owner", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            Owner ownerToBeUpdated = (Owner)lvOwners.SelectedItem;
            //ownerToBeUpdated.Name = txtName.Text;

            int id = ownerToBeUpdated.OwnerId;

            CarsDialog carsDialon = new CarsDialog(id);

            carsDialon.Owner = this;
            carsDialon.ShowDialog();
        }