예제 #1
0
        private void btnEditBoat_Click(object sender, RoutedEventArgs e)
        {
            var boat = (Boat)dgBoatInventory.SelectedItem;

            var addEditForm = new frmBoatAddEdit(boat, _boatManager);
            var result      = addEditForm.ShowDialog();

            if (result == true)
            {
                // refresh _boatInventory and dgBoatInventory.Items
            }
            else
            {
                MessageBox.Show("Edit operation aborted.");
            }

            //if(dgBoatInventory.SelectedIndex.Equals(-1))
            //{
            //    MessageBox.Show("Please select a boat to edit!");
            //}
        }
예제 #2
0
        private void btnAddBoat_Click(object sender, RoutedEventArgs e)
        {
            var addEditForm = new frmBoatAddEdit(_boatManager);

            addEditForm.ShowDialog();
        }