Exemplo n.º 1
0
        /// <summary> Elimina un agraciado de la base de datos. </summary>
        /// <param name="tobjAgraciado"> Un objeto del tipo tblAgraciado. </param>
        /// <returns> Un string que indica si se ejecuto o no el metodo. </returns>
        public String gmtdEliminar(tblAgraciado tobjAgraciado)
        {
            if (tobjAgraciado.strCedulaAgra.Trim() == "")
            {
                return("- Debe de ingresar la cédula del agraciado. ");
            }

            if (new blCreditos().gmtdConsultarCreditosxPersona(tobjAgraciado.strCedulaAgra).Count > 0)
            {
                return("- No se puede eliminar el agraciado por que aparece como deudor o codeudor de un crédito. ");
            }

            tblAgraciado agr = new daoAgraciado().gmtdConsultar(tobjAgraciado.strCedulaAgra);

            if (agr.strCedulaAgra == null)
            {
                return("- Este registro no aparece ingresado.");
            }
            else
            {
                tobjAgraciado.intCodigoAgr = agr.intCodigoAgr;
                tobjAgraciado.log          = metodos.gmtdLog("Elimina el Agraciado " + tobjAgraciado.strCedulaAgra, tobjAgraciado.strFormulario);
                return(new daoAgraciado().gmtdEliminar(tobjAgraciado));
            }
        }
Exemplo n.º 2
0
        /// <summary> Modifica un la cédula de un agraciado. </summary>
        /// <param name="tobjAgraciado"> Número de cédula que desea modificar. </param>
        /// <param name="tobjAgraciado"> Número de cédula a modificar. </param>
        /// <returns> Un string que indica si se ejecuto o no la operación. </returns>
        public string gmtdEditarCeduladeAgraciado(string tstrCedulaaModificar, string tstrCambiarpor)
        {
            string       strResultado        = "";
            tblAgraciado agraciadoNuevo      = new tblAgraciado();
            tblAgraciado agraciadoConsultado = new daoAgraciado().gmtdConsultarDetalle(tstrCedulaaModificar);

            agraciadoNuevo = agraciadoConsultado;
            agraciadoNuevo.dtmFecAnulado = Convert.ToDateTime("1/1/1900");
            if (new daoAgraciado().gmtdEliminarFisicamenteunAgraciado(agraciadoConsultado))
            {
                agraciadoNuevo.strCedulaAgra  = tstrCambiarpor;
                agraciadoNuevo.dtmFecAnulado  = Convert.ToDateTime("1/1/1900");
                agraciadoNuevo.bitActualizado = false;
                strResultado = new daoAgraciado().gmtdInsertarxModificaciondeCedula(agraciadoConsultado);
            }
            else
            {
                strResultado = "- No se pudo realizar la operación. ";
            }

            return(strResultado);
        }
Exemplo n.º 3
0
        /// <summary> Modifica un Agraciado. </summary>
        /// <param name="tobjAgraciado"> Un objeto del tipo Agraciado.</param>
        /// <returns> Un string que indica si se ejecuto o no la operación. </returns>
        public string gmtdEditar(tblAgraciado tobjAgraciado)
        {
            if (tobjAgraciado.intCodigoSoc == 0)
            {
                return("- Debe de ingresar el código del socio. ");
            }

            if (tobjAgraciado.strApellido1Agra.Trim() == "")
            {
                return("- Debe de ingresar el apellido del agraciado. ");
            }

            if (tobjAgraciado.strCodBarrio.Trim() == "")
            {
                return("- Debe de ingresar el barrio del agraciado. ");
            }

            if (tobjAgraciado.strCodOficio.Trim() == "")
            {
                return("- Debe de ingresar el oficio del agraciado. ");
            }

            if (tobjAgraciado.strCedulaAgra.Trim() == "")
            {
                return("- Debe de ingresar la cédula del agraciado. ");
            }

            if (tobjAgraciado.strDireccion.Trim() == "")
            {
                return("- Debe de ingresar la direccion del agraciado. ");
            }

            if (tobjAgraciado.strEscolaridad.Trim() == "")
            {
                return("- Debe de ingresar la escolaridad del agraciado. ");
            }

            if (tobjAgraciado.strNombreAgra.Trim() == "")
            {
                return("- Debe de ingresar el nombre del agraciado. ");
            }

            if (tobjAgraciado.strParentesco.Trim() == "")
            {
                return("- Debe de ingresar el parentesco del socio con el agraciado. ");
            }

            if (tobjAgraciado.strTelefono.Trim() == "")
            {
                return("- Debe de ingresar el teléfono del agraciado. ");
            }

            if (tobjAgraciado.strTipoCed.Trim() == "")
            {
                return("- Debe de ingresar el tipo de cédula del agraciado. ");
            }

            if (tobjAgraciado.dtmFechaIng == null)
            {
                return("- Debe de ingresar el barrio del Agraciado. ");
            }

            if (tobjAgraciado.dtmFechaIng >= DateTime.Now)
            {
                return("- La fecha de ingreso no puede ser mayor a la actual. ");
            }

            if (tobjAgraciado.dtmFechaNac == null)
            {
                return("- Debe de ingresar el barrio del Agraciado. ");
            }

            if (tobjAgraciado.dtmFechaNac >= DateTime.Now)
            {
                return("- La fecha de nacimiento no puede ser mayor a la actual. ");
            }

            tblAgraciado agr = new daoAgraciado().gmtdConsultar(tobjAgraciado.strCedulaAgra);

            if (agr.strCedulaAgra == null)
            {
                return("- Este registro ya aparece ingresado.");
            }
            else
            {
                tobjAgraciado.log = metodos.gmtdLog("Modifica el Agraciado " + tobjAgraciado.strCedulaAgra, tobjAgraciado.strFormulario);
                return(new daoAgraciado().gmtdEditar(tobjAgraciado));
            }
        }
Exemplo n.º 4
0
        /// <summary> Inserta un Agraciado. </summary>
        /// <param name="tobjAgraciado"> Un objeto del tipo agraciado. </param>
        /// <returns> Un string que indica si se ejecuto o no la operación. </returns>
        public string gmtdInsertar(tblAgraciado tobjAgraciado)
        {
            if (tobjAgraciado.intCodigoSoc == 0)
            {
                return("- Debe de ingresar el código del Agraciado. ");
            }

            if (tobjAgraciado.strCedulaAgra.Trim() == "")
            {
                return("- Debe de ingresar la cédula del Agraciado. ");
            }

            if (tobjAgraciado.strNombreAgra.Trim() == "")
            {
                return("- Debe de ingresar el nombre del Agraciado. ");
            }

            if (tobjAgraciado.strApellido1Agra.Trim() == "")
            {
                return("- Debe de ingresar el apellido del Agraciado. ");
            }

            if (tobjAgraciado.strDireccion.Trim() == "")
            {
                return("- Debe de ingresar la direccion del Agraciado. ");
            }

            if (tobjAgraciado.strTelefono.Trim() == "")
            {
                return("- Debe de ingresar el teléfono del agraciado. ");
            }

            if (tobjAgraciado.strTelefono.Trim() == "")
            {
                return("- Debe de ingresar el teléfono del agraciado. ");
            }

            if (tobjAgraciado.dtmFechaIng == null)
            {
                return("- Debe de ingresar el barrio del Agraciado. ");
            }

            if (tobjAgraciado.dtmFechaIng >= DateTime.Now)
            {
                return("- La fecha de ingreso no puede ser mayor a la actual. ");
            }

            if (tobjAgraciado.dtmFechaNac == null)
            {
                return("- Debe de ingresar el barrio del Agraciado. ");
            }

            if (tobjAgraciado.dtmFechaNac >= DateTime.Now)
            {
                return("- La fecha de nacimiento no puede ser mayor a la actual. ");
            }

            if (tobjAgraciado.strCodBarrio.Trim() == "")
            {
                return("- Debe de ingresar el barrio del Agraciado. ");
            }

            if (tobjAgraciado.strCodOficio.Trim() == "")
            {
                return("- Debe de ingresar el oficio del Agraciado. ");
            }

            if (tobjAgraciado.strEscolaridad.Trim() == "")
            {
                return("- Debe de ingresar la escolaridad del Agraciado. ");
            }

            if (tobjAgraciado.strParentesco.Trim() == "")
            {
                return("- Debe de ingresar el parentesco del Agraciado con el agraciado. ");
            }

            if (tobjAgraciado.strTipoCed.Trim() == "")
            {
                return("- Debe de ingresar el tipo de cédula del agraciado. ");
            }

            if (new blSocio().gmtdConsultar(tobjAgraciado.intCodigoSoc).strCedulaSoc == null)
            {
                return("- El código de socio no aparece registrado. ");
            }

            tblAgraciado agr = new daoAgraciado().gmtdConsultar(tobjAgraciado.strCedulaAgra);

            if (agr.strCedulaAgra == null)
            {
                if (new blSocio().gmtdConsultarCeduladeSocioAgraciadoFallecido(tobjAgraciado.strCedulaAgra) == false)
                {
                    tobjAgraciado.log           = metodos.gmtdLog("Ingresa el Agraciado " + tobjAgraciado.strCedulaAgra, tobjAgraciado.strFormulario);
                    tobjAgraciado.bitAnulado    = false;
                    tobjAgraciado.dtmFecAnulado = Convert.ToDateTime("1900/01/01");
                    return(new daoAgraciado().gmtdInsertar(tobjAgraciado));
                }
                else
                {
                    return("- Esta cédula ya aparece registrada como socio o fallecido.");
                }
            }
            else
            {
                return("- Este registro ya aparece ingresado.");
            }
        }