Пример #1
0
        private bool ValidarValorVariables()
        {
            if (PrecioCompra == 0)
            {
                Soporte.MsgError("Ingrese el precio de compra del articulo");
                TxtPrecioCompra.Focus();
                return(false);
            }
            if (GananciaObtener == 0)
            {
                Soporte.MsgError("Ingrese el Saldo de Ganancia a Obtener");
                TxtGananciaObtener.Focus();
                return(false);
            }
            if (Cantidad == 0)
            {
                Soporte.MsgError("Capture la Cantidad de Artiulos que se ingresaran.");
                TxtCantidad.Focus();
                return(false);
            }


            if (Convert.ToInt32(CmbTipEntradas.SelectedValue) == 4)
            {
                if (MontoTotal == 0)
                {
                    Soporte.MsgError("Ingrese el Monto Total del Comprobante.");
                    TxtMontoTotal.Focus();
                    return(false);
                }
                if (TotalArticulos == 0)
                {
                    Soporte.MsgError("Ingrese la Cantidad total de Articulos del Comprobante.");
                    TxtTotalArticulos.Focus();
                    return(false);
                }

                if (NumeroComprobante == 0)
                {
                    Soporte.MsgError("Ingrese el Numero del Comprobante.");
                    TxtNumComprobante.Focus();
                    return(false);
                }
            }
            else
            {
            }



            return(true);
        }
Пример #2
0
        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);
        }