Esempio n. 1
0
 public PersonifyHelper(PersonifyConfiguration personifyConfiguration = null,
                        serviceSoap personifySsoServiceProxy          = null,
                        IMServiceSoap personifyImsServiceProxy        = null)
 {
     _personifyConfiguration   = personifyConfiguration ?? new PersonifyConfiguration();
     _personifySsoServiceProxy = personifySsoServiceProxy;
     _personifyImsServiceProxy = personifyImsServiceProxy;
 }
Esempio n. 2
0
        public async Task <List <string> > GetCustomersByRoleAsync(string role)
        {
            IMServiceSoap proxy       = null;
            List <string> customersId = null;

            try
            {
                proxy = _personifyImsServiceProxy ?? GetImsServiceProxy();

                var result = await proxy.IMSRoleCustomersGetAsync(_personifyConfiguration.VendorUserName,
                                                                  _personifyConfiguration.VendorPassword, role);


                customersId = result.RoleCustomers.Select(x => x.TimssCustomerId).ToList();
            }
            finally
            {
                CloseProxy(proxy);
            }

            return(customersId);
        }
Esempio n. 3
0
        public async Task <List <string> > GetRolesAsync(string customerId)
        {
            IMServiceSoap proxy = null;
            List <string> roles = null;

            try
            {
                proxy = _personifyImsServiceProxy ?? GetImsServiceProxy();

                var result = await proxy.IMSCustomerRoleGetByTimssCustomerIdAsync(_personifyConfiguration.VendorUserName,
                                                                                  _personifyConfiguration.VendorPassword, customerId);


                roles = result.CustomerRoles.Select(x => x.Value).ToList();
            }
            finally
            {
                CloseProxy(proxy);
            }

            return(roles);
        }