///<summary>Only used for incremental tooth movements. Automatically adds a movement to any existing movement. Supply a list of all toothInitials for the patient.</summary> public static void AddMovement(ToothInitial[] initialList, int patNum, string tooth_id, ToothInitialType initialType, float moveAmt) { ToothInitial ti = null; for (int i = 0; i < initialList.Length; i++) { if (initialList[i].ToothNum == tooth_id && initialList[i].InitialType == initialType) { ti = initialList[i].Copy(); } } if (ti == null) { ti = new ToothInitial(); ti.PatNum = patNum; ti.ToothNum = tooth_id; ti.InitialType = initialType; ti.Movement = moveAmt; ToothInitials.Insert(ti); return; } ti.Movement += moveAmt; ToothInitials.Update(ti); }
///<summary>Same as SetValue, but does not clear any values first. Only use this if you have first run ClearAllValuesForType.</summary> public static void SetValueQuick(int patNum, string tooth_id, ToothInitialType initialType, float moveAmt) { ToothInitial ti = new ToothInitial(); ti.PatNum = patNum; ti.ToothNum = tooth_id; ti.InitialType = initialType; ti.Movement = moveAmt; ToothInitials.Insert(ti); }