コード例 #1
0
        public virtual void SetProductItemDetails(ProductItemDetails productItemDetails)
        {
            if (CanSetProductItemDetails(productItemDetails) != string.Empty)
            {
                throw new InvalidOperationException();
            }

            this.productItemDetails = productItemDetails;
        }
コード例 #2
0
        private string CanSetProductItemDetails(ProductItemDetails productItemDetails)
        {
            if (productItemDetails.Product_Description.Any(x => x > 255))
            {
                return("Product Description must have Unicode Characters");
            }

            if (productItemDetails.Other_Details.Length > 120)
            {
                return("Other Details must be less than 120 Characters");
            }

            return(string.Empty);
        }
コード例 #3
0
 public Product()
 {
     productInventoryDetails = NoneInventoryDetails;
     productItemDetails      = NoneItemDetails;
 }