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