///<summary></summary>
        public static void Delete(PerioMeasure Cur)
        {
            string command = "DELETE from periomeasure WHERE PerioMeasureNum = '"
                             + Cur.PerioMeasureNum.ToString() + "'";

            General.NonQ(command);
        }
Example #2
0
 ///<summary>Inserts one PerioMeasure into the database.  Returns the new priKey.</summary>
 internal static long Insert(PerioMeasure perioMeasure)
 {
     if(DataConnection.DBtype==DatabaseType.Oracle) {
         perioMeasure.PerioMeasureNum=DbHelper.GetNextOracleKey("periomeasure","PerioMeasureNum");
         int loopcount=0;
         while(loopcount<100){
             try {
                 return Insert(perioMeasure,true);
             }
             catch(Oracle.DataAccess.Client.OracleException ex){
                 if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
                     perioMeasure.PerioMeasureNum++;
                     loopcount++;
                 }
                 else{
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else {
         return Insert(perioMeasure,false);
     }
 }
Example #3
0
 ///<summary>Inserts one PerioMeasure into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(PerioMeasure perioMeasure,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         perioMeasure.PerioMeasureNum=ReplicationServers.GetKey("periomeasure","PerioMeasureNum");
     }
     string command="INSERT INTO periomeasure (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="PerioMeasureNum,";
     }
     command+="PerioExamNum,SequenceType,IntTooth,ToothValue,MBvalue,Bvalue,DBvalue,MLvalue,Lvalue,DLvalue) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(perioMeasure.PerioMeasureNum)+",";
     }
     command+=
              POut.Long  (perioMeasure.PerioExamNum)+","
         +    POut.Int   ((int)perioMeasure.SequenceType)+","
         +    POut.Int   (perioMeasure.IntTooth)+","
         +    POut.Int   (perioMeasure.ToothValue)+","
         +    POut.Int   (perioMeasure.MBvalue)+","
         +    POut.Int   (perioMeasure.Bvalue)+","
         +    POut.Int   (perioMeasure.DBvalue)+","
         +    POut.Int   (perioMeasure.MLvalue)+","
         +    POut.Int   (perioMeasure.Lvalue)+","
         +    POut.Int   (perioMeasure.DLvalue)+")";
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command);
     }
     else {
         perioMeasure.PerioMeasureNum=Db.NonQ(command,true);
     }
     return perioMeasure.PerioMeasureNum;
 }
Example #4
0
 ///<summary>Inserts one PerioMeasure into the database.  Returns the new priKey.</summary>
 public static long Insert(PerioMeasure perioMeasure)
 {
     if (DataConnection.DBtype == DatabaseType.Oracle)
     {
         perioMeasure.PerioMeasureNum = DbHelper.GetNextOracleKey("periomeasure", "PerioMeasureNum");
         int loopcount = 0;
         while (loopcount < 100)
         {
             try {
                 return(Insert(perioMeasure, true));
             }
             catch (Oracle.DataAccess.Client.OracleException ex) {
                 if (ex.Number == 1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated"))
                 {
                     perioMeasure.PerioMeasureNum++;
                     loopcount++;
                 }
                 else
                 {
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else
     {
         return(Insert(perioMeasure, false));
     }
 }
        ///<summary>For the current exam, clears existing skipped teeth and resets them to the specified skipped teeth. The ArrayList valid values are 1-32 int.</summary>
        public static void SetSkipped(int perioExamNum, ArrayList skippedTeeth)
        {
            //for(int i=0;i<skippedTeeth.Count;i++){
            //MessageBox.Show(skippedTeeth[i].ToString());
            //}
            //first, delete all skipped teeth for this exam
            string command = "DELETE from periomeasure WHERE "
                             + "PerioExamNum = '" + perioExamNum.ToString() + "' "
                             + "AND SequenceType = '" + POut.PInt((int)PerioSequenceType.SkipTooth) + "'";

            General.NonQ(command);
            //then add the new ones in one at a time.
            PerioMeasure Cur;

            for (int i = 0; i < skippedTeeth.Count; i++)
            {
                Cur = new PerioMeasure();
                Cur.PerioExamNum = perioExamNum;
                Cur.SequenceType = PerioSequenceType.SkipTooth;
                Cur.IntTooth     = (int)skippedTeeth[i];
                Cur.ToothValue   = 1;
                Cur.MBvalue      = -1;
                Cur.Bvalue       = -1;
                Cur.DBvalue      = -1;
                Cur.MLvalue      = -1;
                Cur.Lvalue       = -1;
                Cur.DLvalue      = -1;
                Insert(Cur);
            }
        }
Example #6
0
        public void AddPerioMeasure(int intTooth, PerioSequenceType sequenceType, int mb, int b, int db, int ml, int l, int dl)
        {
            PerioMeasure pm = new PerioMeasure();

            pm.MBvalue      = mb;
            pm.Bvalue       = b;
            pm.DBvalue      = db;
            pm.MLvalue      = ml;
            pm.Lvalue       = l;
            pm.DLvalue      = dl;
            pm.IntTooth     = intTooth;
            pm.SequenceType = sequenceType;
            tcData.ListPerioMeasure.Add(pm);
        }
Example #7
0
 ///<summary>Inserts one PerioMeasure into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(PerioMeasure perioMeasure)
 {
     if (DataConnection.DBtype == DatabaseType.MySql)
     {
         return(InsertNoCache(perioMeasure, false));
     }
     else
     {
         if (DataConnection.DBtype == DatabaseType.Oracle)
         {
             perioMeasure.PerioMeasureNum = DbHelper.GetNextOracleKey("periomeasure", "PerioMeasureNum");                  //Cacheless method
         }
         return(InsertNoCache(perioMeasure, true));
     }
 }
        ///<summary></summary>
        public static void Update(PerioMeasure Cur)
        {
            string command = "UPDATE periomeasure SET "
                             + "PerioExamNum = '" + POut.PInt(Cur.PerioExamNum) + "'"
                             + ",SequenceType = '" + POut.PInt((int)Cur.SequenceType) + "'"
                             + ",IntTooth = '" + POut.PInt(Cur.IntTooth) + "'"
                             + ",ToothValue = '" + POut.PInt(Cur.ToothValue) + "'"
                             + ",MBvalue = '" + POut.PInt(Cur.MBvalue) + "'"
                             + ",Bvalue = '" + POut.PInt(Cur.Bvalue) + "'"
                             + ",DBvalue = '" + POut.PInt(Cur.DBvalue) + "'"
                             + ",MLvalue = '" + POut.PInt(Cur.MLvalue) + "'"
                             + ",Lvalue = '" + POut.PInt(Cur.Lvalue) + "'"
                             + ",DLvalue = '" + POut.PInt(Cur.DLvalue) + "'"
                             + " WHERE PerioMeasureNum = '" + POut.PInt(Cur.PerioMeasureNum) + "'";

            General.NonQ(command);
        }
Example #9
0
        ///<summary>Updates one PerioMeasure in the database.</summary>
        public static void Update(PerioMeasure perioMeasure)
        {
            string command = "UPDATE periomeasure SET "
                             + "PerioExamNum   =  " + POut.Long(perioMeasure.PerioExamNum) + ", "
                             + "SequenceType   =  " + POut.Int((int)perioMeasure.SequenceType) + ", "
                             + "IntTooth       =  " + POut.Int(perioMeasure.IntTooth) + ", "
                             + "ToothValue     =  " + POut.Int(perioMeasure.ToothValue) + ", "
                             + "MBvalue        =  " + POut.Int(perioMeasure.MBvalue) + ", "
                             + "Bvalue         =  " + POut.Int(perioMeasure.Bvalue) + ", "
                             + "DBvalue        =  " + POut.Int(perioMeasure.DBvalue) + ", "
                             + "MLvalue        =  " + POut.Int(perioMeasure.MLvalue) + ", "
                             + "Lvalue         =  " + POut.Int(perioMeasure.Lvalue) + ", "
                             + "DLvalue        =  " + POut.Int(perioMeasure.DLvalue) + " "
                             + "WHERE PerioMeasureNum = " + POut.Long(perioMeasure.PerioMeasureNum);

            Db.NonQ(command);
        }
Example #10
0
 ///<summary>Returns true if Update(PerioMeasure,PerioMeasure) 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(PerioMeasure perioMeasure, PerioMeasure oldPerioMeasure)
 {
     if (perioMeasure.PerioExamNum != oldPerioMeasure.PerioExamNum)
     {
         return(true);
     }
     if (perioMeasure.SequenceType != oldPerioMeasure.SequenceType)
     {
         return(true);
     }
     if (perioMeasure.IntTooth != oldPerioMeasure.IntTooth)
     {
         return(true);
     }
     if (perioMeasure.ToothValue != oldPerioMeasure.ToothValue)
     {
         return(true);
     }
     if (perioMeasure.MBvalue != oldPerioMeasure.MBvalue)
     {
         return(true);
     }
     if (perioMeasure.Bvalue != oldPerioMeasure.Bvalue)
     {
         return(true);
     }
     if (perioMeasure.DBvalue != oldPerioMeasure.DBvalue)
     {
         return(true);
     }
     if (perioMeasure.MLvalue != oldPerioMeasure.MLvalue)
     {
         return(true);
     }
     if (perioMeasure.Lvalue != oldPerioMeasure.Lvalue)
     {
         return(true);
     }
     if (perioMeasure.DLvalue != oldPerioMeasure.DLvalue)
     {
         return(true);
     }
     return(false);
 }
Example #11
0
		///<summary>Converts a DataTable to a list of objects.</summary>
		public static List<PerioMeasure> TableToList(DataTable table){
			List<PerioMeasure> retVal=new List<PerioMeasure>();
			PerioMeasure perioMeasure;
			for(int i=0;i<table.Rows.Count;i++) {
				perioMeasure=new PerioMeasure();
				perioMeasure.PerioMeasureNum= PIn.Long  (table.Rows[i]["PerioMeasureNum"].ToString());
				perioMeasure.PerioExamNum   = PIn.Long  (table.Rows[i]["PerioExamNum"].ToString());
				perioMeasure.SequenceType   = (OpenDentBusiness.PerioSequenceType)PIn.Int(table.Rows[i]["SequenceType"].ToString());
				perioMeasure.IntTooth       = PIn.Int   (table.Rows[i]["IntTooth"].ToString());
				perioMeasure.ToothValue     = PIn.Int   (table.Rows[i]["ToothValue"].ToString());
				perioMeasure.MBvalue        = PIn.Int   (table.Rows[i]["MBvalue"].ToString());
				perioMeasure.Bvalue         = PIn.Int   (table.Rows[i]["Bvalue"].ToString());
				perioMeasure.DBvalue        = PIn.Int   (table.Rows[i]["DBvalue"].ToString());
				perioMeasure.MLvalue        = PIn.Int   (table.Rows[i]["MLvalue"].ToString());
				perioMeasure.Lvalue         = PIn.Int   (table.Rows[i]["Lvalue"].ToString());
				perioMeasure.DLvalue        = PIn.Int   (table.Rows[i]["DLvalue"].ToString());
				retVal.Add(perioMeasure);
			}
			return retVal;
		}
Example #12
0
        ///<summary></summary>
        public static void Insert(PerioMeasure Cur)
        {
            if (PrefB.RandomKeys)
            {
                Cur.PerioMeasureNum = MiscData.GetKey("periomeasure", "PerioMeasureNum");
            }
            string command = "INSERT INTO periomeasure (";

            if (PrefB.RandomKeys)
            {
                command += "PerioMeasureNum,";
            }
            command += "PerioExamNum,SequenceType,IntTooth,ToothValue,"
                       + "MBvalue,Bvalue,DBvalue,MLvalue,Lvalue,DLvalue"
                       + ") VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(Cur.PerioMeasureNum) + "', ";
            }
            command +=
                "'" + POut.PInt(Cur.PerioExamNum) + "', "
                + "'" + POut.PInt((int)Cur.SequenceType) + "', "
                + "'" + POut.PInt(Cur.IntTooth) + "', "
                + "'" + POut.PInt(Cur.ToothValue) + "', "
                + "'" + POut.PInt(Cur.MBvalue) + "', "
                + "'" + POut.PInt(Cur.Bvalue) + "', "
                + "'" + POut.PInt(Cur.DBvalue) + "', "
                + "'" + POut.PInt(Cur.MLvalue) + "', "
                + "'" + POut.PInt(Cur.Lvalue) + "', "
                + "'" + POut.PInt(Cur.DLvalue) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                Cur.PerioMeasureNum = General.NonQ(command, true);
            }
        }
Example #13
0
        ///<summary>Inserts one PerioMeasure into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(PerioMeasure perioMeasure, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO periomeasure (";

            if (!useExistingPK && isRandomKeys)
            {
                perioMeasure.PerioMeasureNum = ReplicationServers.GetKeyNoCache("periomeasure", "PerioMeasureNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "PerioMeasureNum,";
            }
            command += "PerioExamNum,SequenceType,IntTooth,ToothValue,MBvalue,Bvalue,DBvalue,MLvalue,Lvalue,DLvalue) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(perioMeasure.PerioMeasureNum) + ",";
            }
            command +=
                POut.Long(perioMeasure.PerioExamNum) + ","
                + POut.Int((int)perioMeasure.SequenceType) + ","
                + POut.Int(perioMeasure.IntTooth) + ","
                + POut.Int(perioMeasure.ToothValue) + ","
                + POut.Int(perioMeasure.MBvalue) + ","
                + POut.Int(perioMeasure.Bvalue) + ","
                + POut.Int(perioMeasure.DBvalue) + ","
                + POut.Int(perioMeasure.MLvalue) + ","
                + POut.Int(perioMeasure.Lvalue) + ","
                + POut.Int(perioMeasure.DLvalue) + ")";
            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                perioMeasure.PerioMeasureNum = Db.NonQ(command, true, "PerioMeasureNum", "perioMeasure");
            }
            return(perioMeasure.PerioMeasureNum);
        }
Example #14
0
        ///<summary>Inserts one PerioMeasure into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(PerioMeasure perioMeasure, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                perioMeasure.PerioMeasureNum = ReplicationServers.GetKey("periomeasure", "PerioMeasureNum");
            }
            string command = "INSERT INTO periomeasure (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "PerioMeasureNum,";
            }
            command += "PerioExamNum,SequenceType,IntTooth,ToothValue,MBvalue,Bvalue,DBvalue,MLvalue,Lvalue,DLvalue) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(perioMeasure.PerioMeasureNum) + ",";
            }
            command +=
                POut.Long(perioMeasure.PerioExamNum) + ","
                + POut.Int((int)perioMeasure.SequenceType) + ","
                + POut.Int(perioMeasure.IntTooth) + ","
                + POut.Int(perioMeasure.ToothValue) + ","
                + POut.Int(perioMeasure.MBvalue) + ","
                + POut.Int(perioMeasure.Bvalue) + ","
                + POut.Int(perioMeasure.DBvalue) + ","
                + POut.Int(perioMeasure.MLvalue) + ","
                + POut.Int(perioMeasure.Lvalue) + ","
                + POut.Int(perioMeasure.DLvalue) + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                perioMeasure.PerioMeasureNum = Db.NonQ(command, true);
            }
            return(perioMeasure.PerioMeasureNum);
        }
Example #15
0
        ///<summary>Gets all measurements for the current patient, then organizes them by exam and sequence.</summary>
        public static void Refresh(int patNum)
        {
            string command =
                "SELECT periomeasure.*,perioexam.ExamDate"
                + " FROM periomeasure,perioexam"
                + " WHERE periomeasure.PerioExamNum = perioexam.PerioExamNum"
                + " AND perioexam.PatNum = '" + patNum.ToString() + "'"
                + " ORDER BY perioexam.ExamDate";
            DataTable table = General.GetTable(command);

            List = new PerioMeasure[PerioExams.List.Length, Enum.GetNames(typeof(PerioSequenceType)).Length, 33];
            int          curExamI = 0;
            PerioMeasure Cur;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                Cur = new PerioMeasure();
                Cur.PerioMeasureNum = PIn.PInt(table.Rows[i][0].ToString());
                Cur.PerioExamNum    = PIn.PInt(table.Rows[i][1].ToString());
                Cur.SequenceType    = (PerioSequenceType)PIn.PInt(table.Rows[i][2].ToString());
                Cur.IntTooth        = PIn.PInt(table.Rows[i][3].ToString());
                Cur.ToothValue      = PIn.PInt(table.Rows[i][4].ToString());
                Cur.MBvalue         = PIn.PInt(table.Rows[i][5].ToString());
                Cur.Bvalue          = PIn.PInt(table.Rows[i][6].ToString());
                Cur.DBvalue         = PIn.PInt(table.Rows[i][7].ToString());
                Cur.MLvalue         = PIn.PInt(table.Rows[i][8].ToString());
                Cur.Lvalue          = PIn.PInt(table.Rows[i][9].ToString());
                Cur.DLvalue         = PIn.PInt(table.Rows[i][10].ToString());
                //perioexam.ExamDate                           11
                //the next statement can also handle exams with no measurements:
                if (i == 0 ||          //if this is the first row
                    table.Rows[i][1].ToString() != table.Rows[i - 1][1].ToString())                     //or examNum has changed
                {
                    curExamI = PerioExams.GetExamIndex(PIn.PInt(table.Rows[i][1].ToString()));
                }
                List[curExamI, (int)Cur.SequenceType, Cur.IntTooth] = Cur;
            }
        }
Example #16
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        public static List <PerioMeasure> TableToList(DataTable table)
        {
            List <PerioMeasure> retVal = new List <PerioMeasure>();
            PerioMeasure        perioMeasure;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                perioMeasure = new PerioMeasure();
                perioMeasure.PerioMeasureNum = PIn.Long(table.Rows[i]["PerioMeasureNum"].ToString());
                perioMeasure.PerioExamNum    = PIn.Long(table.Rows[i]["PerioExamNum"].ToString());
                perioMeasure.SequenceType    = (PerioSequenceType)PIn.Int(table.Rows[i]["SequenceType"].ToString());
                perioMeasure.IntTooth        = PIn.Int(table.Rows[i]["IntTooth"].ToString());
                perioMeasure.ToothValue      = PIn.Int(table.Rows[i]["ToothValue"].ToString());
                perioMeasure.MBvalue         = PIn.Int(table.Rows[i]["MBvalue"].ToString());
                perioMeasure.Bvalue          = PIn.Int(table.Rows[i]["Bvalue"].ToString());
                perioMeasure.DBvalue         = PIn.Int(table.Rows[i]["DBvalue"].ToString());
                perioMeasure.MLvalue         = PIn.Int(table.Rows[i]["MLvalue"].ToString());
                perioMeasure.Lvalue          = PIn.Int(table.Rows[i]["Lvalue"].ToString());
                perioMeasure.DLvalue         = PIn.Int(table.Rows[i]["DLvalue"].ToString());
                retVal.Add(perioMeasure);
            }
            return(retVal);
        }
Example #17
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        public static List <PerioMeasure> TableToList(DataTable table)
        {
            List <PerioMeasure> retVal = new List <PerioMeasure>();
            PerioMeasure        perioMeasure;

            foreach (DataRow row in table.Rows)
            {
                perioMeasure = new PerioMeasure();
                perioMeasure.PerioMeasureNum = PIn.Long(row["PerioMeasureNum"].ToString());
                perioMeasure.PerioExamNum    = PIn.Long(row["PerioExamNum"].ToString());
                perioMeasure.SequenceType    = (OpenDentBusiness.PerioSequenceType)PIn.Int(row["SequenceType"].ToString());
                perioMeasure.IntTooth        = PIn.Int(row["IntTooth"].ToString());
                perioMeasure.ToothValue      = PIn.Int(row["ToothValue"].ToString());
                perioMeasure.MBvalue         = PIn.Int(row["MBvalue"].ToString());
                perioMeasure.Bvalue          = PIn.Int(row["Bvalue"].ToString());
                perioMeasure.DBvalue         = PIn.Int(row["DBvalue"].ToString());
                perioMeasure.MLvalue         = PIn.Int(row["MLvalue"].ToString());
                perioMeasure.Lvalue          = PIn.Int(row["Lvalue"].ToString());
                perioMeasure.DLvalue         = PIn.Int(row["DLvalue"].ToString());
                retVal.Add(perioMeasure);
            }
            return(retVal);
        }
 ///<summary>Inserts one PerioMeasure into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(PerioMeasure perioMeasure)
 {
     return(InsertNoCache(perioMeasure, false));
 }
Example #19
0
        ///<summary>Updates one PerioMeasure 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>
        public static void Update(PerioMeasure perioMeasure, PerioMeasure oldPerioMeasure)
        {
            string command = "";

            if (perioMeasure.PerioExamNum != oldPerioMeasure.PerioExamNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PerioExamNum = " + POut.Long(perioMeasure.PerioExamNum) + "";
            }
            if (perioMeasure.SequenceType != oldPerioMeasure.SequenceType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SequenceType = " + POut.Int((int)perioMeasure.SequenceType) + "";
            }
            if (perioMeasure.IntTooth != oldPerioMeasure.IntTooth)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IntTooth = " + POut.Int(perioMeasure.IntTooth) + "";
            }
            if (perioMeasure.ToothValue != oldPerioMeasure.ToothValue)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ToothValue = " + POut.Int(perioMeasure.ToothValue) + "";
            }
            if (perioMeasure.MBvalue != oldPerioMeasure.MBvalue)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "MBvalue = " + POut.Int(perioMeasure.MBvalue) + "";
            }
            if (perioMeasure.Bvalue != oldPerioMeasure.Bvalue)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Bvalue = " + POut.Int(perioMeasure.Bvalue) + "";
            }
            if (perioMeasure.DBvalue != oldPerioMeasure.DBvalue)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DBvalue = " + POut.Int(perioMeasure.DBvalue) + "";
            }
            if (perioMeasure.MLvalue != oldPerioMeasure.MLvalue)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "MLvalue = " + POut.Int(perioMeasure.MLvalue) + "";
            }
            if (perioMeasure.Lvalue != oldPerioMeasure.Lvalue)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Lvalue = " + POut.Int(perioMeasure.Lvalue) + "";
            }
            if (perioMeasure.DLvalue != oldPerioMeasure.DLvalue)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DLvalue = " + POut.Int(perioMeasure.DLvalue) + "";
            }
            if (command == "")
            {
                return;
            }
            command = "UPDATE periomeasure SET " + command
                      + " WHERE PerioMeasureNum = " + POut.Long(perioMeasure.PerioMeasureNum);
            Db.NonQ(command);
        }
Example #20
0
 public void AddPerioMeasure(PerioMeasure pm)
 {
     tcData.ListPerioMeasure.Add(pm);
 }
Example #21
0
		///<summary>Updates one PerioMeasure in the database.</summary>
		public static void Update(PerioMeasure perioMeasure){
			string command="UPDATE periomeasure SET "
				+"PerioExamNum   =  "+POut.Long  (perioMeasure.PerioExamNum)+", "
				+"SequenceType   =  "+POut.Int   ((int)perioMeasure.SequenceType)+", "
				+"IntTooth       =  "+POut.Int   (perioMeasure.IntTooth)+", "
				+"ToothValue     =  "+POut.Int   (perioMeasure.ToothValue)+", "
				+"MBvalue        =  "+POut.Int   (perioMeasure.MBvalue)+", "
				+"Bvalue         =  "+POut.Int   (perioMeasure.Bvalue)+", "
				+"DBvalue        =  "+POut.Int   (perioMeasure.DBvalue)+", "
				+"MLvalue        =  "+POut.Int   (perioMeasure.MLvalue)+", "
				+"Lvalue         =  "+POut.Int   (perioMeasure.Lvalue)+", "
				+"DLvalue        =  "+POut.Int   (perioMeasure.DLvalue)+" "
				+"WHERE PerioMeasureNum = "+POut.Long(perioMeasure.PerioMeasureNum);
			Db.NonQ(command);
		}
Example #22
0
		///<summary>Updates one PerioMeasure 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(PerioMeasure perioMeasure,PerioMeasure oldPerioMeasure){
			string command="";
			if(perioMeasure.PerioExamNum != oldPerioMeasure.PerioExamNum) {
				if(command!=""){ command+=",";}
				command+="PerioExamNum = "+POut.Long(perioMeasure.PerioExamNum)+"";
			}
			if(perioMeasure.SequenceType != oldPerioMeasure.SequenceType) {
				if(command!=""){ command+=",";}
				command+="SequenceType = "+POut.Int   ((int)perioMeasure.SequenceType)+"";
			}
			if(perioMeasure.IntTooth != oldPerioMeasure.IntTooth) {
				if(command!=""){ command+=",";}
				command+="IntTooth = "+POut.Int(perioMeasure.IntTooth)+"";
			}
			if(perioMeasure.ToothValue != oldPerioMeasure.ToothValue) {
				if(command!=""){ command+=",";}
				command+="ToothValue = "+POut.Int(perioMeasure.ToothValue)+"";
			}
			if(perioMeasure.MBvalue != oldPerioMeasure.MBvalue) {
				if(command!=""){ command+=",";}
				command+="MBvalue = "+POut.Int(perioMeasure.MBvalue)+"";
			}
			if(perioMeasure.Bvalue != oldPerioMeasure.Bvalue) {
				if(command!=""){ command+=",";}
				command+="Bvalue = "+POut.Int(perioMeasure.Bvalue)+"";
			}
			if(perioMeasure.DBvalue != oldPerioMeasure.DBvalue) {
				if(command!=""){ command+=",";}
				command+="DBvalue = "+POut.Int(perioMeasure.DBvalue)+"";
			}
			if(perioMeasure.MLvalue != oldPerioMeasure.MLvalue) {
				if(command!=""){ command+=",";}
				command+="MLvalue = "+POut.Int(perioMeasure.MLvalue)+"";
			}
			if(perioMeasure.Lvalue != oldPerioMeasure.Lvalue) {
				if(command!=""){ command+=",";}
				command+="Lvalue = "+POut.Int(perioMeasure.Lvalue)+"";
			}
			if(perioMeasure.DLvalue != oldPerioMeasure.DLvalue) {
				if(command!=""){ command+=",";}
				command+="DLvalue = "+POut.Int(perioMeasure.DLvalue)+"";
			}
			if(command==""){
				return false;
			}
			command="UPDATE periomeasure SET "+command
				+" WHERE PerioMeasureNum = "+POut.Long(perioMeasure.PerioMeasureNum);
			Db.NonQ(command);
			return true;
		}