示例#1
0
        private static IEnumerable <ProductValidationResult> ValidateName(ProductData product)
        {
            var reference = ProductsReference.GetInstance();

            if (!reference.FindCodeByName(product.Name).HasValue)
            {
                yield return(new ProductValidationResult(product,
                                                         "Unknown product name",
                                                         ProductValidationSeverity.Error));
            }
        }
示例#2
0
        private bool NameIsValid(ProductData product)
        {
            var reference = ProductsReference.GetInstance();

            return(reference.FindCodeByName(product.Name).HasValue);
        }
示例#3
0
 public virtual ProductsReference GetProductsReferenceInstance()
 {
     return(ProductsReference.GetInstance());
 }
示例#4
0
 public ProductValidator(ProductsReference productsReference, MeasureUnitsReference measureUnitsReference)
 {
     this.productsReference     = productsReference ?? ProductsReference.GetInstance();
     this.measureUnitsReference = measureUnitsReference ?? MeasureUnitsReference.GetInstance();
 }
示例#5
0
 public ProviderProcessor(ProductsReference productsReference = null, MeasureUnitsReference measureUnitsReference = null, IProviderRepository repo = null)
 {
     this.productsReference     = productsReference ?? ProductsReference.GetInstance();
     this.measureUnitsReference = measureUnitsReference ?? MeasureUnitsReference.GetInstance();
     this.repo = repo ?? new ProviderRepository();
 }