Beispiel #1
0
        private InputParams FromFilterToInput(IInternalLicenseFilter filter)
        {
            var result = FromFilterToInputSlim(filter);

            FillBaseParameters(filter, result);
            return(result);
        }
Beispiel #2
0
        public void SqueezeNormalRules(IInternalLicenseFilter context, string BuildNumber, out string Version2Display)
        {
            var input = new InputParams();

            FillBaseParameters(context, input);
            PreFilterRules(input);
            Version2Display = GetVersion2Display(input.Version, BuildNumber);
        }
Beispiel #3
0
        // filter is supposed to have user, logicalmodel and countryname filled
        public void FillBaseParameters(IInternalLicenseFilter filter, InputParams input)
        {
            input.UserLevel      = filter.UserLevel;
            input.LogicalModelId = DBRegister.LogicalModelDictionary[filter.LogicalModelName];
            input.CountryId      = DBRegister.CountryDictionary[filter.CountryName];
            input.DistributorId  = Provider.GetValueOrDefault_Stuct(DBRegister.DistributorDictionary, filter.CountryName);             // Distributor might be null

            FillVersion(input, (int)input.CountryId, input.DistributorId, (int)input.LogicalModelId, DBRegister);
        }
Beispiel #4
0
        // maps the license filter to the input paramter class of the Feature Manager DB
        private InputParams FromFilterToInputSlim(IInternalLicenseFilter filter)
        {
            var result            = new InputParams();
            var NonNullSlimFields = 0;

            if ((filter.ApplicationType != null) && DBRegister.ApplicationDictionary.ContainsKey(filter.ApplicationType.ToString()))
            {
                result.ApplicationId = DBRegister.ApplicationDictionary[filter.ApplicationType.ToString()];
                NonNullSlimFields++;
            }

            if ((filter.OptionName != null) && DBRegister.OptionDictionary.ContainsKey(filter.OptionName))
            {
                result.OptionId = DBRegister.OptionDictionary[filter.OptionName];
                NonNullSlimFields++;
            }

            if ((filter.ProbeName != null) && DBRegister.ProbeDictionary.ContainsKey(filter.ProbeName))
            {
                result.ProbeId = DBRegister.ProbeDictionary[filter.ProbeName];
                NonNullSlimFields++;
            }

            if (filter.TransducerType != null)
            {
                result.TransducerType = filter.TransducerType;
                NonNullSlimFields++;
            }

            if ((filter.KitName != null) && DBRegister.KitDictionary.ContainsKey(filter.KitName))
            {
                result.KitId = DBRegister.KitDictionary[filter.KitName];
                NonNullSlimFields++;
            }

            if (CheckInput(result, NonNullSlimFields))
            {
                return(result);
            }
            else
            {
                var msg = "Wrong input format: forbidden application " + filter.ApplicationType;
                // ANTO LOG
                //Logger.LogTrace("FeatureManager", Flow_Type.Configuration, LogLevel.LogNormal, msg);
                Logger.Log($"FeatureManager {msg}");
                throw new ApplicationException(msg);
            }
        }
Beispiel #5
0
 public void SqueezeNormalRules(IInternalLicenseFilter context, out string Version2Display)
 {
     SqueezeNormalRules(context, null, out Version2Display);
 }