Exemplo n.º 1
0
		public bool Delete(PointDetailEntity entity)
		{
			try
            {
                _pointdetailRepository.Delete(entity);
                return true;
            }
            catch (Exception e)
            {
				_log.Error(e,"数据库操作出错");
                return false;
            }
		}
Exemplo n.º 2
0
		public PointDetailEntity Update (PointDetailEntity entity)
		{
			try
            {
                _pointdetailRepository.Update(entity);
                return entity;
            }
            catch (Exception e)
            {
				_log.Error(e,"数据库操作出错");
                return null;
            }
		}
Exemplo n.º 3
0
        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, "数据验证错误!"));

        }