Esempio n. 1
0
        public static bool ActivaContenido(YouCom.DTO.ContenidoDTO theContenidoDTO)
        {
            bool retorno = false;

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

            wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 50, theContenidoDTO.UsuarioModificacion);
            wobjSQLHelper.SetParametro("@pIdContenido", SqlDbType.VarChar, 20, theContenidoDTO.ContenidoId);

            try
            {
                //====================================================================================
                switch (wobjSQLHelper.EjecutarNQ("Activa_Contenido", "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);
        }
Esempio n. 2
0
        public static IList <YouCom.DTO.ContenidoDTO> getListadoContenido()
        {
            IList <YouCom.DTO.ContenidoDTO> IContenido = new List <YouCom.DTO.ContenidoDTO>();

            DataTable pobjDataTable = new DataTable();

            if (YouCom.DAL.ContenidoDAL.getListadoContenido(ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    YouCom.DTO.ContenidoDTO contenido = new YouCom.DTO.ContenidoDTO();

                    contenido.ContenidoId      = decimal.Parse(wobjDataRow["IdCasa"].ToString());
                    contenido.ContenidoTitulo  = wobjDataRow["idCondominio"].ToString();
                    contenido.ContenidoResumen = wobjDataRow["nombreCasa"].ToString();
                    contenido.ContenidoDetalle = wobjDataRow["direccionCasa"].ToString();
                    contenido.ContenidoBanner  = wobjDataRow["telefonoCasa"].ToString();
                    contenido.ContenidoImagen  = wobjDataRow["telefonoCasa"].ToString();

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

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

                    IContenido.Add(contenido);
                }
            }

            return(IContenido);
        }
Esempio n. 3
0
        public static bool ValidaEliminacionContenido(YouCom.DTO.ContenidoDTO theContenidoDTO)
        {
            DataTable pobjDataTable = new DataTable();
            bool      retorno       = false;

            if (YouCom.DAL.ContenidoDAL.ValidaEliminacionContenido(theContenidoDTO, ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    retorno = true;
                }
            }

            return(retorno);
        }
Esempio n. 4
0
        public static bool Update(YouCom.DTO.ContenidoDTO myContenidoDTO)
        {
            bool retorno = false;

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

            try
            {
                //Seteo Parámetros.
                //====================================================================================
                wobjSQLHelper.SetParametro("@pContenidoId", SqlDbType.Decimal, -1, myContenidoDTO.ContenidoId);
                wobjSQLHelper.SetParametro("@pContenidoTitulo", SqlDbType.VarChar, 200, myContenidoDTO.ContenidoTitulo);
                wobjSQLHelper.SetParametro("@pContenidoResumen", SqlDbType.VarChar, 200, myContenidoDTO.ContenidoResumen);
                wobjSQLHelper.SetParametro("@pContenidoBanner", SqlDbType.VarChar, 200, myContenidoDTO.ContenidoBanner);
                wobjSQLHelper.SetParametro("@pContenidoImagen", SqlDbType.VarChar, 200, myContenidoDTO.ContenidoImagen);
                wobjSQLHelper.SetParametro("@pContenidoDetalle", SqlDbType.Text, -1, myContenidoDTO.ContenidoDetalle);
                wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myContenidoDTO.UsuarioModificacion);
                //====================================================================================

                //Ejecuto SP.
                //====================================================================================
                switch (wobjSQLHelper.EjecutarNQ("UPD_Contenido", "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);
        }