예제 #1
0
        public CashContext(string type)
        {
            switch (type)
            {
            case "正常收费":
                cs = new CashNormal();
                break;

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

            case "打8折":
                cs = new CashRebate("0.8");
                break;
            }
        }
예제 #2
0
        //public CashContext(CashSuper cash)
        //{
        //    this._cashSuper = cash;//构造函数注入
        //}


        public CashContext(string type)
        {
            switch (type)
            {
            case "正常收费":
                _cashSuper = new CashNormal();
                break;

            case "满300返299":
                _cashSuper = new CashReturn(300, 299);
                break;

            case "八折":
                _cashSuper = new CashRebate(0.8);
                break;
            }
        }
예제 #3
0
        public CashConext(String eventInfo)
        {
            switch (eventInfo)
            {
            case "无折扣":
                m_cashSuper = new CashNormal();
                break;

            case "打8折":
                m_cashSuper = new CashDiscount(0.8);
                break;

            case "满100减10":
                m_cashSuper = new CashReturn(100, 10);
                break;

            default:
                break;
            }
        }
예제 #4
0
        public CashContext(string type)
        {
            switch (type)
            {
            case "正常收费":
                CashNormal cashNormal = new CashNormal();
                cs = cashNormal;
                break;

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

            case "打八折":
                CashRebate cashRebate = new CashRebate("0.8");
                cs = cashRebate;
                break;
            }
        }
예제 #5
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 "打八折":
                cs = new CashRebate("0.8");
                break;

            default:
                break;
            }
            return(cs);
        }
예제 #6
0
 public CashContext(CashSuper csuper)
 {
     this.cs = csuper;
 }
예제 #7
0
 public CashConext(CashSuper cashSuper)
 {
     m_cashSuper = cashSuper;
 }
 /// <summary>
 /// 初始化收钱的规则
 /// </summary>
 /// <param name="cash"></param>
 public CashContext(CashSuper cash)
 {
     this._listCash.Add(cash);
 }