Beispiel #1
0
        public FindUserDetailsResponse FindUserDetails(FindUserDetailsRequest request)
        {
            IClaimsIdentity identity = (IClaimsIdentity)Thread.CurrentPrincipal.Identity;
            string          upn      = identity.Claims.FindAll(c => { return(c.ClaimType == ClaimTypes.Upn); }).First().Value;

            AuthenticationActions.FindUserDetailsAction action = PolicyInjection.Create <AuthenticationActions.FindUserDetailsAction>();

            AuthenticationEntities.FindUserDetailsParameters parameters = Translators.FindUserDetailsTranslator.TranslateFromServiceToBusiness(request.FindUserDetailsParameters);

            parameters.UserPrincipalIdentity = upn; /* user@domain */
            parameters.UserIdentity          = upn.Split('@')[0];

            AuthenticationEntities.FindUserDetailsResult r = action.Execute(parameters);

            FindUserDetailsResponse response = new FindUserDetailsResponse();

            response.FindUserDetailsResult = GenericMapper.MapNew <DataContracts.FindUserDetailsResult>(r);

            response.FindUserDetailsResult.UserWarehouses = GenericMapper.MapListNew <DataContracts.UserWarehouseCollection, AuthenticationEntities.FindUserWarehousesResult, DataContracts.UserWarehouse>(
                r.Warehouses, Translators.FindUserDetailsTranslator.TranslateFromBusinessToService);

            response.FindUserDetailsResult.UserCompanies = GenericMapper.MapListNew <DataContracts.UserCompanyCollection, AuthenticationEntities.FindUserCompaniesResult, DataContracts.UserCompany>(
                r.Companies, Translators.FindUserDetailsTranslator.TranslateFromBusinessToService);

            return(response);
        }
        public FindOutputManagersResponse FindOutputManagers(FindOutputManagersRequest request)
        {
            IClaimsIdentity identity = (IClaimsIdentity)Thread.CurrentPrincipal.Identity;
            string          upn      = identity.Claims.FindAll(c => { return(c.ClaimType == ClaimTypes.Upn); }).First().Value;

            InitializationActions.FindOutputManagersAction action = PolicyInjection.Create <InitializationActions.FindOutputManagersAction>();

            InitializationEntities.FindOutputManagersParameters parameters = Translators.FindOutputManagersTranslator.TranslateFromServiceToBusiness(request.FindOutputManagersParameters);

            //parameters.UserPrincipalIdentity = upn; /* user@domain */
            //parameters.UserIdentity = upn.Split('@')[0];


            InitializationEntities.FindOutputManagersResult r = action.Execute();

            FindOutputManagersResponse response = new FindOutputManagersResponse();

            response.FindOutputManagerResult = GenericMapper.MapNew <DataContracts.FindOutputManagerResult>(r);

            response.FindOutputManagerResult.OutputManagers =
                GenericMapper.MapListNew <DataContracts.OutputManagerCollection, InitializationEntities.FindOutputManagerResult, DataContracts.OutputManager>(
                    r.OutputManagers, Translators.FindOutputManagersTranslator.TranslateFromBusinessToService);


            return(response);
        }
Beispiel #3
0
 public static Service.FindLiftTruckResult TranslateFromBusinessToService(Business.FindLiftTruckResult businessEntity)
 {
     return(GenericMapper.MapListNew <DataContracts.FindLiftTruckResult, Business.LiftTruck, DataContracts.LiftTruck>(businessEntity, LiftTruckTranslator.TranslateFromBusinessToService));
 }