private static string GetAuthUrl(int tenantId)
        {
            var tenantResource = new TenantResource();
            var tenant = tenantResource.GetTenant(tenantId);
            return HttpHelper.GetUrl(tenant.Domain);

           
        }
Exemple #2
0
        private void cbTenant_changed(object sender, EventArgs e)
        {
            try
            {
                cbSite.DataSource = null;
                var scope = (Scope) cbTenant.SelectedItem;

                var tenantResource = new TenantResource();
                _tenant = tenantResource.GetTenant(scope.Id);
                var sites = _tenant.Sites;
                cbSite.DataSource = sites;
                cbSite.DisplayMember = "Name";
                panelAPI.Show();

            }
            catch (Exception exc)
            {
                LogError(exc);
            }
        }
Exemple #3
0
	    private static Site GetSite(int tenantId, int siteId)
	    {
            var tenantResource = new TenantResource();
            var tenant = tenantResource.GetTenant(tenantId);
            var site = tenant.Sites.SingleOrDefault(x => x.Id.Equals(siteId));

            if (site == null) throw new Exception(string.Format("{0} not found for tenant {1}", siteId, tenantId));
	        return site;
	    }