Ejemplo n.º 1
0
 private void ConfiguredMaterialDtoIsValid(ConfiguredMaterialDto dto, ValidationOutput validationOutput)
 {
     if (dto == null)
     {
         validationOutput.AddError("Material", "Material is missing!");
         return;
     }
     if (dto.OriginMaterialReference == null)
     {
         validationOutput.AddError("Material's reference", "Material's reference is missing!");
     }
     if (dto.ColorReference == null)
     {
         validationOutput.AddError("Color", "Color is missing!");
         return;
     }
     if (dto.ColorReference == null)
     {
         validationOutput.AddError("Color's reference", "Color's reference is missing!");
     }
     if (dto.FinishReference == null)
     {
         validationOutput.AddError("Finish", "Finish is missing!");
         return;
     }
     if (dto.FinishReference == null)
     {
         validationOutput.AddError("Finish's reference", "Finish's reference is missing!");
     }
 }
Ejemplo n.º 2
0
        public bool ConfiguredMaterialDtoExists(ConfiguredMaterialDto configuredMaterial)
        {
            foreach (var material in ProductMaterialList)
            {
                if (string.Equals(material.MaterialReference, configuredMaterial.OriginMaterialReference,
                                  StringComparison.Ordinal))
                {
                    return(true);
                }
            }

            return(false);
        }