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; } }
public void AddPromotion(Promotion p) { if (p == null) throw new NullReferenceException(); string name = p.Name; _listpromotion.Add(name, p); }
//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; }