private InputParams FromFilterToInput(IInternalLicenseFilter filter) { var result = FromFilterToInputSlim(filter); FillBaseParameters(filter, result); return(result); }
public void SqueezeNormalRules(IInternalLicenseFilter context, string BuildNumber, out string Version2Display) { var input = new InputParams(); FillBaseParameters(context, input); PreFilterRules(input); Version2Display = GetVersion2Display(input.Version, BuildNumber); }
// 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); }
// 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); } }
public void SqueezeNormalRules(IInternalLicenseFilter context, out string Version2Display) { SqueezeNormalRules(context, null, out Version2Display); }