Beispiel #1
0
        private Monitor GetMonitor(LocationView locationView)
        {
            DynThingsEntities db    = new DynThingsEntities();
            Monitor           monit = new Monitor();

            //Fill Monitor values
            monit.ID               = locationView.ID;
            monit.Title            = locationView.Title;
            monit.IsActive         = (bool)locationView.IsActive;
            monit.locationViewType = locationView.LocationViewType;
            monit.OwnerID          = locationView.OwnerID;
            monit.X = locationView.X;
            monit.Y = locationView.Y;
            monit.Z = locationView.Z;


            List <LinkLocationsLocationView> linksLocations = db.LinkLocationsLocationViews.Where(l => l.LocationViewID == locationView.ID).ToList();
            List <long> ids = new List <long>();

            foreach (LinkLocationsLocationView lnk in linksLocations)
            {
                ids.Add((long)lnk.LocationID);
            }

            monit.MLocations = db.Locations.Where(l => l.ID > 0 && ids.Contains(l.ID)).ToList();

            return(monit);
        }
Beispiel #2
0
        public static void SetLastCentralSync()
        {
            DynThingsEntities db   = new DynThingsEntities();
            DynSetting        dset = db.DynSettings.First();

            dset.LastCentralSync = DateTime.UtcNow;
            db.SaveChanges();
        }
Beispiel #3
0
        public static void SetGogoleAnalytics(string googleAnalytics)
        {
            DynThingsEntities db   = new DynThingsEntities();
            DynSetting        dset = db.DynSettings.First();

            dset.GoogleAnalytics = googleAnalytics;
            db.SaveChanges();
        }
Beispiel #4
0
        public static void SetKeyMap(string mapKey)
        {
            DynThingsEntities db   = new DynThingsEntities();
            DynSetting        dset = db.DynSettings.First();

            dset.MapKey = mapKey;
            db.SaveChanges();
        }
Beispiel #5
0
        public static void SetPlatformTitle(string title)
        {
            DynThingsEntities db   = new DynThingsEntities();
            DynSetting        dset = db.DynSettings.First();

            dset.PlatformTitle = title;
            db.SaveChanges();
        }
Beispiel #6
0
        public static void SetApp_TimeZone(int timeZone)
        {
            DynThingsEntities db   = new DynThingsEntities();
            DynSetting        dset = db.DynSettings.First();

            dset.App_TimeZone = timeZone;
            db.SaveChanges();
        }
Beispiel #7
0
        public static void SetPlatformKey(Guid newKey)
        {
            DynThingsEntities db   = new DynThingsEntities();
            DynSetting        dset = db.DynSettings.First();

            dset.PlatformKey = newKey;
            db.SaveChanges();
        }
Beispiel #8
0
        public static void SetSystemLogger(bool activation)
        {
            DynThingsEntities db   = new DynThingsEntities();
            DynSetting        dset = db.DynSettings.First();

            dset.EnableSystemLogger = activation;
            db.SaveChanges();
        }
Beispiel #9
0
        public static void SetPublicSignUP(bool activation)
        {
            DynThingsEntities db   = new DynThingsEntities();
            DynSetting        dset = db.DynSettings.First();

            dset.PublicSignUP = activation;
            db.SaveChanges();
        }
Beispiel #10
0
        public static void SetDefaultRecordsPerChild(int recordsCount)
        {
            DynThingsEntities db   = new DynThingsEntities();
            DynSetting        dset = db.DynSettings.First();

            dset.DefaultRecordsPerChild = recordsCount;
            db.SaveChanges();
        }
Beispiel #11
0
        public static void SetDevelopmentMode(bool activation)
        {
            DynThingsEntities db   = new DynThingsEntities();
            DynSetting        dset = db.DynSettings.First();

            dset.DevelopmentMode = activation;
            db.SaveChanges();
        }
Beispiel #12
0
        public IPagedList GetPagedListByThingID(string search, long ThingID, int pageNumber, int recordsPerPage)
        {
            db = new DynThingsEntities();
            IPagedList cmds = db.EndPointCommands
                              .Where(e => search == null || e.Title.Contains(search) && e.Endpoint.ThingID == ThingID)
                              .OrderBy(e => e.Title).ToList()
                              .ToPagedList(pageNumber, recordsPerPage);

            return(cmds);
        }
Beispiel #13
0
        public static void SetMailsConfig(Mails.MailsConfig mailConfig)
        {
            DynThingsEntities db   = new DynThingsEntities();
            DynSetting        dset = db.DynSettings.First();

            dset.SMTPAddress     = mailConfig.Host;
            dset.SMTPPort        = mailConfig.Port;
            dset.NotifcationMail = mailConfig.Sender;
            db.SaveChanges();
        }
Beispiel #14
0
        public static void Setup(string title, bool publicAccess, bool publicSignUp, int appLocalTime, bool developmentMode)
        {
            DynThingsEntities db   = new DynThingsEntities();
            DynSetting        dset = db.DynSettings.First();

            dset.PlatformTitle   = title;
            dset.PublicAccess    = publicAccess;
            dset.PublicSignUP    = PublicSignUP;
            dset.App_TimeZone    = appLocalTime;
            dset.DevelopmentMode = developmentMode;
            db.SaveChanges();
        }
        public IPagedList <EndPointCommand> GetPagedList(string search, long EndPointID, long ThingID, long LocationID, int pageNumber, int recordsPerPage)
        {
            db = new DynThingsEntities();
            IPagedList <EndPointCommand> cmds = db.EndPointCommands
                                                .Where(e =>
                                                       (e.EndPointID == EndPointID || (search == null || search == "")) &&//Filter by EndpointID
                                                       (e.Title.Contains(search) || (search == null || search == "")) &&//Filter by Search "Title"
                                                       ((e.Endpoint.Thing.LinkThingsLocations.Any(l => l.LocationID == LocationID)) || (LocationID == null || LocationID == 0)) &&//Filter by locationID
                                                       ((e.Endpoint.ThingID == ThingID) || (ThingID == null || ThingID == 0)) //Filter by ThingID
                                                       ).OrderBy(e => e.Title)
                                                .ToPagedList(pageNumber, recordsPerPage);

            return(cmds);
        }
Beispiel #16
0
        public IPagedList GetLogsPagedList(string search, long LocationID, long ThingID, int pageNumber, int recordsPerPage)
        {
            db = new DynThingsEntities();
            List <EndPointIO> logs = db.EndPointIOs
                                     .Where(e => search == null || e.Valu.Contains(search) &&
                                            e.Endpoint.Thing.LinkThingsLocations.Any(l => l.LocationID == LocationID) &&
                                            e.IOTypeID == 3)
                                     .OrderByDescending(e => e.ExecTimeStamp).ToList();

            if (ThingID != 0)
            {
                logs = logs.Where(c => c.Endpoint.ThingID == ThingID).ToList();
            }

            IPagedList plLogs = logs.ToPagedList(pageNumber, recordsPerPage);

            return(plLogs);
        }
Beispiel #17
0
        public IPagedList GetPagedListByLocationID(string search, long LocationID, long ThingID, int pageNumber, int recordsPerPage)
        {
            List <LinkThingsLocation> lnks = db.LinkThingsLocations.Where(l => l.LocationID == LocationID).ToList();

            db = new DynThingsEntities();
            List <EndPointCommand> cmds = db.EndPointCommands
                                          .Where(e => search == null || e.Title.Contains(search) && e.Endpoint.Thing.LinkThingsLocations.Any(l => l.LocationID == LocationID))
                                          .OrderBy(e => e.Title).ToList();

            if (ThingID != 0)
            {
                cmds = cmds.Where(c => c.Endpoint.ThingID == ThingID).ToList();
            }

            IPagedList plCmds = cmds.ToPagedList(pageNumber, recordsPerPage);

            return(plCmds);
        }
Beispiel #18
0
 public LocationsRepository(DynThingsEntities dynThingsEntities)
 {
     db = dynThingsEntities;
 }
Beispiel #19
0
 public UserNotificationsRepository(DynThingsEntities dbSource)
 {
     db = dbSource;
 }
Beispiel #20
0
 public APIUtilizationsRepository(DynThingsEntities dbSource)
 {
     db = dbSource;
 }
 public AppThingExtensionsRepository(DynThingsEntities dbSource)
 {
     db = dbSource;
 }
Beispiel #22
0
 public Lookups(DynThingsEntities dbSource)
 {
     db = dbSource;
 }
Beispiel #23
0
 public DBInfoRepository(DynThingsEntities dbSource)
 {
     db = dbSource;
 }
Beispiel #24
0
 public RolesRepository(DynThingsEntities dynThingsEntities)
 {
     db = dynThingsEntities;
 }
 public IOTypesRepository(DynThingsEntities dynThingsEntities)
 {
     db = dynThingsEntities;
 }
 public DynUsersRepository(DynThingsEntities dbSource)
 {
     db        = dbSource;
     repoRoles = new RolesRepository(dbSource);
 }
Beispiel #27
0
 public DynThingsAppsRepository(DynThingsEntities dbSource)
 {
     db = dbSource;
 }
Beispiel #28
0
 public EndpointIOsRepository(DynThingsEntities dbSource)
 {
     db = dbSource;
 }
 public AppAPIEntitysRepository(DynThingsEntities dbSource)
 {
     db = dbSource;
 }
Beispiel #30
0
 public APIAppRepository(DynThingsEntities dbSource)
 {
     db = dbSource;
 }