public HttpResponseMessage AddPointDetail([FromBody] PointDetailEntity pointDetail) { if (pointDetail != null) { var entity = new PointDetailEntity { Addpoints = pointDetail.Addpoints, Broker = null, Pointsds = pointDetail.Pointsds, Totalpoints = pointDetail.Totalpoints, Uptime = DateTime.Now, Addtime = DateTime.Now, }; try { if (_pointdetailService.Create(entity) != null) { return(PageHelper.toJson(PageHelper.ReturnValue(true, "数据添加成功!"))); } } catch { return(PageHelper.toJson(PageHelper.ReturnValue(false, "数据添加失败!"))); } } return(PageHelper.toJson(PageHelper.ReturnValue(false, "数据验证错误!"))); }
public PointDetailEntity Update(PointDetailEntity entity) { try { _pointdetailRepository.Update(entity); return(entity); } catch (Exception e) { _log.Error(e, "数据库操作出错"); return(null); } }
public bool Delete(PointDetailEntity entity) { try { _pointdetailRepository.Delete(entity); return(true); } catch (Exception e) { _log.Error(e, "数据库操作出错"); return(false); } }