示例#1
0
        public bool RemovePromotion(Promotion p)
        {
            if (p == null)
                throw new NullReferenceException();

            string name = p.Name;

            if (_listpromotion.ContainsKey(name))
            {
                _listpromotion.Remove(name);
                return true;
            }
            else
            {
                return false;
            }
        }
示例#2
0
        public void AddPromotion(Promotion p)
        {
            if (p == null)
                throw new NullReferenceException();

            string name = p.Name;
            _listpromotion.Add(name, p);
        }
示例#3
0
        //PROMOTION
        public Promotion AddPromotion(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new NullReferenceException();
            }

            if (_listpromotion.ContainsKey(name))
            {
                throw new ArgumentException();
            }

            Promotion promo = new Promotion(name, this);
            _listpromotion.Add(name, promo);
            return promo;
        }