Пример #1
0
 ///<summary>Returns true if Update(ToothInitial,ToothInitial) would make changes to the database.
 ///Does not make any changes to the database and can be called before remoting role is checked.</summary>
 public static bool UpdateComparison(ToothInitial toothInitial, ToothInitial oldToothInitial)
 {
     if (toothInitial.PatNum != oldToothInitial.PatNum)
     {
         return(true);
     }
     if (toothInitial.ToothNum != oldToothInitial.ToothNum)
     {
         return(true);
     }
     if (toothInitial.InitialType != oldToothInitial.InitialType)
     {
         return(true);
     }
     if (toothInitial.Movement != oldToothInitial.Movement)
     {
         return(true);
     }
     if (toothInitial.DrawingSegment != oldToothInitial.DrawingSegment)
     {
         return(true);
     }
     if (toothInitial.ColorDraw != oldToothInitial.ColorDraw)
     {
         return(true);
     }
     return(false);
 }
Пример #2
0
 ///<summary>Inserts one ToothInitial into the database.  Returns the new priKey.</summary>
 internal static long Insert(ToothInitial toothInitial)
 {
     if(DataConnection.DBtype==DatabaseType.Oracle) {
         toothInitial.ToothInitialNum=DbHelper.GetNextOracleKey("toothinitial","ToothInitialNum");
         int loopcount=0;
         while(loopcount<100){
             try {
                 return Insert(toothInitial,true);
             }
             catch(Oracle.DataAccess.Client.OracleException ex){
                 if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
                     toothInitial.ToothInitialNum++;
                     loopcount++;
                 }
                 else{
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else {
         return Insert(toothInitial,false);
     }
 }
Пример #3
0
 ///<summary>Inserts one ToothInitial into the database.  Returns the new priKey.</summary>
 public static long Insert(ToothInitial toothInitial)
 {
     if (DataConnection.DBtype == DatabaseType.Oracle)
     {
         toothInitial.ToothInitialNum = DbHelper.GetNextOracleKey("toothinitial", "ToothInitialNum");
         int loopcount = 0;
         while (loopcount < 100)
         {
             try {
                 return(Insert(toothInitial, true));
             }
             catch (Oracle.ManagedDataAccess.Client.OracleException ex) {
                 if (ex.Number == 1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated"))
                 {
                     toothInitial.ToothInitialNum++;
                     loopcount++;
                 }
                 else
                 {
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else
     {
         return(Insert(toothInitial, false));
     }
 }
Пример #4
0
 ///<summary>Inserts one ToothInitial into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(ToothInitial toothInitial,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         toothInitial.ToothInitialNum=ReplicationServers.GetKey("toothinitial","ToothInitialNum");
     }
     string command="INSERT INTO toothinitial (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="ToothInitialNum,";
     }
     command+="PatNum,ToothNum,InitialType,Movement,DrawingSegment,ColorDraw) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(toothInitial.ToothInitialNum)+",";
     }
     command+=
              POut.Long  (toothInitial.PatNum)+","
         +"'"+POut.String(toothInitial.ToothNum)+"',"
         +    POut.Int   ((int)toothInitial.InitialType)+","
         +    POut.Float (toothInitial.Movement)+","
         +"'"+POut.String(toothInitial.DrawingSegment)+"',"
         +    POut.Int   (toothInitial.ColorDraw.ToArgb())+")";
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command);
     }
     else {
         toothInitial.ToothInitialNum=Db.NonQ(command,true);
     }
     return toothInitial.ToothInitialNum;
 }
Пример #5
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);
        }
Пример #6
0
        ///<summary>Updates one ToothInitial in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.</summary>
        internal static void Update(ToothInitial toothInitial, ToothInitial oldToothInitial)
        {
            string command = "";

            if (toothInitial.PatNum != oldToothInitial.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(toothInitial.PatNum) + "";
            }
            if (toothInitial.ToothNum != oldToothInitial.ToothNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ToothNum = '" + POut.String(toothInitial.ToothNum) + "'";
            }
            if (toothInitial.InitialType != oldToothInitial.InitialType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "InitialType = " + POut.Int((int)toothInitial.InitialType) + "";
            }
            if (toothInitial.Movement != oldToothInitial.Movement)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Movement = " + POut.Float(toothInitial.Movement) + "";
            }
            if (toothInitial.DrawingSegment != oldToothInitial.DrawingSegment)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DrawingSegment = '" + POut.String(toothInitial.DrawingSegment) + "'";
            }
            if (toothInitial.ColorDraw != oldToothInitial.ColorDraw)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ColorDraw = " + POut.Int(toothInitial.ColorDraw.ToArgb()) + "";
            }
            if (command == "")
            {
                return;
            }
            command = "UPDATE toothinitial SET " + command
                      + " WHERE ToothInitialNum = " + POut.Long(toothInitial.ToothInitialNum);
            Db.NonQ(command);
        }
Пример #7
0
        ///<summary></summary>
        public static void Insert(ToothInitial init)
        {
            if (PrefB.RandomKeys)
            {
                init.ToothInitialNum = MiscData.GetKey("toothinitial", "ToothInitialNum");
            }
            string command = "INSERT INTO toothinitial (";

            if (PrefB.RandomKeys)
            {
                command += "ToothInitialNum,";
            }
            command += "PatNum,ToothNum,InitialType,Movement) VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(init.ToothInitialNum) + "', ";
            }
            command +=
                "'" + POut.PInt(init.PatNum) + "', "
                + "'" + POut.PString(init.ToothNum) + "', "
                + "'" + POut.PInt((int)init.InitialType) + "', "
                + "'" + POut.PFloat(init.Movement) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                init.ToothInitialNum = General.NonQ(command, true);
            }
        }
Пример #8
0
        ///<summary>Inserts one ToothInitial into the database.  Provides option to use the existing priKey.</summary>
        internal static long Insert(ToothInitial toothInitial, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                toothInitial.ToothInitialNum = ReplicationServers.GetKey("toothinitial", "ToothInitialNum");
            }
            string command = "INSERT INTO toothinitial (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "ToothInitialNum,";
            }
            command += "PatNum,ToothNum,InitialType,Movement,DrawingSegment,ColorDraw) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(toothInitial.ToothInitialNum) + ",";
            }
            command +=
                POut.Long(toothInitial.PatNum) + ","
                + "'" + POut.String(toothInitial.ToothNum) + "',"
                + POut.Int((int)toothInitial.InitialType) + ","
                + POut.Float(toothInitial.Movement) + ","
                + "'" + POut.String(toothInitial.DrawingSegment) + "',"
                + POut.Int(toothInitial.ColorDraw.ToArgb()) + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                toothInitial.ToothInitialNum = Db.NonQ(command, true);
            }
            return(toothInitial.ToothInitialNum);
        }
Пример #9
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);
        }
Пример #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(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);
        }
Пример #11
0
        ///<summary></summary>
        public static void Update(ToothInitial init)
        {
            string command = "UPDATE toothinitial SET "
                             + "PatNum = '" + POut.PInt(init.PatNum) + "', "
                             + "ToothNum= '" + POut.PString(init.ToothNum) + "', "
                             + "InitialType = '" + POut.PInt((int)init.InitialType) + "', "
                             + "Movement = '" + POut.PFloat(init.Movement) + "' "
                             + "WHERE ToothInitialNum = '" + POut.PInt(init.ToothInitialNum) + "'";

            General.NonQ(command);
        }
Пример #12
0
        ///<summary>Updates one ToothInitial in the database.</summary>
        internal static void Update(ToothInitial toothInitial)
        {
            string command = "UPDATE toothinitial SET "
                             + "PatNum         =  " + POut.Long(toothInitial.PatNum) + ", "
                             + "ToothNum       = '" + POut.String(toothInitial.ToothNum) + "', "
                             + "InitialType    =  " + POut.Int((int)toothInitial.InitialType) + ", "
                             + "Movement       =  " + POut.Float(toothInitial.Movement) + ", "
                             + "DrawingSegment = '" + POut.String(toothInitial.DrawingSegment) + "', "
                             + "ColorDraw      =  " + POut.Int(toothInitial.ColorDraw.ToArgb()) + " "
                             + "WHERE ToothInitialNum = " + POut.Long(toothInitial.ToothInitialNum);

            Db.NonQ(command);
        }
Пример #13
0
 ///<summary>Inserts one ToothInitial into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(ToothInitial toothInitial)
 {
     if (DataConnection.DBtype == DatabaseType.MySql)
     {
         return(InsertNoCache(toothInitial, false));
     }
     else
     {
         if (DataConnection.DBtype == DatabaseType.Oracle)
         {
             toothInitial.ToothInitialNum = DbHelper.GetNextOracleKey("toothinitial", "ToothInitialNum");                  //Cacheless method
         }
         return(InsertNoCache(toothInitial, true));
     }
 }
Пример #14
0
		///<summary>Converts a DataTable to a list of objects.</summary>
		public static List<ToothInitial> TableToList(DataTable table){
			List<ToothInitial> retVal=new List<ToothInitial>();
			ToothInitial toothInitial;
			for(int i=0;i<table.Rows.Count;i++) {
				toothInitial=new ToothInitial();
				toothInitial.ToothInitialNum= PIn.Long  (table.Rows[i]["ToothInitialNum"].ToString());
				toothInitial.PatNum         = PIn.Long  (table.Rows[i]["PatNum"].ToString());
				toothInitial.ToothNum       = PIn.String(table.Rows[i]["ToothNum"].ToString());
				toothInitial.InitialType    = (OpenDentBusiness.ToothInitialType)PIn.Int(table.Rows[i]["InitialType"].ToString());
				toothInitial.Movement       = PIn.Float (table.Rows[i]["Movement"].ToString());
				toothInitial.DrawingSegment = PIn.String(table.Rows[i]["DrawingSegment"].ToString());
				toothInitial.ColorDraw      = Color.FromArgb(PIn.Int(table.Rows[i]["ColorDraw"].ToString()));
				retVal.Add(toothInitial);
			}
			return retVal;
		}
Пример #15
0
        ///<summary>Updates one ToothInitial in the database.</summary>
        public static void Update(ToothInitial toothInitial)
        {
            string command = "UPDATE toothinitial SET "
                             + "PatNum         =  " + POut.Long(toothInitial.PatNum) + ", "
                             + "ToothNum       = '" + POut.String(toothInitial.ToothNum) + "', "
                             + "InitialType    =  " + POut.Int((int)toothInitial.InitialType) + ", "
                             + "Movement       =  " + POut.Float(toothInitial.Movement) + ", "
                             + "DrawingSegment =  " + DbHelper.ParamChar + "paramDrawingSegment, "
                             + "ColorDraw      =  " + POut.Int(toothInitial.ColorDraw.ToArgb()) + " "
                             + "WHERE ToothInitialNum = " + POut.Long(toothInitial.ToothInitialNum);

            if (toothInitial.DrawingSegment == null)
            {
                toothInitial.DrawingSegment = "";
            }
            OdSqlParameter paramDrawingSegment = new OdSqlParameter("paramDrawingSegment", OdDbType.Text, POut.StringParam(toothInitial.DrawingSegment));

            Db.NonQ(command, paramDrawingSegment);
        }
Пример #16
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        internal static List <ToothInitial> TableToList(DataTable table)
        {
            List <ToothInitial> retVal = new List <ToothInitial>();
            ToothInitial        toothInitial;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                toothInitial = new ToothInitial();
                toothInitial.ToothInitialNum = PIn.Long(table.Rows[i]["ToothInitialNum"].ToString());
                toothInitial.PatNum          = PIn.Long(table.Rows[i]["PatNum"].ToString());
                toothInitial.ToothNum        = PIn.String(table.Rows[i]["ToothNum"].ToString());
                toothInitial.InitialType     = (ToothInitialType)PIn.Int(table.Rows[i]["InitialType"].ToString());
                toothInitial.Movement        = PIn.Float(table.Rows[i]["Movement"].ToString());
                toothInitial.DrawingSegment  = PIn.String(table.Rows[i]["DrawingSegment"].ToString());
                toothInitial.ColorDraw       = Color.FromArgb(PIn.Int(table.Rows[i]["ColorDraw"].ToString()));
                retVal.Add(toothInitial);
            }
            return(retVal);
        }
Пример #17
0
        ///<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);
        }
Пример #18
0
        ///<summary>Gets all toothinitial entries for the current patient.</summary>
        public static ToothInitial[] Refresh(int patNum)
        {
            string command =
                "SELECT * FROM toothinitial"
                + " WHERE PatNum = " + POut.PInt(patNum);
            DataTable table = General.GetTable(command);

            ToothInitial[] List = new ToothInitial[table.Rows.Count];
            for (int i = 0; i < List.Length; i++)
            {
                List[i] = new ToothInitial();
                List[i].ToothInitialNum = PIn.PInt(table.Rows[i][0].ToString());
                List[i].PatNum          = PIn.PInt(table.Rows[i][1].ToString());
                List[i].ToothNum        = PIn.PString(table.Rows[i][2].ToString());
                List[i].InitialType     = (ToothInitialType)PIn.PInt(table.Rows[i][3].ToString());
                List[i].Movement        = PIn.PFloat(table.Rows[i][4].ToString());
            }
            return(List);
        }
Пример #19
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        public static List <ToothInitial> TableToList(DataTable table)
        {
            List <ToothInitial> retVal = new List <ToothInitial>();
            ToothInitial        toothInitial;

            foreach (DataRow row in table.Rows)
            {
                toothInitial = new ToothInitial();
                toothInitial.ToothInitialNum = PIn.Long(row["ToothInitialNum"].ToString());
                toothInitial.PatNum          = PIn.Long(row["PatNum"].ToString());
                toothInitial.ToothNum        = PIn.String(row["ToothNum"].ToString());
                toothInitial.InitialType     = (OpenDentBusiness.ToothInitialType)PIn.Int(row["InitialType"].ToString());
                toothInitial.Movement        = PIn.Float(row["Movement"].ToString());
                toothInitial.DrawingSegment  = PIn.String(row["DrawingSegment"].ToString());
                toothInitial.ColorDraw       = Color.FromArgb(PIn.Int(row["ColorDraw"].ToString()));
                retVal.Add(toothInitial);
            }
            return(retVal);
        }
Пример #20
0
        ///<summary>Inserts one ToothInitial into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(ToothInitial toothInitial, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO toothinitial (";

            if (!useExistingPK && isRandomKeys)
            {
                toothInitial.ToothInitialNum = ReplicationServers.GetKeyNoCache("toothinitial", "ToothInitialNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "ToothInitialNum,";
            }
            command += "PatNum,ToothNum,InitialType,Movement,DrawingSegment,ColorDraw) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(toothInitial.ToothInitialNum) + ",";
            }
            command +=
                POut.Long(toothInitial.PatNum) + ","
                + "'" + POut.String(toothInitial.ToothNum) + "',"
                + POut.Int((int)toothInitial.InitialType) + ","
                + POut.Float(toothInitial.Movement) + ","
                + DbHelper.ParamChar + "paramDrawingSegment,"
                + POut.Int(toothInitial.ColorDraw.ToArgb()) + ")";
            if (toothInitial.DrawingSegment == null)
            {
                toothInitial.DrawingSegment = "";
            }
            OdSqlParameter paramDrawingSegment = new OdSqlParameter("paramDrawingSegment", OdDbType.Text, POut.StringParam(toothInitial.DrawingSegment));

            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command, paramDrawingSegment);
            }
            else
            {
                toothInitial.ToothInitialNum = Db.NonQ(command, true, "ToothInitialNum", "toothInitial", paramDrawingSegment);
            }
            return(toothInitial.ToothInitialNum);
        }
Пример #21
0
		///<summary>Updates one ToothInitial in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.  Returns true if an update occurred.</summary>
		public static bool Update(ToothInitial toothInitial,ToothInitial oldToothInitial){
			string command="";
			if(toothInitial.PatNum != oldToothInitial.PatNum) {
				if(command!=""){ command+=",";}
				command+="PatNum = "+POut.Long(toothInitial.PatNum)+"";
			}
			if(toothInitial.ToothNum != oldToothInitial.ToothNum) {
				if(command!=""){ command+=",";}
				command+="ToothNum = '"+POut.String(toothInitial.ToothNum)+"'";
			}
			if(toothInitial.InitialType != oldToothInitial.InitialType) {
				if(command!=""){ command+=",";}
				command+="InitialType = "+POut.Int   ((int)toothInitial.InitialType)+"";
			}
			if(toothInitial.Movement != oldToothInitial.Movement) {
				if(command!=""){ command+=",";}
				command+="Movement = "+POut.Float(toothInitial.Movement)+"";
			}
			if(toothInitial.DrawingSegment != oldToothInitial.DrawingSegment) {
				if(command!=""){ command+=",";}
				command+="DrawingSegment = '"+POut.String(toothInitial.DrawingSegment)+"'";
			}
			if(toothInitial.ColorDraw != oldToothInitial.ColorDraw) {
				if(command!=""){ command+=",";}
				command+="ColorDraw = "+POut.Int(toothInitial.ColorDraw.ToArgb())+"";
			}
			if(command==""){
				return false;
			}
			command="UPDATE toothinitial SET "+command
				+" WHERE ToothInitialNum = "+POut.Long(toothInitial.ToothInitialNum);
			Db.NonQ(command);
			return true;
		}
Пример #22
0
		///<summary>Updates one ToothInitial in the database.</summary>
		public static void Update(ToothInitial toothInitial){
			string command="UPDATE toothinitial SET "
				+"PatNum         =  "+POut.Long  (toothInitial.PatNum)+", "
				+"ToothNum       = '"+POut.String(toothInitial.ToothNum)+"', "
				+"InitialType    =  "+POut.Int   ((int)toothInitial.InitialType)+", "
				+"Movement       =  "+POut.Float (toothInitial.Movement)+", "
				+"DrawingSegment = '"+POut.String(toothInitial.DrawingSegment)+"', "
				+"ColorDraw      =  "+POut.Int   (toothInitial.ColorDraw.ToArgb())+" "
				+"WHERE ToothInitialNum = "+POut.Long(toothInitial.ToothInitialNum);
			Db.NonQ(command);
		}
Пример #23
0
        ///<summary></summary>
        public static void Delete(ToothInitial init)
        {
            string command = "DELETE FROM toothinitial WHERE ToothInitialNum = '" + init.ToothInitialNum.ToString() + "'";

            General.NonQ(command);
        }
Пример #24
0
        ///<summary>Updates one ToothInitial in the database.  Uses an old object to compare to, and only alters changed fields.  This prevents collisions and concurrency problems in heavily used tables.  Returns true if an update occurred.</summary>
        public static bool Update(ToothInitial toothInitial, ToothInitial oldToothInitial)
        {
            string command = "";

            if (toothInitial.PatNum != oldToothInitial.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(toothInitial.PatNum) + "";
            }
            if (toothInitial.ToothNum != oldToothInitial.ToothNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ToothNum = '" + POut.String(toothInitial.ToothNum) + "'";
            }
            if (toothInitial.InitialType != oldToothInitial.InitialType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "InitialType = " + POut.Int((int)toothInitial.InitialType) + "";
            }
            if (toothInitial.Movement != oldToothInitial.Movement)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Movement = " + POut.Float(toothInitial.Movement) + "";
            }
            if (toothInitial.DrawingSegment != oldToothInitial.DrawingSegment)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DrawingSegment = " + DbHelper.ParamChar + "paramDrawingSegment";
            }
            if (toothInitial.ColorDraw != oldToothInitial.ColorDraw)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ColorDraw = " + POut.Int(toothInitial.ColorDraw.ToArgb()) + "";
            }
            if (command == "")
            {
                return(false);
            }
            if (toothInitial.DrawingSegment == null)
            {
                toothInitial.DrawingSegment = "";
            }
            OdSqlParameter paramDrawingSegment = new OdSqlParameter("paramDrawingSegment", OdDbType.Text, POut.StringParam(toothInitial.DrawingSegment));

            command = "UPDATE toothinitial SET " + command
                      + " WHERE ToothInitialNum = " + POut.Long(toothInitial.ToothInitialNum);
            Db.NonQ(command, paramDrawingSegment);
            return(true);
        }
Пример #25
0
 ///<summary>Inserts one ToothInitial into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(ToothInitial toothInitial)
 {
     return(InsertNoCache(toothInitial, false));
 }