protected Product(ProductInformation info) { _name = info._productName; BuyPrice = info._buyPrice; MemberPrice = info._memberPrice; NotMemberPrice = info._notMemberPrice; _isVeggie = info._isVeggie; }
public Product OrderType(string productname) { ProductInformation productInformation = Brochure.FirstOrDefault(pr => pr._productName.ToUpper().Equals(productname.ToUpper())); return(productInformation._typeProduct switch { EnumTypeProduct.Beverage => new Beverage(productInformation), EnumTypeProduct.Food => new Food(productInformation), EnumTypeProduct.AlcoholicBeverage => new AlcoholicBeverage(productInformation), _ => throw new NotImplementedException(), });
public Food(ProductInformation info) : base(info) { _isVeggie = info._isVeggie; Packaging = "Paper bag"; }
public void AddToBrochure(ProductInformation productinfo) { Brochure.Add(productinfo); }
public Beverage(ProductInformation info) : base(info) { Packaging = "Bottle"; }
public AlcoholicBeverage(ProductInformation info) : base(info) { _alcoholDegree = info._alcoholDegree; }