/// <summary>メンバーのスケジュールを取得する</summary> private CSchedule GetSchedule(CMember member) { if (member == null) { return(null); } CSchedule ret = null;; if (MemberToSchedule.ContainsKey(member)) { // 存在する ret = MemberToSchedule[member]; } else { // メンバーに対応したスケジュールが存在しなければ作成する CSchedule schedule = CreateSchedule(); schedule.Member = member; if (member.IsAvailable(Date)) { MemberToSchedule[member] = schedule; } ret = schedule; } return(ret); }
/// <summary>メンバーに対するシフトのランクを設定する</summary> public virtual void SetPatternRank(CMember m, CPattern p, int rank) { if (!m.IsAvailable(Date)) { return; } MembersPattern mp = null; if (MemberToMembersPattern.ContainsKey(m)) { mp = MemberToMembersPattern[m]; } else { mp = new MembersPattern(this, m); MemberToMembersPattern[m] = mp; } mp.SetPattern(rank, p); }
/// <summary>有効なメンバーの設定</summary> public virtual void MakeMembers() { if (validMembers == null) { // 配列の再確保 validMembers = new List <CMember>(); } if (MemberToSchedule == null) { MemberToSchedule = new Dictionary <CMember, CSchedule>(); } // validMembers.clear(); // 初期化 CMemberCollection members = timeTable.Members; for (int i = 0; i < members.Size(true); i++) { CMember member1 = members[i, true]; if (member1.IsAvailable(Date)) { if (!validMembers.Contains(member1)) { validMembers.Add(member1); } } else { if (validMembers.Contains(member1)) { //System.out.println("完全削除3:" + member1.getName()); validMembers.Remove(member1); } if (MemberToSchedule.ContainsKey(member1)) { //System.out.println("完全削除4:" + member1.getName()); // スケジュールの完全削除 CSchedule scd = MemberToSchedule[member1]; if (scd != null) { //System.out.println("完全削除5:" + member1.getName()); MemberToSchedule.Remove(member1); } } } } List <CMember> work = new List <CMember>(); int sz1 = validMembers.Count; for (int i = 0; i < sz1; i++) { //System.out.println("Step1"); CMember mem = validMembers[i]; long id = mem.ObjectID; if (members.GetByID(id) == null) { work.Add(mem); } } int sz2 = work.Count; for (int i = 0; i < sz2; i++) { validMembers.Remove(work[i]); } }