Esempio n. 1
0
        /// <summary>
        /// A method to insert a new Adapter
        /// </summary>
        /// <param name="djs">An adapter entity with information about the new adapter</param>
        public void insert(List <Model.DjLiquidInfo> djs)
        {
            if (djs.Count <= 0)
            {
                return;
            }

            IDjLiquid dal = SensorHub.DALFactory.DjLiquid.Create();
            List <Model.DjLiquidInfo> list = new List <DjLiquidInfo>();

            foreach (Model.DjLiquidInfo dj in djs)
            {
                if (dal.queryCountByDevAndUpTime(dj.DEVID, dj.UPTIME) <= 0)
                {
                    list.Add(dj);
                }
            }
            if (list.Count > 0)
            {
                dal.insert(djs);
            }
        }