Exemplo n.º 1
0
 protected Product(ProductInformation info)
 {
     _name          = info._productName;
     BuyPrice       = info._buyPrice;
     MemberPrice    = info._memberPrice;
     NotMemberPrice = info._notMemberPrice;
     _isVeggie      = info._isVeggie;
 }
Exemplo n.º 2
0
        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(),
            });
Exemplo n.º 3
0
 public Food(ProductInformation info) : base(info)
 {
     _isVeggie = info._isVeggie;
     Packaging = "Paper bag";
 }
Exemplo n.º 4
0
 public void AddToBrochure(ProductInformation productinfo)
 {
     Brochure.Add(productinfo);
 }
Exemplo n.º 5
0
 public Beverage(ProductInformation info) : base(info)
 {
     Packaging = "Bottle";
 }
Exemplo n.º 6
0
 public AlcoholicBeverage(ProductInformation info) : base(info)
 {
     _alcoholDegree = info._alcoholDegree;
 }