private bool ValidarTextBox() { if (CmbComprobante.SelectedIndex == 0) { Soporte.MsgInformacion("Seleccione un comprobante de la compra del Articulo"); CmbComprobante.Focus(); return(false); } if (Convert.ToInt32(CmbEmpresa.SelectedValue) == 0) { Soporte.MsgInformacion("Seleccione una Empres"); CmbEmpresa.Focus(); return(false); } if (Convert.ToInt32(CmbSucursal.SelectedValue) == 0) { Soporte.MsgInformacion("Seleccione una Sucursal"); CmbSucursal.Focus(); return(false); } if (Convert.ToInt32(CmbTipEntradas.SelectedValue) == 0) { Soporte.MsgInformacion("Seleccione un Tipo Entrada"); CmbTipEntradas.Focus(); return(false); } if (CmbProveedores.SelectedIndex == 0) { Soporte.MsgInformacion("Seleccione un Proveedor del comprobante."); CmbProveedores.Focus(); return(false); } if (string.IsNullOrEmpty(TxtCodigo.Text)) { Soporte.MsgInformacion("Ingrese Codigo del Articulo para poder agregar a la Lista"); TxtCodigo.Focus(); return(false); } if (string.IsNullOrEmpty(TxtDescripcion.Text)) { Soporte.MsgInformacion("Busque el Articulo ya que faltan datos para Agregar a la Lista."); TxtCodigo.Focus(); return(false); } if (string.IsNullOrEmpty(TxtCantidad.Text) && TxtCantidad.Text != "0") { Soporte.MsgInformacion("Ingrese la cantidad del articulo a Ingresar"); TxtCantidad.Focus(); return(false); } if (!Soporte.ValidarFormatoMoneda(TxtCantidad.Text)) { Soporte.MsgInformacion("El formato de la Cantidad no es Valido."); TxtCantidad.Focus(); return(false); } if (string.IsNullOrEmpty(TxtPrecioCompra.Text) && TxtPrecioCompra.Text != "0") { Soporte.MsgInformacion("Ingrese Precio del articulo"); TxtPrecioCompra.Focus(); return(false); } if (!Soporte.ValidarFormatoMoneda(TxtPrecioCompra.Text)) { Soporte.MsgInformacion("El formato de Precio de Compra no es Valido."); TxtPrecioCompra.Focus(); return(false); } if (string.IsNullOrEmpty(TxtGananciaObtener.Text) && TxtGananciaObtener.Text != "0") { Soporte.MsgInformacion("Ingrese la cantidad de la Ganancia a Obtener"); TxtGananciaObtener.Focus(); return(false); } if (!Soporte.ValidarFormatoMoneda(TxtGananciaObtener.Text)) { Soporte.MsgInformacion("El formato de Ganancia a Obtener no es Valido."); TxtGananciaObtener.Focus(); return(false); } if (Convert.ToInt32(CmbTipEntradas.SelectedValue) == 4) { if (string.IsNullOrEmpty(TxtNumComprobante.Text) && TxtNumComprobante.MaxLength < 2) { Soporte.MsgInformacion("El numero de comprobante no tiene el Formato correcto, revise."); TxtNumComprobante.Focus(); return(false); } if (string.IsNullOrEmpty(TxtTotalArticulos.Text) && TxtTotalArticulos.Text != "0") { Soporte.MsgInformacion("Ingrese la cantidad Total del Comprobante"); TxtTotalArticulos.Focus(); return(false); } if (!Soporte.ValidarFormatoMoneda(TxtTotalArticulos.Text)) { Soporte.MsgInformacion("El formato de Total Articulos no es Valido."); TxtTotalArticulos.Focus(); return(false); } if (string.IsNullOrEmpty(TxtMontoTotal.Text) && TxtMontoTotal.Text != "0") { Soporte.MsgInformacion("Ingrese el Monto Total del Comprobante"); TxtMontoTotal.Focus(); return(false); } if (!Soporte.ValidarFormatoMoneda(TxtMontoTotal.Text)) { Soporte.MsgInformacion("El formato del Monto Total no es Valido."); TxtMontoTotal.Focus(); return(false); } if (string.IsNullOrEmpty(TxtIvaTotal.Text) && TxtIvaTotal.Text != "0") { Soporte.MsgInformacion("Ingrese el Monto Total del Iva"); TxtIvaTotal.Focus(); return(false); } if (!Soporte.ValidarFormatoMoneda(TxtIvaTotal.Text)) { Soporte.MsgInformacion("El formato del Iva Total no es Valido."); TxtIvaTotal.Focus(); return(false); } } else { } return(true); }
private bool ValidarCampos() { if (ChkbAgranel.Checked == true) { if (CmbFamiliaAgranel.SelectedIndex == 0) { Soporte.MsgError("Seleccione una Categoria del Articulo en Agranel"); CmbFamiliaAgranel.Focus(); return(false); } } if (TxtCodigo.Visible == true) { if (TxtCodigo.TextLength < 4) { Soporte.MsgError("Ingrese un Codigo del Articulo"); TxtCodigo.Focus(); return(false); } } if (string.IsNullOrEmpty(TxtNombre.Text)) { Soporte.MsgError("Ingrese una Nombre del Articulo"); TxtNombre.Focus(); return(false); } if (string.IsNullOrEmpty(TxtMarca.Text)) { Soporte.MsgError("Ingrese una Marca."); TxtMarca.Focus(); return(false); } if (string.IsNullOrEmpty(TxtDescripcion.Text)) { Soporte.MsgError("Ingrese una Descripcion del Articulo."); TxtDescripcion.Focus(); return(false); } if (CmbPrestArt.SelectedIndex == 0) { Soporte.MsgError("Seleccione una Presentacion del Articulo"); CmbPrestArt.Focus(); return(false); } if (string.IsNullOrEmpty(TxtContenido.Text)) { Soporte.MsgError("Ingrese el Contenido del Articulo"); TxtContenido.Focus(); return(false); } if (CmbUnidMed.SelectedIndex == 0) { Soporte.MsgError("Seleccione una Unidad de Medina del Articulo"); CmbUnidMed.Focus(); return(false); } if (CmbUnidadVenta.SelectedIndex == 0) { Soporte.MsgError("Seleccione Unidad de Medida para la Venta del Articulo"); CmbUnidadVenta.Focus(); return(false); } if (string.IsNullOrEmpty(TxtCantidadMinimo.Text)) { Soporte.MsgError("Ingrese un Valor Valido para la cantidad Minimo del Articulo"); TxtCantidadMinimo.Focus(); return(false); } if (string.IsNullOrEmpty(TxtCantidadMaximo.Text)) { Soporte.MsgError("Ingrese un Valor Valido para la cantidad Maximo del Articulo"); TxtCantidadMaximo.Focus(); return(false); } if (CmbEstatus.SelectedIndex == 0) { Soporte.MsgError("Seleccione un Estatus del Articulo"); CmbPrestArt.Focus(); return(false); } if (CmbFabricante.SelectedIndex == 0) { Soporte.MsgError("Seleccione un Fabricante o elige sin Fabricante"); CmbFabricante.Focus(); return(false); } if (CmbEmpresa.SelectedIndex == 0) { Soporte.MsgError("Seleccione la Empresa en donde se registrara el Articulo"); CmbEmpresa.Focus(); return(false); } if (CmbSucursal.SelectedIndex == 0) { Soporte.MsgError("Seleccione la Sucursal en donde se registrara el Articulo"); CmbSucursal.Focus(); return(false); } return(true); }
private bool ValidarCampos() { if (Editar) { if (IdSucursal == 0) { Soporte.MsgError("Seleccione un registro al que desea Actualizar."); TxtNombre.Focus(); return(false); } } if (string.IsNullOrEmpty(TxtNombre.Text) || TxtNombre.Text == "0") { Soporte.MsgError("Ingrese Nombre de la Sucursal"); TxtNombre.Focus(); return(false); } if (string.IsNullOrEmpty(TxtTelefono.Text) || TxtTelefono.Text == "0") { Telefono = "Registro Pendiente"; } if (string.IsNullOrEmpty(TxtCorreo.Text) || TxtCorreo.Text == "0") { Correo = "*****@*****.**"; } else { if (Soporte.ValidarMail(TxtCorreo.Text) == false) { Soporte.MsgError("El correo no cuenta con el Formato correcto"); TxtCorreo.Focus(); TxtCorreo.SelectAll(); return(false); } } if (CmbEmpresa.SelectedIndex == 0) { Soporte.MsgError("Seleccione una empresa al que pertenecera la Sucursal"); CmbEmpresa.Focus(); CmbEmpresa.SelectAll(); return(false); } if (CmbxPais.SelectedIndex == 0) { Soporte.MsgError("Seleccione un Pais"); CmbxPais.Focus(); CmbxPais.SelectAll(); return(false); } if (CmbxEstado.SelectedIndex == 0) { Soporte.MsgError("Seleccione un Estado"); CmbxEstado.Focus(); CmbxEstado.SelectAll(); return(false); } if (CmbxMunicipio.SelectedIndex == 0) { Soporte.MsgError("Seleccione un Municipio"); CmbxMunicipio.Focus(); CmbxMunicipio.SelectAll(); return(false); } if (CmbColonias.SelectedIndex == 0) { Soporte.MsgError("Seleccione una Colonia"); CmbColonias.Focus(); CmbColonias.SelectAll(); return(false); } if (TxtCodigoPostal.TextLength < 4) { Soporte.MsgError("Ingrse un Codigo Postal Valido."); TxtCodigoPostal.Focus(); return(false); } if (TxtCalle.TextLength < 5) { Soporte.MsgError("Ingrse una calle valido"); TxtCalle.Focus(); return(false); } if (string.IsNullOrEmpty(TxtEntreCalles.Text) || TxtEntreCalles.Text == "0") { Entre_Calles = "Sin Registro"; } if (string.IsNullOrEmpty(TxtNumExterno.Text) || TxtNumExterno.Text == "0") { Numero_Externo = "SIN NUMERO"; } if (string.IsNullOrEmpty(TxtNumInterno.Text) || TxtNumInterno.Text == "0") { Numero_Interno = "SIN NUMERO"; } return(true); }