public bool Validar() { bool HayErrores = false; if (IdnumericUpDown.Value == 0) { ArticulosIderrorProvider.SetError(IdnumericUpDown, "Id:"); HayErrores = true; } if (String.IsNullOrWhiteSpace(DescripciontextBox.Text)) { DescripcionerrorProvider.SetError(DescripciontextBox, "Descripcion Vacio"); HayErrores = true; } if (PreciotextBox.Text == String.Empty) { PrecioerrorProvider.SetError(PreciotextBox, "Precio Vacio"); HayErrores = true; } if (ExistenciatextBox.Text == String.Empty) { ExistenciaerrorProvider.SetError(ExistenciatextBox, "Existencia Vacia"); HayErrores = true; } if (CantidadCotizadatextBox.Text == String.Empty) { CantidadCotizadaerrorProvider.SetError(CantidadCotizadatextBox, "Cantidad Cotizada Vacia"); HayErrores = true; } return(HayErrores); }
private bool Validar() { bool interruptor = true; if (string.IsNullOrEmpty(descripcionTextBox.Text)) { DescripcionerrorProvider.SetError(descripcionTextBox, "Por favor llenar el campo vacio."); interruptor = false; } if (cantidadNumericUpDown.Value == 0) { CantidaderrorProvider.SetError(cantidadNumericUpDown, "Por favor llenar el campo vacio."); interruptor = false; } if (string.IsNullOrEmpty(CostotextBox.Text)) { CostoerrorProvider.SetError(CostotextBox, "Por favor llenar el campo vacio."); interruptor = false; } if (string.IsNullOrEmpty(PreciotextBox.Text)) { PrecioerrorProvider.SetError(PreciotextBox, "Por favor llenar el campo vacio."); interruptor = false; } return(interruptor); }
private bool Validar() { bool cambio = true; if (string.IsNullOrEmpty(DescripciontextBox.Text)) { DescripcionerrorProvider.SetError(DescripciontextBox, "Por favor llenar el campo"); cambio = false; } return(cambio); }
private bool ValidarTextbox() { if (string.IsNullOrEmpty(DescripciontextBox.Text) ) { DescripcionerrorProvider.SetError(DescripciontextBox, "Favor la descripcion de la Categoria de los articulo"); MessageBox.Show("Favor llenar todos los campos obligatorios"); } return(true); }
private bool SetProvider(int id) { bool paso = false; if (id == 1) { if (numericUpDown.Value == 0 || DescripcionrichTextBox.Text == string.Empty) { PrecioerrorProvider.SetError(numericUpDown, "Campo debe de estar lleno"); DescripcionerrorProvider.SetError(DescripcionrichTextBox, "Debe de estar lleno"); paso = true; } } if (id == 2) { if (IDtextBox.Text == string.Empty) { IDerrorProvider.SetError(IDtextBox, "Debe llenar este campo"); paso = true; } } return(paso); }
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); }