public DetectorType QueryByNameOrCode(string name, byte code) { DetectorType result = null; DetectorTypeHibernate hibernate = new DetectorTypeHibernate(); result = hibernate.QueryByNameOrCode(name, code); return result; }
public DetectorType QueryByGuid(string guid) { DetectorType result = null; DetectorTypeHibernate hibernate = new DetectorTypeHibernate(); result = hibernate.QueryByGuid(guid); return result; }
/// <summary> /// 分页查询 /// </summary> /// <param name="page">页码</param> /// <param name="rows">每页行数</param> /// <param name="total">总数</param> /// <returns>探头类型集合</returns> public List<DetectorType> Query(int page, int rows, ref int total) { List<DetectorType> results = new List<DetectorType>(); DetectorTypeHibernate hibernate = new DetectorTypeHibernate(); results = hibernate.Query(page, rows, ref total); return results; }
/// <summary> /// 增加 /// </summary> /// <param name="value">值</param> /// <returns>结果</returns> public bool Insert(DetectorType value) { bool result = false; DetectorTypeHibernate hibernate = new DetectorTypeHibernate(); result = hibernate.Insert(value); return result; }
public bool Delete(DetectorType value) { bool result = false; DetectorTypeHibernate hibernate = new DetectorTypeHibernate(); result = hibernate.Delete(value); return result; }
/// <summary> /// 解析数据 /// </summary> /// <param name="values">数据集合</param> /// <returns>探头集合</returns> public List<Detector> ParseDataCache(List<object[]> values) { List<Detector> results = new List<Detector>(); if (values != null) { int total = 0; MachineHibernate machineHibernate = new MachineHibernate(); List<Machine> machines = machineHibernate.Query(1, int.MaxValue, ref total); DetectorTypeHibernate detectorTypeHibernate = new DetectorTypeHibernate(); List<DetectorType> detectorTypes = detectorTypeHibernate.Query(1, int.MaxValue, ref total); for (int i = 0; i < values.Count; i++) { Detector value = this.ParseDataCache(values[i], machines, detectorTypes); results.Add(value); } } return results; }