public static SensorsController GetSensors()
 {
     if (ctrler == null)
     {
         ctrler = new SensorsController();
     }
     return(ctrler);
 }
 public static SensorsController GetSensors()
 {
     if (ctrler == null)
     {
         ctrler = new SensorsController();
     }
     return ctrler;
 }
Example #3
0
        public string Delete(string appKey, int dvid)
        {
            if (!DataDV.GetDV().CheckConnected())
            {
                return(Errors.e7006);
            }
            var sensors = SensorsController.GetSensors().GetAllForDel(dvid);

            Parallel.ForEach(sensors, item =>
            {
                SensorsController.GetSensors().Delete(item["dvid"].AsInt32, item["ssid"].AsInt32);
            });
            var query1 = Query.EQ("ukey", appKey);
            var query2 = Query.EQ("dvid", dvid);
            var query  = Query.And(query1, query2);

            dvs.Remove(query);
            return(string.Empty);
        }