private ValidarDato ValidarValores(ValidarDato validaDatos) { validaDatos.MensajesDeError.RemoveRange(0, validaDatos.MensajesDeError.Count()); if (string.IsNullOrEmpty(this.tb_nombre.Text)) { validaDatos.AgregarError("El campo 'Nombre' es requerido."); } if (string.IsNullOrEmpty(this.tb_apellido.Text)) { validaDatos.AgregarError("El campo 'Apellido' es requerido."); } if (string.IsNullOrEmpty(this.tb_nick.Text)) { validaDatos.AgregarError("El campo 'Nick' es requerido."); } if (string.IsNullOrEmpty(this.tb_pass.Text)) { validaDatos.AgregarError("El campo 'Pass' es requerido."); } if (validaDatos.MensajesDeError.Count() == 0) { validaDatos.EsValido = true; } return(validaDatos); }
private ValidarDato ValidarValores(ValidarDato validaDatos) { validaDatos.MensajesDeError.RemoveRange(0, validaDatos.MensajesDeError.Count()); if (string.IsNullOrEmpty(this.tb_modelo.Text)) { validaDatos.AgregarError("El campo 'Modelo' es requerido."); } if (string.IsNullOrEmpty(this.tb_cantidad.Text)) { validaDatos.AgregarError("Debe ingresar una cantidad."); } if ((productoSeleccionado.Stock - Convert.ToInt32(this.tb_cantidad.Text)) < 0) { validaDatos.AgregarError("No puede dar mas regalias que el inventario existente"); } if (validaDatos.MensajesDeError.Count() == 0) { validaDatos.EsValido = true; } return(validaDatos); }
private ValidarDato ValidarValores(ValidarDato validaDatos) { validaDatos.MensajesDeError.RemoveRange(0, validaDatos.MensajesDeError.Count()); if (string.IsNullOrEmpty(this.tb_numFactura.Text)) { validaDatos.AgregarError("Debe ingresar el número de factura."); } if (dg_orden.Rows.Count <= 0) { validaDatos.AgregarError("Aún no ingresa productos a la factura"); } if (string.IsNullOrEmpty(this.tb_nombre.Text)) { validaDatos.AgregarError("Debe ingresar un cliente"); } if (validaDatos.MensajesDeError.Count() == 0) { validaDatos.EsValido = true; } return(validaDatos); }
private ValidarDato ValidarValores(ValidarDato validaDatos) { validaDatos.MensajesDeError.RemoveRange(0, validaDatos.MensajesDeError.Count()); if (string.IsNullOrEmpty(this.tb_stock.Text)) { validaDatos.AgregarError("El campo 'Stock' es requerido."); } if (string.IsNullOrEmpty(this.tb_marca.Text)) { validaDatos.AgregarError("El campo 'Marca' es requerido."); } if (string.IsNullOrEmpty(this.tb_modelo.Text)) { validaDatos.AgregarError("El campo 'Modelo' es requerido."); } if (string.IsNullOrEmpty(this.tb_minimo.Text)) { validaDatos.AgregarError("El campo 'Minimo' es requerido."); } if (string.IsNullOrEmpty(this.tb_costo.Text)) { validaDatos.AgregarError("El campo 'Costo de Importacion' es requerido."); } if (string.IsNullOrEmpty(this.tb_precio1.Text)) { validaDatos.AgregarError("El campo 'Precio 1' es requerido."); } if (string.IsNullOrEmpty(this.tb_precio2.Text)) { validaDatos.AgregarError("El campo 'Precio 2' es requerido."); } if (string.IsNullOrEmpty(this.tb_precio3.Text)) { validaDatos.AgregarError("El campo 'Precio 3' es requerido."); } if (string.IsNullOrEmpty(this.tb_precio4.Text)) { validaDatos.AgregarError("El campo 'Precio 4' es requerido."); } if (string.IsNullOrEmpty(this.txt_descripcion.Text)) { validaDatos.AgregarError("El campo 'Descripcion' es requerido."); } if (validaDatos.MensajesDeError.Count() == 0) { validaDatos.EsValido = true; } return(validaDatos); }