Ejemplo n.º 1
0
        ///<summary>Updates one EhrAmendment in the database.</summary>
        public static void Update(EhrAmendment ehrAmendment)
        {
            string command = "UPDATE ehramendment SET "
                             + "PatNum         =  " + POut.Long(ehrAmendment.PatNum) + ", "
                             + "IsAccepted     =  " + POut.Int((int)ehrAmendment.IsAccepted) + ", "
                             + "Description    =  " + DbHelper.ParamChar + "paramDescription, "
                             + "Source         =  " + POut.Int((int)ehrAmendment.Source) + ", "
                             + "SourceName     =  " + DbHelper.ParamChar + "paramSourceName, "
                             + "FileName       = '" + POut.String(ehrAmendment.FileName) + "', "
                             + "RawBase64      =  " + DbHelper.ParamChar + "paramRawBase64, "
                             + "DateTRequest   =  " + POut.DateT(ehrAmendment.DateTRequest) + ", "
                             + "DateTAcceptDeny=  " + POut.DateT(ehrAmendment.DateTAcceptDeny) + ", "
                             + "DateTAppend    =  " + POut.DateT(ehrAmendment.DateTAppend) + " "
                             + "WHERE EhrAmendmentNum = " + POut.Long(ehrAmendment.EhrAmendmentNum);

            if (ehrAmendment.Description == null)
            {
                ehrAmendment.Description = "";
            }
            OdSqlParameter paramDescription = new OdSqlParameter("paramDescription", OdDbType.Text, POut.StringParam(ehrAmendment.Description));

            if (ehrAmendment.SourceName == null)
            {
                ehrAmendment.SourceName = "";
            }
            OdSqlParameter paramSourceName = new OdSqlParameter("paramSourceName", OdDbType.Text, POut.StringParam(ehrAmendment.SourceName));

            if (ehrAmendment.RawBase64 == null)
            {
                ehrAmendment.RawBase64 = "";
            }
            OdSqlParameter paramRawBase64 = new OdSqlParameter("paramRawBase64", OdDbType.Text, POut.StringParam(ehrAmendment.RawBase64));

            Db.NonQ(command, paramDescription, paramSourceName, paramRawBase64);
        }
Ejemplo n.º 2
0
 ///<summary>Inserts one EhrAmendment into the database.  Returns the new priKey.</summary>
 public static long Insert(EhrAmendment ehrAmendment)
 {
     if (DataConnection.DBtype == DatabaseType.Oracle)
     {
         ehrAmendment.EhrAmendmentNum = DbHelper.GetNextOracleKey("ehramendment", "EhrAmendmentNum");
         int loopcount = 0;
         while (loopcount < 100)
         {
             try {
                 return(Insert(ehrAmendment, true));
             }
             catch (Oracle.DataAccess.Client.OracleException ex) {
                 if (ex.Number == 1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated"))
                 {
                     ehrAmendment.EhrAmendmentNum++;
                     loopcount++;
                 }
                 else
                 {
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else
     {
         return(Insert(ehrAmendment, false));
     }
 }
Ejemplo n.º 3
0
        private void gridMain_CellDoubleClick(object sender, ODGridClickEventArgs e)
        {
            EhrAmendment         ehrAmd  = ListAmendments[e.Row];
            FormEhrAmendmentEdit FormEAE = new FormEhrAmendmentEdit(ehrAmd);

            FormEAE.ShowDialog();
            FillGrid();            //Always have to refresh grid due to using the images module to update the db.
        }
Ejemplo n.º 4
0
        ///<summary>Inserts one EhrAmendment into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(EhrAmendment ehrAmendment, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO ehramendment (";

            if (!useExistingPK && isRandomKeys)
            {
                ehrAmendment.EhrAmendmentNum = ReplicationServers.GetKeyNoCache("ehramendment", "EhrAmendmentNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "EhrAmendmentNum,";
            }
            command += "PatNum,IsAccepted,Description,Source,SourceName,FileName,RawBase64,DateTRequest,DateTAcceptDeny,DateTAppend) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(ehrAmendment.EhrAmendmentNum) + ",";
            }
            command +=
                POut.Long(ehrAmendment.PatNum) + ","
                + POut.Int((int)ehrAmendment.IsAccepted) + ","
                + DbHelper.ParamChar + "paramDescription,"
                + POut.Int((int)ehrAmendment.Source) + ","
                + DbHelper.ParamChar + "paramSourceName,"
                + "'" + POut.String(ehrAmendment.FileName) + "',"
                + DbHelper.ParamChar + "paramRawBase64,"
                + POut.DateT(ehrAmendment.DateTRequest) + ","
                + POut.DateT(ehrAmendment.DateTAcceptDeny) + ","
                + POut.DateT(ehrAmendment.DateTAppend) + ")";
            if (ehrAmendment.Description == null)
            {
                ehrAmendment.Description = "";
            }
            OdSqlParameter paramDescription = new OdSqlParameter("paramDescription", OdDbType.Text, POut.StringParam(ehrAmendment.Description));

            if (ehrAmendment.SourceName == null)
            {
                ehrAmendment.SourceName = "";
            }
            OdSqlParameter paramSourceName = new OdSqlParameter("paramSourceName", OdDbType.Text, POut.StringParam(ehrAmendment.SourceName));

            if (ehrAmendment.RawBase64 == null)
            {
                ehrAmendment.RawBase64 = "";
            }
            OdSqlParameter paramRawBase64 = new OdSqlParameter("paramRawBase64", OdDbType.Text, POut.StringParam(ehrAmendment.RawBase64));

            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command, paramDescription, paramSourceName, paramRawBase64);
            }
            else
            {
                ehrAmendment.EhrAmendmentNum = Db.NonQ(command, true, "EhrAmendmentNum", "ehrAmendment", paramDescription, paramSourceName, paramRawBase64);
            }
            return(ehrAmendment.EhrAmendmentNum);
        }
Ejemplo n.º 5
0
        private void butAdd_Click(object sender, EventArgs e)
        {
            EhrAmendment ehrAmd = new EhrAmendment();

            ehrAmd.PatNum = PatCur.PatNum;
            ehrAmd.IsNew  = true;
            EhrAmendments.Insert(ehrAmd);
            FormEhrAmendmentEdit FormEAE = new FormEhrAmendmentEdit(ehrAmd);

            FormEAE.ShowDialog();
            FillGrid();            //Always have to refresh grid due to using the images module to update the db.
        }
Ejemplo n.º 6
0
 ///<summary>Inserts one EhrAmendment into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(EhrAmendment ehrAmendment)
 {
     if (DataConnection.DBtype == DatabaseType.MySql)
     {
         return(InsertNoCache(ehrAmendment, false));
     }
     else
     {
         if (DataConnection.DBtype == DatabaseType.Oracle)
         {
             ehrAmendment.EhrAmendmentNum = DbHelper.GetNextOracleKey("ehramendment", "EhrAmendmentNum");                  //Cacheless method
         }
         return(InsertNoCache(ehrAmendment, true));
     }
 }
Ejemplo n.º 7
0
        ///<summary>Inserts one EhrAmendment into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(EhrAmendment ehrAmendment, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                ehrAmendment.EhrAmendmentNum = ReplicationServers.GetKey("ehramendment", "EhrAmendmentNum");
            }
            string command = "INSERT INTO ehramendment (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "EhrAmendmentNum,";
            }
            command += "PatNum,IsAccepted,Description,Source,SourceName,FileName,RawBase64,DateTRequest,DateTAcceptDeny,DateTAppend) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(ehrAmendment.EhrAmendmentNum) + ",";
            }
            command +=
                POut.Long(ehrAmendment.PatNum) + ","
                + POut.Int((int)ehrAmendment.IsAccepted) + ","
                + "'" + POut.String(ehrAmendment.Description) + "',"
                + POut.Int((int)ehrAmendment.Source) + ","
                + "'" + POut.String(ehrAmendment.SourceName) + "',"
                + "'" + POut.String(ehrAmendment.FileName) + "',"
                + DbHelper.ParamChar + "paramRawBase64,"
                + POut.DateT(ehrAmendment.DateTRequest) + ","
                + POut.DateT(ehrAmendment.DateTAcceptDeny) + ","
                + POut.DateT(ehrAmendment.DateTAppend) + ")";
            if (ehrAmendment.RawBase64 == null)
            {
                ehrAmendment.RawBase64 = "";
            }
            OdSqlParameter paramRawBase64 = new OdSqlParameter("paramRawBase64", OdDbType.Text, ehrAmendment.RawBase64);

            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command, paramRawBase64);
            }
            else
            {
                ehrAmendment.EhrAmendmentNum = Db.NonQ(command, true, paramRawBase64);
            }
            return(ehrAmendment.EhrAmendmentNum);
        }
Ejemplo n.º 8
0
 ///<summary>Returns true if Update(EhrAmendment,EhrAmendment) 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(EhrAmendment ehrAmendment, EhrAmendment oldEhrAmendment)
 {
     if (ehrAmendment.PatNum != oldEhrAmendment.PatNum)
     {
         return(true);
     }
     if (ehrAmendment.IsAccepted != oldEhrAmendment.IsAccepted)
     {
         return(true);
     }
     if (ehrAmendment.Description != oldEhrAmendment.Description)
     {
         return(true);
     }
     if (ehrAmendment.Source != oldEhrAmendment.Source)
     {
         return(true);
     }
     if (ehrAmendment.SourceName != oldEhrAmendment.SourceName)
     {
         return(true);
     }
     if (ehrAmendment.FileName != oldEhrAmendment.FileName)
     {
         return(true);
     }
     if (ehrAmendment.RawBase64 != oldEhrAmendment.RawBase64)
     {
         return(true);
     }
     if (ehrAmendment.DateTRequest != oldEhrAmendment.DateTRequest)
     {
         return(true);
     }
     if (ehrAmendment.DateTAcceptDeny != oldEhrAmendment.DateTAcceptDeny)
     {
         return(true);
     }
     if (ehrAmendment.DateTAppend != oldEhrAmendment.DateTAppend)
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 9
0
		///<summary>Converts a DataTable to a list of objects.</summary>
		public static List<EhrAmendment> TableToList(DataTable table){
			List<EhrAmendment> retVal=new List<EhrAmendment>();
			EhrAmendment ehrAmendment;
			for(int i=0;i<table.Rows.Count;i++) {
				ehrAmendment=new EhrAmendment();
				ehrAmendment.EhrAmendmentNum= PIn.Long  (table.Rows[i]["EhrAmendmentNum"].ToString());
				ehrAmendment.PatNum         = PIn.Long  (table.Rows[i]["PatNum"].ToString());
				ehrAmendment.IsAccepted     = (OpenDentBusiness.YN)PIn.Int(table.Rows[i]["IsAccepted"].ToString());
				ehrAmendment.Description    = PIn.String(table.Rows[i]["Description"].ToString());
				ehrAmendment.Source         = (OpenDentBusiness.AmendmentSource)PIn.Int(table.Rows[i]["Source"].ToString());
				ehrAmendment.SourceName     = PIn.String(table.Rows[i]["SourceName"].ToString());
				ehrAmendment.FileName       = PIn.String(table.Rows[i]["FileName"].ToString());
				ehrAmendment.RawBase64      = PIn.String(table.Rows[i]["RawBase64"].ToString());
				ehrAmendment.DateTRequest   = PIn.DateT (table.Rows[i]["DateTRequest"].ToString());
				ehrAmendment.DateTAcceptDeny= PIn.DateT (table.Rows[i]["DateTAcceptDeny"].ToString());
				ehrAmendment.DateTAppend    = PIn.DateT (table.Rows[i]["DateTAppend"].ToString());
				retVal.Add(ehrAmendment);
			}
			return retVal;
		}
Ejemplo n.º 10
0
        private void butScan_Click(object sender, EventArgs e)
        {
            FormImages   FormI        = new FormImages();
            EhrAmendment amendmentOld = EhrAmendmentCur;

            FormI.EhrAmendmentCur = EhrAmendmentCur;
            FormI.ShowDialog();
            EhrAmendmentCur = EhrAmendments.GetOne(EhrAmendmentCur.EhrAmendmentNum);
            if (EhrAmendmentCur.FileName != "")
            {
                labelScan.Visible = true;
                butScan.Text      = "View";
                textDateApp.Text  = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString();
            }
            else
            {
                labelScan.Visible = false;
                butScan.Text      = "Scan";
                textDateApp.Text  = "";
            }
        }
Ejemplo n.º 11
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        public static List <EhrAmendment> TableToList(DataTable table)
        {
            List <EhrAmendment> retVal = new List <EhrAmendment>();
            EhrAmendment        ehrAmendment;

            foreach (DataRow row in table.Rows)
            {
                ehrAmendment = new EhrAmendment();
                ehrAmendment.EhrAmendmentNum = PIn.Long(row["EhrAmendmentNum"].ToString());
                ehrAmendment.PatNum          = PIn.Long(row["PatNum"].ToString());
                ehrAmendment.IsAccepted      = (OpenDentBusiness.YN)PIn.Int(row["IsAccepted"].ToString());
                ehrAmendment.Description     = PIn.String(row["Description"].ToString());
                ehrAmendment.Source          = (OpenDentBusiness.AmendmentSource)PIn.Int(row["Source"].ToString());
                ehrAmendment.SourceName      = PIn.String(row["SourceName"].ToString());
                ehrAmendment.FileName        = PIn.String(row["FileName"].ToString());
                ehrAmendment.RawBase64       = PIn.String(row["RawBase64"].ToString());
                ehrAmendment.DateTRequest    = PIn.DateT(row["DateTRequest"].ToString());
                ehrAmendment.DateTAcceptDeny = PIn.DateT(row["DateTAcceptDeny"].ToString());
                ehrAmendment.DateTAppend     = PIn.DateT(row["DateTAppend"].ToString());
                retVal.Add(ehrAmendment);
            }
            return(retVal);
        }
Ejemplo n.º 12
0
        ///<summary>Converts a DataTable to a list of objects.</summary>
        public static List <EhrAmendment> TableToList(DataTable table)
        {
            List <EhrAmendment> retVal = new List <EhrAmendment>();
            EhrAmendment        ehrAmendment;

            for (int i = 0; i < table.Rows.Count; i++)
            {
                ehrAmendment = new EhrAmendment();
                ehrAmendment.EhrAmendmentNum = PIn.Long(table.Rows[i]["EhrAmendmentNum"].ToString());
                ehrAmendment.PatNum          = PIn.Long(table.Rows[i]["PatNum"].ToString());
                ehrAmendment.IsAccepted      = (YN)PIn.Int(table.Rows[i]["IsAccepted"].ToString());
                ehrAmendment.Description     = PIn.String(table.Rows[i]["Description"].ToString());
                ehrAmendment.Source          = (AmendmentSource)PIn.Int(table.Rows[i]["Source"].ToString());
                ehrAmendment.SourceName      = PIn.String(table.Rows[i]["SourceName"].ToString());
                ehrAmendment.FileName        = PIn.String(table.Rows[i]["FileName"].ToString());
                ehrAmendment.RawBase64       = PIn.String(table.Rows[i]["RawBase64"].ToString());
                ehrAmendment.DateTRequest    = PIn.DateT(table.Rows[i]["DateTRequest"].ToString());
                ehrAmendment.DateTAcceptDeny = PIn.DateT(table.Rows[i]["DateTAcceptDeny"].ToString());
                ehrAmendment.DateTAppend     = PIn.DateT(table.Rows[i]["DateTAppend"].ToString());
                retVal.Add(ehrAmendment);
            }
            return(retVal);
        }
Ejemplo n.º 13
0
		///<summary>Inserts one EhrAmendment into the database.  Returns the new priKey.</summary>
		public static long Insert(EhrAmendment ehrAmendment){
			if(DataConnection.DBtype==DatabaseType.Oracle) {
				ehrAmendment.EhrAmendmentNum=DbHelper.GetNextOracleKey("ehramendment","EhrAmendmentNum");
				int loopcount=0;
				while(loopcount<100){
					try {
						return Insert(ehrAmendment,true);
					}
					catch(Oracle.DataAccess.Client.OracleException ex){
						if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
							ehrAmendment.EhrAmendmentNum++;
							loopcount++;
						}
						else{
							throw ex;
						}
					}
				}
				throw new ApplicationException("Insert failed.  Could not generate primary key.");
			}
			else {
				return Insert(ehrAmendment,false);
			}
		}
Ejemplo n.º 14
0
        ///<summary>Updates one EhrAmendment 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(EhrAmendment ehrAmendment, EhrAmendment oldEhrAmendment)
        {
            string command = "";

            if (ehrAmendment.PatNum != oldEhrAmendment.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(ehrAmendment.PatNum) + "";
            }
            if (ehrAmendment.IsAccepted != oldEhrAmendment.IsAccepted)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsAccepted = " + POut.Int((int)ehrAmendment.IsAccepted) + "";
            }
            if (ehrAmendment.Description != oldEhrAmendment.Description)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Description = '" + POut.String(ehrAmendment.Description) + "'";
            }
            if (ehrAmendment.Source != oldEhrAmendment.Source)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Source = " + POut.Int((int)ehrAmendment.Source) + "";
            }
            if (ehrAmendment.SourceName != oldEhrAmendment.SourceName)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SourceName = '" + POut.String(ehrAmendment.SourceName) + "'";
            }
            if (ehrAmendment.FileName != oldEhrAmendment.FileName)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FileName = '" + POut.String(ehrAmendment.FileName) + "'";
            }
            if (ehrAmendment.RawBase64 != oldEhrAmendment.RawBase64)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RawBase64 = " + DbHelper.ParamChar + "paramRawBase64";
            }
            if (ehrAmendment.DateTRequest != oldEhrAmendment.DateTRequest)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTRequest = " + POut.DateT(ehrAmendment.DateTRequest) + "";
            }
            if (ehrAmendment.DateTAcceptDeny != oldEhrAmendment.DateTAcceptDeny)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTAcceptDeny = " + POut.DateT(ehrAmendment.DateTAcceptDeny) + "";
            }
            if (ehrAmendment.DateTAppend != oldEhrAmendment.DateTAppend)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTAppend = " + POut.DateT(ehrAmendment.DateTAppend) + "";
            }
            if (command == "")
            {
                return;
            }
            if (ehrAmendment.RawBase64 == null)
            {
                ehrAmendment.RawBase64 = "";
            }
            OdSqlParameter paramRawBase64 = new OdSqlParameter("paramRawBase64", OdDbType.Text, ehrAmendment.RawBase64);

            command = "UPDATE ehramendment SET " + command
                      + " WHERE EhrAmendmentNum = " + POut.Long(ehrAmendment.EhrAmendmentNum);
            Db.NonQ(command, paramRawBase64);
        }
Ejemplo n.º 15
0
		///<summary>Inserts one EhrAmendment into the database.  Provides option to use the existing priKey.</summary>
		public static long Insert(EhrAmendment ehrAmendment,bool useExistingPK){
			if(!useExistingPK && PrefC.RandomKeys) {
				ehrAmendment.EhrAmendmentNum=ReplicationServers.GetKey("ehramendment","EhrAmendmentNum");
			}
			string command="INSERT INTO ehramendment (";
			if(useExistingPK || PrefC.RandomKeys) {
				command+="EhrAmendmentNum,";
			}
			command+="PatNum,IsAccepted,Description,Source,SourceName,FileName,RawBase64,DateTRequest,DateTAcceptDeny,DateTAppend) VALUES(";
			if(useExistingPK || PrefC.RandomKeys) {
				command+=POut.Long(ehrAmendment.EhrAmendmentNum)+",";
			}
			command+=
				     POut.Long  (ehrAmendment.PatNum)+","
				+    POut.Int   ((int)ehrAmendment.IsAccepted)+","
				+"'"+POut.String(ehrAmendment.Description)+"',"
				+    POut.Int   ((int)ehrAmendment.Source)+","
				+"'"+POut.String(ehrAmendment.SourceName)+"',"
				+"'"+POut.String(ehrAmendment.FileName)+"',"
				+    DbHelper.ParamChar+"paramRawBase64,"
				+    POut.DateT (ehrAmendment.DateTRequest)+","
				+    POut.DateT (ehrAmendment.DateTAcceptDeny)+","
				+    POut.DateT (ehrAmendment.DateTAppend)+")";
			if(ehrAmendment.RawBase64==null) {
				ehrAmendment.RawBase64="";
			}
			OdSqlParameter paramRawBase64=new OdSqlParameter("paramRawBase64",OdDbType.Text,ehrAmendment.RawBase64);
			if(useExistingPK || PrefC.RandomKeys) {
				Db.NonQ(command,paramRawBase64);
			}
			else {
				ehrAmendment.EhrAmendmentNum=Db.NonQ(command,true,paramRawBase64);
			}
			return ehrAmendment.EhrAmendmentNum;
		}
Ejemplo n.º 16
0
		///<summary>Updates one EhrAmendment 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(EhrAmendment ehrAmendment,EhrAmendment oldEhrAmendment){
			string command="";
			if(ehrAmendment.PatNum != oldEhrAmendment.PatNum) {
				if(command!=""){ command+=",";}
				command+="PatNum = "+POut.Long(ehrAmendment.PatNum)+"";
			}
			if(ehrAmendment.IsAccepted != oldEhrAmendment.IsAccepted) {
				if(command!=""){ command+=",";}
				command+="IsAccepted = "+POut.Int   ((int)ehrAmendment.IsAccepted)+"";
			}
			if(ehrAmendment.Description != oldEhrAmendment.Description) {
				if(command!=""){ command+=",";}
				command+="Description = '"+POut.String(ehrAmendment.Description)+"'";
			}
			if(ehrAmendment.Source != oldEhrAmendment.Source) {
				if(command!=""){ command+=",";}
				command+="Source = "+POut.Int   ((int)ehrAmendment.Source)+"";
			}
			if(ehrAmendment.SourceName != oldEhrAmendment.SourceName) {
				if(command!=""){ command+=",";}
				command+="SourceName = '"+POut.String(ehrAmendment.SourceName)+"'";
			}
			if(ehrAmendment.FileName != oldEhrAmendment.FileName) {
				if(command!=""){ command+=",";}
				command+="FileName = '"+POut.String(ehrAmendment.FileName)+"'";
			}
			if(ehrAmendment.RawBase64 != oldEhrAmendment.RawBase64) {
				if(command!=""){ command+=",";}
				command+="RawBase64 = "+DbHelper.ParamChar+"paramRawBase64";
			}
			if(ehrAmendment.DateTRequest != oldEhrAmendment.DateTRequest) {
				if(command!=""){ command+=",";}
				command+="DateTRequest = "+POut.DateT(ehrAmendment.DateTRequest)+"";
			}
			if(ehrAmendment.DateTAcceptDeny != oldEhrAmendment.DateTAcceptDeny) {
				if(command!=""){ command+=",";}
				command+="DateTAcceptDeny = "+POut.DateT(ehrAmendment.DateTAcceptDeny)+"";
			}
			if(ehrAmendment.DateTAppend != oldEhrAmendment.DateTAppend) {
				if(command!=""){ command+=",";}
				command+="DateTAppend = "+POut.DateT(ehrAmendment.DateTAppend)+"";
			}
			if(command==""){
				return false;
			}
			if(ehrAmendment.RawBase64==null) {
				ehrAmendment.RawBase64="";
			}
			OdSqlParameter paramRawBase64=new OdSqlParameter("paramRawBase64",OdDbType.Text,ehrAmendment.RawBase64);
			command="UPDATE ehramendment SET "+command
				+" WHERE EhrAmendmentNum = "+POut.Long(ehrAmendment.EhrAmendmentNum);
			Db.NonQ(command,paramRawBase64);
			return true;
		}
Ejemplo n.º 17
0
		///<summary>Updates one EhrAmendment in the database.</summary>
		public static void Update(EhrAmendment ehrAmendment){
			string command="UPDATE ehramendment SET "
				+"PatNum         =  "+POut.Long  (ehrAmendment.PatNum)+", "
				+"IsAccepted     =  "+POut.Int   ((int)ehrAmendment.IsAccepted)+", "
				+"Description    = '"+POut.String(ehrAmendment.Description)+"', "
				+"Source         =  "+POut.Int   ((int)ehrAmendment.Source)+", "
				+"SourceName     = '"+POut.String(ehrAmendment.SourceName)+"', "
				+"FileName       = '"+POut.String(ehrAmendment.FileName)+"', "
				+"RawBase64      =  "+DbHelper.ParamChar+"paramRawBase64, "
				+"DateTRequest   =  "+POut.DateT (ehrAmendment.DateTRequest)+", "
				+"DateTAcceptDeny=  "+POut.DateT (ehrAmendment.DateTAcceptDeny)+", "
				+"DateTAppend    =  "+POut.DateT (ehrAmendment.DateTAppend)+" "
				+"WHERE EhrAmendmentNum = "+POut.Long(ehrAmendment.EhrAmendmentNum);
			if(ehrAmendment.RawBase64==null) {
				ehrAmendment.RawBase64="";
			}
			OdSqlParameter paramRawBase64=new OdSqlParameter("paramRawBase64",OdDbType.Text,ehrAmendment.RawBase64);
			Db.NonQ(command,paramRawBase64);
		}
Ejemplo n.º 18
0
 public FormEhrAmendmentEdit(EhrAmendment ehrAmdCur)
 {
     InitializeComponent();
     EhrAmendmentCur = ehrAmdCur;
 }
Ejemplo n.º 19
0
 ///<summary>Inserts one EhrAmendment into the database.  Returns the new priKey.  Doesn't use the cache.</summary>
 public static long InsertNoCache(EhrAmendment ehrAmendment)
 {
     return(InsertNoCache(ehrAmendment, false));
 }