Пример #1
0
        public static bool ActivaTipoCategoria(YouCom.DTO.TipoCategoriaDTO theTipoCategoriaDTO)
        {
            bool retorno = false;

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

            wobjSQLHelper.SetParametro("@usuarioIngreso", SqlDbType.VarChar, 50, theTipoCategoriaDTO.UsuarioModificacion);
            wobjSQLHelper.SetParametro("@pIdTipoCategoria", SqlDbType.VarChar, 20, theTipoCategoriaDTO.IdTipoCategoria);

            try
            {
                //====================================================================================
                switch (wobjSQLHelper.EjecutarNQ("Activa_TipoCategoria", "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);
        }
Пример #2
0
        public static IList <YouCom.DTO.TipoCategoriaDTO> getListadoTipoCategoria()
        {
            IList <YouCom.DTO.TipoCategoriaDTO> ITipoCategoria = new List <YouCom.DTO.TipoCategoriaDTO>();

            DataTable pobjDataTable = new DataTable();

            if (YouCom.DAL.TipoCategoriaDAL.getListadoTipoCategoria(ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    YouCom.DTO.TipoCategoriaDTO tipo_categoria = new YouCom.DTO.TipoCategoriaDTO();

                    tipo_categoria.IdTipoCategoria     = decimal.Parse(wobjDataRow["IdTipoCategoria"].ToString());
                    tipo_categoria.NombreTipoCategoria = wobjDataRow["nombreTipoCategoria"].ToString();

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

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

                    ITipoCategoria.Add(tipo_categoria);
                }
            }

            return(ITipoCategoria);
        }
Пример #3
0
        public static bool ValidaEliminacionTipoCategoria(YouCom.DTO.TipoCategoriaDTO theTipoCategoriaDTO)
        {
            DataTable pobjDataTable = new DataTable();
            bool      retorno       = false;

            if (YouCom.DAL.TipoCategoriaDAL.ValidaEliminacionTipoCategoria(theTipoCategoriaDTO, ref pobjDataTable))
            {
                foreach (DataRow wobjDataRow in pobjDataTable.Rows)
                {
                    retorno = true;
                }
            }

            return(retorno);
        }
Пример #4
0
        public static bool Update(YouCom.DTO.TipoCategoriaDTO myTipoCategoriaDTO)
        {
            bool retorno = false;

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

            try
            {
                //Seteo Parámetros.
                //====================================================================================
                wobjSQLHelper.SetParametro("@pIdTipoCategoria", SqlDbType.Decimal, -1, myTipoCategoriaDTO.IdTipoCategoria);
                wobjSQLHelper.SetParametro("@pIdCondominio", SqlDbType.Decimal, -1, myTipoCategoriaDTO.TheCondominioDTO.IdCondominio);
                wobjSQLHelper.SetParametro("@pIdComunidad", SqlDbType.Decimal, -1, myTipoCategoriaDTO.TheComunidadDTO.IdComunidad);
                wobjSQLHelper.SetParametro("@pNombreTipoCategoria", SqlDbType.VarChar, 200, myTipoCategoriaDTO.NombreTipoCategoria);
                wobjSQLHelper.SetParametro("@pUsuarioModificacion", SqlDbType.VarChar, 20, myTipoCategoriaDTO.UsuarioModificacion);
                //====================================================================================

                //Ejecuto SP.
                //====================================================================================
                switch (wobjSQLHelper.EjecutarNQ("UPD_TipoCategoria", "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);
        }
Пример #5
0
        public static bool Insert(YouCom.DTO.TipoCategoriaDTO myTipoCategoriaDTO)
        {
            bool retorno = false;

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

            try
            {
                //Seteo Parámetros.
                //====================================================================================
                wobjSQLHelper.SetParametro("@pNombreTipoCategoria", SqlDbType.VarChar, 200, myTipoCategoriaDTO.NombreTipoCategoria);
                wobjSQLHelper.SetParametro("@pUsuarioIngreso", SqlDbType.VarChar, 20, myTipoCategoriaDTO.UsuarioIngreso);
                //====================================================================================

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