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); }
public void Create(CategoriaFavorita entidad) { try { crud.Create(entidad); } catch (Exception ex) { ExceptionManager.GetInstance().Process(ex); } }
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))); } }
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))); } }
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)); }
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))); } }
public void Delete(CategoriaFavorita entidad) { crud.Delete(entidad); }