/// <summary> /// 同日に複数清掃箇所の割り当てがあるかを判定する /// </summary> /// <param name="member"></param> /// <param name="targetDay"></param> /// <returns></returns> public static Boolean Judge(Member member, ContractConst.DAYS? targetDay, int? i) { if (member.day.Count() != 0) { foreach (var d in member.day) { if (d.days == targetDay) { return false; } } }else { return true; } return true; }
/// <summary> /// 各曜日の出力結果を作成 /// </summary> /// <param name="RetInfo"></param> /// <param name="dAYS"></param> /// <returns></returns> private int?[] GetDayRowVal(Queue<Member> RetInfo, ContractConst.DAYS dAYS) { Dictionary<int?, int?> D = new Dictionary<int?, int?>(); foreach (var member in RetInfo) { foreach (var thisDay in member.day) { if (thisDay.days == dAYS) { foreach (var v in thisDay.place) { if (v.value.Count == 0) { break; } D.Add(v.value.Dequeue(), member.No); } } } } int?[] Day = new int?[ContractConst.PLACE_COUNT + 1]; int i = 0; foreach (var v in D) { Day[(int)v.Key] = (int)v.Value; i++; } return Day; }
/// <summary> /// /// </summary> /// <param name="member"></param> /// <param name="randamPlaceValue"></param> /// <param name="dAYS"></param> /// <returns></returns> private bool CheckCleanable(Member member, int? randamPlaceValue, ContractConst.DAYS dAYS) { //男女毎清掃箇所判定 if (!GenderAllocationJudge.Judge(member.Gender, randamPlaceValue)) { return false; } //同日割り当て判定 //if (!SameDayAssignmentJudge.Judge(member, dAYS, randamPlaceValue)) //{ // return false; //} //同一清掃箇所判定 if (!SamePlaceJudge.Judge(member, randamPlaceValue)) { return false; } return true; }