示例#1
0
 public static CashSuper CreatCash(string cashSort)
 {
     CashSuper cs = null;
     switch (cashSort)
     {
         case "正常": cs = new CashNormal();
             break;
         case "满三百返一百": cs = new CashReturn(300,100);
             break;
         case "打0.8折": cs = new CashDisCount(0.8);
             break;
     }
     return cs;
 }
示例#2
0
            public static CashSuper CreateCashAccept(string type)
            {
                CashSuper cashSuper = null;

                switch (type)
                {
                case "正常收费": cashSuper = new CashNormal(); break;

                case "打折收费": cashSuper = new CashRebate(0.8); break;

                case "满减收费": cashSuper = new CashReturn(300, 100); break;
                }
                return(cashSuper);
            }
示例#3
0
        public CashContext(string type)
        {
            switch (type)
            {
            case "正常收费":
                CashNormal cs0 = new CashNormal();
                cs = cs0;
                break;

            case "满300返100":
                CashReturn cs1 = new CashReturn("300", "100");
                cs = cs1;
                break;

            case "打8折":
                CashRebate cs2 = new CashRebate("0.8");
                cs = cs2;
                break;
            }
        }
示例#4
0
        public static CashSuper CreateCashAccept(string type)
        {
            CashSuper cs = null;

            switch (type)
            {
            case "正常收费":
                cs = new CashNormal();
                break;

            case "满300返100":
                cs = new CashReturn("300", "100");
                break;

            case "打8折":
                cs = new CashRebate("0.8");
                break;

            default: break;
            }
            return(cs);
        }