Beispiel #1
0
        //PASA LOS DATOS DEL CLIENTE AL FORMULARIO
        private void PasarDatosAlFormulario()
        {
            //Paso los datos del proveedor al formulario

            clsCUIT oCUIT = new clsCUIT(myCliente.Cuit);

            if (oCUIT.EsValido)
            {
                this.txtCuit.Text = clsGlobales.cFormato.CUITGuiones(this.myCliente.Cuit, 1);
            }
            else
            {
                this.txtCuit.Text = myCliente.Cuit;
            }
        }
Beispiel #2
0
        //METODO QUE VALIDA EL OBJETO PROVEEDOR (VALOR DE PROPIEDADES CARGADAS). N.
        public string[] cValidaProveedor()
        {
            string[] mValida   = new string[20];
            int      cantError = 0;

            //VALIDAR Razon Social
            if (string.IsNullOrEmpty(RazonSocial.ToString()))
            {
                mValida[cantError] = "EL CAMPO RAZON SOCIAL NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (RazonSocial == " ")
            {
                mValida[cantError] = "DEBE COMPLETAR EL CAMPO RAZON SOCIAL";
                cantError         += 1;
            }

            //Validar Condicion de IVA
            if (string.IsNullOrEmpty(this.IdCondicionIva.ToString()))
            {
                mValida[cantError] = "EL CAMPO CONDICION DE IVA NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.IdCondicionIva == 0)
            {
                mValida[cantError] = "DEBE COMPLETAR EL CAMPO CONDICION DE IVA";
                cantError         += 1;
            }


            //Validar CUIT
            if (string.IsNullOrEmpty(this.CUIT.ToString()))
            {
                mValida[cantError] = "EL CAMPO CUIT NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.CUIT == " ")
            {
                mValida[cantError] = "DEBE COMPLETAR EL CAMPO CUIT";
                cantError         += 1;
            }
            else
            {
                //Validar la CUIT
                clsCUIT oCUITvalido = new clsCUIT(this.CUIT);

                if (!(oCUITvalido.EsValido))
                {
                    mValida[cantError] = "EL CUIT INGRESADO ES INCORRECTO. VERIFIQUE!";
                    cantError         += 1;
                }
            }


            //Validar Condicion de Compra
            if (string.IsNullOrEmpty(this.IdCondicionCompra.ToString()))
            {
                mValida[cantError] = "EL CAMPO CONDICION DE COMPRA NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.IdCondicionCompra == 0)
            {
                mValida[cantError] = "DEBE COMPLETAR EL CAMPO CONDICION DE COMPRA";
                cantError         += 1;
            }


            //Validar Direccion
            if (string.IsNullOrEmpty(this.Direccion.ToString()))
            {
                mValida[cantError] = "EL CAMPO DIRECCION NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.Direccion == " ")
            {
                mValida[cantError] = "DEBE COMPLETAR EL CAMPO DIRECCION";
                cantError         += 1;
            }

            //Validar Provincia
            if (string.IsNullOrEmpty(this.IdProvincia.ToString()))
            {
                mValida[cantError] = "EL CAMPO PROVINCIA NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.IdProvincia == 0)
            {
                mValida[cantError] = "DEBE COMPLETAR EL CAMPO PROVINCIA";
                cantError         += 1;
            }

            //Validar Localidad
            if (string.IsNullOrEmpty(this.IdLocalidad.ToString()))
            {
                mValida[cantError] = "EL CAMPO LOCALIDAD NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.IdLocalidad == 0)
            {
                mValida[cantError] = "DEBE COMPLETAR EL CAMPO LOCALIDAD";
                cantError         += 1;
            }

            //Validar Fecha Inicio Actividades no sea superior a la fecha actual N.
            if (Convert.ToDateTime(this.FechaInicioActividad) > DateTime.Now.Date)
            {
                mValida[cantError] = "LA FECHA DE INICIO DE ACTIVIDAD NO PUEDE SER MAYOR A LA ACTUAL!";
                cantError         += 1;
            }

            return(mValida);
        }
Beispiel #3
0
        public string[] cValidaParametros()
        {
            string[] mValida   = new string[32];
            int      cantError = 0;

            //VALIDAR Razon Social
            if (string.IsNullOrEmpty(this.RazonSocial))
            {
                mValida[cantError] = "EL CAMPO 'RAZON SOCIAL' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.RazonSocial == " ")
            {
                mValida[cantError] = "DEBE COMPLETAR EL CAMPO 'RAZON SOCIAL'";
                cantError         += 1;
            }

            //VALIDAR Nombre Fantasia
            if (string.IsNullOrEmpty(this.NombreFantasia))
            {
                mValida[cantError] = "EL CAMPO 'NOMBRE FANTASIA' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.NombreFantasia == " ")
            {
                mValida[cantError] = "DEBE COMPLETAR EL CAMPO 'NOMBRE FANTASIA'";
                cantError         += 1;
            }

            //VALIDAR Direccion
            if (string.IsNullOrEmpty(this.Direccion))
            {
                mValida[cantError] = "EL CAMPO 'DIRECCION' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.Direccion == " ")
            {
                mValida[cantError] = "DEBE COMPLETAR CAMPO 'DIRECCION'!";
                cantError         += 1;
            }

            //VALIDAR Telefono
            if (string.IsNullOrEmpty(this.Telefono))
            {
                mValida[cantError] = "EL CAMPO 'TELEFONO' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.Telefono == " ")
            {
                mValida[cantError] = "DEBE COMPLETAR CAMPO 'TELEFONO'!";
                cantError         += 1;
            }

            //VALIDAR Mail
            if (string.IsNullOrEmpty(this.Mail))
            {
                mValida[cantError] = "EL CAMPO 'MAIL' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.Mail == " ")
            {
                mValida[cantError] = "DEBE COMPLETAR CAMPO 'MAIL'!";
                cantError         += 1;
            }

            //VALIDAR Web
            if (string.IsNullOrEmpty(this.Web))
            {
                mValida[cantError] = "EL CAMPO 'WEB' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.Web == " ")
            {
                mValida[cantError] = "DEBE COMPLETAR CAMPO 'WEB'!";
                cantError         += 1;
            }

            //VALIDAR CUIT
            if (string.IsNullOrEmpty(this.CUIT))
            {
                mValida[cantError] = "EL CAMPO 'CUIT' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.CUIT == " ")
            {
                mValida[cantError] = "DEBE COMPLETAR CAMPO 'CUIT'!";
                cantError         += 1;
            }
            else
            {
                //Validar la CUIT
                clsCUIT oCUITvalido = new clsCUIT(this.CUIT);

                if (!(oCUITvalido.EsValido))
                {
                    mValida[cantError] = "EL CUIT INGRESADO ES INCORRECTO. VERIFIQUE!";
                    cantError         += 1;
                }
            }


            //VALIDAR Localidad
            if (string.IsNullOrEmpty(this.Localidad))
            {
                mValida[cantError] = "EL CAMPO 'LOCALIDAD' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.Localidad == " ")
            {
                mValida[cantError] = "DEBE COMPLETAR CAMPO 'LOCALIDAD'!";
                cantError         += 1;
            }


            //VALIDAR Condicion IVA
            if (string.IsNullOrEmpty(this.CondicionIva))
            {
                mValida[cantError] = "EL CAMPO 'CONDICION IVA' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.CondicionIva == " ")
            {
                mValida[cantError] = "DEBE COMPLETAR CAMPO 'CONDICION IVA'!";
                cantError         += 1;
            }

            //VALIDAR % IVA
            if (string.IsNullOrEmpty(this.Iva.ToString()))
            {
                mValida[cantError] = "EL CAMPO '% IVA' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.Iva > 100.00)
            {
                mValida[cantError] = "EL CAMPO '% IVA' NO PUEDE SER MAYOR A 100%";
                cantError         += 1;
            }
            else if (this.Iva == 0)
            {
                mValida[cantError] = "EL CAMPO '% IVA' DEBER SER MAYOR A CERO!";
                cantError         += 1;
            }


            //VALIDAR % PROV LIMIT CDBA
            if (string.IsNullOrEmpty(this.PorcLimitCdba.ToString()))
            {
                mValida[cantError] = "EL CAMPO '% A APLICAR EN LISTA PROV. LIMITROFES CDBA' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.PorcLimitCdba > 100.00)
            {
                mValida[cantError] = "EL CAMPO '% A APLICAR EN LISTA PROV. LIMITROFES CDBA' NO PUEDE SER MAYOR A 100%";
                cantError         += 1;
            }
            else if (this.PorcLimitCdba == 0)
            {
                mValida[cantError] = "EL CAMPO '% A APLICAR EN LISTA PROV. LIMITROFES CDBA' DEBER SER MAYOR A CERO!";
                cantError         += 1;
            }



            //VALIDAR % PROV LIMIT CDBA LIMIT
            if (string.IsNullOrEmpty(this.PorcLimitCbaLimit.ToString()))
            {
                mValida[cantError] = "EL CAMPO '% A APLICAR EN LISTA PROV. LIMITROFES DE LIMITROFES CDBA' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.PorcLimitCbaLimit > 100.00)
            {
                mValida[cantError] = "EL CAMPO'% A APLICAR EN LISTA PROV. LIMITROFES DE LIMITROFES CDBA' NO PUEDE SER MAYOR A 100%";
                cantError         += 1;
            }
            else if (this.PorcLimitCbaLimit == 0)
            {
                mValida[cantError] = "EL CAMPO '% A APLICAR EN LISTA PROV. LIMITROFES DE LIMITROFES CDBA' DEBER SER MAYOR A CERO!";
                cantError         += 1;
            }

            //VALIDAR CADUCIDAD PRESUPUESTOS
            if (string.IsNullOrEmpty(this.CaducidadPresupuestos.ToString()))
            {
                mValida[cantError] = "EL CAMPO 'MESES PRESUPUESTOS PENDIENTES' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.CaducidadPresupuestos > 99)
            {
                mValida[cantError] = "EL CAMPO 'MESES PRESUPUESTOS PENDIENTES' NO PUEDE SER MAYOR A 99";
                cantError         += 1;
            }
            else if (this.CaducidadPresupuestos == 0)
            {
                mValida[cantError] = "EL CAMPO 'MESES PRESUPUESTOS PENDIENTES' DEBE SER MAYOR A 0!";
                cantError         += 1;
            }

            //VALIDAR CADUCIDAD PRESUPUESTOS
            if (string.IsNullOrEmpty(this.CaducidadPedidos.ToString()))
            {
                mValida[cantError] = "EL CAMPO 'MESES PEDIDOS PENDIENTES' NO PUEDE ESTAR VACIO!";
                cantError         += 1;
            }
            else if (this.CaducidadPedidos > 99)
            {
                mValida[cantError] = "EL CAMPO 'MESES PEDIDOS PENDIENTES' NO PUEDE SER MAYOR A 99";
                cantError         += 1;
            }
            else if (this.CaducidadPedidos == 0)
            {
                mValida[cantError] = "EL CAMPO 'MESES PEDIDOS PENDIENTES' DEBE SER MAYOR A 0!";
                cantError         += 1;
            }

            //RETORNAR VECTOR
            return(mValida);
        }
Beispiel #4
0
        private bool ValidarCarga()
        {
            bool bValida = true;


            //Nombre
            if (this.txtNombre.Text == "")
            {
                MessageBox.Show("Debe completar el dato 'Nombre'!", "Atención!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                this.txtNombre.Focus();
                bValida = false;
                //reornar valor
                return(bValida);
            }

            //Numero
            if (this.txtNumero.Text == "")
            {
                MessageBox.Show("Debe completar el dato 'Número'!", "Atención!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                this.txtNumero.Focus();
                bValida = false;
                //reornar valor
                return(bValida);
            }

            //CBU
            if (this.txtCbu.Text == "")
            {
                MessageBox.Show("Debe completar el dato 'CBU'!", "Atención!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                this.txtCbu.Focus();
                bValida = false;
                //reornar valor
                return(bValida);
            }
            else if (this.txtCbu.TextLength < 22)
            {
                MessageBox.Show("EL largo del dato 'CBU' es incorrecto (ebe tener 22 posiciones)!", "Atención!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                this.txtCbu.Focus();
                bValida = false;
                //reornar valor
                return(bValida);
            }


            //TITULAR
            if (this.txtTitular.Text == "")
            {
                MessageBox.Show("Debe completar el dato 'Titular'!", "Atención!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                this.txtTitular.Focus();
                bValida = false;
                //reornar valor
                return(bValida);
            }

            //CUIT
            if (this.txtCuit.Text == "")
            {
                MessageBox.Show("Debe completar el dato 'CUIT'!", "Atención!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                this.txtCuit.Focus();
                bValida = false;
                //reornar valor
                return(bValida);
            }
            else
            {
                //Validar la CUIT
                clsCUIT oCUITvalido = new clsCUIT(this.txtCuit.ToString());

                if (!(oCUITvalido.EsValido))
                {
                    MessageBox.Show("El 'CUIT' ingresado es inválido!", "Atención!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    this.txtCuit.Focus();
                    bValida = false;
                    //reornar valor
                    return(bValida);
                }
            }

            //reornar valor
            return(bValida);
        }