private void btnEditar_Click(object sender, RoutedEventArgs e) { if (repositorio.LeerProductos().Count == 0) { MessageBox.Show("error...", "No tienes productos", MessageBoxButton.OK, MessageBoxImage.Error); } else { if (dtgTabla.SelectedItem != null) { Producto a = dtgTabla.SelectedItem as Producto; HabilitarCajas(true); txbNombre.Text = a.Mercancia; txbCategoria.Text = a.Categoria; txbDescripcion.Text = a.Descripcion; txbPventa.Text = a.PrecioV; txbPcompra.Text = a.PrecioC; txbActual.Text = a.ProductoE; HabilitarBotones(false); esNuevo = false; } else { MessageBox.Show("¿A Quien???", ".", MessageBoxButton.OK, MessageBoxImage.Question); } } }
public Venta() { InitializeComponent(); repositorioCliente = new RepositorioCliente(); repositorioEmpleados = new RepositorioEmpleados(); repositorioProductos = new RepositorioProductos(); venta = null; cmbProducto.ItemsSource = repositorioProductos.LeerProductos(); cmbNombreCliente.ItemsSource = repositorioCliente.LeerClientes(); cmbEmpleado.ItemsSource = repositorioEmpleados.LeerEmpleados(); ActualizarTabla(); BloquearBotones(); }