/// <summary> /// /// </summary> /// <param name="componentKey"></param> /// <param name="vo"></param> /// <returns></returns> public bool getComponent(string componentKey, ref Common.Libraries.Objects.Rules.Structure.BusinessRuleComponentVO vo) { if (StringUtilities.isEmpty(componentKey) || !this.ruleComponents.ContainsKey(componentKey)) { return(false); } vo = this.ruleComponents[componentKey]; if (vo == null) { return(false); } //switch (brvo.ValueType) //{ // case BusinessRuleComponentVO.RuleValueType.FEES: // vo = brvo.FeesValue; // break; // case BusinessRuleComponentVO.RuleValueType.INTEREST: // vo = brvo.InterestValue; // break; // case BusinessRuleComponentVO.RuleValueType.PARAM: // vo = brvo.ParamValue; // break; // case BusinessRuleComponentVO.RuleValueType.METHOD: // vo = brvo.MethodValue; // break; //} return(true); }
public bool getComponentValue(string componentKey, ref string vo) { if (StringUtilities.isEmpty(componentKey) || !this.ruleComponents.ContainsKey(componentKey)) { return(false); } Common.Libraries.Objects.Rules.Structure.BusinessRuleComponentVO brvo = this.ruleComponents[componentKey]; if (brvo == null) { return(false); } switch (brvo.ValueType) { case Common.Libraries.Objects.Rules.Structure.BusinessRuleComponentVO.RuleValueType.FEES: if (brvo.FeesValue == null || StringUtilities.isEmpty(brvo.FeesValue.Value)) { return(false); } vo = brvo.FeesValue.Value; break; case Common.Libraries.Objects.Rules.Structure.BusinessRuleComponentVO.RuleValueType.INTEREST: if (brvo.InterestValue == null) { return(false); } vo = "" + brvo.InterestValue.InterestRate; break; case Common.Libraries.Objects.Rules.Structure.BusinessRuleComponentVO.RuleValueType.PARAM: if (brvo.ParamValue == null || brvo.ParamValue.Value == null) { return(false); } vo = (string)(brvo.ParamValue.Value); break; } return(true); }
/// <summary> /// /// </summary> /// <param name="vo"></param> public void addComponent(Common.Libraries.Objects.Rules.Structure.BusinessRuleComponentVO vo) { string keyData = vo.Code; if (this.ruleComponents == null || this.ruleComponents.ContainsKey(vo.Code)) { return; } if (vo.ValueType == BusinessRuleComponentVO.RuleValueType.INTEREST) { if (vo.InterestValue.MaxAmount >= 0) { keyData = keyData + "_" + vo.InterestValue.MaxAmount; } else { if (this.ruleComponents.ContainsKey(vo.Code)) { return; } } } this.ruleComponents.Add(keyData, vo); }