using HighWayIot.Log4net; using HighWayIot.Repository.domain; using Models; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; namespace HighWayIot.Repository.service { public class ZxSchedulingService { private static readonly Lazy lazy = new Lazy(() => new ZxSchedulingService()); public static ZxSchedulingService Instance { get { return lazy.Value; } } private LogHelper log = LogHelper.Instance; Repository _repository => new Repository("sqlserver"); /// /// 查询所有排程信息 /// /// public List GetSchedulingInfo(Expression> expression = null) { try { List entity; if (expression != null) { entity = _repository.GetList(expression); } else { entity = _repository.GetList(); } return entity; } catch (Exception ex) { log.Error("排程信息获取异常", ex); return null; } } ///// ///// 添加排程信息 ///// ///// ///// //public bool InsertSchedulingInfo(ZxSchedulingEntity entity) //{ // try // { // return _repository.Insert(entity); // } // catch (Exception ex) // { // log.Error("排程信息插入异常", ex); // return false; // } //} /// /// 修改排程信息 /// /// /// public bool UpdateSchedulingInfo(List entity) { try { return _repository.UpdateRange(entity); } catch (Exception ex) { log.Error("排程信息修改异常", ex); return false; } } } }