Ejemplo n.º 1
0
        /// <summary>
        /// Add Domain License Detail Claims
        /// </summary>
        private void AddDomainLicenseDetailClaims(long domainKey, ClaimsIdentity identity)
        {
            DomainLicenseDetail domainLicenseDetail = null;

            //domainLicenseDetailsRepository.GetDomainLicenseDetailByDomainKey(domainKey);
            if (domainLicenseDetail != null)
            {
                var claim = new Claim(CaresUserClaims.DomainLicenseDetail,
                                      ClaimHelper.Serialize(
                                          new DomainLicenseDetailClaim
                {
                    UserDomainKey = domainLicenseDetail.UserDomainKey,
                    Branches      = domainLicenseDetail.Branches,
                    FleetPools    = domainLicenseDetail.FleetPools,
                    Employee      = domainLicenseDetail.Employee,
                    RaPerMonth    = domainLicenseDetail.RaPerMonth,
                    Vehicles      = domainLicenseDetail.Vehicles
                }),
                                      typeof(DomainLicenseDetailClaim).AssemblyQualifiedName);
                ClaimHelper.AddClaim(claim, identity);
            }
            else
            {
                throw new InvalidOperationException("No Domain License Detail data found!");
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Add Organisation Claims
        /// </summary>
        private void AddDomainLicenseDetailClaims(double domainKey)
        {
            DomainLicenseDetail domainLicenseDetail =
                domainLicenseDetailsRepository.GetDomainLicenseDetailByDomainKey(domainKey);

            if (domainLicenseDetail != null)
            {
                ClaimHelper.AddClaim(new Claim(CaresUserClaims.DomainLicenseDetail,
                                               ClaimHelper.Serialize(
                                                   new DomainLicenseDetailClaim
                {
                    UserDomainKey = domainLicenseDetail.UserDomainKey,
                    Branches      = domainLicenseDetail.Branches,
                    FleetPools    = domainLicenseDetail.FleetPools,
                    Employee      = domainLicenseDetail.Employee,
                    RaPerMonth    = domainLicenseDetail.RaPerMonth,
                    Vehicles      = domainLicenseDetail.Vehicles
                }),
                                               typeof(DomainLicenseDetailClaim).AssemblyQualifiedName));
            }
        }