private void AgregarFilaButton_Click(object sender, RoutedEventArgs e) { if (CaracteristicasComboBox.Text == string.Empty) { MessageBox.Show("El Campo (Caracteristicas) está vacío.\n\nPorfavor, Seleccione el Libro.", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Warning); CaracteristicasComboBox.IsDropDownOpen = true; return; } if (ObservacionTextBox.Text == String.Empty) { MessageBox.Show("El Campo (Observacion) está vacio.\n\nEscriba la referencia.", "Advertencia", MessageBoxButton.OK, MessageBoxImage.Warning); ObservacionTextBox.Focus(); return; } var filaDetalle = new VehiculosDetalle { VehiculoId = this.vehiculos.VehiculoId, CaracteristicasId = Convert.ToInt32(CaracteristicasComboBox.SelectedValue.ToString()), caracteristicas = (Caracteristicas)CaracteristicasComboBox.SelectedItem, Observacion = ObservacionTextBox.Text.ToString(), }; this.vehiculos.Detalle.Add(filaDetalle); Cargar(); CaracteristicasComboBox.SelectedIndex = -1; ObservacionTextBox.Clear(); }
public void LimpiarDetalle() { CalificacionTextBox.Clear(); ValorTextBox.Clear(); TipoEvaluacionComboBox.SelectedIndex = -1; FechaEvaluacion.SelectedDate = DateTime.Now; ObservacionTextBox.Clear(); CalificacionTextBox.Focus(); }