/// <summary> /// 提供按照设定条件搜索指定设备的功能。 /// </summary> /// <param name="application"></param> public DeviceSearch(ApplicationClass application) : base(application) { this.m_Filters = new DeviceFilterCollection(); this.m_Filters.SetApplication(application); this.OrderInfos = new Searchs.SearchOrderInfoCollection <IDeviceOrder>(); }
/// <summary> /// 设置分类数据集。 /// </summary> /// <param name="dr"></param> protected internal virtual void SetDataReader(System.Data.IDataReader dr) { this.ClassifyId = Function.ToInt(dr[Tables.Classify.ClassifyId]); this.m_ParentId = Function.ToInt(dr[Tables.Classify.ParentId]); this.Name = Function.ToString(dr[Tables.Classify.Name]); this.NameShortcut = Function.ToString(dr[Tables.Classify.NameShortcut]); this.Identifier = Function.ToString(dr[Tables.Classify.Identifier]); this.OrdinalNumber = Function.ToInt(dr[Tables.Classify.OrdinalNumber]); object objConfig = dr[Tables.Classify.XMLConfig]; if (objConfig != null && !(objConfig is System.DBNull)) { System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument(); try { xmlDoc.LoadXml(objConfig.ToString()); if (xmlDoc.ChildNodes.Count > 0) { foreach (System.Xml.XmlNode xnConfigItem in xmlDoc.ChildNodes[0].ChildNodes) { switch (xnConfigItem.Name) { case "EnabledDevice": this.EnabledDevice = Function.ToBool(xnConfigItem.InnerText); break; case "DeviceFilters": if (xnConfigItem.ChildNodes.Count > 0) { this.DeviceFilters = new DeviceSearchs.DeviceFilterCollection(); this.DeviceFilters.SetApplication(this.Application); this.DeviceFilters.SetFilterConfig(xnConfigItem.ChildNodes[0]); } break; default: this.SetClassifyConfig(xnConfigItem); break; } } } } catch (Exception e) { throw e; } } }
/// <summary> /// 提供按照设定条件搜索指定设备的上级设备ID的功能。 /// </summary> /// <param name="application"></param> public DeviceParentIdSearch(ApplicationClass application) : base(application) { this.m_Filters = new DeviceFilterCollection(); this.m_Filters.SetApplication(application); }