private void EditBtnClick(object sender, RoutedEventArgs e) { if (nameOutputBox.SelectedItem == null) { MessageBox.Show("No client selected!"); } else { string[] vs = nameOutputBox.SelectedItem.ToString().Split(null); Update update = new Update(dataConnect.GetCus_ID(vs[0], vs[1])); update.Show(); ManageClients1 create = new ManageClients1(); NavigationService.Navigate(create); } }
private void DeleteBtnClick(object sender, RoutedEventArgs e) { //get name and split and store string selectedName = nameOutputBox.SelectedItem.ToString(); string[] firstAndLast = selectedName.Split(null); //delete all vehicles relating to the customer from db dataConnect.deleteVehicleFromDb(firstAndLast[0], firstAndLast[1]); //delete customer from db dataConnect.deleteCusFromDb(firstAndLast[0], firstAndLast[1]); ManageClients1 create = new ManageClients1(); NavigationService.Navigate(create); }