PartnerPlan.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Collections.Generic;
  2. namespace FL.Data
  3. {
  4. public class PartnerPlan
  5. {
  6. public int Id { get; private set; }
  7. public string Name { get; private set; }
  8. /// <summary>
  9. /// key 位置 : value 槽位信息
  10. /// </summary>
  11. private Dictionary<int, PartnerPlanSlot> _planMap = new Dictionary<int, PartnerPlanSlot>();
  12. public Dictionary<int, PartnerPlanSlot>.ValueCollection PlanValues
  13. {
  14. get { return _planMap.Values; }
  15. }
  16. public void SetData(int id, string name, List<PartnerPlanSlot> planList)
  17. {
  18. Id = id;
  19. Name =
  20. name.Length > 0 ? name : string.Format(StringDefine.partnerInitPlanName, id);
  21. _planMap.Clear();
  22. foreach (var slot in planList)
  23. {
  24. _planMap.Add(slot.CaoId, slot);
  25. }
  26. }
  27. public PartnerPlanSlot GetSlot(int slotId)
  28. {
  29. return _planMap.GetValueOrDefault(slotId);
  30. }
  31. }
  32. }