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

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

            case "打8折":
                //csRtn = new CashRebate(0.8);
                CashRebate cr = new CashRebate(0.8);
                _cs = cr;
                break;
            }
        }
예제 #2
0
        public CashContext(string type)
        {
            switch (type)
            {
                case "正常收费":
                    _cs = new CashNormal();
                    break;

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

                case "打8折":
                    //csRtn = new CashRebate(0.8);
                    CashRebate cr = new CashRebate(0.8);
                    _cs = cr;
                    break;
            }
        }
예제 #3
0
        public static CashSuper CreateCashAccept(string type)
        {
            CashSuper cs = null;
            switch (type)
            {
                case "Normal":
                    cs = new CashNormal();
                    break;

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

                case "0.8":
                    cs = new CashRebate("0.8");
                    break;
            }

            return cs;
        }
예제 #4
0
        public static CashSuper CreateCashAccept(string type)
        {
            CashSuper cs = null;

            switch (type)
            {
            case "Normal":
                cs = new CashNormal();
                break;

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

            case "0.8":
                cs = new CashRebate("0.8");
                break;
            }

            return(cs);
        }
예제 #5
0
        /// <summary>
        /// 通过string type获取某一种活动的对象.
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static CashSuper createCashAccept(string type)
        {
            CashSuper csRtn = null;

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

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

                case "打8折":
                    //csRtn = new CashRebate(0.8);
                    CashRebate cr = new CashRebate(0.8);
                    csRtn = cr;
                    break;
            }

            return csRtn;
        }
예제 #6
0
        /// <summary>
        /// 通过string type获取某一种活动的对象.
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static CashSuper createCashAccept(string type)
        {
            CashSuper csRtn = null;

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

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

            case "打8折":
                //csRtn = new CashRebate(0.8);
                CashRebate cr = new CashRebate(0.8);
                csRtn = cr;
                break;
            }


            return(csRtn);
        }