Exemple #1
0
        public static async Task NewCNDSUser(CNDSClient client, Dns.DTO.UserDTO newUser, Guid networkID, Guid cndsOrganizationID)
        {
            var sendUser = new CNDS.DTO.UserTransferDTO()
            {
                ID             = newUser.ID.Value,
                UserName       = newUser.UserName,
                FirstName      = newUser.FirstName,
                LastName       = newUser.LastName,
                EmailAddress   = newUser.Email,
                FaxNumber      = newUser.Fax,
                OrganizationID = cndsOrganizationID,
                MiddleName     = newUser.MiddleName,
                PhoneNumber    = newUser.Phone,
                NetworkID      = networkID
            };

            sendUser.Metadata = DomainData.GetDomainData(newUser.Metadata, new List <DomainDataDTO>());

            await client.Users.Register(sendUser);
        }
Exemple #2
0
        public static async Task RegisterCNDSOrg(CNDSClient client, Dns.DTO.OrganizationDTO newOrg, Guid networkID, Guid?cndsParentOrgID)
        {
            var sendOrg = new CNDS.DTO.OrganizationTransferDTO()
            {
                ID      = newOrg.ID.Value,
                Name    = newOrg.Name,
                Acronym = newOrg.Acronym,
                ParentOrganizationID = cndsParentOrgID.HasValue ? cndsParentOrgID : null,
                NetworkID            = networkID,
                ContactEmail         = newOrg.ContactEmail,
                ContactFirstName     = newOrg.ContactFirstName,
                ContactLastName      = newOrg.ContactLastName,
                ContactPhone         = newOrg.ContactPhone
            };

            sendOrg.Metadata = DomainData.GetDomainData(newOrg.Metadata, new List <DomainDataDTO>());


            await client.Organizations.Register(sendOrg);
        }
Exemple #3
0
        public static async Task UpdateCNDSOrg(CNDSClient client, Dns.DTO.OrganizationDTO editOrgs, Guid networkID, Guid cndsOrganizationID, Guid?cndsParentOrgID)
        {
            var sendOrg = new CNDS.DTO.OrganizationTransferDTO()
            {
                ID      = cndsOrganizationID,
                Name    = editOrgs.Name,
                Acronym = editOrgs.Acronym,
                ParentOrganizationID = cndsParentOrgID.HasValue ? cndsParentOrgID : null,
                NetworkID            = networkID,
                ContactEmail         = editOrgs.ContactEmail,
                ContactFirstName     = editOrgs.ContactFirstName,
                ContactLastName      = editOrgs.ContactLastName,
                ContactPhone         = editOrgs.ContactPhone
            };

            var currentMetaData = await client.Organizations.ListOrganizationDomains(cndsOrganizationID);

            sendOrg.Metadata = DomainData.GetDomainData(editOrgs.Metadata, currentMetaData);

            await client.Organizations.Update(sendOrg);
        }
Exemple #4
0
        public static async Task EditCNDSUser(CNDSClient client, Dns.DTO.UserDTO editUser, Guid networkID, Guid cndsUserID, Guid cndsOrganizationID)
        {
            var sendUser = new CNDS.DTO.UserTransferDTO()
            {
                ID             = cndsUserID,
                UserName       = editUser.UserName,
                FirstName      = editUser.FirstName,
                LastName       = editUser.LastName,
                EmailAddress   = editUser.Email,
                FaxNumber      = editUser.Fax,
                OrganizationID = cndsOrganizationID,
                MiddleName     = editUser.MiddleName,
                PhoneNumber    = editUser.Phone,
                NetworkID      = networkID,
                Active         = editUser.Active
            };

            var currentMetaData = await client.Users.ListUserDomains(cndsUserID);

            sendUser.Metadata = DomainData.GetDomainData(editUser.Metadata, currentMetaData);

            await client.Users.Update(sendUser);
        }