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;
            }
        }
Esempio n. 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;
            }
        }
Esempio n. 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;
            }
        }
Esempio n. 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;
            }
        }
Esempio n. 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);
        }
Esempio n. 6
0
 public CashContext(CashSuper csuper)
 {
     this.cs = csuper;
 }
Esempio n. 7
0
 public CashConext(CashSuper cashSuper)
 {
     m_cashSuper = cashSuper;
 }
 /// <summary>
 /// 初始化收钱的规则
 /// </summary>
 /// <param name="cash"></param>
 public CashContext(CashSuper cash)
 {
     this._listCash.Add(cash);
 }