//metodo en el cual validamos los campos para que sean obligatorios private bool Validar() { bool paso = true; if (FechaVenc_dateTimePicker.Value != DateTime.Now && FechaVenc_dateTimePicker.Value < DateTime.Now) { Validar_errorProvider.SetError(FechaVenc_dateTimePicker, "Debe Seleccionar Una Fecha Mayor A La Actual"); paso = false; } else if (Descripcion_textBox.Text == string.Empty) { Validar_errorProvider.SetError(Descripcion_textBox, "Falto Introducir La Descripcion Del Articulo"); paso = false; } else if (Precio_numericUpDown.Value == 0) { Validar_errorProvider.SetError(Precio_numericUpDown, "Falto Digital El Precio Del Articulo"); paso = false; } else if (Existencia_numericUpDown.Value == 0) { Validar_errorProvider.SetError(Existencia_numericUpDown, "Al Menos Debe Exitir 1 Articulo"); paso = false; } else if (CantCotizada_numericUpDown.Value == 0) { Validar_errorProvider.SetError(CantCotizada_numericUpDown, "Debe Ingresar La Cantidad Cotizada Del Articulo"); paso = false; } else if (CantCotizada_numericUpDown.Value > Existencia_numericUpDown.Value) { Validar_errorProvider.SetError(CantCotizada_numericUpDown, "La Cantidad Cotizada No Debe Superar La Existencia Del Articulo"); paso = false; } return(paso); }
//metodo en el cual validamos los campos para que sean obligatorios private bool Validar() { bool paso = true; if (Descripcion_textBox.Text == string.Empty) { Validar_errorProvider.SetError(Descripcion_textBox, "Falto Introducir La Descripcion Del Articulo"); paso = false; } //else if (Precio_numericUpDown.Value == 0) { Validar_errorProvider.SetError(Precio_numericUpDown, "Falto Digital El Precio Del Articulo"); paso = false; } //else if (Existencia_numericUpDown.Value == 0) { Validar_errorProvider.SetError(Existencia_numericUpDown, "Al Menos Debe Exitir 1 Articulo"); paso = false; } //else /* if (CantCotizada_numericUpDown.Value == 0) * { * Validar_errorProvider.SetError(CantCotizada_numericUpDown, "Debe Ingresar La Cantidad Cotizada Del Articulo"); * paso = false; * } * //else * * * if (CantCotizada_numericUpDown.Value > Existencia_numericUpDown.Value) * { * Validar_errorProvider.SetError(CantCotizada_numericUpDown, "La Cantidad Cotizada No Debe Superar La Existencia Del Articulo"); * paso = false; * }*/ return(paso); }