Example #1
0
 ///<summary>Inserts one PerioExam into the database.  Returns the new priKey.</summary>
 internal static long Insert(PerioExam perioExam)
 {
     if(DataConnection.DBtype==DatabaseType.Oracle) {
         perioExam.PerioExamNum=DbHelper.GetNextOracleKey("perioexam","PerioExamNum");
         int loopcount=0;
         while(loopcount<100){
             try {
                 return Insert(perioExam,true);
             }
             catch(Oracle.DataAccess.Client.OracleException ex){
                 if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
                     perioExam.PerioExamNum++;
                     loopcount++;
                 }
                 else{
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else {
         return Insert(perioExam,false);
     }
 }
Example #2
0
 public FormPerioGraphical(PerioExam perioExam, Patient patient, ToothChartData toothChartData)
 {
     _perioExamCur   = perioExam;
     _patCur         = patient;
     _toothChartData = toothChartData;
     InitializeComponent();
 }
Example #3
0
        ///<summary>Inserts one PerioExam into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(PerioExam perioExam, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO perioexam (";

            if (!useExistingPK && isRandomKeys)
            {
                perioExam.PerioExamNum = ReplicationServers.GetKeyNoCache("perioexam", "PerioExamNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "PerioExamNum,";
            }
            command += "PatNum,ExamDate,ProvNum,DateTMeasureEdit) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(perioExam.PerioExamNum) + ",";
            }
            command +=
                POut.Long(perioExam.PatNum) + ","
                + POut.Date(perioExam.ExamDate) + ","
                + POut.Long(perioExam.ProvNum) + ","
                + DbHelper.Now() + ")";
            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                perioExam.PerioExamNum = Db.NonQ(command, true, "PerioExamNum", "perioExam");
            }
            return(perioExam.PerioExamNum);
        }
Example #4
0
        ///<summary>Inserts one PerioExam into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(PerioExam perioExam, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                perioExam.PerioExamNum = ReplicationServers.GetKey("perioexam", "PerioExamNum");
            }
            string command = "INSERT INTO perioexam (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "PerioExamNum,";
            }
            command += "PatNum,ExamDate,ProvNum,DateTMeasureEdit) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(perioExam.PerioExamNum) + ",";
            }
            command +=
                POut.Long(perioExam.PatNum) + ","
                + POut.Date(perioExam.ExamDate) + ","
                + POut.Long(perioExam.ProvNum) + ","
                + DbHelper.Now() + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                perioExam.PerioExamNum = Db.NonQ(command, true, "PerioExamNum", "perioExam");
            }
            return(perioExam.PerioExamNum);
        }
Example #5
0
 ///<summary>Inserts one PerioExam into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(PerioExam perioExam,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         perioExam.PerioExamNum=ReplicationServers.GetKey("perioexam","PerioExamNum");
     }
     string command="INSERT INTO perioexam (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="PerioExamNum,";
     }
     command+="PatNum,ExamDate,ProvNum) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(perioExam.PerioExamNum)+",";
     }
     command+=
              POut.Long  (perioExam.PatNum)+","
         +    POut.Date  (perioExam.ExamDate)+","
         +    POut.Long  (perioExam.ProvNum)+")";
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command);
     }
     else {
         perioExam.PerioExamNum=Db.NonQ(command,true);
     }
     return perioExam.PerioExamNum;
 }
Example #6
0
        ///<summary></summary>
        public static void Insert(PerioExam Cur)
        {
            if (PrefB.RandomKeys)
            {
                Cur.PerioExamNum = MiscData.GetKey("perioexam", "PerioExamNum");
            }
            string command = "INSERT INTO perioexam (";

            if (PrefB.RandomKeys)
            {
                command += "PerioExamNum,";
            }
            command += "PatNum,ExamDate,ProvNum"
                       + ") VALUES(";
            if (PrefB.RandomKeys)
            {
                command += "'" + POut.PInt(Cur.PerioExamNum) + "', ";
            }
            command +=
                "'" + POut.PInt(Cur.PatNum) + "', "
                + POut.PDate(Cur.ExamDate) + ", "
                + "'" + POut.PInt(Cur.ProvNum) + "')";
            if (PrefB.RandomKeys)
            {
                General.NonQ(command);
            }
            else
            {
                Cur.PerioExamNum = General.NonQ(command, true);
            }
        }
Example #7
0
 ///<summary>Inserts one PerioExam into the database.  Returns the new priKey.</summary>
 public static long Insert(PerioExam perioExam)
 {
     if (DataConnection.DBtype == DatabaseType.Oracle)
     {
         perioExam.PerioExamNum = DbHelper.GetNextOracleKey("perioexam", "PerioExamNum");
         int loopcount = 0;
         while (loopcount < 100)
         {
             try {
                 return(Insert(perioExam, true));
             }
             catch (Oracle.ManagedDataAccess.Client.OracleException ex) {
                 if (ex.Number == 1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated"))
                 {
                     perioExam.PerioExamNum++;
                     loopcount++;
                 }
                 else
                 {
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else
     {
         return(Insert(perioExam, false));
     }
 }
Example #8
0
        ///<summary></summary>
        public static void Delete(PerioExam Cur)
        {
            string command = "DELETE from perioexam WHERE PerioExamNum = '" + Cur.PerioExamNum.ToString() + "'";

            General.NonQ(command);
            command = "DELETE from periomeasure WHERE PerioExamNum = '" + Cur.PerioExamNum.ToString() + "'";
            General.NonQ(command);
        }
Example #9
0
        ///<summary></summary>
        public static void Update(PerioExam Cur)
        {
            string command = "UPDATE perioexam SET "
                             + "PatNum = '" + POut.PInt(Cur.PatNum) + "'"
                             + ",ExamDate = " + POut.PDate(Cur.ExamDate)
                             + ",ProvNum = '" + POut.PInt(Cur.ProvNum) + "'"
                             + " WHERE PerioExamNum = '" + POut.PInt(Cur.PerioExamNum) + "'";

            General.NonQ(command);
        }
Example #10
0
        ///<summary>Updates one PerioExam in the database.</summary>
        public static void Update(PerioExam perioExam)
        {
            string command = "UPDATE perioexam SET "
                             + "PatNum      =  " + POut.Long(perioExam.PatNum) + ", "
                             + "ExamDate    =  " + POut.Date(perioExam.ExamDate) + ", "
                             + "ProvNum     =  " + POut.Long(perioExam.ProvNum) + " "
                             + "WHERE PerioExamNum = " + POut.Long(perioExam.PerioExamNum);

            Db.NonQ(command);
        }
Example #11
0
		///<summary>Converts a DataTable to a list of objects.</summary>
		public static List<PerioExam> TableToList(DataTable table){
			List<PerioExam> retVal=new List<PerioExam>();
			PerioExam perioExam;
			for(int i=0;i<table.Rows.Count;i++) {
				perioExam=new PerioExam();
				perioExam.PerioExamNum= PIn.Long  (table.Rows[i]["PerioExamNum"].ToString());
				perioExam.PatNum      = PIn.Long  (table.Rows[i]["PatNum"].ToString());
				perioExam.ExamDate    = PIn.Date  (table.Rows[i]["ExamDate"].ToString());
				perioExam.ProvNum     = PIn.Long  (table.Rows[i]["ProvNum"].ToString());
				retVal.Add(perioExam);
			}
			return retVal;
		}
Example #12
0
 ///<summary>Inserts one PerioExam into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(PerioExam perioExam)
 {
     if (DataConnection.DBtype == DatabaseType.MySql)
     {
         return(InsertNoCache(perioExam, false));
     }
     else
     {
         if (DataConnection.DBtype == DatabaseType.Oracle)
         {
             perioExam.PerioExamNum = DbHelper.GetNextOracleKey("perioexam", "PerioExamNum");                  //Cacheless method
         }
         return(InsertNoCache(perioExam, true));
     }
 }
Example #13
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        public static List <PerioExam> TableToList(DataTable table)
        {
            List <PerioExam> retVal = new List <PerioExam>();
            PerioExam        perioExam;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                perioExam = new PerioExam();
                perioExam.PerioExamNum = PIn.Long(table.Rows[i]["PerioExamNum"].ToString());
                perioExam.PatNum       = PIn.Long(table.Rows[i]["PatNum"].ToString());
                perioExam.ExamDate     = PIn.Date(table.Rows[i]["ExamDate"].ToString());
                perioExam.ProvNum      = PIn.Long(table.Rows[i]["ProvNum"].ToString());
                retVal.Add(perioExam);
            }
            return(retVal);
        }
Example #14
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        public static List <PerioExam> TableToList(DataTable table)
        {
            List <PerioExam> retVal = new List <PerioExam>();
            PerioExam        perioExam;

            foreach (DataRow row in table.Rows)
            {
                perioExam = new PerioExam();
                perioExam.PerioExamNum     = PIn.Long(row["PerioExamNum"].ToString());
                perioExam.PatNum           = PIn.Long(row["PatNum"].ToString());
                perioExam.ExamDate         = PIn.Date(row["ExamDate"].ToString());
                perioExam.ProvNum          = PIn.Long(row["ProvNum"].ToString());
                perioExam.DateTMeasureEdit = PIn.DateT(row["DateTMeasureEdit"].ToString());
                retVal.Add(perioExam);
            }
            return(retVal);
        }
Example #15
0
        ///<summary>Updates one PerioExam 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(PerioExam perioExam, PerioExam oldPerioExam)
        {
            string command = "";

            if (perioExam.PatNum != oldPerioExam.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(perioExam.PatNum) + "";
            }
            if (perioExam.ExamDate.Date != oldPerioExam.ExamDate.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ExamDate = " + POut.Date(perioExam.ExamDate) + "";
            }
            if (perioExam.ProvNum != oldPerioExam.ProvNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ProvNum = " + POut.Long(perioExam.ProvNum) + "";
            }
            if (perioExam.DateTMeasureEdit != oldPerioExam.DateTMeasureEdit)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTMeasureEdit = " + POut.DateT(perioExam.DateTMeasureEdit) + "";
            }
            if (command == "")
            {
                return(false);
            }
            command = "UPDATE perioexam SET " + command
                      + " WHERE PerioExamNum = " + POut.Long(perioExam.PerioExamNum);
            Db.NonQ(command);
            return(true);
        }
Example #16
0
        ///<summary>Most recent date last.  All exams loaded, even if not displayed.</summary>
        public static void Refresh(int patNum)
        {
            string command =
                "SELECT * from perioexam"
                + " WHERE PatNum = '" + patNum.ToString() + "'"
                + " ORDER BY perioexam.ExamDate";
            DataTable table = General.GetTable(command);

            List = new PerioExam[table.Rows.Count];
            for (int i = 0; i < table.Rows.Count; i++)
            {
                List[i] = new PerioExam();
                List[i].PerioExamNum = PIn.PInt(table.Rows[i][0].ToString());
                List[i].PatNum       = PIn.PInt(table.Rows[i][1].ToString());
                List[i].ExamDate     = PIn.PDate(table.Rows[i][2].ToString());
                List[i].ProvNum      = PIn.PInt(table.Rows[i][3].ToString());
            }
            //PerioMeasures.Refresh(patNum);
        }
Example #17
0
 ///<summary>Returns true if Update(PerioExam,PerioExam) 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(PerioExam perioExam, PerioExam oldPerioExam)
 {
     if (perioExam.PatNum != oldPerioExam.PatNum)
     {
         return(true);
     }
     if (perioExam.ExamDate.Date != oldPerioExam.ExamDate.Date)
     {
         return(true);
     }
     if (perioExam.ProvNum != oldPerioExam.ProvNum)
     {
         return(true);
     }
     if (perioExam.DateTMeasureEdit != oldPerioExam.DateTMeasureEdit)
     {
         return(true);
     }
     return(false);
 }
Example #18
0
        ///<summary>Updates one PerioExam 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(PerioExam perioExam, PerioExam oldPerioExam)
        {
            string command = "";

            if (perioExam.PatNum != oldPerioExam.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(perioExam.PatNum) + "";
            }
            if (perioExam.ExamDate != oldPerioExam.ExamDate)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ExamDate = " + POut.Date(perioExam.ExamDate) + "";
            }
            if (perioExam.ProvNum != oldPerioExam.ProvNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ProvNum = " + POut.Long(perioExam.ProvNum) + "";
            }
            if (command == "")
            {
                return;
            }
            command = "UPDATE perioexam SET " + command
                      + " WHERE PerioExamNum = " + POut.Long(perioExam.PerioExamNum);
            Db.NonQ(command);
        }
Example #19
0
        //public List<PerioMeasure> ListPerioMeasures;

        public FormPerioGraphical(PerioExam perioExam, Patient patient)
        {
            PerioExamCur = perioExam;
            PatCur       = patient;
            InitializeComponent();
            //ComputerPref localComputerPrefs=ComputerPrefs.GetForLocalComputer();
            toothChart.DeviceFormat = new ToothChartDirectX.DirectXDeviceFormat(ComputerPrefs.LocalComputer.DirectXFormat);          //Must be set before draw mode
            toothChart.DrawMode     = DrawingMode.DirectX;
            toothChart.SetToothNumberingNomenclature((ToothNumberingNomenclature)PrefC.GetInt(PrefName.UseInternationalToothNumbers));
            toothChart.ColorBackground     = Color.White;
            toothChart.ColorText           = Color.Black;
            toothChart.PerioMode           = true;
            toothChart.ColorBleeding       = DefC.Short[(int)DefCat.MiscColors][1].ItemColor;
            toothChart.ColorSuppuration    = DefC.Short[(int)DefCat.MiscColors][2].ItemColor;
            toothChart.ColorProbing        = PrefC.GetColor(PrefName.PerioColorProbing);
            toothChart.ColorProbingRed     = PrefC.GetColor(PrefName.PerioColorProbingRed);
            toothChart.ColorGingivalMargin = PrefC.GetColor(PrefName.PerioColorGM);
            toothChart.ColorCAL            = PrefC.GetColor(PrefName.PerioColorCAL);
            toothChart.ColorMGJ            = PrefC.GetColor(PrefName.PerioColorMGJ);
            toothChart.ColorFurcations     = PrefC.GetColor(PrefName.PerioColorFurcations);
            toothChart.ColorFurcationsRed  = PrefC.GetColor(PrefName.PerioColorFurcationsRed);
            toothChart.RedLimitProbing     = PrefC.GetInt(PrefName.PerioRedProb);
            toothChart.RedLimitFurcations  = PrefC.GetInt(PrefName.PerioRedFurc);
            List <PerioMeasure> listMeas = PerioMeasures.GetAllForExam(PerioExamCur.PerioExamNum);
            //compute CAL's for each site.  If a CAL is valid, pass it in.
            PerioMeasure measureProbe;
            PerioMeasure measureGM;
            int          gm;
            int          pd;
            int          calMB;
            int          calB;
            int          calDB;
            int          calML;
            int          calL;
            int          calDL;

            for (int t = 1; t <= 32; t++)
            {
                measureProbe = null;
                measureGM    = null;
                for (int i = 0; i < listMeas.Count; i++)
                {
                    if (listMeas[i].IntTooth != t)
                    {
                        continue;
                    }
                    if (listMeas[i].SequenceType == PerioSequenceType.Probing)
                    {
                        measureProbe = listMeas[i];
                    }
                    if (listMeas[i].SequenceType == PerioSequenceType.GingMargin)
                    {
                        measureGM = listMeas[i];
                    }
                }
                if (measureProbe == null || measureGM == null)
                {
                    continue;                    //to the next tooth
                }
                //mb
                calMB = -1;
                gm    = measureGM.MBvalue;  //MBvalue must stay over 100 for hyperplasia, because that's how we're storing it in ToothChartData.ListPerioMeasure.
                if (gm > 100)               //hyperplasia
                {
                    gm = 100 - gm;          //e.g. 100-103=-3
                }
                pd = measureProbe.MBvalue;
                if (measureGM.MBvalue != -1 && pd != -1)
                {
                    calMB = gm + pd;
                    if (calMB < 0)
                    {
                        calMB = 0;                      //CALs can't be negative
                    }
                }
                //B
                calB = -1;
                gm   = measureGM.Bvalue;
                if (gm > 100)               //hyperplasia
                {
                    gm = 100 - gm;          //e.g. 100-103=-3
                }
                pd = measureProbe.Bvalue;
                if (measureGM.Bvalue != -1 && pd != -1)
                {
                    calB = gm + pd;
                    if (calB < 0)
                    {
                        calB = 0;
                    }
                }
                //DB
                calDB = -1;
                gm    = measureGM.DBvalue;
                if (gm > 100)               //hyperplasia
                {
                    gm = 100 - gm;          //e.g. 100-103=-3
                }
                pd = measureProbe.DBvalue;
                if (measureGM.DBvalue != -1 && pd != -1)
                {
                    calDB = gm + pd;
                    if (calDB < 0)
                    {
                        calDB = 0;
                    }
                }
                //ML
                calML = -1;
                gm    = measureGM.MLvalue;
                if (gm > 100)               //hyperplasia
                {
                    gm = 100 - gm;          //e.g. 100-103=-3
                }
                pd = measureProbe.MLvalue;
                if (measureGM.MLvalue != -1 && pd != -1)
                {
                    calML = gm + pd;
                    if (calML < 0)
                    {
                        calML = 0;
                    }
                }
                //L
                calL = -1;
                gm   = measureGM.Lvalue;
                if (gm > 100)               //hyperplasia
                {
                    gm = 100 - gm;          //e.g. 100-103=-3
                }
                pd = measureProbe.Lvalue;
                if (measureGM.Lvalue != -1 && pd != -1)
                {
                    calL = gm + pd;
                    if (calL < 0)
                    {
                        calL = 0;
                    }
                }
                //DL
                calDL = -1;
                gm    = measureGM.DLvalue;
                if (gm > 100)               //hyperplasia
                {
                    gm = 100 - gm;          //e.g. 100-103=-3
                }
                pd = measureProbe.DLvalue;
                if (measureGM.DLvalue != -1 && pd != -1)
                {
                    calDL = gm + pd;
                    if (calDL < 0)
                    {
                        calDL = 0;
                    }
                }
                if (calMB != -1 || calB != -1 || calDB != -1 || calML != -1 || calL != -1 || calDL != -1)
                {
                    toothChart.AddPerioMeasure(t, PerioSequenceType.CAL, calMB, calB, calDB, calML, calL, calDL);
                }
            }
            for (int i = 0; i < listMeas.Count; i++)
            {
                if (listMeas[i].SequenceType == PerioSequenceType.SkipTooth)
                {
                    toothChart.SetMissing(listMeas[i].IntTooth.ToString());
                }
                else if (listMeas[i].SequenceType == PerioSequenceType.Mobility)
                {
                    int   mob   = listMeas[i].ToothValue;
                    Color color = Color.Black;
                    if (mob >= PrefC.GetInt(PrefName.PerioRedMob))
                    {
                        color = Color.Red;
                    }
                    toothChart.SetMobility(listMeas[i].IntTooth.ToString(), mob.ToString(), color);
                }
                else
                {
                    toothChart.AddPerioMeasure(listMeas[i]);
                }
            }


            /*
             * toothChart.SetMissing("13");
             * toothChart.SetMissing("14");
             * toothChart.SetMissing("18");
             * toothChart.SetMissing("25");
             * toothChart.SetMissing("26");
             * toothChart.SetImplant("14",Color.Gray);
             * //Movements are too low of a priority to test right now.  We might not even want to implement them.
             * //toothChart.MoveTooth("4",0,0,0,0,-5,0);
             * //toothChart.MoveTooth("16",0,20,0,-3,0,0);
             * //toothChart.MoveTooth("24",15,2,0,0,0,0);
             * toothChart.SetMobility("2","3",Color.Red);
             * toothChart.SetMobility("7","2",Color.Red);
             * toothChart.SetMobility("8","2",Color.Red);
             * toothChart.SetMobility("9","2",Color.Red);
             * toothChart.SetMobility("10","2",Color.Red);
             * toothChart.SetMobility("16","3",Color.Red);
             * toothChart.SetMobility("24","2",Color.Red);
             * toothChart.SetMobility("31","3",Color.Red);
             * toothChart.AddPerioMeasure(1,PerioSequenceType.Furcation,-1,2,-1,1,-1,-1);
             * toothChart.AddPerioMeasure(2,PerioSequenceType.Furcation,-1,2,-1,1,-1,-1);
             * toothChart.AddPerioMeasure(3,PerioSequenceType.Furcation,-1,2,-1,1,-1,-1);
             * toothChart.AddPerioMeasure(5,PerioSequenceType.Furcation,1,-1,-1,-1,-1,-1);
             * toothChart.AddPerioMeasure(30,PerioSequenceType.Furcation,-1,-1,-1,-1,3,-1);
             * for(int i=1;i<=32;i++) {
             *      //string tooth_id=i.ToString();
             *      //bleeding and suppuration on all MB sites
             *      //bleeding only all DL sites
             *      //suppuration only all B sites
             *      //blood=1, suppuration=2, both=3
             *      toothChart.AddPerioMeasure(i,PerioSequenceType.Bleeding,  3,2,-1,-1,-1,1);
             *      toothChart.AddPerioMeasure(i,PerioSequenceType.GingMargin,0,1,1,1,0,0);
             *      toothChart.AddPerioMeasure(i,PerioSequenceType.Probing,   3,2,3,4,2,3);
             *      toothChart.AddPerioMeasure(i,PerioSequenceType.CAL,       3,3,4,5,2,3);//basically GingMargin+Probing, unless one of them is -1
             *      toothChart.AddPerioMeasure(i,PerioSequenceType.MGJ,       5,5,5,6,6,6);
             * }*/
        }
Example #20
0
		///<summary>Updates one PerioExam 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(PerioExam perioExam,PerioExam oldPerioExam){
			string command="";
			if(perioExam.PatNum != oldPerioExam.PatNum) {
				if(command!=""){ command+=",";}
				command+="PatNum = "+POut.Long(perioExam.PatNum)+"";
			}
			if(perioExam.ExamDate != oldPerioExam.ExamDate) {
				if(command!=""){ command+=",";}
				command+="ExamDate = "+POut.Date(perioExam.ExamDate)+"";
			}
			if(perioExam.ProvNum != oldPerioExam.ProvNum) {
				if(command!=""){ command+=",";}
				command+="ProvNum = "+POut.Long(perioExam.ProvNum)+"";
			}
			if(command==""){
				return;
			}
			command="UPDATE perioexam SET "+command
				+" WHERE PerioExamNum = "+POut.Long(perioExam.PerioExamNum);
			Db.NonQ(command);
		}
Example #21
0
		///<summary>Updates one PerioExam in the database.</summary>
		public static void Update(PerioExam perioExam){
			string command="UPDATE perioexam SET "
				+"PatNum      =  "+POut.Long  (perioExam.PatNum)+", "
				+"ExamDate    =  "+POut.Date  (perioExam.ExamDate)+", "
				+"ProvNum     =  "+POut.Long  (perioExam.ProvNum)+" "
				+"WHERE PerioExamNum = "+POut.Long(perioExam.PerioExamNum);
			Db.NonQ(command);
		}
Example #22
0
 ///<summary>Inserts one PerioExam into the database.  Returns the new priKey.</summary>
 public static long Insert(PerioExam perioExam)
 {
     return(Insert(perioExam, false));
 }