12345678910111213141516171819202122232425262728293031323334353637 |
- using System.Collections.Generic;
- namespace FL.Data
- {
- public class PartnerPlan
- {
- public int Id { get; private set; }
- public string Name { get; private set; }
- /// <summary>
- /// key 位置 : value 槽位信息
- /// </summary>
- private Dictionary<int, PartnerPlanSlot> _planMap = new Dictionary<int, PartnerPlanSlot>();
- public Dictionary<int, PartnerPlanSlot>.ValueCollection PlanValues
- {
- get { return _planMap.Values; }
- }
- public void SetData(int id, string name, List<PartnerPlanSlot> planList)
- {
- Id = id;
- Name =
- name.Length > 0 ? name : string.Format(StringDefine.partnerInitPlanName, id);
- _planMap.Clear();
- foreach (var slot in planList)
- {
- _planMap.Add(slot.CaoId, slot);
- }
- }
- public PartnerPlanSlot GetSlot(int slotId)
- {
- return _planMap.GetValueOrDefault(slotId);
- }
- }
- }
|