Example #1
0
        /// <summary>
        ///
        /// </summary>
        public void Do()
        {
            // devices
            //
            DeviceCollection devices = DeviceFactory.CreateDeviceCollection();

            // foreach device
            //
            foreach (DeviceClass d in devices)
            {
                DateTime dtlast = d.GetLastDateTimeForm10MinuteDataTable();
                DateTime begin  = dtlast.Date + TimeSpan.FromDays(1d);
                DateTime end    = DateTime.Now.Date;
                for (DateTime temp = begin; temp < end; temp += TimeSpan.FromDays(1d))
                {
                    DataTable source = d.GetDitchData(temp, temp + TimeSpan.FromDays(1d));
                    DataTable dest   = Create10MinuteDataTable(source);
                    if (dest != null && dest.Rows.Count > 0)
                    {
                        d.Write10MinuteDataTable(dest);
                    }
                }
            }
            // device last zb data dt
            //
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        private void Bind()
        {
            DeviceCollection devices = DeviceFactory.CreateDeviceCollection();

            //DeviceFactory
            this.clStation.DataSource     = devices;
            this.clStation.DataTextField  = "StationName";
            this.clStation.DataValueField = "DeviceID";
            this.clStation.DataBind();


            DeviceCollection inOutDevices = GetInOrOutDeviceCollection();

            foreach (DeviceClass d in inOutDevices)
            {
                foreach (ListItem item in clStation.Items)
                {
                    if (d.DeviceID == Convert.ToInt32(item.Value))
                    {
                        item.Selected = true;
                    }
                }
            }
        }