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