Exemplo n.º 1
0
 public AzureIoT(ISiteInformation siteInformation)
 {
     _site = (SiteInformation)siteInformation;
     InitIoTHub();
 }
Exemplo n.º 2
0
        public UserController(ApplicationDbContext context, UserManager <IdentityUser> userManager, ISiteInformation site)
        {
            _context     = context;
            _userManager = userManager;
            _site        = (SiteInformation)site;
            // Add the first user to admin
            var users = _userManager.Users;

            if (users.Count() == 1)
            {
                var usr = users.First();
                _userManager.AddToRoleAsync(usr, "Admin").Wait();
            }
            else
            {
                //Check if anyone is admin. If no one, then make the first user Admin
                var usr = _userManager.GetUsersInRoleAsync("Admin").GetAwaiter().GetResult();
                if ((usr.Count == 0) && (users.Count() > 0))
                {
                    _userManager.AddToRoleAsync(users.First(), "Admin").Wait();
                }
            }
        }
Exemplo n.º 3
0
 public HomeController(ISiteInformation site)
 {
     _site = (SiteInformation)site;
 }
Exemplo n.º 4
0
 public AutomationController(ISiteInformation site)
 {
     _site = (SiteInformation)site;
 }
 public SprinklerController(ISiteInformation site)
 {
     _site = (SiteInformation)site;
 }
 public ProgramController(ISiteInformation site)
 {
     _site = (SiteInformation)site;
 }
 public SettingsController(ISiteInformation site)
 {
     _site = (SiteInformation)site;
 }
 public ForecastController(ISiteInformation site)
 {
     _site = (SiteInformation)site;
 }
Exemplo n.º 9
0
 public HistoryController(ISiteInformation site)
 {
     _site = (SiteInformation)site;
 }