コード例 #1
0
        public override customer CreateCustomer()
        {
            goldCustomer objCust = new goldCustomer();

            objCust.GoldOperation();
            return(objCust);
        }
コード例 #2
0
        public static customer GetCustomer(int i)
        {
            switch (i)
            {
            case 1:
                goldCustomer goldCustomer = new goldCustomer();
                goldCustomer.GoldOperation();
                goldCustomer.AddPoints();
                goldCustomer.AddDiscount();
                return(goldCustomer);

            case 2:
                silverCustomer silverCustomer = new silverCustomer();
                silverCustomer.SilverOperation();
                silverCustomer.AddPoints();
                silverCustomer.AddDiscount();
                return(silverCustomer);

            default: return(null);
            }
        }