public async Task OnGetAsync()
        {
            OrganizationUnit = new CreatOrganizationUnitViewModel();
            var childrens = await _organizationUnitManager.FindChildrenAsync(null, true);

            OrganizationUnits = childrens.OrderBy(t => t.Code).Select(x => new SelectListItem($"{x.Code} {x.DisplayName}", x.Id.ToString())).ToList();
            OrganizationUnits.Insert(0, new SelectListItem()
            {
                Text = "Root", Value = null
            });
            if (_currentTenant.Id == null)
            {
                Tenants = new List <SelectListItem>()
                {
                    new SelectListItem()
                    {
                        Text = "Host", Value = null
                    }
                };
            }
            else
            {
                var temptenants = await _tenantAppService.GetListAsync(new GetTenantsInput()
                {
                });

                Tenants = temptenants.Items.OrderBy(t => t.Name).Select(x => new SelectListItem(x.Name, x.Id.ToString())).ToList();
                Tenants.Insert(0, new SelectListItem()
                {
                    Text = "Host", Value = null
                });
            }
        }
示例#2
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Account                = new Account(this);
     Logs                   = new Logs(this);
     RobotsService          = new RobotsService(this);
     Stats                  = new Stats(this);
     Status                 = new Status(this);
     Alerts                 = new Alerts(this);
     Assets                 = new Assets(this);
     AuditLogs              = new AuditLogs(this);
     Environments           = new Environments(this);
     Jobs                   = new Jobs(this);
     OrganizationUnits      = new OrganizationUnits(this);
     Permissions            = new Permissions(this);
     Processes              = new Processes(this);
     ProcessSchedules       = new ProcessSchedules(this);
     QueueDefinitions       = new QueueDefinitions(this);
     QueueItemComments      = new QueueItemComments(this);
     QueueItemEvents        = new QueueItemEvents(this);
     QueueItems             = new QueueItems(this);
     QueueProcessingRecords = new QueueProcessingRecords(this);
     Queues                 = new Queues(this);
     Releases               = new Releases(this);
     RobotLogs              = new RobotLogs(this);
     Robots                 = new Robots(this);
     Roles                  = new Roles(this);
     Sessions               = new Sessions(this);
     Settings               = new Settings(this);
     Tenants                = new Tenants(this);
     UserLoginAttempts      = new UserLoginAttempts(this);
     Users                  = new Users(this);
     BaseUri                = new System.Uri("http://localhost:6234");
     SerializationSettings  = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new  List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     CustomInitialize();
 }
        /// <summary>
        ///     Parses the Dn value into components
        /// </summary>
        /// <param name="dn">The distinguishedname value</param>
        private void ParseDistinguishedName(string dn)
        {
            var segments = dn.Split(',');

            foreach (var seg in segments)
            {
                var values = seg.Trim().Split('=');
                switch (values[0].ToLowerInvariant())
                {
                case "cn":
                    CommonName = values[1];
                    break;

                case "ou":
                    OrganizationUnits.Insert(0, values[1]);
                    break;

                case "dc":
                    DomainComponents.Add(values[1]);
                    break;
                }
            }
        }
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Account           = new Account(this);
     Token             = new Token(this);
     DirectoryService  = new DirectoryService(this);
     FoldersNavigation = new FoldersNavigation(this);
     Licensing         = new Licensing(this);
     Logs                   = new Logs(this);
     Maintenance            = new Maintenance(this);
     RobotsService          = new RobotsService(this);
     Stats                  = new Stats(this);
     Status                 = new Status(this);
     TestAutomation         = new TestAutomation(this);
     TestDataQueueActions   = new TestDataQueueActions(this);
     Translations           = new Translations(this);
     TaskForms              = new TaskForms(this);
     Alerts                 = new Alerts(this);
     Assets                 = new Assets(this);
     AuditLogs              = new AuditLogs(this);
     Buckets                = new Buckets(this);
     Calendars              = new Calendars(this);
     CredentialStores       = new CredentialStores(this);
     Environments           = new Environments(this);
     ExecutionMedia         = new ExecutionMedia(this);
     Folders                = new Folders(this);
     HostLicenses           = new HostLicenses(this);
     Jobs                   = new Jobs(this);
     JobTriggers            = new JobTriggers(this);
     Libraries              = new Libraries(this);
     LicensesNamedUser      = new LicensesNamedUser(this);
     LicensesRuntime        = new LicensesRuntime(this);
     Machines               = new Machines(this);
     MessageTemplates       = new MessageTemplates(this);
     OrganizationUnits      = new OrganizationUnits(this);
     Permissions            = new Permissions(this);
     Processes              = new Processes(this);
     ProcessSchedules       = new ProcessSchedules(this);
     QueueDefinitions       = new QueueDefinitions(this);
     QueueItemComments      = new QueueItemComments(this);
     QueueItemEvents        = new QueueItemEvents(this);
     QueueItems             = new QueueItems(this);
     QueueProcessingRecords = new QueueProcessingRecords(this);
     Queues                 = new Queues(this);
     Releases               = new Releases(this);
     RobotLogs              = new RobotLogs(this);
     Robots                 = new Robots(this);
     Roles                  = new Roles(this);
     Sessions               = new Sessions(this);
     Settings               = new Settings(this);
     TaskActivities         = new TaskActivities(this);
     TaskCatalogs           = new TaskCatalogs(this);
     TaskNotes              = new TaskNotes(this);
     Tasks                  = new Tasks(this);
     Tenants                = new Tenants(this);
     TestCaseDefinitions    = new TestCaseDefinitions(this);
     TestCaseExecutions     = new TestCaseExecutions(this);
     TestDataQueueItems     = new TestDataQueueItems(this);
     TestDataQueues         = new TestDataQueues(this);
     TestSetExecutions      = new TestSetExecutions(this);
     TestSets               = new TestSets(this);
     TestSetSchedules       = new TestSetSchedules(this);
     UserLoginAttempts      = new UserLoginAttempts(this);
     Users                  = new Users(this);
     Webhooks               = new Webhooks(this);
     GenericTasks           = new GenericTasks(this);
     BaseUri                = new System.Uri("https://cloud.uipath.com");
     SerializationSettings  = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new  List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     CustomInitialize();
 }