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); }
public static void SetLastCentralSync() { DynThingsEntities db = new DynThingsEntities(); DynSetting dset = db.DynSettings.First(); dset.LastCentralSync = DateTime.UtcNow; db.SaveChanges(); }
public static void SetGogoleAnalytics(string googleAnalytics) { DynThingsEntities db = new DynThingsEntities(); DynSetting dset = db.DynSettings.First(); dset.GoogleAnalytics = googleAnalytics; db.SaveChanges(); }
public static void SetKeyMap(string mapKey) { DynThingsEntities db = new DynThingsEntities(); DynSetting dset = db.DynSettings.First(); dset.MapKey = mapKey; db.SaveChanges(); }
public static void SetPlatformTitle(string title) { DynThingsEntities db = new DynThingsEntities(); DynSetting dset = db.DynSettings.First(); dset.PlatformTitle = title; db.SaveChanges(); }
public static void SetApp_TimeZone(int timeZone) { DynThingsEntities db = new DynThingsEntities(); DynSetting dset = db.DynSettings.First(); dset.App_TimeZone = timeZone; db.SaveChanges(); }
public static void SetPlatformKey(Guid newKey) { DynThingsEntities db = new DynThingsEntities(); DynSetting dset = db.DynSettings.First(); dset.PlatformKey = newKey; db.SaveChanges(); }
public static void SetSystemLogger(bool activation) { DynThingsEntities db = new DynThingsEntities(); DynSetting dset = db.DynSettings.First(); dset.EnableSystemLogger = activation; db.SaveChanges(); }
public static void SetPublicSignUP(bool activation) { DynThingsEntities db = new DynThingsEntities(); DynSetting dset = db.DynSettings.First(); dset.PublicSignUP = activation; db.SaveChanges(); }
public static void SetDefaultRecordsPerChild(int recordsCount) { DynThingsEntities db = new DynThingsEntities(); DynSetting dset = db.DynSettings.First(); dset.DefaultRecordsPerChild = recordsCount; db.SaveChanges(); }
public static void SetDevelopmentMode(bool activation) { DynThingsEntities db = new DynThingsEntities(); DynSetting dset = db.DynSettings.First(); dset.DevelopmentMode = activation; db.SaveChanges(); }
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); }
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(); }
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); }
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); }
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); }
public LocationsRepository(DynThingsEntities dynThingsEntities) { db = dynThingsEntities; }
public UserNotificationsRepository(DynThingsEntities dbSource) { db = dbSource; }
public APIUtilizationsRepository(DynThingsEntities dbSource) { db = dbSource; }
public AppThingExtensionsRepository(DynThingsEntities dbSource) { db = dbSource; }
public Lookups(DynThingsEntities dbSource) { db = dbSource; }
public DBInfoRepository(DynThingsEntities dbSource) { db = dbSource; }
public RolesRepository(DynThingsEntities dynThingsEntities) { db = dynThingsEntities; }
public IOTypesRepository(DynThingsEntities dynThingsEntities) { db = dynThingsEntities; }
public DynUsersRepository(DynThingsEntities dbSource) { db = dbSource; repoRoles = new RolesRepository(dbSource); }
public DynThingsAppsRepository(DynThingsEntities dbSource) { db = dbSource; }
public EndpointIOsRepository(DynThingsEntities dbSource) { db = dbSource; }
public AppAPIEntitysRepository(DynThingsEntities dbSource) { db = dbSource; }
public APIAppRepository(DynThingsEntities dbSource) { db = dbSource; }