private bool Validar() { bool paso = true; if (ProductoIdTextBox.Text == string.Empty) { MessageBox.Show("ProductoId Vacio"); ProductoIdTextBox.Focus(); paso = false; } else if (NombreProductoTextBox.Text == string.Empty) { MessageBox.Show("Nombre del Producto Vacio"); NombreProductoTextBox.Focus(); paso = false; } else if (MarcaProductoTextBox.Text == string.Empty) { MessageBox.Show("Marca del Producto Vacio"); MarcaProductoTextBox.Focus(); paso = false; } else if (CategoriaIdTextBox.Text == string.Empty) { MessageBox.Show("CategoriaId del Producto Vacio"); CategoriaIdTextBox.Focus(); paso = false; } else if (CategoriaTextBox.Text == string.Empty) { MessageBox.Show("Categoria del Producto Vacio"); CategoriaIdTextBox.Focus(); paso = false; } else if (CantidadTextBox.Text == string.Empty) { MessageBox.Show("Cantidad Vacia"); CantidadTextBox.Focus(); paso = false; } else if (PrecioTextBox.Text == string.Empty) { MessageBox.Show("Precio Vacio"); PrecioTextBox.Focus(); paso = false; } else if (UsuarioIdTextBox.Text == string.Empty) { MessageBox.Show("UsuarioId Vacio o no Valido"); UsuarioIdTextBox.Focus(); paso = false; } return(paso); }
private void Limpiar() { ProductoIdTextBox.Text = "0"; NombreProductoTextBox.Clear(); MarcaProductoTextBox.Clear(); InventarioTextBox.Clear(); PrecioDeVentaTextBox.Text = "0"; PrecioDeCompraTextBox.Text = "0"; FechaIngresoDateTimePicker.SelectedDate = DateTime.Now; SuplidorIdTextBox.Text = "0"; CategoriaIdTextBox.Text = "0"; UsuarioIdTextBox.Text = (MainWindow.usuarioSiempreActivoId.ToString()); Productos producto = new Productos(); Actualizar(); }
private void GuardarButton_Click(object sender, EventArgs e) { ProductoComboBox.Items.Add(NombreProductoTextBox.Text); NombreProductoTextBox.Clear(); }
private bool Validar() { bool paso = true; if (string.IsNullOrEmpty(NombreProductoTextBox.Text)) { paso = false; MessageBox.Show("El campo Nombre producto no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information); NombreProductoTextBox.Focus(); } if (string.IsNullOrEmpty(MarcaProductoTextBox.Text)) { paso = false; MessageBox.Show("El campo marca producto no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information); MarcaProductoTextBox.Focus(); } if (string.IsNullOrEmpty(InventarioTextBox.Text)) { paso = false; MessageBox.Show("El campo Inventario no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information); InventarioTextBox.Focus(); } if (string.IsNullOrEmpty(PrecioDeCompraTextBox.Text)) { paso = false; MessageBox.Show("El campo Precio de Compra no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information); InventarioTextBox.Focus(); } if (string.IsNullOrEmpty(PrecioDeVentaTextBox.Text)) { paso = false; MessageBox.Show("El campo Precio de Venta no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information); InventarioTextBox.Focus(); } if (string.IsNullOrEmpty(FechaIngresoDateTimePicker.Text)) { MessageBox.Show("Debe ingresar la fecha de ingreso", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information); FechaIngresoDateTimePicker.Focus(); } if (string.IsNullOrEmpty(SuplidorIdTextBox.Text.Replace("-", ""))) { paso = false; MessageBox.Show("El campo Suplidpr Id no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information); SuplidorIdTextBox.Focus(); } if (string.IsNullOrEmpty(CategoriaIdTextBox.Text)) { paso = false; MessageBox.Show("El campo Categoria Id no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information); CategoriaIdTextBox.Focus(); } if (string.IsNullOrEmpty(UsuarioIdTextBox.Text)) { paso = false; MessageBox.Show("El campo Usuario Id no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information); UsuarioIdTextBox.Focus(); } return(paso); }