Exemplo n.º 1
0
        public async Task <bool> DeleteNoticiaDto(DTO.NoticiaDTO noticiaDto)
        {
            await Eliminar <DTO.NoticiaDTO>(noticiaDto, false);

            modelEF.SaveChanges();
            return(true);
        }
Exemplo n.º 2
0
        public static bool ValidaEliminacionNoticia(DTO.NoticiaDTO theNoticiaDTO, ref DataTable pobjDatatable)
        {
            bool retorno = false;

            YouCom.Service.BD.SQLHelper wobjSQLHelper = new YouCom.Service.BD.SQLHelper();
            wobjSQLHelper.SetParametro("@idNoticia", SqlDbType.VarChar, 20, theNoticiaDTO.NoticiaId);

            try
            {
                //====================================================================================
                if (wobjSQLHelper.Ejecutar("validaEliminacionNoticia", "YouCom", pobjDatatable) <= 0)
                {
                    retorno = false;
                }
                else
                {
                    retorno = true;
                }
            }
            catch (Exception eobjException)
            {
                throw eobjException;
            }
            return(retorno);
        }
Exemplo n.º 3
0
        public async Task <bool> CreateNoticiaDto(DTO.NoticiaDTO noticiaDto)
        {
            await Crear <DTO.NoticiaDTO>(noticiaDto, false);

            modelEF.SaveChanges();
            modelEF.Noticia.Local.FirstOrDefault();
            return(true);
        }
Exemplo n.º 4
0
        public async Task <OperationResult <bool> > DeleteNoticiaDto(DTO.NoticiaDTO Noticia)
        {
            try
            {
                var resultado = await informacionNoticia.DeleteNoticiaDto(Noticia);

                return(OperationResult <bool> .SuccessResponse(resultado));
            }
            catch (System.Exception ex)
            {
                return(OperationResult <bool> .ErrorResponse(ex));
            }
        }
Exemplo n.º 5
0
 public async Task <DTO.NoticiaDTO> GetBy_NoticiaDto(int Codigo)
 {
     DTO.NoticiaDTO noticia = ObtenerEntidadPorCondicion <DTO.NoticiaDTO>(t => t.Codigo == Codigo);
     return(await Task.FromResult(noticia));
 }
Exemplo n.º 6
0
        public static bool Update(DTO.NoticiaDTO myNoticiaDTO)
        {
            bool resultado = NoticiaDAL.Update(myNoticiaDTO);

            return(resultado);
        }
Exemplo n.º 7
0
        public static bool Insert(DTO.NoticiaDTO myNoticiaDTO)
        {
            bool resultado = NoticiaDAL.Insert(myNoticiaDTO);

            return(resultado);
        }