private bool MeetsContraints(ShippingOptionRecord option, IList <Tuple <int, IShippingInfo> > ShippingInfos, Decimal ItemsTotal) { foreach (var contraint in option.Contraints) { double propertyValue = EvalProperty(contraint.Property, ShippingInfos, ItemsTotal); switch (contraint.Operator) { case ShippingContraintOperator.LessThan: if (contraint.Value <= propertyValue) { return(false); } break; case ShippingContraintOperator.LessThanOrEqual: if (contraint.Value < propertyValue) { return(false); } break; case ShippingContraintOperator.Equal: if (contraint.Value != propertyValue) { return(false); } break; case ShippingContraintOperator.GreaterThan: if (contraint.Value >= propertyValue) { return(false); } break; case ShippingContraintOperator.GreaterThanOrEqual: if (contraint.Value > propertyValue) { return(false); } break; case ShippingContraintOperator.NotEqual: if (contraint.Value == propertyValue) { return(false); } break; } } return(true); }
public void UpdateOption(ShippingOptionRecord record) { _optionRepository.Update(record); }
public void CreateOption(ShippingOptionRecord record) { _optionRepository.Create(record); }
public void DeleteOption(ShippingOptionRecord record) { _optionRepository.Delete(record); }