///<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(long patNum,string tooth_id,ToothInitialType initialType,float moveAmt) { //No need to check RemotingRole; no call to db. ToothInitial ti=new ToothInitial(); ti.PatNum=patNum; ti.ToothNum=tooth_id; ti.InitialType=initialType; ti.Movement=moveAmt; ToothInitials.Insert(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(long patNum, string tooth_id, ToothInitialType initialType, float moveAmt) { //No need to check RemotingRole; no call to db. //if initialType is a movement and the movement amt is 0, then don't add a row, just return; if (moveAmt == 0 && initialType.In(ToothInitialType.ShiftM, ToothInitialType.ShiftO, ToothInitialType.ShiftB, ToothInitialType.Rotate, ToothInitialType.TipM, ToothInitialType.TipB)) { return; } ToothInitial ti = new ToothInitial(); ti.PatNum = patNum; ti.ToothNum = tooth_id; ti.InitialType = initialType; ti.Movement = moveAmt; ToothInitials.Insert(ti); }
///<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(List<ToothInitial> initialList,long patNum,string tooth_id,ToothInitialType initialType,float moveAmt) { //No need to check RemotingRole; no call to db. ToothInitial ti=null; for(int i=0;i<initialList.Count;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>Sets teeth missing, or sets primary, or sets movement values. It first clears the value from the database, then adds a new row to represent that value. Movements require an amount. If movement amt is 0, then no row gets added.</summary> public static void SetValue(long patNum,string tooth_id,ToothInitialType initialType) { //No need to check RemotingRole; no call to db. SetValue(patNum,tooth_id,initialType,0); }
///<summary>Gets the current movement value for a single tooth by looping through the supplied list.</summary> public static float GetMovement(List<ToothInitial> initialList,string toothNum,ToothInitialType initialType){ //No need to check RemotingRole; no call to db. for(int i=0;i<initialList.Count;i++) { if(initialList[i].InitialType==initialType && initialList[i].ToothNum==toothNum) { return initialList[i].Movement; } } return 0; }
///<summary>Sets teeth not missing, or sets to perm, or clears movement values. Clears all the values of one type for all teeth in the mouth.</summary> public static void ClearAllValuesForType(long patNum,ToothInitialType initialType) { if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) { Meth.GetVoid(MethodBase.GetCurrentMethod(),patNum,initialType); return; } string command="DELETE FROM toothinitial WHERE PatNum="+POut.Long(patNum) +" AND InitialType="+POut.Long((int)initialType); Db.NonQ(command); }
///<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(List <ToothInitial> initialList, long patNum, string tooth_id, ToothInitialType initialType, float moveAmt) { //No need to check RemotingRole; no call to db. ToothInitial ti = null; for (int i = 0; i < initialList.Count; 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>Sets teeth missing, or sets primary, or sets movement values. It first clears the value from the database, then adds a new row to represent that value. Movements require an amount. If movement amt is 0, then no row gets added.</summary> public static void SetValue(long patNum, string tooth_id, ToothInitialType initialType) { //No need to check RemotingRole; no call to db. SetValue(patNum, tooth_id, initialType, 0); }
///<summary>Gets the current movement value for a single tooth by looping through the supplied list.</summary> public static float GetMovement(List <ToothInitial> initialList, string toothNum, ToothInitialType initialType) { //No need to check RemotingRole; no call to db. for (int i = 0; i < initialList.Count; i++) { if (initialList[i].InitialType == initialType && initialList[i].ToothNum == toothNum) { return(initialList[i].Movement); } } return(0); }
///<summary>Sets teeth missing, or sets primary, or sets movement values. It first clears the value from the database, then adds a new row to represent that value. Movements require an amount. If movement amt is 0, then no row gets added.</summary> public static void SetValue(int patNum, string tooth_id, ToothInitialType initialType) { SetValue(patNum, tooth_id, initialType, 0); }
///<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>Sets teeth missing, or sets primary, or sets movement values. It first clears the value from the database, then adds a new row to represent that value. Movements require an amount. If movement amt is 0, then no row gets added.</summary> public static void SetValue(long patNum, string tooth_id, ToothInitialType initialType, float moveAmt) { //No need to check RemotingRole; no call to db. ClearValue(patNum, tooth_id, initialType); SetValueQuick(patNum, tooth_id, initialType, moveAmt); }
///<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(List <ToothInitial> initialList, long patNum, string tooth_id, ToothInitialType initialType, float moveAmt) { //No need to check RemotingRole; no call to db. if (moveAmt == 0) { return; } ToothInitial ti = initialList.Find(x => x.ToothNum == tooth_id && x.InitialType == initialType)?.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; if (ti.Movement == 0) { ClearValue(patNum, tooth_id, initialType); } else { ToothInitials.Update(ti); } }