Exemplo n.º 1
0
        public BaseEntity BuildObject(Dictionary <string, object> row)
        {
            var ent = new CategoriaFavorita
            {
                IdCategoria = GetIntValue(row, DB_COL_ID_CATEGORIA),
                IdUsuario   = GetStringValue(row, DB_COL_ID_USUARIO)
            };

            return(ent);
        }
Exemplo n.º 2
0
 public void Create(CategoriaFavorita entidad)
 {
     try
     {
         crud.Create(entidad);
     }
     catch (Exception ex)
     {
         ExceptionManager.GetInstance().Process(ex);
     }
 }
Exemplo n.º 3
0
        public IHttpActionResult Delete(CategoriaFavorita entidad)
        {
            try
            {
                var mng = new CategoriaFavoritaManager();
                mng.Delete(entidad);
                apiResp         = new ApiResponse();//
                apiResp.Message = "Action was executed.";

                return(Ok(apiResp));
            }
            catch (BussinessException bex)
            {
                return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message)));
            }
        }
Exemplo n.º 4
0
        public IHttpActionResult Post(CategoriaFavorita entidad)
        {
            try
            {
                var mng = new CategoriaFavoritaManager();
                mng.Create(entidad);

                apiResp         = new ApiResponse();
                apiResp.Message = "Categoría favorita registrada";

                return(Ok(apiResp));
            }
            catch (BussinessException bex)
            {
                return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message)));
            }
        }
Exemplo n.º 5
0
        public List <CategoriaFavorita> RetrieveAllCategoriasUsuario(CategoriaFavorita entidad)
        {
            List <CategoriaFavorita> e = null;

            try
            {
                e = crud.RetrieveAllCategoriasUsuario <CategoriaFavorita>(entidad);
                if (e == null)
                {
                    throw new BusinessException(0);
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.GetInstance().Process(ex);
            }

            return(crud.RetrieveAllCategoriasUsuario <CategoriaFavorita>(entidad));
        }
Exemplo n.º 6
0
        public IHttpActionResult Get(string idUsuario)
        {
            try
            {
                apiResp = new ApiResponse();
                var mng    = new CategoriaFavoritaManager();
                var catFav = new CategoriaFavorita
                {
                    IdUsuario = idUsuario
                };
                apiResp.Data    = mng.RetrieveAllCategoriasUsuario(catFav);
                apiResp.Message = "Action was executed.";

                return(Ok(apiResp));
            }
            catch (BusinessException bex)
            {
                return(InternalServerError(new Exception(bex.ExceptionId + "-" + bex.AppMessage.Message)));
            }
        }
Exemplo n.º 7
0
 public void Delete(CategoriaFavorita entidad)
 {
     crud.Delete(entidad);
 }