private bool ValidarTextbox() { if (string.IsNullOrEmpty(marcaEquipoTextBox.Text) && string.IsNullOrEmpty(serialNumTextBox.Text)) { MarcaerrorProvider.SetError(marcaEquipoTextBox, "Favor ingresar la marca del equipo"); SerialerrorProvider.SetError(serialNumTextBox, "Favor ingresar el serial del equipo"); MessageBox.Show("Favor llenar todos los campos obligatorios"); } if (string.IsNullOrEmpty(marcaEquipoTextBox.Text)) { MarcaerrorProvider.SetError(marcaEquipoTextBox, "Favor ingresar la marca del equipo"); return(false); } if (string.IsNullOrEmpty(serialNumTextBox.Text)) { MarcaerrorProvider.Clear(); SerialerrorProvider.SetError(serialNumTextBox, "Favor ingresar el serial del equipo"); return(false); } /*for (int aux = 4; aux <= n; aux++) * { * if (UserNameTextBox.Text == UsuariosBLL.Buscar(aux).NombreUsuario) * { * MessageBox.Show("EL Nombre de usuario que intenta ingresar ya existe"); * return false; * } * }*/ return(true); }
private bool ValidarTextbox() { if (string.IsNullOrEmpty(NombreArticulotextBox.Text) && string.IsNullOrEmpty(DespcripciontextBox.Text) && string.IsNullOrEmpty(MarcaArticulotextBox.Text) && string.IsNullOrEmpty(NombreProveedorcomboBox1.Text) && string.IsNullOrEmpty(CategoriacomboBox.Text) && string.IsNullOrEmpty(CantidadtextBox.Text) && string.IsNullOrEmpty(PrecioCompratextBox.Text) && string.IsNullOrEmpty(PrecioVentatextBox.Text) ) { NombreArticuloerrorProvider.SetError(NombreArticulotextBox, "Favor Ingresar el nombre del articulos"); DescripcionerrorProvider.SetError(DespcripciontextBox, "Favor Ingresar la descripcion del articulo"); MarcaerrorProvider.SetError(MarcaArticulotextBox, "Favor Ingresar la marca del articulo"); NombreProveedorerrorProvider.SetError(NombreProveedorcomboBox1, "Favor elegir el proveedor a que correponde el articulo"); CategoriaerrorProvider.SetError(CategoriacomboBox, "Favor elegir la categoria a que correponde el articulo"); CantidaderrorProvider.SetError(CantidadtextBox, "Favor Ingresar la cantidad del articulo"); PrecioCompraerrorProvider.SetError(PrecioCompratextBox, "Favor Ingresar el precio de compra del articulo"); PrecioVentaerrorProvider.SetError(PrecioVentatextBox, "Favor Ingresar el precio de venta del articulo"); MessageBox.Show("Favor llenar todos los campos obligatorios"); } if (string.IsNullOrEmpty(NombreArticulotextBox.Text)) { NombreArticuloerrorProvider.Clear(); NombreArticuloerrorProvider.SetError(NombreArticulotextBox, "Favor Ingresar el nombre del articulos"); return(false); } if (string.IsNullOrEmpty(DespcripciontextBox.Text)) { DescripcionerrorProvider.Clear(); DescripcionerrorProvider.SetError(DespcripciontextBox, "Favor Ingresar la descripcion del articulo"); return(false); } if (string.IsNullOrEmpty(MarcaArticulotextBox.Text)) { MarcaerrorProvider.Clear(); MarcaerrorProvider.SetError(MarcaArticulotextBox, "Favor Ingresar la marca del articulo"); return(false); } if (string.IsNullOrEmpty(NombreProveedorcomboBox1.Text)) { NombreProveedorerrorProvider.Clear(); NombreProveedorerrorProvider.SetError(NombreProveedorcomboBox1, "Favor elegir el proveedor a que correponde el articulo"); return(false); } if (string.IsNullOrEmpty(CategoriacomboBox.Text)) { CategoriaerrorProvider.Clear(); CategoriaerrorProvider.SetError(CategoriacomboBox, "Favor elegir la categoria a que correponde el articulo"); return(false); } if (string.IsNullOrEmpty(CantidadtextBox.Text)) { CantidaderrorProvider.Clear(); CantidaderrorProvider.SetError(CantidadtextBox, "Favor Ingresar la cantidad del articulo"); return(false); } if (string.IsNullOrEmpty(PrecioCompratextBox.Text)) { PrecioCompraerrorProvider.Clear(); PrecioCompraerrorProvider.SetError(PrecioCompratextBox, "Favor Ingresar el precio de compra del articulo"); return(false); } if (string.IsNullOrEmpty(PrecioVentatextBox.Text)) { PrecioVentaerrorProvider.Clear(); PrecioVentaerrorProvider.SetError(PrecioVentatextBox, "Favor Ingresar el precio de venta del articulo"); return(false); } return(true); }