Ejemplo n.º 1
0
        public override string ToString()
        {
            var type = ProductType == null ? string.Empty : $"{ProductType} ";

            if (!string.IsNullOrEmpty(DesignationSpecial))
            {
                return($"{type}{DesignationSpecial}");
            }
            if (!string.IsNullOrEmpty(Designation))
            {
                return($"{type}{Designation}");
            }
            return(ProductBlock.ToString());
        }
Ejemplo n.º 2
0
        public string GetFullDescription(int spaceCount = 0)
        {
            var sb = new StringBuilder();

            sb.Append($"{Designation} ");
            sb.Append($"{this} (параметры: {ProductBlock.ParametersToString().ToLower()})".AddSpacesBefore(spaceCount));
            if (DependentProducts.Any())
            {
                spaceCount++;
                sb.AppendLine("Составные части:".AddSpacesBefore(spaceCount));
                foreach (var dependentProduct in DependentProducts)
                {
                    sb.AppendLine($"{dependentProduct.Amount} шт. " + dependentProduct.Product.GetFullDescription(spaceCount).AddSpacesBefore(spaceCount));
                }
            }

            return(sb.ToString());
        }
Ejemplo n.º 3
0
 protected bool Equals(ProductBlock other)
 {
     return(other != null && this.Parameters.MembersAreSame(other.Parameters, new ParameterComparer()));
 }