public List <GroupOfTooth> GetAnalogGroupsFromPrepare() { List <GroupOfTooth> groups = new List <GroupOfTooth>(); foreach (Tooth tooth in Tooths) { bool haveOne = false; foreach (GroupOfTooth group in groups) { if (group.comparer == tooth.Treat.prepare) { group.ToothsInGroup.Add(tooth); haveOne = true; break; } } if (!haveOne) { GroupOfTooth newGroup = new GroupOfTooth(); newGroup.comparer = tooth.Treat.prepare; newGroup.ToothsInGroup.Add(tooth); groups.Add(newGroup); } } return(groups); }
public List <GroupOfTooth> GetAnalogGroupsFromDiagnosis() { List <GroupOfTooth> groups = new List <GroupOfTooth>(); foreach (Tooth tooth in Tooths) { foreach (Diagnos ds in tooth.GetDiagnosisOfTooth()) { bool haveOne = false; foreach (GroupOfTooth group in groups) { if (group.MainDs.identityString == ds.identityString) { group.ToothsInGroup.Add(tooth); haveOne = true; break; } } if (!haveOne) { GroupOfTooth newGroup = new GroupOfTooth(); newGroup.MainDs = ds; newGroup.ToothsInGroup.Add(tooth); groups.Add(newGroup); } } } return(groups); }
public List <GroupOfTooth> GetAnalogGroupsFromPretreat() { List <GroupOfTooth> groups = new List <GroupOfTooth>(); foreach (Tooth tooth in Tooths) { tooth.ApplyAllAffictions(); bool haveOne = false; foreach (GroupOfTooth group in groups) { if (group.pretreat == tooth.pretreat) { group.ToothsInGroup.Add(tooth); haveOne = true; break; } } if (!haveOne) { GroupOfTooth newGroup = new GroupOfTooth(); newGroup.pretreat = tooth.pretreat; newGroup.ToothsInGroup.Add(tooth); groups.Add(newGroup); } } return(groups); }
public List <GroupOfTooth> GetAnalogGroupsFromCondition() { List <GroupOfTooth> groups = new List <GroupOfTooth>(); foreach (Tooth tooth in Tooths) { foreach (Condition cond in tooth.GetConditionsOfTooth()) { bool haveOne = false; foreach (GroupOfTooth group in groups) { if (group.MainCondition.Name == cond.Name) { if (!group.ToothsInGroup.Contains(tooth)) { group.ToothsInGroup.Add(tooth); } haveOne = true; break; } } if (!haveOne) { GroupOfTooth newGroup = new GroupOfTooth(); newGroup.MainCondition = cond; newGroup.ToothsInGroup.Add(tooth); groups.Add(newGroup); } } } return(groups); }
public List <GroupOfTooth> GetAnalogGroupsFromToothIdentity() { List <GroupOfTooth> groups = new List <GroupOfTooth>(); foreach (Tooth tooth in Tooths) { bool haveOne = false; foreach (GroupOfTooth group in groups) { if (group.ToothsInGroup.Contains(tooth)) { haveOne = true; break; } } if (!haveOne) { GroupOfTooth group = new GroupOfTooth(); //foreach (Tooth t in Tooths) //{ // if (t == tooth) // group.ToothsInGroup.Add(t); //} group.ToothsInGroup = Tooths.Where(t => t == tooth).ToList(); groups.Add(group); } } return(groups); }