private void dtgReservas1_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (depago) { object item = dtgReservas1.SelectedItem; if ((dtgReservas1.Items.Count > 0) && (item != null)) { //numeroReserva = Convert.ToInt32((dtgReservas1.SelectedCells[0].Column.GetCellContent(item) as TextBlock).Text); dsH.Clear(); dsCotizacionHabitacionTableAdapters._V_cotizacionHabitacionTableAdapter tH = new dsCotizacionHabitacionTableAdapters._V_cotizacionHabitacionTableAdapter(); tH.ClearBeforeFill = true; //tH.Fill(dsH._V_cotizacionHabitacion, numeroReserva); dtgdetalle.ItemsSource = tH.GetData(numeroReserva); btnGuardalocalizador.IsEnabled = true; depago = false; } } else { dtgdetalle.ItemsSource = null; depago = false; } }
private void dtgReservas1_MouseDoubleClick(object sender, MouseButtonEventArgs e) { object item = dtgReservas1.SelectedItem; if ((dtgReservas1.Items.Count > 0) && (item != null)) { numeroReserva = Convert.ToInt32((dtgReservas1.SelectedCells[0].Column.GetCellContent(item) as TextBlock).Text); contrato = (dtgReservas1.SelectedCells[11].Column.GetCellContent(item) as TextBlock).Text; dsH.Clear(); dsCotizacionHabitacionTableAdapters._V_cotizacionHabitacionTableAdapter tH = new dsCotizacionHabitacionTableAdapters._V_cotizacionHabitacionTableAdapter(); tH.ClearBeforeFill = true; //tH.Fill(dsH._V_cotizacionHabitacion, numeroReserva); dtgdetalle.ItemsSource = tH.GetData(numeroReserva); btnGuardalocalizador.IsEnabled = true; } }