Example #1
0
 private ParameterType ParamTypeForSconnMapper(sconnConfigMapper mapper)
 {
     try
     {
         iotConnector connector = new iotConnector();
         return(connector.TypeForName(ParameterNameForMapper(mapper))); //ParameterType.TypeForName(ParameterNameForMapper(mapper), cont);
     }
     catch (Exception e)
     {
         nlogger.ErrorException(e.Message, e);
         return(new ParameterType());
     }
 }
Example #2
0
 public iotDomain GetDomainWithName(string name)
 {
     try
     {
         iotConnector connector = new iotConnector();
         return(connector.DomainForDomainName(name));
     }
     catch (Exception e)
     {
         nlogger.ErrorException(e.Message, e);
         return(new iotDomain());
     }
 }
Example #3
0
        /************** Get by id *****************/


        public Site SiteWithId(int id)
        {
            try
            {
                //iotRepository<Site> repo = new iotRepository<Site>();
                //return repo.GetById(id);
                iotConnector connector = new iotConnector();
                return(connector.SiteList().Where(s => { return s.Id == id; }).First());
            }
            catch (Exception e)
            {
                nlogger.ErrorException(e.Message, e);
                return(new Site());
            }
        }
Example #4
0
 public Device DeviceWithId(int id)
 {
     try
     {
         /*
          * iotRepository<Device> repo = new iotRepository<Device>();
          * return repo.GetById(id);
          */
         iotConnector connector = new iotConnector();
         return(connector.DeviceList().Where(s => { return s.Id == id; }).First());
     }
     catch (Exception e)
     {
         nlogger.ErrorException(e.Message, e);
         return(new Device());
     }
 }
Example #5
0
 public CommSconnProtocol()
 {
     connector = new iotConnector();
     site      = new sconnSite();
     cfgMngr   = new sconnCfgMngr();
 }