Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        static public DeviceCollection CreateDeviceCollection()
        {
            DeviceCollection dc  = new DeviceCollection();
            DataTable        tbl = DeviceDBI.GetDeviceDataView();

            foreach (DataRow row in tbl.Rows)
            {
                DeviceClass c = CreateDevice(row);
                dc.Add(c);
            }
            return(dc);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public DeviceCollection GetDeviceCollection()
        {
            DeviceCollection list = new DeviceCollection();

            foreach (StationClass sc in this)
            {
                foreach (DeviceClass d in sc.DeviceCollection)
                {
                    list.Add(d);
                }
            }
            return(list);
        }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="stationID"></param>
        /// <returns></returns>
        static public DeviceCollection CreateDeviceCollectionByStationID(int stationID)
        {
            DeviceCollection dc = new DeviceCollection();
            //int[] devicdIDs = DeviceDBI.GetDeviceIDsByStationID(stationID);
            //string s = SqlHelper.MakeInQueryCondition(devicdIDs);
            DataTable tbl = DeviceDBI.GetDeviceDataTableByStationID(stationID);

            foreach (DataRow row in tbl.Rows)
            {
                DeviceClass d = CreateDevice(row);
                dc.Add(d);
            }
            return(dc);
        }
Пример #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inOrOutTableName"></param>
        /// <param name="waterUserId"></param>
        /// <returns></returns>
        private static DeviceCollection CreateDeviceCollection(string inOrOutTableName, int waterUserId)
        {
            DeviceCollection ds = new DeviceCollection();
            string           s  = string.Format(
                @"select * from tblDevice 
                    where deleted = 0 and 
                        deviceid in (select deviceid from {0} where waterUserID = {1})",
                inOrOutTableName, waterUserId);

            DataTable tbl = DBI.GetDBI().ExecuteDataTable(s);

            foreach (DataRow row in tbl.Rows)
            {
                DeviceClass d = CreateDevice(row);
                ds.Add(d);
            }
            return(ds);
        }