forked from wenjy/HighWayIot
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.6 KiB
C#
64 lines
1.6 KiB
C#
using HighWayIot.Log4net;
|
|
using HighWayIot.Repository.domain;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace HighWayIot.Repository.service
|
|
{
|
|
internal class ZxCarParaService
|
|
{
|
|
private static readonly Lazy<ZxCarParaService> lazy = new Lazy<ZxCarParaService>(() => new ZxCarParaService());
|
|
|
|
public static ZxCarParaService Instance
|
|
{
|
|
get
|
|
{
|
|
return lazy.Value;
|
|
}
|
|
}
|
|
|
|
private LogHelper log = LogHelper.Instance;
|
|
Repository<ZxCarParaEntity> _repository => new Repository<ZxCarParaEntity>("sqlserver");
|
|
|
|
/// <summary>
|
|
/// 查询所有小车参数信息
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public List<ZxCarParaEntity> GetCarParaInfos()
|
|
{
|
|
try
|
|
{
|
|
List<ZxCarParaEntity> entity = _repository.GetList();
|
|
return entity;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("用户信息获取异常", ex);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新小车参数信息
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public bool UpDateCarParaInfos(ZxCarParaEntity entity)
|
|
{
|
|
try
|
|
{
|
|
return _repository.Update(entity);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error("用户信息获取异常", ex);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|