Example #1
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(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);
            }
        }
		///<summary></summary>
		public static void Update(ToothInitial init) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),init);
				return;
			}
			Crud.ToothInitialCrud.Update(init);
		}
Example #3
0
		///<summary>This helps to visually confirm which teeth have been set to extracted.  It also allows setting missing teeth for NIHB without entering any extractions.  The tooth number passed in should be in international format.</summary>
		public static void SetMissing(string toothNumInternat,long patNum) {
			ToothInitial ti=new ToothInitial();
			ti.PatNum=patNum;
			ti.InitialType=ToothInitialType.Missing;
			ti.ToothNum=Tooth.FromInternat(toothNumInternat);
			ToothInitials.Insert(ti);
		}
Example #4
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(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></summary>
		public static void Delete(ToothInitial init) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),init);
				return;
			}
			string command= "DELETE FROM toothinitial WHERE ToothInitialNum = '"+init.ToothInitialNum.ToString()+"'";
			Db.NonQ(command);
		}
Example #6
0
 ///<summary></summary>
 public static void Update(ToothInitial init)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), init);
         return;
     }
     Crud.ToothInitialCrud.Update(init);
 }
		///<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);
		}
Example #8
0
 ///<summary></summary>
 public static long Insert(ToothInitial init)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         init.ToothInitialNum = Meth.GetLong(MethodBase.GetCurrentMethod(), init);
         return(init.ToothInitialNum);
     }
     return(Crud.ToothInitialCrud.Insert(init));
 }
		///<summary></summary>
		public static long Insert(ToothInitial init) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				init.ToothInitialNum=Meth.GetLong(MethodBase.GetCurrentMethod(),init);
				return init.ToothInitialNum;
			}
			if(PrefC.RandomKeys) {
				init.ToothInitialNum=ReplicationServers.GetKey("toothinitial","ToothInitialNum");
			}
			return Crud.ToothInitialCrud.Insert(init);
		}
Example #10
0
        ///<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);
        }
Example #11
0
        ///<summary></summary>
        public static void Delete(ToothInitial init)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), init);
                return;
            }
            string command = "DELETE FROM toothinitial WHERE ToothInitialNum = '" + init.ToothInitialNum.ToString() + "'";

            Db.NonQ(command);
        }
Example #12
0
        ///<summary></summary>
        public ToothInitial Copy()
        {
            ToothInitial t = new ToothInitial();

            t.ToothInitialNum = ToothInitialNum;
            t.PatNum          = PatNum;
            t.ToothNum        = ToothNum;
            t.InitialType     = InitialType;
            t.Movement        = Movement;
            return(t);
        }
Example #13
0
 ///<summary></summary>
 public static long Insert(ToothInitial init)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         init.ToothInitialNum = Meth.GetLong(MethodBase.GetCurrentMethod(), init);
         return(init.ToothInitialNum);
     }
     if (PrefC.RandomKeys)
     {
         init.ToothInitialNum = ReplicationServers.GetKey("toothinitial", "ToothInitialNum");
     }
     return(Crud.ToothInitialCrud.Insert(init));
 }
Example #14
0
        ///<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></summary>
		public void AddDrawingSegment(ToothInitial drawingSegment) {
			bool alreadyAdded=false;
			for(int i=0;i<tcData.DrawingSegmentList.Count;i++) {
				if(tcData.DrawingSegmentList[i].DrawingSegment==drawingSegment.DrawingSegment) {
					alreadyAdded=true;
					break;
				}
			}
			if(!alreadyAdded){
				tcData.DrawingSegmentList.Add(drawingSegment);
			}
			Invalidate();
			//toothChartOpenGL.AddDrawingSegment(drawingSegment);
		}
Example #16
0
File: Form1.cs Project: mnisl/OD
		private void butShowDrawing_Click(object sender,EventArgs e) {
			ToothInitial ti=new ToothInitial();
			ti.ColorDraw=Color.Blue;
			ti.DrawingSegment="30,30;70,30;70,70;50,80;50,90;30,70;30,30";
			ti.InitialType=ToothInitialType.Drawing;
			toothChart2D.AddDrawingSegment(ti);
			toothChartOpenGL.AddDrawingSegment(ti);
			toothChartDirectX.AddDrawingSegment(ti);
		}
Example #17
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(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);		
		}
Example #18
0
		private void toothChart_SegmentDrawn(object sender,ToothChartDrawEventArgs e) {
			if(radioPen.Checked){
				ToothInitial ti=new ToothInitial();
				ti.DrawingSegment=e.DrawingSegement;
				ti.InitialType=ToothInitialType.Drawing;
				ti.PatNum=PatCur.PatNum;
				ti.ColorDraw=panelDrawColor.BackColor;
				ToothInitials.Insert(ti);
				ToothInitialList=ToothInitials.Refresh(PatCur.PatNum);
				FillToothChart(true);
			}
			else if(radioEraser.Checked){
				//for(int i=0;i<ToothInitialList.Count;i++){
				for(int i=ToothInitialList.Count-1;i>=0;i--) {//go backwards
					if(ToothInitialList[i].InitialType!=ToothInitialType.Drawing) {
						continue;
					}
					if(ToothInitialList[i].DrawingSegment!=e.DrawingSegement) {
						continue;
					}
					ToothInitials.Delete(ToothInitialList[i]);
					ToothInitialList.RemoveAt(i);
					//no need to refresh since that's handled by the toothchart.
				}
			}
			else if(radioColorChanger.Checked){
				for(int i=0;i<ToothInitialList.Count;i++){
					if(ToothInitialList[i].InitialType!=ToothInitialType.Drawing){
						continue;
					}
					if(ToothInitialList[i].DrawingSegment!=e.DrawingSegement){
						continue;
					}
					ToothInitialList[i].ColorDraw=panelDrawColor.BackColor;
					ToothInitials.Update(ToothInitialList[i]);
					FillToothChart(true);
				}
			}
		}