Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="deviceid"></param>
        /// <returns></returns>
        static public DeviceClass CreateDevice(int deviceid)
        {
            DeviceClass c   = null;
            DataTable   tbl = DeviceDBI.GetDeviceDataTable(deviceid);

            if (tbl.Rows.Count > 0)
            {
                c = CreateDevice(tbl.Rows[0]);
            }
            return(c);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="begin"></param>
 /// <param name="end"></param>
 /// <returns></returns>
 public double CalcUsedAmount(DateTime begin, DateTime end)
 {
     return(DeviceDBI.CalcUsedAmount(this.DeviceID, begin, end));
 }