Exemplo n.º 1
0
        public static bool ActivaPropuestaEstado(YouCom.DTO.PropuestaEstadoDTO thePropuestaEstadoDTO)
        {
            bool retorno = false;

            YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper();

            wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 50, thePropuestaEstadoDTO.UsuarioModificacion);
            wobjSQLHelper.SetParametro("@pIdPropuestaEstado", SqlDbType.VarChar, 20, thePropuestaEstadoDTO.IdPropuestaEstado);

            try
            {
                //====================================================================================
                switch (wobjSQLHelper.EjecutarNQ("Activa_PropuestaEstado", "YouCom"))
                {
                case 0:
                    throw new Exception("No se pudo grabar.");

                case -1:
                    throw new Exception("Hubo un error.");

                case -2:
                    throw new Exception("Hubo un error.");
                }
                //====================================================================================
                retorno = true;
            }
            catch (Exception eobjException)
            {
                throw eobjException;
            }
            return(retorno);
        }
Exemplo n.º 2
0
        public static IList <YouCom.DTO.PropuestaEstadoDTO> getListadoPropuestaEstado()
        {
            IList <YouCom.DTO.PropuestaEstadoDTO> IPropuestaEstado = new List <YouCom.DTO.PropuestaEstadoDTO>();

            DataTable pobjDataTable = new DataTable();

            if (YouCom.DAL.PropuestaEstadoDAL.getListadoPropuestaEstado(ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    YouCom.DTO.PropuestaEstadoDTO PropuestaEstado = new YouCom.DTO.PropuestaEstadoDTO();

                    PropuestaEstado.IdPropuestaEstado     = decimal.Parse(wobjDataRow["IdPropuestaEstado"].ToString());
                    PropuestaEstado.NombrePropuestaEstado = wobjDataRow["nombrePropuestaEstado"].ToString();

                    PropuestaEstado.UsuarioIngreso      = wobjDataRow["usuario_ingreso"].ToString();
                    PropuestaEstado.FechaIngreso        = wobjDataRow["fecha_ingreso"].ToString();
                    PropuestaEstado.UsuarioModificacion = wobjDataRow["usuario_modificacion"].ToString();
                    PropuestaEstado.FechaModificacion   = wobjDataRow["fecha_modificacion"].ToString();

                    PropuestaEstado.Estado = wobjDataRow["estado"].ToString();

                    IPropuestaEstado.Add(PropuestaEstado);
                }
            }

            return(IPropuestaEstado);
        }
Exemplo n.º 3
0
        public static IList <YouCom.DTO.Propuesta.PropuestaDTO> getListadoPropuesta()
        {
            IList <YouCom.DTO.Propuesta.PropuestaDTO> IPropuesta = new List <YouCom.DTO.Propuesta.PropuestaDTO>();

            DataTable pobjDataTable = new DataTable();

            if (YouCom.DAL.PropuestaDAL.getListadoPropuesta(ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    YouCom.DTO.Propuesta.PropuestaDTO Propuesta = new YouCom.DTO.Propuesta.PropuestaDTO();

                    Propuesta.IdPropuesta = decimal.Parse(wobjDataRow["idPropuesta"].ToString());

                    YouCom.DTO.Seguridad.CondominioDTO myCondominioDTO = new YouCom.DTO.Seguridad.CondominioDTO();
                    myCondominioDTO.IdCondominio = decimal.Parse(wobjDataRow["idCondominio"].ToString());
                    Propuesta.TheCondominioDTO   = myCondominioDTO;

                    YouCom.DTO.Seguridad.ComunidadDTO myComunidadDTO = new YouCom.DTO.Seguridad.ComunidadDTO();
                    myComunidadDTO.IdComunidad = decimal.Parse(wobjDataRow["idComunidad"].ToString());
                    Propuesta.TheComunidadDTO  = myComunidadDTO;

                    YouCom.DTO.Propietario.FamiliaDTO myFamiliaDTO = new YouCom.DTO.Propietario.FamiliaDTO();
                    myFamiliaDTO.IdFamilia              = decimal.Parse(wobjDataRow["idFamilia"].ToString());
                    myFamiliaDTO.NombreFamilia          = wobjDataRow["nombreFamilia"].ToString();
                    myFamiliaDTO.ApellidoPaternoFamilia = wobjDataRow["apellidoPaternoFamilia"].ToString();
                    myFamiliaDTO.ApellidoMaternoFamilia = wobjDataRow["apellidoMaternoFamilia"].ToString();
                    Propuesta.TheFamiliaDTO             = myFamiliaDTO;

                    YouCom.DTO.PropuestaEstadoDTO myPropuestaEstadoDTO = new YouCom.DTO.PropuestaEstadoDTO();
                    myPropuestaEstadoDTO.IdPropuestaEstado     = decimal.Parse(wobjDataRow["idPropuestaEstado"].ToString());
                    myPropuestaEstadoDTO.NombrePropuestaEstado = wobjDataRow["nombrePropuestaEstado"].ToString();
                    Propuesta.ThePropuestaEstadoDTO            = myPropuestaEstadoDTO;

                    Propuesta.NombrePropuesta      = wobjDataRow["nombrePropuesta"].ToString();
                    Propuesta.DescripcionPropuesta = wobjDataRow["descripcionPropuesta"].ToString();
                    Propuesta.FechaPropuesta       = Convert.ToDateTime(wobjDataRow["fechaPropuesta"].ToString());
                    Propuesta.DireccionPropuesta   = wobjDataRow["direccionPropuesta"].ToString();

                    Propuesta.UsuarioIngreso      = wobjDataRow["usuario_ingreso"].ToString();
                    Propuesta.FechaIngreso        = wobjDataRow["fecha_ingreso"].ToString();
                    Propuesta.UsuarioModificacion = wobjDataRow["usuario_modificacion"].ToString();
                    Propuesta.FechaModificacion   = wobjDataRow["fecha_modificacion"].ToString();
                    Propuesta.Estado = wobjDataRow["estado"].ToString();

                    IPropuesta.Add(Propuesta);
                }
            }

            return(IPropuesta);
        }
Exemplo n.º 4
0
        public static bool ValidaEliminacionPropuestaEstado(YouCom.DTO.PropuestaEstadoDTO thePropuestaEstadoDTO)
        {
            DataTable pobjDataTable = new DataTable();
            bool      retorno       = false;

            if (YouCom.DAL.PropuestaEstadoDAL.ValidaEliminacionPropuestaEstado(thePropuestaEstadoDTO, ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    retorno = true;
                }
            }

            return(retorno);
        }
Exemplo n.º 5
0
        public static bool Update(YouCom.DTO.PropuestaEstadoDTO myPropuestaEstadoDTO)
        {
            bool retorno = false;

            YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper();

            try
            {
                //Seteo Parámetros.
                //====================================================================================
                wobjSQLHelper.SetParametro("@pIdPropuestaEstado", SqlDbType.Decimal, -1, myPropuestaEstadoDTO.IdPropuestaEstado);
                wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.VarChar, -1, myPropuestaEstadoDTO.TheCondominioDTO.IdCondominio);
                wobjSQLHelper.SetParametro("@pNombrePropuestaEstado", SqlDbType.VarChar, 200, myPropuestaEstadoDTO.NombrePropuestaEstado);
                wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myPropuestaEstadoDTO.UsuarioModificacion);
                //====================================================================================

                //Ejecuto SP.
                //====================================================================================
                switch (wobjSQLHelper.EjecutarNQ("UPD_PropuestaEstado", "YouCom"))
                {
                case 0:
                    throw new Exception("No se pudo grabar.");

                case -1:
                    throw new Exception("Hubo un error.");

                case -2:
                    throw new Exception("Hubo un error.");
                }
                //====================================================================================

                retorno = true;
            }

            #region Catch

            catch (Exception eobjException)
            {
                throw eobjException;
            }
            #endregion

            return(retorno);
        }