Ejemplo n.º 1
0
 ///<summary>Inserts one PatientNote into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(PatientNote patientNote,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         patientNote.PatNum=ReplicationServers.GetKey("patientnote","PatNum");
     }
     string command="INSERT INTO patientnote (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="PatNum,";
     }
     command+="FamFinancial,ApptPhone,Medical,Service,MedicalComp,Treatment) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(patientNote.PatNum)+",";
     }
     command+=
          "'"+POut.String(patientNote.FamFinancial)+"',"
         +"'"+POut.String(patientNote.ApptPhone)+"',"
         +"'"+POut.String(patientNote.Medical)+"',"
         +"'"+POut.String(patientNote.Service)+"',"
         +DbHelper.ParamChar+"paramMedicalComp,"
         +"'"+POut.String(patientNote.Treatment)+"')";
     if(patientNote.MedicalComp==null) {
         patientNote.MedicalComp="";
     }
     OdSqlParameter paramMedicalComp=new OdSqlParameter("paramMedicalComp",OdDbType.Text,patientNote.MedicalComp);
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command,paramMedicalComp);
     }
     else {
         patientNote.PatNum=Db.NonQ(command,true,paramMedicalComp);
     }
     return patientNote.PatNum;
 }
Ejemplo n.º 2
0
 ///<summary>Inserts one UserQuery into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(UserQuery userQuery,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         userQuery.QueryNum=ReplicationServers.GetKey("userquery","QueryNum");
     }
     string command="INSERT INTO userquery (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="QueryNum,";
     }
     command+="Description,FileName,QueryText) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(userQuery.QueryNum)+",";
     }
     command+=
          "'"+POut.String(userQuery.Description)+"',"
         +"'"+POut.String(userQuery.FileName)+"',"
         +DbHelper.ParamChar+"paramQueryText)";
     if(userQuery.QueryText==null) {
         userQuery.QueryText="";
     }
     OdSqlParameter paramQueryText=new OdSqlParameter("paramQueryText",OdDbType.Text,userQuery.QueryText);
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command,paramQueryText);
     }
     else {
         userQuery.QueryNum=Db.NonQ(command,true,paramQueryText);
     }
     return userQuery.QueryNum;
 }
Ejemplo n.º 3
0
 ///<summary>Inserts one SigElementDef into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(SigElementDef sigElementDef,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         sigElementDef.SigElementDefNum=ReplicationServers.GetKey("sigelementdef","SigElementDefNum");
     }
     string command="INSERT INTO sigelementdef (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="SigElementDefNum,";
     }
     command+="LightRow,LightColor,SigElementType,SigText,Sound,ItemOrder) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(sigElementDef.SigElementDefNum)+",";
     }
     command+=
              POut.Byte  (sigElementDef.LightRow)+","
         +    POut.Int   (sigElementDef.LightColor.ToArgb())+","
         +    POut.Int   ((int)sigElementDef.SigElementType)+","
         +"'"+POut.String(sigElementDef.SigText)+"',"
         +DbHelper.ParamChar+"paramSound,"
         +    POut.Int   (sigElementDef.ItemOrder)+")";
     if(sigElementDef.Sound==null) {
         sigElementDef.Sound="";
     }
     OdSqlParameter paramSound=new OdSqlParameter("paramSound",OdDbType.Text,sigElementDef.Sound);
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command,paramSound);
     }
     else {
         sigElementDef.SigElementDefNum=Db.NonQ(command,true,paramSound);
     }
     return sigElementDef.SigElementDefNum;
 }
Ejemplo n.º 4
0
 ///<summary>Inserts one EhrSummaryCcd into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(EhrSummaryCcd ehrSummaryCcd,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         ehrSummaryCcd.EhrSummaryCcdNum=ReplicationServers.GetKey("ehrsummaryccd","EhrSummaryCcdNum");
     }
     string command="INSERT INTO ehrsummaryccd (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="EhrSummaryCcdNum,";
     }
     command+="PatNum,DateSummary,ContentSummary) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(ehrSummaryCcd.EhrSummaryCcdNum)+",";
     }
     command+=
              POut.Long  (ehrSummaryCcd.PatNum)+","
         +    POut.Date  (ehrSummaryCcd.DateSummary)+","
         +DbHelper.ParamChar+"paramContentSummary)";
     if(ehrSummaryCcd.ContentSummary==null) {
         ehrSummaryCcd.ContentSummary="";
     }
     OdSqlParameter paramContentSummary=new OdSqlParameter("paramContentSummary",OdDbType.Text,ehrSummaryCcd.ContentSummary);
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command,paramContentSummary);
     }
     else {
         ehrSummaryCcd.EhrSummaryCcdNum=Db.NonQ(command,true,paramContentSummary);
     }
     return ehrSummaryCcd.EhrSummaryCcdNum;
 }
Ejemplo n.º 5
0
 ///<summary>Inserts one Letter into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(Letter letter,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         letter.LetterNum=ReplicationServers.GetKey("letter","LetterNum");
     }
     string command="INSERT INTO letter (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="LetterNum,";
     }
     command+="Description,BodyText) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(letter.LetterNum)+",";
     }
     command+=
          "'"+POut.String(letter.Description)+"',"
         +DbHelper.ParamChar+"paramBodyText)";
     if(letter.BodyText==null) {
         letter.BodyText="";
     }
     OdSqlParameter paramBodyText=new OdSqlParameter("paramBodyText",OdDbType.Text,letter.BodyText);
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command,paramBodyText);
     }
     else {
         letter.LetterNum=Db.NonQ(command,true,paramBodyText);
     }
     return letter.LetterNum;
 }
Ejemplo n.º 6
0
 ///<summary>Inserts one HL7Msg into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(HL7Msg hL7Msg,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         hL7Msg.HL7MsgNum=ReplicationServers.GetKey("hl7msg","HL7MsgNum");
     }
     string command="INSERT INTO hl7msg (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="HL7MsgNum,";
     }
     command+="HL7Status,MsgText,AptNum) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(hL7Msg.HL7MsgNum)+",";
     }
     command+=
              POut.Int   ((int)hL7Msg.HL7Status)+","
         +DbHelper.ParamChar+"paramMsgText,"
         +    POut.Long  (hL7Msg.AptNum)+")";
     if(hL7Msg.MsgText==null) {
         hL7Msg.MsgText="";
     }
     OdSqlParameter paramMsgText=new OdSqlParameter("paramMsgText",OdDbType.Text,hL7Msg.MsgText);
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command,paramMsgText);
     }
     else {
         hL7Msg.HL7MsgNum=Db.NonQ(command,true,paramMsgText);
     }
     return hL7Msg.HL7MsgNum;
 }
Ejemplo n.º 7
0
 ///<summary>Inserts one LabPanel into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(LabPanel labPanel,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         labPanel.LabPanelNum=ReplicationServers.GetKey("labpanel","LabPanelNum");
     }
     string command="INSERT INTO labpanel (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="LabPanelNum,";
     }
     command+="PatNum,RawMessage,LabNameAddress,SpecimenCondition,SpecimenSource,ServiceId,ServiceName,MedicalOrderNum) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(labPanel.LabPanelNum)+",";
     }
     command+=
              POut.Long  (labPanel.PatNum)+","
         +DbHelper.ParamChar+"paramRawMessage,"
         +"'"+POut.String(labPanel.LabNameAddress)+"',"
         //DateTStamp can only be set by MySQL
         +"'"+POut.String(labPanel.SpecimenCondition)+"',"
         +"'"+POut.String(labPanel.SpecimenSource)+"',"
         +"'"+POut.String(labPanel.ServiceId)+"',"
         +"'"+POut.String(labPanel.ServiceName)+"',"
         +    POut.Long  (labPanel.MedicalOrderNum)+")";
     if(labPanel.RawMessage==null) {
         labPanel.RawMessage="";
     }
     OdSqlParameter paramRawMessage=new OdSqlParameter("paramRawMessage",OdDbType.Text,labPanel.RawMessage);
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command,paramRawMessage);
     }
     else {
         labPanel.LabPanelNum=Db.NonQ(command,true,paramRawMessage);
     }
     return labPanel.LabPanelNum;
 }
Ejemplo n.º 8
0
 ///<summary>Inserts one EtransMessageText into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(EtransMessageText etransMessageText,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         etransMessageText.EtransMessageTextNum=ReplicationServers.GetKey("etransmessagetext","EtransMessageTextNum");
     }
     string command="INSERT INTO etransmessagetext (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="EtransMessageTextNum,";
     }
     command+="MessageText) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(etransMessageText.EtransMessageTextNum)+",";
     }
     command+=
          DbHelper.ParamChar+"paramMessageText)";
     if(etransMessageText.MessageText==null) {
         etransMessageText.MessageText="";
     }
     OdSqlParameter paramMessageText=new OdSqlParameter("paramMessageText",OdDbType.Text,etransMessageText.MessageText);
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command,paramMessageText);
     }
     else {
         etransMessageText.EtransMessageTextNum=Db.NonQ(command,true,paramMessageText);
     }
     return etransMessageText.EtransMessageTextNum;
 }
Ejemplo n.º 9
0
 ///<summary>Inserts one EobAttach into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(EobAttach eobAttach,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         eobAttach.EobAttachNum=ReplicationServers.GetKey("eobattach","EobAttachNum");
     }
     string command="INSERT INTO eobattach (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="EobAttachNum,";
     }
     command+="ClaimPaymentNum,DateTCreated,FileName,RawBase64) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(eobAttach.EobAttachNum)+",";
     }
     command+=
              POut.Long  (eobAttach.ClaimPaymentNum)+","
         +    POut.DateT (eobAttach.DateTCreated)+","
         +"'"+POut.String(eobAttach.FileName)+"',"
         +DbHelper.ParamChar+"paramRawBase64)";
     if(eobAttach.RawBase64==null) {
         eobAttach.RawBase64="";
     }
     OdSqlParameter paramRawBase64=new OdSqlParameter("paramRawBase64",OdDbType.Text,eobAttach.RawBase64);
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command,paramRawBase64);
     }
     else {
         eobAttach.EobAttachNum=Db.NonQ(command,true,paramRawBase64);
     }
     return eobAttach.EobAttachNum;
 }
Ejemplo n.º 10
0
 ///<summary>Inserts one ProcButton into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(ProcButton procButton,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         procButton.ProcButtonNum=ReplicationServers.GetKey("procbutton","ProcButtonNum");
     }
     string command="INSERT INTO procbutton (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="ProcButtonNum,";
     }
     command+="Description,ItemOrder,Category,ButtonImage) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(procButton.ProcButtonNum)+",";
     }
     command+=
          "'"+POut.String(procButton.Description)+"',"
         +    POut.Int   (procButton.ItemOrder)+","
         +    POut.Long  (procButton.Category)+","
         +DbHelper.ParamChar+"paramButtonImage)";
     if(procButton.ButtonImage==null) {
         procButton.ButtonImage="";
     }
     OdSqlParameter paramButtonImage=new OdSqlParameter("paramButtonImage",OdDbType.Text,procButton.ButtonImage);
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command,paramButtonImage);
     }
     else {
         procButton.ProcButtonNum=Db.NonQ(command,true,paramButtonImage);
     }
     return procButton.ProcButtonNum;
 }
Ejemplo n.º 11
0
 ///<summary>Inserts one InsSub into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(InsSub insSub,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         insSub.InsSubNum=ReplicationServers.GetKey("inssub","InsSubNum");
     }
     string command="INSERT INTO inssub (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="InsSubNum,";
     }
     command+="PlanNum,Subscriber,DateEffective,DateTerm,ReleaseInfo,AssignBen,SubscriberID,BenefitNotes,SubscNote) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(insSub.InsSubNum)+",";
     }
     command+=
              POut.Long  (insSub.PlanNum)+","
         +    POut.Long  (insSub.Subscriber)+","
         +    POut.Date  (insSub.DateEffective)+","
         +    POut.Date  (insSub.DateTerm)+","
         +    POut.Bool  (insSub.ReleaseInfo)+","
         +    POut.Bool  (insSub.AssignBen)+","
         +"'"+POut.String(insSub.SubscriberID)+"',"
         +DbHelper.ParamChar+"paramBenefitNotes,"
         +"'"+POut.String(insSub.SubscNote)+"')";
     if(insSub.BenefitNotes==null) {
         insSub.BenefitNotes="";
     }
     OdSqlParameter paramBenefitNotes=new OdSqlParameter("paramBenefitNotes",OdDbType.Text,insSub.BenefitNotes);
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command,paramBenefitNotes);
     }
     else {
         insSub.InsSubNum=Db.NonQ(command,true,paramBenefitNotes);
     }
     return insSub.InsSubNum;
 }
Ejemplo n.º 12
0
 ///<summary>Inserts one ProcNote into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(ProcNote procNote,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         procNote.ProcNoteNum=ReplicationServers.GetKey("procnote","ProcNoteNum");
     }
     string command="INSERT INTO procnote (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="ProcNoteNum,";
     }
     command+="PatNum,ProcNum,EntryDateTime,UserNum,Note,SigIsTopaz,Signature) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(procNote.ProcNoteNum)+",";
     }
     command+=
              POut.Long  (procNote.PatNum)+","
         +    POut.Long  (procNote.ProcNum)+","
         +    DbHelper.Now()+","
         +    POut.Long  (procNote.UserNum)+","
         +DbHelper.ParamChar+"paramNote,"
         +    POut.Bool  (procNote.SigIsTopaz)+","
         +"'"+POut.String(procNote.Signature)+"')";
     if(procNote.Note==null) {
         procNote.Note="";
     }
     OdSqlParameter paramNote=new OdSqlParameter("paramNote",OdDbType.Text,procNote.Note);
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command,paramNote);
     }
     else {
         procNote.ProcNoteNum=Db.NonQ(command,true,paramNote);
     }
     return procNote.ProcNoteNum;
 }
Ejemplo n.º 13
0
		///<summary>Usually set useExistingPK=true.  Inserts one Documentm into the database.</summary>
		internal static long Insert(Documentm documentm,bool useExistingPK){
			if(!useExistingPK) {
				documentm.DocNum=ReplicationServers.GetKey("documentm","DocNum");
			}
			string command="INSERT INTO documentm (";
			command+="DocNum,";
			command+="CustomerNum,PatNum,RawBase64) VALUES(";
			command+=POut.Long(documentm.DocNum)+",";
			command+=
				     POut.Long  (documentm.CustomerNum)+","
				+    POut.Long  (documentm.PatNum)+","
				+DbHelper.ParamChar+"paramRawBase64)";
			if(documentm.RawBase64==null) {
				documentm.RawBase64="";
			}
			OdSqlParameter paramRawBase64=new OdSqlParameter("paramRawBase64",OdDbType.Text,documentm.RawBase64);
			Db.NonQ(command,paramRawBase64);//There is no autoincrement in the mobile server.
			return documentm.DocNum;
		}
Ejemplo n.º 14
0
 ///<summary>Inserts one Payment into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(Payment payment,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         payment.PayNum=ReplicationServers.GetKey("payment","PayNum");
     }
     string command="INSERT INTO payment (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="PayNum,";
     }
     command+="PayType,PayDate,PayAmt,CheckNum,BankBranch,PayNote,IsSplit,PatNum,ClinicNum,DateEntry,DepositNum,Receipt,IsRecurringCC) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(payment.PayNum)+",";
     }
     command+=
              POut.Long  (payment.PayType)+","
         +    POut.Date  (payment.PayDate)+","
         +"'"+POut.Double(payment.PayAmt)+"',"
         +"'"+POut.String(payment.CheckNum)+"',"
         +"'"+POut.String(payment.BankBranch)+"',"
         +"'"+POut.String(payment.PayNote)+"',"
         +    POut.Bool  (payment.IsSplit)+","
         +    POut.Long  (payment.PatNum)+","
         +    POut.Long  (payment.ClinicNum)+","
         +    DbHelper.Now()+","
         +    POut.Long  (payment.DepositNum)+","
         +DbHelper.ParamChar+"paramReceipt,"
         +    POut.Bool  (payment.IsRecurringCC)+")";
     if(payment.Receipt==null) {
         payment.Receipt="";
     }
     OdSqlParameter paramReceipt=new OdSqlParameter("paramReceipt",OdDbType.Text,payment.Receipt);
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command,paramReceipt);
     }
     else {
         payment.PayNum=Db.NonQ(command,true,paramReceipt);
     }
     return payment.PayNum;
 }
Ejemplo n.º 15
0
 ///<summary>Inserts one Task into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(Task task,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         task.TaskNum=ReplicationServers.GetKey("task","TaskNum");
     }
     string command="INSERT INTO task (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="TaskNum,";
     }
     command+="TaskListNum,DateTask,KeyNum,Descript,TaskStatus,IsRepeating,DateType,FromNum,ObjectType,DateTimeEntry,UserNum,DateTimeFinished) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(task.TaskNum)+",";
     }
     command+=
              POut.Long  (task.TaskListNum)+","
         +    POut.Date  (task.DateTask)+","
         +    POut.Long  (task.KeyNum)+","
         +DbHelper.ParamChar+"paramDescript,"
         +    POut.Int   ((int)task.TaskStatus)+","
         +    POut.Bool  (task.IsRepeating)+","
         +    POut.Int   ((int)task.DateType)+","
         +    POut.Long  (task.FromNum)+","
         +    POut.Int   ((int)task.ObjectType)+","
         +    POut.DateT (task.DateTimeEntry)+","
         +    POut.Long  (task.UserNum)+","
         +    POut.DateT (task.DateTimeFinished)+")";
     if(task.Descript==null) {
         task.Descript="";
     }
     OdSqlParameter paramDescript=new OdSqlParameter("paramDescript",OdDbType.Text,task.Descript);
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command,paramDescript);
     }
     else {
         task.TaskNum=Db.NonQ(command,true,paramDescript);
     }
     return task.TaskNum;
 }
Ejemplo n.º 16
0
        ///<summary>Updates one AsapComm 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(AsapComm asapComm, AsapComm oldAsapComm)
        {
            string command = "";

            if (asapComm.FKey != oldAsapComm.FKey)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FKey = " + POut.Long(asapComm.FKey) + "";
            }
            if (asapComm.FKeyType != oldAsapComm.FKeyType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FKeyType = " + POut.Int((int)asapComm.FKeyType) + "";
            }
            if (asapComm.ScheduleNum != oldAsapComm.ScheduleNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ScheduleNum = " + POut.Long(asapComm.ScheduleNum) + "";
            }
            if (asapComm.PatNum != oldAsapComm.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(asapComm.PatNum) + "";
            }
            if (asapComm.ClinicNum != oldAsapComm.ClinicNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ClinicNum = " + POut.Long(asapComm.ClinicNum) + "";
            }
            if (asapComm.ShortGUID != oldAsapComm.ShortGUID)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ShortGUID = '" + POut.String(asapComm.ShortGUID) + "'";
            }
            //DateTimeEntry not allowed to change
            if (asapComm.DateTimeExpire != oldAsapComm.DateTimeExpire)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeExpire = " + POut.DateT(asapComm.DateTimeExpire) + "";
            }
            if (asapComm.DateTimeSmsScheduled != oldAsapComm.DateTimeSmsScheduled)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeSmsScheduled = " + POut.DateT(asapComm.DateTimeSmsScheduled) + "";
            }
            if (asapComm.SmsSendStatus != oldAsapComm.SmsSendStatus)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SmsSendStatus = " + POut.Int((int)asapComm.SmsSendStatus) + "";
            }
            if (asapComm.EmailSendStatus != oldAsapComm.EmailSendStatus)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "EmailSendStatus = " + POut.Int((int)asapComm.EmailSendStatus) + "";
            }
            if (asapComm.DateTimeSmsSent != oldAsapComm.DateTimeSmsSent)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeSmsSent = " + POut.DateT(asapComm.DateTimeSmsSent) + "";
            }
            if (asapComm.DateTimeEmailSent != oldAsapComm.DateTimeEmailSent)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeEmailSent = " + POut.DateT(asapComm.DateTimeEmailSent) + "";
            }
            if (asapComm.EmailMessageNum != oldAsapComm.EmailMessageNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "EmailMessageNum = " + POut.Long(asapComm.EmailMessageNum) + "";
            }
            if (asapComm.ResponseStatus != oldAsapComm.ResponseStatus)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ResponseStatus = " + POut.Int((int)asapComm.ResponseStatus) + "";
            }
            if (asapComm.DateTimeOrig != oldAsapComm.DateTimeOrig)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeOrig = " + POut.DateT(asapComm.DateTimeOrig) + "";
            }
            if (asapComm.TemplateText != oldAsapComm.TemplateText)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TemplateText = " + DbHelper.ParamChar + "paramTemplateText";
            }
            if (asapComm.TemplateEmail != oldAsapComm.TemplateEmail)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TemplateEmail = " + DbHelper.ParamChar + "paramTemplateEmail";
            }
            if (asapComm.TemplateEmailSubj != oldAsapComm.TemplateEmailSubj)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TemplateEmailSubj = '" + POut.String(asapComm.TemplateEmailSubj) + "'";
            }
            if (asapComm.Note != oldAsapComm.Note)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Note = " + DbHelper.ParamChar + "paramNote";
            }
            if (asapComm.GuidMessageToMobile != oldAsapComm.GuidMessageToMobile)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "GuidMessageToMobile = " + DbHelper.ParamChar + "paramGuidMessageToMobile";
            }
            if (command == "")
            {
                return(false);
            }
            if (asapComm.TemplateText == null)
            {
                asapComm.TemplateText = "";
            }
            OdSqlParameter paramTemplateText = new OdSqlParameter("paramTemplateText", OdDbType.Text, POut.StringParam(asapComm.TemplateText));

            if (asapComm.TemplateEmail == null)
            {
                asapComm.TemplateEmail = "";
            }
            OdSqlParameter paramTemplateEmail = new OdSqlParameter("paramTemplateEmail", OdDbType.Text, POut.StringParam(asapComm.TemplateEmail));

            if (asapComm.Note == null)
            {
                asapComm.Note = "";
            }
            OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(asapComm.Note));

            if (asapComm.GuidMessageToMobile == null)
            {
                asapComm.GuidMessageToMobile = "";
            }
            OdSqlParameter paramGuidMessageToMobile = new OdSqlParameter("paramGuidMessageToMobile", OdDbType.Text, POut.StringParam(asapComm.GuidMessageToMobile));

            command = "UPDATE asapcomm SET " + command
                      + " WHERE AsapCommNum = " + POut.Long(asapComm.AsapCommNum);
            Db.NonQ(command, paramTemplateText, paramTemplateEmail, paramNote, paramGuidMessageToMobile);
            return(true);
        }
Ejemplo n.º 17
0
		///<summary>Inserts one ErxLog into the database.  Provides option to use the existing priKey.</summary>
		public static long Insert(ErxLog erxLog,bool useExistingPK){
			if(!useExistingPK && PrefC.RandomKeys) {
				erxLog.ErxLogNum=ReplicationServers.GetKey("erxlog","ErxLogNum");
			}
			string command="INSERT INTO erxlog (";
			if(useExistingPK || PrefC.RandomKeys) {
				command+="ErxLogNum,";
			}
			command+="PatNum,MsgText,ProvNum) VALUES(";
			if(useExistingPK || PrefC.RandomKeys) {
				command+=POut.Long(erxLog.ErxLogNum)+",";
			}
			command+=
				     POut.Long  (erxLog.PatNum)+","
				+    DbHelper.ParamChar+"paramMsgText,"
				//DateTStamp can only be set by MySQL
				+    POut.Long  (erxLog.ProvNum)+")";
			if(erxLog.MsgText==null) {
				erxLog.MsgText="";
			}
			OdSqlParameter paramMsgText=new OdSqlParameter("paramMsgText",OdDbType.Text,erxLog.MsgText);
			if(useExistingPK || PrefC.RandomKeys) {
				Db.NonQ(command,paramMsgText);
			}
			else {
				erxLog.ErxLogNum=Db.NonQ(command,true,paramMsgText);
			}
			return erxLog.ErxLogNum;
		}
Ejemplo n.º 18
0
        ///<summary>Updates one ProcedureCode 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(ProcedureCode procedureCode, ProcedureCode oldProcedureCode)
        {
            string command = "";

            //ProcCode excluded from update
            if (procedureCode.Descript != oldProcedureCode.Descript)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Descript = '" + POut.String(procedureCode.Descript) + "'";
            }
            if (procedureCode.AbbrDesc != oldProcedureCode.AbbrDesc)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "AbbrDesc = '" + POut.String(procedureCode.AbbrDesc) + "'";
            }
            if (procedureCode.ProcTime != oldProcedureCode.ProcTime)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ProcTime = '" + POut.String(procedureCode.ProcTime) + "'";
            }
            if (procedureCode.ProcCat != oldProcedureCode.ProcCat)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ProcCat = " + POut.Long(procedureCode.ProcCat) + "";
            }
            if (procedureCode.TreatArea != oldProcedureCode.TreatArea)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TreatArea = " + POut.Int((int)procedureCode.TreatArea) + "";
            }
            if (procedureCode.NoBillIns != oldProcedureCode.NoBillIns)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "NoBillIns = " + POut.Bool(procedureCode.NoBillIns) + "";
            }
            if (procedureCode.IsProsth != oldProcedureCode.IsProsth)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsProsth = " + POut.Bool(procedureCode.IsProsth) + "";
            }
            if (procedureCode.DefaultNote != oldProcedureCode.DefaultNote)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DefaultNote = " + DbHelper.ParamChar + "paramDefaultNote";
            }
            if (procedureCode.IsHygiene != oldProcedureCode.IsHygiene)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsHygiene = " + POut.Bool(procedureCode.IsHygiene) + "";
            }
            if (procedureCode.GTypeNum != oldProcedureCode.GTypeNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "GTypeNum = " + POut.Int(procedureCode.GTypeNum) + "";
            }
            if (procedureCode.AlternateCode1 != oldProcedureCode.AlternateCode1)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "AlternateCode1 = '" + POut.String(procedureCode.AlternateCode1) + "'";
            }
            if (procedureCode.MedicalCode != oldProcedureCode.MedicalCode)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "MedicalCode = '" + POut.String(procedureCode.MedicalCode) + "'";
            }
            if (procedureCode.IsTaxed != oldProcedureCode.IsTaxed)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsTaxed = " + POut.Bool(procedureCode.IsTaxed) + "";
            }
            if (procedureCode.PaintType != oldProcedureCode.PaintType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PaintType = " + POut.Int((int)procedureCode.PaintType) + "";
            }
            if (procedureCode.GraphicColor != oldProcedureCode.GraphicColor)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "GraphicColor = " + POut.Int(procedureCode.GraphicColor.ToArgb()) + "";
            }
            if (procedureCode.LaymanTerm != oldProcedureCode.LaymanTerm)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "LaymanTerm = '" + POut.String(procedureCode.LaymanTerm) + "'";
            }
            if (procedureCode.IsCanadianLab != oldProcedureCode.IsCanadianLab)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsCanadianLab = " + POut.Bool(procedureCode.IsCanadianLab) + "";
            }
            if (procedureCode.PreExisting != oldProcedureCode.PreExisting)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PreExisting = " + POut.Bool(procedureCode.PreExisting) + "";
            }
            if (procedureCode.BaseUnits != oldProcedureCode.BaseUnits)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "BaseUnits = " + POut.Int(procedureCode.BaseUnits) + "";
            }
            if (procedureCode.SubstitutionCode != oldProcedureCode.SubstitutionCode)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SubstitutionCode = '" + POut.String(procedureCode.SubstitutionCode) + "'";
            }
            if (procedureCode.SubstOnlyIf != oldProcedureCode.SubstOnlyIf)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SubstOnlyIf = " + POut.Int((int)procedureCode.SubstOnlyIf) + "";
            }
            //DateTStamp can only be set by MySQL
            if (procedureCode.IsMultiVisit != oldProcedureCode.IsMultiVisit)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsMultiVisit = " + POut.Bool(procedureCode.IsMultiVisit) + "";
            }
            if (procedureCode.DrugNDC != oldProcedureCode.DrugNDC)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DrugNDC = '" + POut.String(procedureCode.DrugNDC) + "'";
            }
            if (procedureCode.RevenueCodeDefault != oldProcedureCode.RevenueCodeDefault)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RevenueCodeDefault = '" + POut.String(procedureCode.RevenueCodeDefault) + "'";
            }
            if (procedureCode.ProvNumDefault != oldProcedureCode.ProvNumDefault)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ProvNumDefault = " + POut.Long(procedureCode.ProvNumDefault) + "";
            }
            if (procedureCode.CanadaTimeUnits != oldProcedureCode.CanadaTimeUnits)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CanadaTimeUnits = '" + POut.Double(procedureCode.CanadaTimeUnits) + "'";
            }
            if (procedureCode.IsRadiology != oldProcedureCode.IsRadiology)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsRadiology = " + POut.Bool(procedureCode.IsRadiology) + "";
            }
            if (procedureCode.DefaultClaimNote != oldProcedureCode.DefaultClaimNote)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DefaultClaimNote = " + DbHelper.ParamChar + "paramDefaultClaimNote";
            }
            if (procedureCode.DefaultTPNote != oldProcedureCode.DefaultTPNote)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DefaultTPNote = " + DbHelper.ParamChar + "paramDefaultTPNote";
            }
            if (procedureCode.BypassGlobalLock != oldProcedureCode.BypassGlobalLock)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "BypassGlobalLock = " + POut.Int((int)procedureCode.BypassGlobalLock) + "";
            }
            if (command == "")
            {
                return(false);
            }
            if (procedureCode.DefaultNote == null)
            {
                procedureCode.DefaultNote = "";
            }
            OdSqlParameter paramDefaultNote = new OdSqlParameter("paramDefaultNote", OdDbType.Text, POut.StringParam(procedureCode.DefaultNote));

            if (procedureCode.DefaultClaimNote == null)
            {
                procedureCode.DefaultClaimNote = "";
            }
            OdSqlParameter paramDefaultClaimNote = new OdSqlParameter("paramDefaultClaimNote", OdDbType.Text, POut.StringParam(procedureCode.DefaultClaimNote));

            if (procedureCode.DefaultTPNote == null)
            {
                procedureCode.DefaultTPNote = "";
            }
            OdSqlParameter paramDefaultTPNote = new OdSqlParameter("paramDefaultTPNote", OdDbType.Text, POut.StringParam(procedureCode.DefaultTPNote));

            command = "UPDATE procedurecode SET " + command
                      + " WHERE CodeNum = " + POut.Long(procedureCode.CodeNum);
            Db.NonQ(command, paramDefaultNote, paramDefaultClaimNote, paramDefaultTPNote);
            return(true);
        }
Ejemplo n.º 19
0
        ///<summary>Updates one EmailMessage 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(EmailMessage emailMessage, EmailMessage oldEmailMessage)
        {
            string command = "";

            if (emailMessage.PatNum != oldEmailMessage.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(emailMessage.PatNum) + "";
            }
            if (emailMessage.ToAddress != oldEmailMessage.ToAddress)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ToAddress = " + DbHelper.ParamChar + "paramToAddress";
            }
            if (emailMessage.FromAddress != oldEmailMessage.FromAddress)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FromAddress = " + DbHelper.ParamChar + "paramFromAddress";
            }
            if (emailMessage.Subject != oldEmailMessage.Subject)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Subject = " + DbHelper.ParamChar + "paramSubject";
            }
            if (emailMessage.BodyText != oldEmailMessage.BodyText)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "BodyText = " + DbHelper.ParamChar + "paramBodyText";
            }
            if (emailMessage.MsgDateTime != oldEmailMessage.MsgDateTime)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "MsgDateTime = " + POut.DateT(emailMessage.MsgDateTime) + "";
            }
            if (emailMessage.SentOrReceived != oldEmailMessage.SentOrReceived)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SentOrReceived = " + POut.Int((int)emailMessage.SentOrReceived) + "";
            }
            if (emailMessage.RecipientAddress != oldEmailMessage.RecipientAddress)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RecipientAddress = '" + POut.String(emailMessage.RecipientAddress) + "'";
            }
            if (emailMessage.RawEmailIn != oldEmailMessage.RawEmailIn)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RawEmailIn = " + DbHelper.ParamChar + "paramRawEmailIn";
            }
            if (emailMessage.ProvNumWebMail != oldEmailMessage.ProvNumWebMail)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ProvNumWebMail = " + POut.Long(emailMessage.ProvNumWebMail) + "";
            }
            if (emailMessage.PatNumSubj != oldEmailMessage.PatNumSubj)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNumSubj = " + POut.Long(emailMessage.PatNumSubj) + "";
            }
            if (emailMessage.CcAddress != oldEmailMessage.CcAddress)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CcAddress = " + DbHelper.ParamChar + "paramCcAddress";
            }
            if (emailMessage.BccAddress != oldEmailMessage.BccAddress)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "BccAddress = " + DbHelper.ParamChar + "paramBccAddress";
            }
            if (emailMessage.HideIn != oldEmailMessage.HideIn)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "HideIn = " + POut.Int((int)emailMessage.HideIn) + "";
            }
            if (emailMessage.AptNum != oldEmailMessage.AptNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "AptNum = " + POut.Long(emailMessage.AptNum) + "";
            }
            if (emailMessage.UserNum != oldEmailMessage.UserNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNum = " + POut.Long(emailMessage.UserNum) + "";
            }
            if (emailMessage.HtmlType != oldEmailMessage.HtmlType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "HtmlType = " + POut.Int((int)emailMessage.HtmlType) + "";
            }
            if (command == "")
            {
                return(false);
            }
            if (emailMessage.ToAddress == null)
            {
                emailMessage.ToAddress = "";
            }
            OdSqlParameter paramToAddress = new OdSqlParameter("paramToAddress", OdDbType.Text, POut.StringParam(emailMessage.ToAddress));

            if (emailMessage.FromAddress == null)
            {
                emailMessage.FromAddress = "";
            }
            OdSqlParameter paramFromAddress = new OdSqlParameter("paramFromAddress", OdDbType.Text, POut.StringParam(emailMessage.FromAddress));

            if (emailMessage.Subject == null)
            {
                emailMessage.Subject = "";
            }
            OdSqlParameter paramSubject = new OdSqlParameter("paramSubject", OdDbType.Text, POut.StringParam(emailMessage.Subject));

            if (emailMessage.BodyText == null)
            {
                emailMessage.BodyText = "";
            }
            OdSqlParameter paramBodyText = new OdSqlParameter("paramBodyText", OdDbType.Text, POut.StringParam(emailMessage.BodyText));

            if (emailMessage.RawEmailIn == null)
            {
                emailMessage.RawEmailIn = "";
            }
            OdSqlParameter paramRawEmailIn = new OdSqlParameter("paramRawEmailIn", OdDbType.Text, POut.StringParam(emailMessage.RawEmailIn));

            if (emailMessage.CcAddress == null)
            {
                emailMessage.CcAddress = "";
            }
            OdSqlParameter paramCcAddress = new OdSqlParameter("paramCcAddress", OdDbType.Text, POut.StringParam(emailMessage.CcAddress));

            if (emailMessage.BccAddress == null)
            {
                emailMessage.BccAddress = "";
            }
            OdSqlParameter paramBccAddress = new OdSqlParameter("paramBccAddress", OdDbType.Text, POut.StringParam(emailMessage.BccAddress));

            command = "UPDATE emailmessage SET " + command
                      + " WHERE EmailMessageNum = " + POut.Long(emailMessage.EmailMessageNum);
            Db.NonQ(command, paramToAddress, paramFromAddress, paramSubject, paramBodyText, paramRawEmailIn, paramCcAddress, paramBccAddress);
            return(true);
        }
Ejemplo n.º 20
0
        ///<summary>Updates one SmsToMobile 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(SmsToMobile smsToMobile, SmsToMobile oldSmsToMobile)
        {
            string command = "";

            if (smsToMobile.PatNum != oldSmsToMobile.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(smsToMobile.PatNum) + "";
            }
            if (smsToMobile.GuidMessage != oldSmsToMobile.GuidMessage)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "GuidMessage = '" + POut.String(smsToMobile.GuidMessage) + "'";
            }
            if (smsToMobile.GuidBatch != oldSmsToMobile.GuidBatch)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "GuidBatch = '" + POut.String(smsToMobile.GuidBatch) + "'";
            }
            if (smsToMobile.SmsPhoneNumber != oldSmsToMobile.SmsPhoneNumber)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SmsPhoneNumber = '" + POut.String(smsToMobile.SmsPhoneNumber) + "'";
            }
            if (smsToMobile.MobilePhoneNumber != oldSmsToMobile.MobilePhoneNumber)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "MobilePhoneNumber = '" + POut.String(smsToMobile.MobilePhoneNumber) + "'";
            }
            if (smsToMobile.IsTimeSensitive != oldSmsToMobile.IsTimeSensitive)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsTimeSensitive = " + POut.Bool(smsToMobile.IsTimeSensitive) + "";
            }
            if (smsToMobile.MsgType != oldSmsToMobile.MsgType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "MsgType = " + POut.Int((int)smsToMobile.MsgType) + "";
            }
            if (smsToMobile.MsgText != oldSmsToMobile.MsgText)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "MsgText = " + DbHelper.ParamChar + "paramMsgText";
            }
            if (smsToMobile.SmsStatus != oldSmsToMobile.SmsStatus)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SmsStatus = " + POut.Int((int)smsToMobile.SmsStatus) + "";
            }
            if (smsToMobile.MsgParts != oldSmsToMobile.MsgParts)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "MsgParts = " + POut.Int(smsToMobile.MsgParts) + "";
            }
            if (smsToMobile.MsgChargeUSD != oldSmsToMobile.MsgChargeUSD)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "MsgChargeUSD = " + POut.Float(smsToMobile.MsgChargeUSD) + "";
            }
            if (smsToMobile.ClinicNum != oldSmsToMobile.ClinicNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ClinicNum = " + POut.Long(smsToMobile.ClinicNum) + "";
            }
            if (smsToMobile.CustErrorText != oldSmsToMobile.CustErrorText)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CustErrorText = '" + POut.String(smsToMobile.CustErrorText) + "'";
            }
            if (smsToMobile.DateTimeSent != oldSmsToMobile.DateTimeSent)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeSent = " + POut.DateT(smsToMobile.DateTimeSent) + "";
            }
            if (smsToMobile.DateTimeTerminated != oldSmsToMobile.DateTimeTerminated)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeTerminated = " + POut.DateT(smsToMobile.DateTimeTerminated) + "";
            }
            if (smsToMobile.IsHidden != oldSmsToMobile.IsHidden)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsHidden = " + POut.Bool(smsToMobile.IsHidden) + "";
            }
            if (smsToMobile.MsgDiscountUSD != oldSmsToMobile.MsgDiscountUSD)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "MsgDiscountUSD = " + POut.Float(smsToMobile.MsgDiscountUSD) + "";
            }
            //SecDateTEdit can only be set by MySQL
            if (command == "")
            {
                return(false);
            }
            if (smsToMobile.MsgText == null)
            {
                smsToMobile.MsgText = "";
            }
            OdSqlParameter paramMsgText = new OdSqlParameter("paramMsgText", OdDbType.Text, POut.StringNote(smsToMobile.MsgText));

            command = "UPDATE smstomobile SET " + command
                      + " WHERE SmsToMobileNum = " + POut.Long(smsToMobile.SmsToMobileNum);
            Db.NonQ(command, paramMsgText);
            return(true);
        }
Ejemplo n.º 21
0
        ///<summary>Inserts one Document into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(Document document, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                document.DocNum = ReplicationServers.GetKey("document", "DocNum");
            }
            string command = "INSERT INTO document (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "DocNum,";
            }
            command += "Description,DateCreated,DocCategory,PatNum,FileName,ImgType,IsFlipped,DegreesRotated,ToothNumbers,Note,SigIsTopaz,Signature,CropX,CropY,CropW,CropH,WindowingMin,WindowingMax,MountItemNum,RawBase64,Thumbnail,ExternalGUID,ExternalSource) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(document.DocNum) + ",";
            }
            command +=
                "'" + POut.String(document.Description) + "',"
                + POut.DateT(document.DateCreated) + ","
                + POut.Long(document.DocCategory) + ","
                + POut.Long(document.PatNum) + ","
                + "'" + POut.String(document.FileName) + "',"
                + POut.Int((int)document.ImgType) + ","
                + POut.Bool(document.IsFlipped) + ","
                + POut.Int(document.DegreesRotated) + ","
                + "'" + POut.String(document.ToothNumbers) + "',"
                + DbHelper.ParamChar + "paramNote,"
                + POut.Bool(document.SigIsTopaz) + ","
                + DbHelper.ParamChar + "paramSignature,"
                + POut.Int(document.CropX) + ","
                + POut.Int(document.CropY) + ","
                + POut.Int(document.CropW) + ","
                + POut.Int(document.CropH) + ","
                + POut.Int(document.WindowingMin) + ","
                + POut.Int(document.WindowingMax) + ","
                + POut.Long(document.MountItemNum) + ","
                //DateTStamp can only be set by MySQL
                + DbHelper.ParamChar + "paramRawBase64,"
                + DbHelper.ParamChar + "paramThumbnail,"
                + "'" + POut.String(document.ExternalGUID) + "',"
                + "'" + POut.String(document.ExternalSource.ToString()) + "')";
            if (document.Note == null)
            {
                document.Note = "";
            }
            OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(document.Note));

            if (document.Signature == null)
            {
                document.Signature = "";
            }
            OdSqlParameter paramSignature = new OdSqlParameter("paramSignature", OdDbType.Text, POut.StringParam(document.Signature));

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

            if (document.Thumbnail == null)
            {
                document.Thumbnail = "";
            }
            OdSqlParameter paramThumbnail = new OdSqlParameter("paramThumbnail", OdDbType.Text, POut.StringParam(document.Thumbnail));

            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command, paramNote, paramSignature, paramRawBase64, paramThumbnail);
            }
            else
            {
                document.DocNum = Db.NonQ(command, true, "DocNum", "document", paramNote, paramSignature, paramRawBase64, paramThumbnail);
            }
            return(document.DocNum);
        }
Ejemplo n.º 22
0
        ///<summary>Updates one Supplier 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(Supplier supplier, Supplier oldSupplier)
        {
            string command = "";

            if (supplier.Name != oldSupplier.Name)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Name = '" + POut.String(supplier.Name) + "'";
            }
            if (supplier.Phone != oldSupplier.Phone)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Phone = '" + POut.String(supplier.Phone) + "'";
            }
            if (supplier.CustomerId != oldSupplier.CustomerId)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CustomerId = '" + POut.String(supplier.CustomerId) + "'";
            }
            if (supplier.Website != oldSupplier.Website)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Website = " + DbHelper.ParamChar + "paramWebsite";
            }
            if (supplier.UserName != oldSupplier.UserName)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserName = '******'";
            }
            if (supplier.Password != oldSupplier.Password)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Password = '******'";
            }
            if (supplier.Note != oldSupplier.Note)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Note = " + DbHelper.ParamChar + "paramNote";
            }
            if (command == "")
            {
                return(false);
            }
            if (supplier.Website == null)
            {
                supplier.Website = "";
            }
            OdSqlParameter paramWebsite = new OdSqlParameter("paramWebsite", OdDbType.Text, POut.StringParam(supplier.Website));

            if (supplier.Note == null)
            {
                supplier.Note = "";
            }
            OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(supplier.Note));

            command = "UPDATE supplier SET " + command
                      + " WHERE SupplierNum = " + POut.Long(supplier.SupplierNum);
            Db.NonQ(command, paramWebsite, paramNote);
            return(true);
        }
Ejemplo n.º 23
0
		///<summary>Updates one Commlog 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(Commlog commlog,Commlog oldCommlog){
			string command="";
			if(commlog.PatNum != oldCommlog.PatNum) {
				if(command!=""){ command+=",";}
				command+="PatNum = "+POut.Long(commlog.PatNum)+"";
			}
			if(commlog.CommDateTime != oldCommlog.CommDateTime) {
				if(command!=""){ command+=",";}
				command+="CommDateTime = "+POut.DateT(commlog.CommDateTime)+"";
			}
			if(commlog.CommType != oldCommlog.CommType) {
				if(command!=""){ command+=",";}
				command+="CommType = "+POut.Long(commlog.CommType)+"";
			}
			if(commlog.Note != oldCommlog.Note) {
				if(command!=""){ command+=",";}
				command+="Note = "+DbHelper.ParamChar+"paramNote";
			}
			if(commlog.Mode_ != oldCommlog.Mode_) {
				if(command!=""){ command+=",";}
				command+="Mode_ = "+POut.Int   ((int)commlog.Mode_)+"";
			}
			if(commlog.SentOrReceived != oldCommlog.SentOrReceived) {
				if(command!=""){ command+=",";}
				command+="SentOrReceived = "+POut.Int   ((int)commlog.SentOrReceived)+"";
			}
			if(commlog.UserNum != oldCommlog.UserNum) {
				if(command!=""){ command+=",";}
				command+="UserNum = "+POut.Long(commlog.UserNum)+"";
			}
			if(commlog.Signature != oldCommlog.Signature) {
				if(command!=""){ command+=",";}
				command+="Signature = '"+POut.String(commlog.Signature)+"'";
			}
			if(commlog.SigIsTopaz != oldCommlog.SigIsTopaz) {
				if(command!=""){ command+=",";}
				command+="SigIsTopaz = "+POut.Bool(commlog.SigIsTopaz)+"";
			}
			//DateTStamp can only be set by MySQL
			if(commlog.DateTimeEnd != oldCommlog.DateTimeEnd) {
				if(command!=""){ command+=",";}
				command+="DateTimeEnd = "+POut.DateT(commlog.DateTimeEnd)+"";
			}
			if(commlog.IsWebSched != oldCommlog.IsWebSched) {
				if(command!=""){ command+=",";}
				command+="IsWebSched = "+POut.Bool(commlog.IsWebSched)+"";
			}
			if(command==""){
				return false;
			}
			if(commlog.Note==null) {
				commlog.Note="";
			}
			OdSqlParameter paramNote=new OdSqlParameter("paramNote",OdDbType.Text,POut.StringNote(commlog.Note));
			command="UPDATE commlog SET "+command
				+" WHERE CommlogNum = "+POut.Long(commlog.CommlogNum);
			Db.NonQ(command,paramNote);
			return true;
		}
Ejemplo n.º 24
0
        ///<summary>Updates one VaccinePat 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(VaccinePat vaccinePat, VaccinePat oldVaccinePat)
        {
            string command = "";

            if (vaccinePat.VaccineDefNum != oldVaccinePat.VaccineDefNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "VaccineDefNum = " + POut.Long(vaccinePat.VaccineDefNum) + "";
            }
            if (vaccinePat.DateTimeStart != oldVaccinePat.DateTimeStart)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeStart = " + POut.DateT(vaccinePat.DateTimeStart) + "";
            }
            if (vaccinePat.DateTimeEnd != oldVaccinePat.DateTimeEnd)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeEnd = " + POut.DateT(vaccinePat.DateTimeEnd) + "";
            }
            if (vaccinePat.AdministeredAmt != oldVaccinePat.AdministeredAmt)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "AdministeredAmt = " + POut.Float(vaccinePat.AdministeredAmt) + "";
            }
            if (vaccinePat.DrugUnitNum != oldVaccinePat.DrugUnitNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DrugUnitNum = " + POut.Long(vaccinePat.DrugUnitNum) + "";
            }
            if (vaccinePat.LotNumber != oldVaccinePat.LotNumber)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "LotNumber = '" + POut.String(vaccinePat.LotNumber) + "'";
            }
            if (vaccinePat.PatNum != oldVaccinePat.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(vaccinePat.PatNum) + "";
            }
            if (vaccinePat.Note != oldVaccinePat.Note)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Note = " + DbHelper.ParamChar + "paramNote";
            }
            if (vaccinePat.FilledCity != oldVaccinePat.FilledCity)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FilledCity = '" + POut.String(vaccinePat.FilledCity) + "'";
            }
            if (vaccinePat.FilledST != oldVaccinePat.FilledST)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FilledST = '" + POut.String(vaccinePat.FilledST) + "'";
            }
            if (vaccinePat.CompletionStatus != oldVaccinePat.CompletionStatus)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CompletionStatus = " + POut.Int((int)vaccinePat.CompletionStatus) + "";
            }
            if (vaccinePat.AdministrationNoteCode != oldVaccinePat.AdministrationNoteCode)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "AdministrationNoteCode = " + POut.Int((int)vaccinePat.AdministrationNoteCode) + "";
            }
            if (vaccinePat.UserNum != oldVaccinePat.UserNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNum = " + POut.Long(vaccinePat.UserNum) + "";
            }
            if (vaccinePat.ProvNumOrdering != oldVaccinePat.ProvNumOrdering)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ProvNumOrdering = " + POut.Long(vaccinePat.ProvNumOrdering) + "";
            }
            if (vaccinePat.ProvNumAdminister != oldVaccinePat.ProvNumAdminister)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ProvNumAdminister = " + POut.Long(vaccinePat.ProvNumAdminister) + "";
            }
            if (vaccinePat.DateExpire.Date != oldVaccinePat.DateExpire.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateExpire = " + POut.Date(vaccinePat.DateExpire) + "";
            }
            if (vaccinePat.RefusalReason != oldVaccinePat.RefusalReason)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RefusalReason = " + POut.Int((int)vaccinePat.RefusalReason) + "";
            }
            if (vaccinePat.ActionCode != oldVaccinePat.ActionCode)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ActionCode = " + POut.Int((int)vaccinePat.ActionCode) + "";
            }
            if (vaccinePat.AdministrationRoute != oldVaccinePat.AdministrationRoute)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "AdministrationRoute = " + POut.Int((int)vaccinePat.AdministrationRoute) + "";
            }
            if (vaccinePat.AdministrationSite != oldVaccinePat.AdministrationSite)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "AdministrationSite = " + POut.Int((int)vaccinePat.AdministrationSite) + "";
            }
            if (command == "")
            {
                return(false);
            }
            if (vaccinePat.Note == null)
            {
                vaccinePat.Note = "";
            }
            OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(vaccinePat.Note));

            command = "UPDATE vaccinepat SET " + command
                      + " WHERE VaccinePatNum = " + POut.Long(vaccinePat.VaccinePatNum);
            Db.NonQ(command, paramNote);
            return(true);
        }
Ejemplo n.º 25
0
        ///<summary>Updates one Evaluation 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(Evaluation evaluation, Evaluation oldEvaluation)
        {
            string command = "";

            if (evaluation.InstructNum != oldEvaluation.InstructNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "InstructNum = " + POut.Long(evaluation.InstructNum) + "";
            }
            if (evaluation.StudentNum != oldEvaluation.StudentNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "StudentNum = " + POut.Long(evaluation.StudentNum) + "";
            }
            if (evaluation.SchoolCourseNum != oldEvaluation.SchoolCourseNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SchoolCourseNum = " + POut.Long(evaluation.SchoolCourseNum) + "";
            }
            if (evaluation.EvalTitle != oldEvaluation.EvalTitle)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "EvalTitle = '" + POut.String(evaluation.EvalTitle) + "'";
            }
            if (evaluation.DateEval.Date != oldEvaluation.DateEval.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateEval = " + POut.Date(evaluation.DateEval) + "";
            }
            if (evaluation.GradingScaleNum != oldEvaluation.GradingScaleNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "GradingScaleNum = " + POut.Long(evaluation.GradingScaleNum) + "";
            }
            if (evaluation.OverallGradeShowing != oldEvaluation.OverallGradeShowing)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "OverallGradeShowing = '" + POut.String(evaluation.OverallGradeShowing) + "'";
            }
            if (evaluation.OverallGradeNumber != oldEvaluation.OverallGradeNumber)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "OverallGradeNumber = " + POut.Float(evaluation.OverallGradeNumber) + "";
            }
            if (evaluation.Notes != oldEvaluation.Notes)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Notes = " + DbHelper.ParamChar + "paramNotes";
            }
            if (command == "")
            {
                return(false);
            }
            if (evaluation.Notes == null)
            {
                evaluation.Notes = "";
            }
            OdSqlParameter paramNotes = new OdSqlParameter("paramNotes", OdDbType.Text, POut.StringParam(evaluation.Notes));

            command = "UPDATE evaluation SET " + command
                      + " WHERE EvaluationNum = " + POut.Long(evaluation.EvaluationNum);
            Db.NonQ(command, paramNotes);
            return(true);
        }
Ejemplo n.º 26
0
        ///<summary>Updates one Equipment 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(Equipment equipment, Equipment oldEquipment)
        {
            string command = "";

            if (equipment.Description != oldEquipment.Description)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Description = " + DbHelper.ParamChar + "paramDescription";
            }
            if (equipment.SerialNumber != oldEquipment.SerialNumber)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SerialNumber = '" + POut.String(equipment.SerialNumber) + "'";
            }
            if (equipment.ModelYear != oldEquipment.ModelYear)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ModelYear = '" + POut.String(equipment.ModelYear) + "'";
            }
            if (equipment.DatePurchased.Date != oldEquipment.DatePurchased.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DatePurchased = " + POut.Date(equipment.DatePurchased) + "";
            }
            if (equipment.DateSold.Date != oldEquipment.DateSold.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateSold = " + POut.Date(equipment.DateSold) + "";
            }
            if (equipment.PurchaseCost != oldEquipment.PurchaseCost)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PurchaseCost = '" + POut.Double(equipment.PurchaseCost) + "'";
            }
            if (equipment.MarketValue != oldEquipment.MarketValue)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "MarketValue = '" + POut.Double(equipment.MarketValue) + "'";
            }
            if (equipment.Location != oldEquipment.Location)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Location = " + DbHelper.ParamChar + "paramLocation";
            }
            if (equipment.DateEntry.Date != oldEquipment.DateEntry.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateEntry = " + POut.Date(equipment.DateEntry) + "";
            }
            if (equipment.ProvNumCheckedOut != oldEquipment.ProvNumCheckedOut)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ProvNumCheckedOut = " + POut.Long(equipment.ProvNumCheckedOut) + "";
            }
            if (equipment.DateCheckedOut.Date != oldEquipment.DateCheckedOut.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateCheckedOut = " + POut.Date(equipment.DateCheckedOut) + "";
            }
            if (equipment.DateExpectedBack.Date != oldEquipment.DateExpectedBack.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateExpectedBack = " + POut.Date(equipment.DateExpectedBack) + "";
            }
            if (equipment.DispenseNote != oldEquipment.DispenseNote)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DispenseNote = " + DbHelper.ParamChar + "paramDispenseNote";
            }
            if (equipment.Status != oldEquipment.Status)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Status = " + DbHelper.ParamChar + "paramStatus";
            }
            if (command == "")
            {
                return(false);
            }
            if (equipment.Description == null)
            {
                equipment.Description = "";
            }
            OdSqlParameter paramDescription = new OdSqlParameter("paramDescription", OdDbType.Text, POut.StringParam(equipment.Description));

            if (equipment.Location == null)
            {
                equipment.Location = "";
            }
            OdSqlParameter paramLocation = new OdSqlParameter("paramLocation", OdDbType.Text, POut.StringParam(equipment.Location));

            if (equipment.DispenseNote == null)
            {
                equipment.DispenseNote = "";
            }
            OdSqlParameter paramDispenseNote = new OdSqlParameter("paramDispenseNote", OdDbType.Text, POut.StringNote(equipment.DispenseNote));

            if (equipment.Status == null)
            {
                equipment.Status = "";
            }
            OdSqlParameter paramStatus = new OdSqlParameter("paramStatus", OdDbType.Text, POut.StringParam(equipment.Status));

            command = "UPDATE equipment SET " + command
                      + " WHERE EquipmentNum = " + POut.Long(equipment.EquipmentNum);
            Db.NonQ(command, paramDescription, paramLocation, paramDispenseNote, paramStatus);
            return(true);
        }
Ejemplo n.º 27
0
        ///<summary>Inserts one Equipment into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(Equipment equipment, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO equipment (";

            if (!useExistingPK && isRandomKeys)
            {
                equipment.EquipmentNum = ReplicationServers.GetKeyNoCache("equipment", "EquipmentNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "EquipmentNum,";
            }
            command += "Description,SerialNumber,ModelYear,DatePurchased,DateSold,PurchaseCost,MarketValue,Location,DateEntry,ProvNumCheckedOut,DateCheckedOut,DateExpectedBack,DispenseNote,Status) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(equipment.EquipmentNum) + ",";
            }
            command +=
                DbHelper.ParamChar + "paramDescription,"
                + "'" + POut.String(equipment.SerialNumber) + "',"
                + "'" + POut.String(equipment.ModelYear) + "',"
                + POut.Date(equipment.DatePurchased) + ","
                + POut.Date(equipment.DateSold) + ","
                + "'" + POut.Double(equipment.PurchaseCost) + "',"
                + "'" + POut.Double(equipment.MarketValue) + "',"
                + DbHelper.ParamChar + "paramLocation,"
                + POut.Date(equipment.DateEntry) + ","
                + POut.Long(equipment.ProvNumCheckedOut) + ","
                + POut.Date(equipment.DateCheckedOut) + ","
                + POut.Date(equipment.DateExpectedBack) + ","
                + DbHelper.ParamChar + "paramDispenseNote,"
                + DbHelper.ParamChar + "paramStatus)";
            if (equipment.Description == null)
            {
                equipment.Description = "";
            }
            OdSqlParameter paramDescription = new OdSqlParameter("paramDescription", OdDbType.Text, POut.StringParam(equipment.Description));

            if (equipment.Location == null)
            {
                equipment.Location = "";
            }
            OdSqlParameter paramLocation = new OdSqlParameter("paramLocation", OdDbType.Text, POut.StringParam(equipment.Location));

            if (equipment.DispenseNote == null)
            {
                equipment.DispenseNote = "";
            }
            OdSqlParameter paramDispenseNote = new OdSqlParameter("paramDispenseNote", OdDbType.Text, POut.StringNote(equipment.DispenseNote));

            if (equipment.Status == null)
            {
                equipment.Status = "";
            }
            OdSqlParameter paramStatus = new OdSqlParameter("paramStatus", OdDbType.Text, POut.StringParam(equipment.Status));

            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command, paramDescription, paramLocation, paramDispenseNote, paramStatus);
            }
            else
            {
                equipment.EquipmentNum = Db.NonQ(command, true, "EquipmentNum", "equipment", paramDescription, paramLocation, paramDispenseNote, paramStatus);
            }
            return(equipment.EquipmentNum);
        }
        ///<summary>Updates one WebForms_SheetFieldDef 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(WebForms_SheetFieldDef webForms_SheetFieldDef, WebForms_SheetFieldDef oldWebForms_SheetFieldDef)
        {
            string command = "";

            if (webForms_SheetFieldDef.WebSheetDefID != oldWebForms_SheetFieldDef.WebSheetDefID)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "WebSheetDefID = " + POut.Long(webForms_SheetFieldDef.WebSheetDefID) + "";
            }
            if (webForms_SheetFieldDef.FieldType != oldWebForms_SheetFieldDef.FieldType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FieldType = " + POut.Int((int)webForms_SheetFieldDef.FieldType) + "";
            }
            if (webForms_SheetFieldDef.FieldName != oldWebForms_SheetFieldDef.FieldName)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FieldName = '" + POut.String(webForms_SheetFieldDef.FieldName) + "'";
            }
            if (webForms_SheetFieldDef.FieldValue != oldWebForms_SheetFieldDef.FieldValue)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FieldValue = " + DbHelper.ParamChar + "paramFieldValue";
            }
            if (webForms_SheetFieldDef.FontSize != oldWebForms_SheetFieldDef.FontSize)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FontSize = " + POut.Float(webForms_SheetFieldDef.FontSize) + "";
            }
            if (webForms_SheetFieldDef.FontName != oldWebForms_SheetFieldDef.FontName)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FontName = '" + POut.String(webForms_SheetFieldDef.FontName) + "'";
            }
            if (webForms_SheetFieldDef.FontIsBold != oldWebForms_SheetFieldDef.FontIsBold)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FontIsBold = " + POut.Bool(webForms_SheetFieldDef.FontIsBold) + "";
            }
            if (webForms_SheetFieldDef.XPos != oldWebForms_SheetFieldDef.XPos)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "XPos = " + POut.Int(webForms_SheetFieldDef.XPos) + "";
            }
            if (webForms_SheetFieldDef.YPos != oldWebForms_SheetFieldDef.YPos)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "YPos = " + POut.Int(webForms_SheetFieldDef.YPos) + "";
            }
            if (webForms_SheetFieldDef.Width != oldWebForms_SheetFieldDef.Width)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Width = " + POut.Int(webForms_SheetFieldDef.Width) + "";
            }
            if (webForms_SheetFieldDef.Height != oldWebForms_SheetFieldDef.Height)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Height = " + POut.Int(webForms_SheetFieldDef.Height) + "";
            }
            if (webForms_SheetFieldDef.GrowthBehavior != oldWebForms_SheetFieldDef.GrowthBehavior)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "GrowthBehavior = " + POut.Int((int)webForms_SheetFieldDef.GrowthBehavior) + "";
            }
            if (webForms_SheetFieldDef.RadioButtonValue != oldWebForms_SheetFieldDef.RadioButtonValue)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RadioButtonValue = '" + POut.String(webForms_SheetFieldDef.RadioButtonValue) + "'";
            }
            if (webForms_SheetFieldDef.RadioButtonGroup != oldWebForms_SheetFieldDef.RadioButtonGroup)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RadioButtonGroup = '" + POut.String(webForms_SheetFieldDef.RadioButtonGroup) + "'";
            }
            if (webForms_SheetFieldDef.IsRequired != oldWebForms_SheetFieldDef.IsRequired)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsRequired = " + POut.Bool(webForms_SheetFieldDef.IsRequired) + "";
            }
            if (webForms_SheetFieldDef.ImageData != oldWebForms_SheetFieldDef.ImageData)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ImageData = " + DbHelper.ParamChar + "paramImageData";
            }
            if (webForms_SheetFieldDef.TabOrder != oldWebForms_SheetFieldDef.TabOrder)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TabOrder = " + POut.Int(webForms_SheetFieldDef.TabOrder) + "";
            }
            if (webForms_SheetFieldDef.ReportableName != oldWebForms_SheetFieldDef.ReportableName)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ReportableName = '" + POut.String(webForms_SheetFieldDef.ReportableName) + "'";
            }
            if (webForms_SheetFieldDef.TextAlign != oldWebForms_SheetFieldDef.TextAlign)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TextAlign = " + POut.Int((int)webForms_SheetFieldDef.TextAlign) + "";
            }
            if (webForms_SheetFieldDef.ItemColor != oldWebForms_SheetFieldDef.ItemColor)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ItemColor = " + POut.Int(webForms_SheetFieldDef.ItemColor.ToArgb()) + "";
            }
            if (webForms_SheetFieldDef.TabOrderMobile != oldWebForms_SheetFieldDef.TabOrderMobile)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TabOrderMobile = " + POut.Int(webForms_SheetFieldDef.TabOrderMobile) + "";
            }
            if (webForms_SheetFieldDef.UiLabelMobile != oldWebForms_SheetFieldDef.UiLabelMobile)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UiLabelMobile = '" + POut.String(webForms_SheetFieldDef.UiLabelMobile) + "'";
            }
            if (webForms_SheetFieldDef.UiLabelMobileRadioButton != oldWebForms_SheetFieldDef.UiLabelMobileRadioButton)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UiLabelMobileRadioButton = '" + POut.String(webForms_SheetFieldDef.UiLabelMobileRadioButton) + "'";
            }
            if (command == "")
            {
                return(false);
            }
            if (webForms_SheetFieldDef.FieldValue == null)
            {
                webForms_SheetFieldDef.FieldValue = "";
            }
            OdSqlParameter paramFieldValue = new OdSqlParameter("paramFieldValue", OdDbType.Text, webForms_SheetFieldDef.FieldValue);

            if (webForms_SheetFieldDef.ImageData == null)
            {
                webForms_SheetFieldDef.ImageData = "";
            }
            OdSqlParameter paramImageData = new OdSqlParameter("paramImageData", OdDbType.Text, webForms_SheetFieldDef.ImageData);

            command = "UPDATE webforms_sheetfielddef SET " + command
                      + " WHERE WebSheetFieldDefID = " + POut.Long(webForms_SheetFieldDef.WebSheetFieldDefID);
            DataCore.NonQ(command, paramFieldValue, paramImageData);
            return(true);
        }
Ejemplo n.º 29
0
 ///<summary>Updates one EtransMessageText 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(EtransMessageText etransMessageText,EtransMessageText oldEtransMessageText)
 {
     string command="";
     if(etransMessageText.MessageText != oldEtransMessageText.MessageText) {
         if(command!=""){ command+=",";}
         command+="MessageText = "+DbHelper.ParamChar+"paramMessageText";
     }
     if(command==""){
         return;
     }
     if(etransMessageText.MessageText==null) {
         etransMessageText.MessageText="";
     }
     OdSqlParameter paramMessageText=new OdSqlParameter("paramMessageText",OdDbType.Text,etransMessageText.MessageText);
     command="UPDATE etransmessagetext SET "+command
         +" WHERE EtransMessageTextNum = "+POut.Long(etransMessageText.EtransMessageTextNum);
     Db.NonQ(command,paramMessageText);
 }
Ejemplo n.º 30
0
        ///<summary>Updates one Document 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(Document document, Document oldDocument)
        {
            string command = "";

            if (document.Description != oldDocument.Description)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Description = '" + POut.String(document.Description) + "'";
            }
            if (document.DateCreated != oldDocument.DateCreated)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateCreated = " + POut.Date(document.DateCreated) + "";
            }
            if (document.DocCategory != oldDocument.DocCategory)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DocCategory = " + POut.Long(document.DocCategory) + "";
            }
            if (document.PatNum != oldDocument.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(document.PatNum) + "";
            }
            if (document.FileName != oldDocument.FileName)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FileName = '" + POut.String(document.FileName) + "'";
            }
            if (document.ImgType != oldDocument.ImgType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ImgType = " + POut.Int((int)document.ImgType) + "";
            }
            if (document.IsFlipped != oldDocument.IsFlipped)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsFlipped = " + POut.Bool(document.IsFlipped) + "";
            }
            if (document.DegreesRotated != oldDocument.DegreesRotated)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DegreesRotated = " + POut.Int(document.DegreesRotated) + "";
            }
            if (document.ToothNumbers != oldDocument.ToothNumbers)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ToothNumbers = '" + POut.String(document.ToothNumbers) + "'";
            }
            if (document.Note != oldDocument.Note)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Note = '" + POut.String(document.Note) + "'";
            }
            if (document.SigIsTopaz != oldDocument.SigIsTopaz)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SigIsTopaz = " + POut.Bool(document.SigIsTopaz) + "";
            }
            if (document.Signature != oldDocument.Signature)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Signature = '" + POut.String(document.Signature) + "'";
            }
            if (document.CropX != oldDocument.CropX)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CropX = " + POut.Int(document.CropX) + "";
            }
            if (document.CropY != oldDocument.CropY)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CropY = " + POut.Int(document.CropY) + "";
            }
            if (document.CropW != oldDocument.CropW)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CropW = " + POut.Int(document.CropW) + "";
            }
            if (document.CropH != oldDocument.CropH)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CropH = " + POut.Int(document.CropH) + "";
            }
            if (document.WindowingMin != oldDocument.WindowingMin)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "WindowingMin = " + POut.Int(document.WindowingMin) + "";
            }
            if (document.WindowingMax != oldDocument.WindowingMax)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "WindowingMax = " + POut.Int(document.WindowingMax) + "";
            }
            if (document.MountItemNum != oldDocument.MountItemNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "MountItemNum = " + POut.Long(document.MountItemNum) + "";
            }
            //DateTStamp can only be set by MySQL
            if (document.RawBase64 != oldDocument.RawBase64)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RawBase64 = " + DbHelper.ParamChar + "paramRawBase64";
            }
            if (document.Thumbnail != oldDocument.Thumbnail)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Thumbnail = " + DbHelper.ParamChar + "paramThumbnail";
            }
            if (command == "")
            {
                return;
            }
            if (document.RawBase64 == null)
            {
                document.RawBase64 = "";
            }
            OdSqlParameter paramRawBase64 = new OdSqlParameter("paramRawBase64", OdDbType.Text, document.RawBase64);

            if (document.Thumbnail == null)
            {
                document.Thumbnail = "";
            }
            OdSqlParameter paramThumbnail = new OdSqlParameter("paramThumbnail", OdDbType.Text, document.Thumbnail);

            command = "UPDATE document SET " + command
                      + " WHERE DocNum = " + POut.Long(document.DocNum);
            Db.NonQ(command, paramRawBase64, paramThumbnail);
        }
Ejemplo n.º 31
0
        ///<summary>Updates one EmailMessage in the database.</summary>
        public static void Update(EmailMessage emailMessage)
        {
            string command = "UPDATE emailmessage SET "
                             + "PatNum          =  " + POut.Long(emailMessage.PatNum) + ", "
                             + "ToAddress       =  " + DbHelper.ParamChar + "paramToAddress, "
                             + "FromAddress     =  " + DbHelper.ParamChar + "paramFromAddress, "
                             + "Subject         =  " + DbHelper.ParamChar + "paramSubject, "
                             + "BodyText        =  " + DbHelper.ParamChar + "paramBodyText, "
                             + "MsgDateTime     =  " + POut.DateT(emailMessage.MsgDateTime) + ", "
                             + "SentOrReceived  =  " + POut.Int((int)emailMessage.SentOrReceived) + ", "
                             + "RecipientAddress= '" + POut.String(emailMessage.RecipientAddress) + "', "
                             + "RawEmailIn      =  " + DbHelper.ParamChar + "paramRawEmailIn, "
                             + "ProvNumWebMail  =  " + POut.Long(emailMessage.ProvNumWebMail) + ", "
                             + "PatNumSubj      =  " + POut.Long(emailMessage.PatNumSubj) + ", "
                             + "CcAddress       =  " + DbHelper.ParamChar + "paramCcAddress, "
                             + "BccAddress      =  " + DbHelper.ParamChar + "paramBccAddress, "
                             + "HideIn          =  " + POut.Int((int)emailMessage.HideIn) + ", "
                             + "AptNum          =  " + POut.Long(emailMessage.AptNum) + ", "
                             + "UserNum         =  " + POut.Long(emailMessage.UserNum) + ", "
                             + "HtmlType        =  " + POut.Int((int)emailMessage.HtmlType) + " "
                             + "WHERE EmailMessageNum = " + POut.Long(emailMessage.EmailMessageNum);

            if (emailMessage.ToAddress == null)
            {
                emailMessage.ToAddress = "";
            }
            OdSqlParameter paramToAddress = new OdSqlParameter("paramToAddress", OdDbType.Text, POut.StringParam(emailMessage.ToAddress));

            if (emailMessage.FromAddress == null)
            {
                emailMessage.FromAddress = "";
            }
            OdSqlParameter paramFromAddress = new OdSqlParameter("paramFromAddress", OdDbType.Text, POut.StringParam(emailMessage.FromAddress));

            if (emailMessage.Subject == null)
            {
                emailMessage.Subject = "";
            }
            OdSqlParameter paramSubject = new OdSqlParameter("paramSubject", OdDbType.Text, POut.StringParam(emailMessage.Subject));

            if (emailMessage.BodyText == null)
            {
                emailMessage.BodyText = "";
            }
            OdSqlParameter paramBodyText = new OdSqlParameter("paramBodyText", OdDbType.Text, POut.StringParam(emailMessage.BodyText));

            if (emailMessage.RawEmailIn == null)
            {
                emailMessage.RawEmailIn = "";
            }
            OdSqlParameter paramRawEmailIn = new OdSqlParameter("paramRawEmailIn", OdDbType.Text, POut.StringParam(emailMessage.RawEmailIn));

            if (emailMessage.CcAddress == null)
            {
                emailMessage.CcAddress = "";
            }
            OdSqlParameter paramCcAddress = new OdSqlParameter("paramCcAddress", OdDbType.Text, POut.StringParam(emailMessage.CcAddress));

            if (emailMessage.BccAddress == null)
            {
                emailMessage.BccAddress = "";
            }
            OdSqlParameter paramBccAddress = new OdSqlParameter("paramBccAddress", OdDbType.Text, POut.StringParam(emailMessage.BccAddress));

            Db.NonQ(command, paramToAddress, paramFromAddress, paramSubject, paramBodyText, paramRawEmailIn, paramCcAddress, paramBccAddress);
        }
Ejemplo n.º 32
0
        ///<summary>Updates one RefAttach 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(RefAttach refAttach, RefAttach oldRefAttach)
        {
            string command = "";

            if (refAttach.ReferralNum != oldRefAttach.ReferralNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ReferralNum = " + POut.Long(refAttach.ReferralNum) + "";
            }
            if (refAttach.PatNum != oldRefAttach.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(refAttach.PatNum) + "";
            }
            if (refAttach.ItemOrder != oldRefAttach.ItemOrder)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ItemOrder = " + POut.Int(refAttach.ItemOrder) + "";
            }
            if (refAttach.RefDate.Date != oldRefAttach.RefDate.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RefDate = " + POut.Date(refAttach.RefDate) + "";
            }
            if (refAttach.RefType != oldRefAttach.RefType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RefType = " + POut.Int((int)refAttach.RefType) + "";
            }
            if (refAttach.RefToStatus != oldRefAttach.RefToStatus)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RefToStatus = " + POut.Int((int)refAttach.RefToStatus) + "";
            }
            if (refAttach.Note != oldRefAttach.Note)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Note = " + DbHelper.ParamChar + "paramNote";
            }
            if (refAttach.IsTransitionOfCare != oldRefAttach.IsTransitionOfCare)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsTransitionOfCare = " + POut.Bool(refAttach.IsTransitionOfCare) + "";
            }
            if (refAttach.ProcNum != oldRefAttach.ProcNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ProcNum = " + POut.Long(refAttach.ProcNum) + "";
            }
            if (refAttach.DateProcComplete.Date != oldRefAttach.DateProcComplete.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateProcComplete = " + POut.Date(refAttach.DateProcComplete) + "";
            }
            if (refAttach.ProvNum != oldRefAttach.ProvNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ProvNum = " + POut.Long(refAttach.ProvNum) + "";
            }
            //DateTStamp can only be set by MySQL
            if (command == "")
            {
                return(false);
            }
            if (refAttach.Note == null)
            {
                refAttach.Note = "";
            }
            OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(refAttach.Note));

            command = "UPDATE refattach SET " + command
                      + " WHERE RefAttachNum = " + POut.Long(refAttach.RefAttachNum);
            Db.NonQ(command, paramNote);
            return(true);
        }
Ejemplo n.º 33
0
        ///<summary>Updates one InsSub 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(InsSub insSub, InsSub oldInsSub)
        {
            string command = "";

            if (insSub.PlanNum != oldInsSub.PlanNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PlanNum = " + POut.Long(insSub.PlanNum) + "";
            }
            if (insSub.Subscriber != oldInsSub.Subscriber)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Subscriber = " + POut.Long(insSub.Subscriber) + "";
            }
            if (insSub.DateEffective != oldInsSub.DateEffective)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateEffective = " + POut.Date(insSub.DateEffective) + "";
            }
            if (insSub.DateTerm != oldInsSub.DateTerm)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTerm = " + POut.Date(insSub.DateTerm) + "";
            }
            if (insSub.ReleaseInfo != oldInsSub.ReleaseInfo)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ReleaseInfo = " + POut.Bool(insSub.ReleaseInfo) + "";
            }
            if (insSub.AssignBen != oldInsSub.AssignBen)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "AssignBen = " + POut.Bool(insSub.AssignBen) + "";
            }
            if (insSub.SubscriberID != oldInsSub.SubscriberID)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SubscriberID = '" + POut.String(insSub.SubscriberID) + "'";
            }
            if (insSub.BenefitNotes != oldInsSub.BenefitNotes)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "BenefitNotes = " + DbHelper.ParamChar + "paramBenefitNotes";
            }
            if (insSub.SubscNote != oldInsSub.SubscNote)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SubscNote = '" + POut.String(insSub.SubscNote) + "'";
            }
            if (command == "")
            {
                return;
            }
            if (insSub.BenefitNotes == null)
            {
                insSub.BenefitNotes = "";
            }
            OdSqlParameter paramBenefitNotes = new OdSqlParameter("paramBenefitNotes", OdDbType.Text, insSub.BenefitNotes);

            command = "UPDATE inssub SET " + command
                      + " WHERE InsSubNum = " + POut.Long(insSub.InsSubNum);
            Db.NonQ(command, paramBenefitNotes);
        }
        ///<summary>Updates one PatientPortalInvite 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(PatientPortalInvite patientPortalInvite, PatientPortalInvite oldPatientPortalInvite)
        {
            string command = "";

            if (patientPortalInvite.PatNum != oldPatientPortalInvite.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(patientPortalInvite.PatNum) + "";
            }
            if (patientPortalInvite.AptNum != oldPatientPortalInvite.AptNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "AptNum = " + POut.Long(patientPortalInvite.AptNum) + "";
            }
            if (patientPortalInvite.ClinicNum != oldPatientPortalInvite.ClinicNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ClinicNum = " + POut.Long(patientPortalInvite.ClinicNum) + "";
            }
            //DateTimeEntry not allowed to change
            if (patientPortalInvite.TSPrior != oldPatientPortalInvite.TSPrior)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TSPrior = '" + POut.Long(patientPortalInvite.TSPrior.Ticks) + "'";
            }
            if (patientPortalInvite.EmailSendStatus != oldPatientPortalInvite.EmailSendStatus)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "EmailSendStatus = " + POut.Int((int)patientPortalInvite.EmailSendStatus) + "";
            }
            if (patientPortalInvite.EmailMessageNum != oldPatientPortalInvite.EmailMessageNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "EmailMessageNum = " + POut.Long(patientPortalInvite.EmailMessageNum) + "";
            }
            if (patientPortalInvite.TemplateEmail != oldPatientPortalInvite.TemplateEmail)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TemplateEmail = " + DbHelper.ParamChar + "paramTemplateEmail";
            }
            if (patientPortalInvite.TemplateEmailSubj != oldPatientPortalInvite.TemplateEmailSubj)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TemplateEmailSubj = '" + POut.String(patientPortalInvite.TemplateEmailSubj) + "'";
            }
            if (patientPortalInvite.Note != oldPatientPortalInvite.Note)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Note = " + DbHelper.ParamChar + "paramNote";
            }
            if (command == "")
            {
                return(false);
            }
            if (patientPortalInvite.TemplateEmail == null)
            {
                patientPortalInvite.TemplateEmail = "";
            }
            OdSqlParameter paramTemplateEmail = new OdSqlParameter("paramTemplateEmail", OdDbType.Text, POut.StringParam(patientPortalInvite.TemplateEmail));

            if (patientPortalInvite.Note == null)
            {
                patientPortalInvite.Note = "";
            }
            OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(patientPortalInvite.Note));

            command = "UPDATE patientportalinvite SET " + command
                      + " WHERE PatientPortalInviteNum = " + POut.Long(patientPortalInvite.PatientPortalInviteNum);
            Db.NonQ(command, paramTemplateEmail, paramNote);
            return(true);
        }
Ejemplo n.º 35
0
        ///<summary>Updates one Task 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(Task task, Task oldTask)
        {
            string command = "";

            if (task.TaskListNum != oldTask.TaskListNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TaskListNum = " + POut.Long(task.TaskListNum) + "";
            }
            if (task.DateTask != oldTask.DateTask)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTask = " + POut.Date(task.DateTask) + "";
            }
            if (task.KeyNum != oldTask.KeyNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "KeyNum = " + POut.Long(task.KeyNum) + "";
            }
            if (task.Descript != oldTask.Descript)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Descript = " + DbHelper.ParamChar + "paramDescript";
            }
            if (task.TaskStatus != oldTask.TaskStatus)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TaskStatus = " + POut.Int((int)task.TaskStatus) + "";
            }
            if (task.IsRepeating != oldTask.IsRepeating)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsRepeating = " + POut.Bool(task.IsRepeating) + "";
            }
            if (task.DateType != oldTask.DateType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateType = " + POut.Int((int)task.DateType) + "";
            }
            if (task.FromNum != oldTask.FromNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FromNum = " + POut.Long(task.FromNum) + "";
            }
            if (task.ObjectType != oldTask.ObjectType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ObjectType = " + POut.Int((int)task.ObjectType) + "";
            }
            if (task.DateTimeEntry != oldTask.DateTimeEntry)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeEntry = " + POut.DateT(task.DateTimeEntry) + "";
            }
            if (task.UserNum != oldTask.UserNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNum = " + POut.Long(task.UserNum) + "";
            }
            if (task.DateTimeFinished != oldTask.DateTimeFinished)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeFinished = " + POut.DateT(task.DateTimeFinished) + "";
            }
            if (command == "")
            {
                return;
            }
            if (task.Descript == null)
            {
                task.Descript = "";
            }
            OdSqlParameter paramDescript = new OdSqlParameter("paramDescript", OdDbType.Text, task.Descript);

            command = "UPDATE task SET " + command
                      + " WHERE TaskNum = " + POut.Long(task.TaskNum);
            Db.NonQ(command, paramDescript);
        }
Ejemplo n.º 36
0
		///<summary>Updates one HL7Msg in the database.</summary>
		public static void Update(HL7Msg hL7Msg){
			string command="UPDATE hl7msg SET "
				+"HL7Status =  "+POut.Int   ((int)hL7Msg.HL7Status)+", "
				+"MsgText   =  "+DbHelper.ParamChar+"paramMsgText, "
				+"AptNum    =  "+POut.Long  (hL7Msg.AptNum)+", "
				//DateTStamp can only be set by MySQL
				+"PatNum    =  "+POut.Long  (hL7Msg.PatNum)+", "
				+"Note      = '"+POut.String(hL7Msg.Note)+"' "
				+"WHERE HL7MsgNum = "+POut.Long(hL7Msg.HL7MsgNum);
			if(hL7Msg.MsgText==null) {
				hL7Msg.MsgText="";
			}
			OdSqlParameter paramMsgText=new OdSqlParameter("paramMsgText",OdDbType.Text,hL7Msg.MsgText);
			Db.NonQ(command,paramMsgText);
		}
Ejemplo n.º 37
0
        ///<summary>Updates one Recall 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(Recall recall, Recall oldRecall)
        {
            string command = "";

            if (recall.PatNum != oldRecall.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(recall.PatNum) + "";
            }
            if (recall.DateDueCalc.Date != oldRecall.DateDueCalc.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateDueCalc = " + POut.Date(recall.DateDueCalc) + "";
            }
            if (recall.DateDue.Date != oldRecall.DateDue.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateDue = " + POut.Date(recall.DateDue) + "";
            }
            if (recall.DatePrevious.Date != oldRecall.DatePrevious.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DatePrevious = " + POut.Date(recall.DatePrevious) + "";
            }
            if (recall.RecallInterval != oldRecall.RecallInterval)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RecallInterval = " + POut.Int(recall.RecallInterval.ToInt()) + "";
            }
            if (recall.RecallStatus != oldRecall.RecallStatus)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RecallStatus = " + POut.Long(recall.RecallStatus) + "";
            }
            if (recall.Note != oldRecall.Note)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Note = " + DbHelper.ParamChar + "paramNote";
            }
            if (recall.IsDisabled != oldRecall.IsDisabled)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsDisabled = " + POut.Bool(recall.IsDisabled) + "";
            }
            //DateTStamp can only be set by MySQL
            if (recall.RecallTypeNum != oldRecall.RecallTypeNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RecallTypeNum = " + POut.Long(recall.RecallTypeNum) + "";
            }
            if (recall.DisableUntilBalance != oldRecall.DisableUntilBalance)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DisableUntilBalance = '" + POut.Double(recall.DisableUntilBalance) + "'";
            }
            if (recall.DisableUntilDate.Date != oldRecall.DisableUntilDate.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DisableUntilDate = " + POut.Date(recall.DisableUntilDate) + "";
            }
            if (recall.DateScheduled.Date != oldRecall.DateScheduled.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateScheduled = " + POut.Date(recall.DateScheduled) + "";
            }
            if (recall.Priority != oldRecall.Priority)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Priority = " + POut.Int((int)recall.Priority) + "";
            }
            if (command == "")
            {
                return(false);
            }
            if (recall.Note == null)
            {
                recall.Note = "";
            }
            OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(recall.Note));

            command = "UPDATE recall SET " + command
                      + " WHERE RecallNum = " + POut.Long(recall.RecallNum);
            Db.NonQ(command, paramNote);
            return(true);
        }
Ejemplo n.º 38
0
		///<summary>Updates one PatientNote in the database.</summary>
		public static void Update(PatientNote patientNote){
			string command="UPDATE patientnote SET "
				//FamFinancial excluded from update
				+"ApptPhone   = '"+POut.String(patientNote.ApptPhone)+"', "
				+"Medical     = '"+POut.String(patientNote.Medical)+"', "
				+"Service     = '"+POut.String(patientNote.Service)+"', "
				+"MedicalComp =  "+DbHelper.ParamChar+"paramMedicalComp, "
				+"Treatment   = '"+POut.String(patientNote.Treatment)+"' "
				+"WHERE PatNum = "+POut.Long(patientNote.PatNum);
			if(patientNote.MedicalComp==null) {
				patientNote.MedicalComp="";
			}
			OdSqlParameter paramMedicalComp=new OdSqlParameter("paramMedicalComp",OdDbType.Text,patientNote.MedicalComp);
			Db.NonQ(command,paramMedicalComp);
		}
Ejemplo n.º 39
0
        ///<summary>Inserts one ProcedureCode into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(ProcedureCode procedureCode, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO procedurecode (";

            if (!useExistingPK && isRandomKeys)
            {
                procedureCode.CodeNum = ReplicationServers.GetKeyNoCache("procedurecode", "CodeNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "CodeNum,";
            }
            command += "ProcCode,Descript,AbbrDesc,ProcTime,ProcCat,TreatArea,NoBillIns,IsProsth,DefaultNote,IsHygiene,GTypeNum,AlternateCode1,MedicalCode,IsTaxed,PaintType,GraphicColor,LaymanTerm,IsCanadianLab,PreExisting,BaseUnits,SubstitutionCode,SubstOnlyIf,IsMultiVisit,DrugNDC,RevenueCodeDefault,ProvNumDefault,CanadaTimeUnits,IsRadiology,DefaultClaimNote,DefaultTPNote,BypassGlobalLock) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(procedureCode.CodeNum) + ",";
            }
            command +=
                "'" + POut.String(procedureCode.ProcCode) + "',"
                + "'" + POut.String(procedureCode.Descript) + "',"
                + "'" + POut.String(procedureCode.AbbrDesc) + "',"
                + "'" + POut.String(procedureCode.ProcTime) + "',"
                + POut.Long(procedureCode.ProcCat) + ","
                + POut.Int((int)procedureCode.TreatArea) + ","
                + POut.Bool(procedureCode.NoBillIns) + ","
                + POut.Bool(procedureCode.IsProsth) + ","
                + DbHelper.ParamChar + "paramDefaultNote,"
                + POut.Bool(procedureCode.IsHygiene) + ","
                + POut.Int(procedureCode.GTypeNum) + ","
                + "'" + POut.String(procedureCode.AlternateCode1) + "',"
                + "'" + POut.String(procedureCode.MedicalCode) + "',"
                + POut.Bool(procedureCode.IsTaxed) + ","
                + POut.Int((int)procedureCode.PaintType) + ","
                + POut.Int(procedureCode.GraphicColor.ToArgb()) + ","
                + "'" + POut.String(procedureCode.LaymanTerm) + "',"
                + POut.Bool(procedureCode.IsCanadianLab) + ","
                + POut.Bool(procedureCode.PreExisting) + ","
                + POut.Int(procedureCode.BaseUnits) + ","
                + "'" + POut.String(procedureCode.SubstitutionCode) + "',"
                + POut.Int((int)procedureCode.SubstOnlyIf) + ","
                //DateTStamp can only be set by MySQL
                + POut.Bool(procedureCode.IsMultiVisit) + ","
                + "'" + POut.String(procedureCode.DrugNDC) + "',"
                + "'" + POut.String(procedureCode.RevenueCodeDefault) + "',"
                + POut.Long(procedureCode.ProvNumDefault) + ","
                + "'" + POut.Double(procedureCode.CanadaTimeUnits) + "',"
                + POut.Bool(procedureCode.IsRadiology) + ","
                + DbHelper.ParamChar + "paramDefaultClaimNote,"
                + DbHelper.ParamChar + "paramDefaultTPNote,"
                + POut.Int((int)procedureCode.BypassGlobalLock) + ")";
            if (procedureCode.DefaultNote == null)
            {
                procedureCode.DefaultNote = "";
            }
            OdSqlParameter paramDefaultNote = new OdSqlParameter("paramDefaultNote", OdDbType.Text, POut.StringParam(procedureCode.DefaultNote));

            if (procedureCode.DefaultClaimNote == null)
            {
                procedureCode.DefaultClaimNote = "";
            }
            OdSqlParameter paramDefaultClaimNote = new OdSqlParameter("paramDefaultClaimNote", OdDbType.Text, POut.StringParam(procedureCode.DefaultClaimNote));

            if (procedureCode.DefaultTPNote == null)
            {
                procedureCode.DefaultTPNote = "";
            }
            OdSqlParameter paramDefaultTPNote = new OdSqlParameter("paramDefaultTPNote", OdDbType.Text, POut.StringParam(procedureCode.DefaultTPNote));

            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command, paramDefaultNote, paramDefaultClaimNote, paramDefaultTPNote);
            }
            else
            {
                procedureCode.CodeNum = Db.NonQ(command, true, "CodeNum", "procedureCode", paramDefaultNote, paramDefaultClaimNote, paramDefaultTPNote);
            }
            return(procedureCode.CodeNum);
        }
Ejemplo n.º 40
0
		///<summary>Updates one ErxLog in the database.</summary>
		public static void Update(ErxLog erxLog){
			string command="UPDATE erxlog SET "
				+"PatNum    =  "+POut.Long  (erxLog.PatNum)+", "
				+"MsgText   =  "+DbHelper.ParamChar+"paramMsgText, "
				//DateTStamp can only be set by MySQL
				+"ProvNum   =  "+POut.Long  (erxLog.ProvNum)+" "
				+"WHERE ErxLogNum = "+POut.Long(erxLog.ErxLogNum);
			if(erxLog.MsgText==null) {
				erxLog.MsgText="";
			}
			OdSqlParameter paramMsgText=new OdSqlParameter("paramMsgText",OdDbType.Text,erxLog.MsgText);
			Db.NonQ(command,paramMsgText);
		}
Ejemplo n.º 41
0
        ///<summary>Updates one SigElementDef 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(SigElementDef sigElementDef, SigElementDef oldSigElementDef)
        {
            string command = "";

            if (sigElementDef.LightRow != oldSigElementDef.LightRow)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "LightRow = " + POut.Byte(sigElementDef.LightRow) + "";
            }
            if (sigElementDef.LightColor != oldSigElementDef.LightColor)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "LightColor = " + POut.Int(sigElementDef.LightColor.ToArgb()) + "";
            }
            if (sigElementDef.SigElementType != oldSigElementDef.SigElementType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SigElementType = " + POut.Int((int)sigElementDef.SigElementType) + "";
            }
            if (sigElementDef.SigText != oldSigElementDef.SigText)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SigText = '" + POut.String(sigElementDef.SigText) + "'";
            }
            if (sigElementDef.Sound != oldSigElementDef.Sound)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Sound = " + DbHelper.ParamChar + "paramSound";
            }
            if (sigElementDef.ItemOrder != oldSigElementDef.ItemOrder)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ItemOrder = " + POut.Int(sigElementDef.ItemOrder) + "";
            }
            if (command == "")
            {
                return;
            }
            if (sigElementDef.Sound == null)
            {
                sigElementDef.Sound = "";
            }
            OdSqlParameter paramSound = new OdSqlParameter("paramSound", OdDbType.Text, sigElementDef.Sound);

            command = "UPDATE sigelementdef SET " + command
                      + " WHERE SigElementDefNum = " + POut.Long(sigElementDef.SigElementDefNum);
            Db.NonQ(command, paramSound);
        }
Ejemplo n.º 42
0
        ///<summary>Inserts one AsapComm into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(AsapComm asapComm, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO asapcomm (";

            if (!useExistingPK && isRandomKeys)
            {
                asapComm.AsapCommNum = ReplicationServers.GetKeyNoCache("asapcomm", "AsapCommNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "AsapCommNum,";
            }
            command += "FKey,FKeyType,ScheduleNum,PatNum,ClinicNum,ShortGUID,DateTimeEntry,DateTimeExpire,DateTimeSmsScheduled,SmsSendStatus,EmailSendStatus,DateTimeSmsSent,DateTimeEmailSent,EmailMessageNum,ResponseStatus,DateTimeOrig,TemplateText,TemplateEmail,TemplateEmailSubj,Note,GuidMessageToMobile) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(asapComm.AsapCommNum) + ",";
            }
            command +=
                POut.Long(asapComm.FKey) + ","
                + POut.Int((int)asapComm.FKeyType) + ","
                + POut.Long(asapComm.ScheduleNum) + ","
                + POut.Long(asapComm.PatNum) + ","
                + POut.Long(asapComm.ClinicNum) + ","
                + "'" + POut.String(asapComm.ShortGUID) + "',"
                + DbHelper.Now() + ","
                + POut.DateT(asapComm.DateTimeExpire) + ","
                + POut.DateT(asapComm.DateTimeSmsScheduled) + ","
                + POut.Int((int)asapComm.SmsSendStatus) + ","
                + POut.Int((int)asapComm.EmailSendStatus) + ","
                + POut.DateT(asapComm.DateTimeSmsSent) + ","
                + POut.DateT(asapComm.DateTimeEmailSent) + ","
                + POut.Long(asapComm.EmailMessageNum) + ","
                + POut.Int((int)asapComm.ResponseStatus) + ","
                + POut.DateT(asapComm.DateTimeOrig) + ","
                + DbHelper.ParamChar + "paramTemplateText,"
                + DbHelper.ParamChar + "paramTemplateEmail,"
                + "'" + POut.String(asapComm.TemplateEmailSubj) + "',"
                + DbHelper.ParamChar + "paramNote,"
                + DbHelper.ParamChar + "paramGuidMessageToMobile)";
            if (asapComm.TemplateText == null)
            {
                asapComm.TemplateText = "";
            }
            OdSqlParameter paramTemplateText = new OdSqlParameter("paramTemplateText", OdDbType.Text, POut.StringParam(asapComm.TemplateText));

            if (asapComm.TemplateEmail == null)
            {
                asapComm.TemplateEmail = "";
            }
            OdSqlParameter paramTemplateEmail = new OdSqlParameter("paramTemplateEmail", OdDbType.Text, POut.StringParam(asapComm.TemplateEmail));

            if (asapComm.Note == null)
            {
                asapComm.Note = "";
            }
            OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(asapComm.Note));

            if (asapComm.GuidMessageToMobile == null)
            {
                asapComm.GuidMessageToMobile = "";
            }
            OdSqlParameter paramGuidMessageToMobile = new OdSqlParameter("paramGuidMessageToMobile", OdDbType.Text, POut.StringParam(asapComm.GuidMessageToMobile));

            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command, paramTemplateText, paramTemplateEmail, paramNote, paramGuidMessageToMobile);
            }
            else
            {
                asapComm.AsapCommNum = Db.NonQ(command, true, "AsapCommNum", "asapComm", paramTemplateText, paramTemplateEmail, paramNote, paramGuidMessageToMobile);
            }
            return(asapComm.AsapCommNum);
        }
Ejemplo n.º 43
0
        ///<summary>Updates one JournalEntry 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(JournalEntry journalEntry, JournalEntry oldJournalEntry)
        {
            string command = "";

            if (journalEntry.TransactionNum != oldJournalEntry.TransactionNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TransactionNum = " + POut.Long(journalEntry.TransactionNum) + "";
            }
            if (journalEntry.AccountNum != oldJournalEntry.AccountNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "AccountNum = " + POut.Long(journalEntry.AccountNum) + "";
            }
            if (journalEntry.DateDisplayed.Date != oldJournalEntry.DateDisplayed.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateDisplayed = " + POut.Date(journalEntry.DateDisplayed) + "";
            }
            if (journalEntry.DebitAmt != oldJournalEntry.DebitAmt)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DebitAmt = '" + POut.Double(journalEntry.DebitAmt) + "'";
            }
            if (journalEntry.CreditAmt != oldJournalEntry.CreditAmt)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CreditAmt = '" + POut.Double(journalEntry.CreditAmt) + "'";
            }
            if (journalEntry.Memo != oldJournalEntry.Memo)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Memo = " + DbHelper.ParamChar + "paramMemo";
            }
            if (journalEntry.Splits != oldJournalEntry.Splits)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Splits = " + DbHelper.ParamChar + "paramSplits";
            }
            if (journalEntry.CheckNumber != oldJournalEntry.CheckNumber)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CheckNumber = '" + POut.String(journalEntry.CheckNumber) + "'";
            }
            if (journalEntry.ReconcileNum != oldJournalEntry.ReconcileNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ReconcileNum = " + POut.Long(journalEntry.ReconcileNum) + "";
            }
            //SecUserNumEntry excluded from update
            //SecDateTEntry not allowed to change
            if (journalEntry.SecUserNumEdit != oldJournalEntry.SecUserNumEdit)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SecUserNumEdit = " + POut.Long(journalEntry.SecUserNumEdit) + "";
            }
            //SecDateTEdit can only be set by MySQL
            if (command == "")
            {
                return(false);
            }
            if (journalEntry.Memo == null)
            {
                journalEntry.Memo = "";
            }
            OdSqlParameter paramMemo = new OdSqlParameter("paramMemo", OdDbType.Text, POut.StringParam(journalEntry.Memo));

            if (journalEntry.Splits == null)
            {
                journalEntry.Splits = "";
            }
            OdSqlParameter paramSplits = new OdSqlParameter("paramSplits", OdDbType.Text, POut.StringParam(journalEntry.Splits));

            command = "UPDATE journalentry SET " + command
                      + " WHERE JournalEntryNum = " + POut.Long(journalEntry.JournalEntryNum);
            Db.NonQ(command, paramMemo, paramSplits);
            return(true);
        }
Ejemplo n.º 44
0
        ///<summary>Updates one Question 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(Question question, Question oldQuestion)
        {
            string command = "";

            if (question.PatNum != oldQuestion.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(question.PatNum) + "";
            }
            if (question.ItemOrder != oldQuestion.ItemOrder)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ItemOrder = " + POut.Int(question.ItemOrder) + "";
            }
            if (question.Description != oldQuestion.Description)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Description = " + DbHelper.ParamChar + "paramDescription";
            }
            if (question.Answer != oldQuestion.Answer)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Answer = " + DbHelper.ParamChar + "paramAnswer";
            }
            if (question.FormPatNum != oldQuestion.FormPatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FormPatNum = " + POut.Long(question.FormPatNum) + "";
            }
            if (command == "")
            {
                return(false);
            }
            if (question.Description == null)
            {
                question.Description = "";
            }
            OdSqlParameter paramDescription = new OdSqlParameter("paramDescription", OdDbType.Text, POut.StringParam(question.Description));

            if (question.Answer == null)
            {
                question.Answer = "";
            }
            OdSqlParameter paramAnswer = new OdSqlParameter("paramAnswer", OdDbType.Text, POut.StringParam(question.Answer));

            command = "UPDATE question SET " + command
                      + " WHERE QuestionNum = " + POut.Long(question.QuestionNum);
            Db.NonQ(command, paramDescription, paramAnswer);
            return(true);
        }
Ejemplo n.º 45
0
		///<summary>Updates one HL7Msg 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(HL7Msg hL7Msg,HL7Msg oldHL7Msg){
			string command="";
			if(hL7Msg.HL7Status != oldHL7Msg.HL7Status) {
				if(command!=""){ command+=",";}
				command+="HL7Status = "+POut.Int   ((int)hL7Msg.HL7Status)+"";
			}
			if(hL7Msg.MsgText != oldHL7Msg.MsgText) {
				if(command!=""){ command+=",";}
				command+="MsgText = "+DbHelper.ParamChar+"paramMsgText";
			}
			if(hL7Msg.AptNum != oldHL7Msg.AptNum) {
				if(command!=""){ command+=",";}
				command+="AptNum = "+POut.Long(hL7Msg.AptNum)+"";
			}
			//DateTStamp can only be set by MySQL
			if(hL7Msg.PatNum != oldHL7Msg.PatNum) {
				if(command!=""){ command+=",";}
				command+="PatNum = "+POut.Long(hL7Msg.PatNum)+"";
			}
			if(hL7Msg.Note != oldHL7Msg.Note) {
				if(command!=""){ command+=",";}
				command+="Note = '"+POut.String(hL7Msg.Note)+"'";
			}
			if(command==""){
				return false;
			}
			if(hL7Msg.MsgText==null) {
				hL7Msg.MsgText="";
			}
			OdSqlParameter paramMsgText=new OdSqlParameter("paramMsgText",OdDbType.Text,hL7Msg.MsgText);
			command="UPDATE hl7msg SET "+command
				+" WHERE HL7MsgNum = "+POut.Long(hL7Msg.HL7MsgNum);
			Db.NonQ(command,paramMsgText);
			return true;
		}
Ejemplo n.º 46
0
        ///<summary>Updates one SheetFieldDef 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(SheetFieldDef sheetFieldDef, SheetFieldDef oldSheetFieldDef)
        {
            string command = "";

            if (sheetFieldDef.SheetDefNum != oldSheetFieldDef.SheetDefNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "SheetDefNum = " + POut.Long(sheetFieldDef.SheetDefNum) + "";
            }
            if (sheetFieldDef.FieldType != oldSheetFieldDef.FieldType)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FieldType = " + POut.Int((int)sheetFieldDef.FieldType) + "";
            }
            if (sheetFieldDef.FieldName != oldSheetFieldDef.FieldName)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FieldName = '" + POut.String(sheetFieldDef.FieldName) + "'";
            }
            if (sheetFieldDef.FieldValue != oldSheetFieldDef.FieldValue)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FieldValue = " + DbHelper.ParamChar + "paramFieldValue";
            }
            if (sheetFieldDef.FontSize != oldSheetFieldDef.FontSize)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FontSize = " + POut.Float(sheetFieldDef.FontSize) + "";
            }
            if (sheetFieldDef.FontName != oldSheetFieldDef.FontName)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FontName = '" + POut.String(sheetFieldDef.FontName) + "'";
            }
            if (sheetFieldDef.FontIsBold != oldSheetFieldDef.FontIsBold)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "FontIsBold = " + POut.Bool(sheetFieldDef.FontIsBold) + "";
            }
            if (sheetFieldDef.XPos != oldSheetFieldDef.XPos)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "XPos = " + POut.Int(sheetFieldDef.XPos) + "";
            }
            if (sheetFieldDef.YPos != oldSheetFieldDef.YPos)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "YPos = " + POut.Int(sheetFieldDef.YPos) + "";
            }
            if (sheetFieldDef.Width != oldSheetFieldDef.Width)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Width = " + POut.Int(sheetFieldDef.Width) + "";
            }
            if (sheetFieldDef.Height != oldSheetFieldDef.Height)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Height = " + POut.Int(sheetFieldDef.Height) + "";
            }
            if (sheetFieldDef.GrowthBehavior != oldSheetFieldDef.GrowthBehavior)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "GrowthBehavior = " + POut.Int((int)sheetFieldDef.GrowthBehavior) + "";
            }
            if (sheetFieldDef.RadioButtonValue != oldSheetFieldDef.RadioButtonValue)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RadioButtonValue = '" + POut.String(sheetFieldDef.RadioButtonValue) + "'";
            }
            if (sheetFieldDef.RadioButtonGroup != oldSheetFieldDef.RadioButtonGroup)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RadioButtonGroup = '" + POut.String(sheetFieldDef.RadioButtonGroup) + "'";
            }
            if (sheetFieldDef.IsRequired != oldSheetFieldDef.IsRequired)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsRequired = " + POut.Bool(sheetFieldDef.IsRequired) + "";
            }
            if (sheetFieldDef.TabOrder != oldSheetFieldDef.TabOrder)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TabOrder = " + POut.Int(sheetFieldDef.TabOrder) + "";
            }
            if (command == "")
            {
                return;
            }
            if (sheetFieldDef.FieldValue == null)
            {
                sheetFieldDef.FieldValue = "";
            }
            OdSqlParameter paramFieldValue = new OdSqlParameter("paramFieldValue", OdDbType.Text, sheetFieldDef.FieldValue);

            command = "UPDATE sheetfielddef SET " + command
                      + " WHERE SheetFieldDefNum = " + POut.Long(sheetFieldDef.SheetFieldDefNum);
            Db.NonQ(command, paramFieldValue);
        }
Ejemplo n.º 47
0
		///<summary>Updates one PatientNote 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(PatientNote patientNote,PatientNote oldPatientNote){
			string command="";
			//FamFinancial excluded from update
			if(patientNote.ApptPhone != oldPatientNote.ApptPhone) {
				if(command!=""){ command+=",";}
				command+="ApptPhone = '"+POut.String(patientNote.ApptPhone)+"'";
			}
			if(patientNote.Medical != oldPatientNote.Medical) {
				if(command!=""){ command+=",";}
				command+="Medical = '"+POut.String(patientNote.Medical)+"'";
			}
			if(patientNote.Service != oldPatientNote.Service) {
				if(command!=""){ command+=",";}
				command+="Service = '"+POut.String(patientNote.Service)+"'";
			}
			if(patientNote.MedicalComp != oldPatientNote.MedicalComp) {
				if(command!=""){ command+=",";}
				command+="MedicalComp = "+DbHelper.ParamChar+"paramMedicalComp";
			}
			if(patientNote.Treatment != oldPatientNote.Treatment) {
				if(command!=""){ command+=",";}
				command+="Treatment = '"+POut.String(patientNote.Treatment)+"'";
			}
			if(command==""){
				return false;
			}
			if(patientNote.MedicalComp==null) {
				patientNote.MedicalComp="";
			}
			OdSqlParameter paramMedicalComp=new OdSqlParameter("paramMedicalComp",OdDbType.Text,patientNote.MedicalComp);
			command="UPDATE patientnote SET "+command
				+" WHERE PatNum = "+POut.Long(patientNote.PatNum);
			Db.NonQ(command,paramMedicalComp);
			return true;
		}
Ejemplo n.º 48
0
        ///<summary>Updates one JobQuote 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(JobQuote jobQuote, JobQuote oldJobQuote)
        {
            string command = "";

            if (jobQuote.JobNum != oldJobQuote.JobNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "JobNum = " + POut.Long(jobQuote.JobNum) + "";
            }
            if (jobQuote.PatNum != oldJobQuote.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(jobQuote.PatNum) + "";
            }
            if (jobQuote.Amount != oldJobQuote.Amount)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Amount = '" + POut.String(jobQuote.Amount) + "'";
            }
            if (jobQuote.Note != oldJobQuote.Note)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Note = " + DbHelper.ParamChar + "paramNote";
            }
            if (jobQuote.Hours != oldJobQuote.Hours)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Hours = '" + POut.String(jobQuote.Hours) + "'";
            }
            if (jobQuote.ApprovedAmount != oldJobQuote.ApprovedAmount)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ApprovedAmount = '" + POut.String(jobQuote.ApprovedAmount) + "'";
            }
            if (jobQuote.IsCustomerApproved != oldJobQuote.IsCustomerApproved)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsCustomerApproved = " + POut.Bool(jobQuote.IsCustomerApproved) + "";
            }
            if (command == "")
            {
                return(false);
            }
            if (jobQuote.Note == null)
            {
                jobQuote.Note = "";
            }
            OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(jobQuote.Note));

            command = "UPDATE jobquote SET " + command
                      + " WHERE JobQuoteNum = " + POut.Long(jobQuote.JobQuoteNum);
            Db.NonQ(command, paramNote);
            return(true);
        }
Ejemplo n.º 49
0
		///<summary>Updates one ErxLog 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(ErxLog erxLog,ErxLog oldErxLog){
			string command="";
			if(erxLog.PatNum != oldErxLog.PatNum) {
				if(command!=""){ command+=",";}
				command+="PatNum = "+POut.Long(erxLog.PatNum)+"";
			}
			if(erxLog.MsgText != oldErxLog.MsgText) {
				if(command!=""){ command+=",";}
				command+="MsgText = "+DbHelper.ParamChar+"paramMsgText";
			}
			//DateTStamp can only be set by MySQL
			if(erxLog.ProvNum != oldErxLog.ProvNum) {
				if(command!=""){ command+=",";}
				command+="ProvNum = "+POut.Long(erxLog.ProvNum)+"";
			}
			if(command==""){
				return false;
			}
			if(erxLog.MsgText==null) {
				erxLog.MsgText="";
			}
			OdSqlParameter paramMsgText=new OdSqlParameter("paramMsgText",OdDbType.Text,erxLog.MsgText);
			command="UPDATE erxlog SET "+command
				+" WHERE ErxLogNum = "+POut.Long(erxLog.ErxLogNum);
			Db.NonQ(command,paramMsgText);
			return true;
		}
Ejemplo n.º 50
0
 ///<summary>Updates one Document in the database.</summary>
 internal static void Update(Document document)
 {
     string command="UPDATE document SET "
         +"Description   = '"+POut.String(document.Description)+"', "
         +"DateCreated   =  "+POut.Date  (document.DateCreated)+", "
         +"DocCategory   =  "+POut.Long  (document.DocCategory)+", "
         +"PatNum        =  "+POut.Long  (document.PatNum)+", "
         +"FileName      = '"+POut.String(document.FileName)+"', "
         +"ImgType       =  "+POut.Int   ((int)document.ImgType)+", "
         +"IsFlipped     =  "+POut.Bool  (document.IsFlipped)+", "
         +"DegreesRotated=  "+POut.Int   (document.DegreesRotated)+", "
         +"ToothNumbers  = '"+POut.String(document.ToothNumbers)+"', "
         +"Note          = '"+POut.String(document.Note)+"', "
         +"SigIsTopaz    =  "+POut.Bool  (document.SigIsTopaz)+", "
         +"Signature     = '"+POut.String(document.Signature)+"', "
         +"CropX         =  "+POut.Int   (document.CropX)+", "
         +"CropY         =  "+POut.Int   (document.CropY)+", "
         +"CropW         =  "+POut.Int   (document.CropW)+", "
         +"CropH         =  "+POut.Int   (document.CropH)+", "
         +"WindowingMin  =  "+POut.Int   (document.WindowingMin)+", "
         +"WindowingMax  =  "+POut.Int   (document.WindowingMax)+", "
         +"MountItemNum  =  "+POut.Long  (document.MountItemNum)+", "
         //DateTStamp can only be set by MySQL
         +"RawBase64     =  "+DbHelper.ParamChar+"paramRawBase64, "
         +"Thumbnail     =  "+DbHelper.ParamChar+"paramThumbnail "
         +"WHERE DocNum = "+POut.Long(document.DocNum);
     if(document.RawBase64==null) {
         document.RawBase64="";
     }
     OdSqlParameter paramRawBase64=new OdSqlParameter("paramRawBase64",OdDbType.Text,document.RawBase64);
     if(document.Thumbnail==null) {
         document.Thumbnail="";
     }
     OdSqlParameter paramThumbnail=new OdSqlParameter("paramThumbnail",OdDbType.Text,document.Thumbnail);
     Db.NonQ(command,paramRawBase64,paramThumbnail);
 }
Ejemplo n.º 51
0
 ///<summary>Updates one EtransMessageText in the database.</summary>
 internal static void Update(EtransMessageText etransMessageText)
 {
     string command="UPDATE etransmessagetext SET "
         +"MessageText         =  "+DbHelper.ParamChar+"paramMessageText "
         +"WHERE EtransMessageTextNum = "+POut.Long(etransMessageText.EtransMessageTextNum);
     if(etransMessageText.MessageText==null) {
         etransMessageText.MessageText="";
     }
     OdSqlParameter paramMessageText=new OdSqlParameter("paramMessageText",OdDbType.Text,etransMessageText.MessageText);
     Db.NonQ(command,paramMessageText);
 }
Ejemplo n.º 52
0
 ///<summary>Inserts one Document into the database.  Provides option to use the existing priKey.</summary>
 internal static long Insert(Document document,bool useExistingPK)
 {
     if(!useExistingPK && PrefC.RandomKeys) {
         document.DocNum=ReplicationServers.GetKey("document","DocNum");
     }
     string command="INSERT INTO document (";
     if(useExistingPK || PrefC.RandomKeys) {
         command+="DocNum,";
     }
     command+="Description,DateCreated,DocCategory,PatNum,FileName,ImgType,IsFlipped,DegreesRotated,ToothNumbers,Note,SigIsTopaz,Signature,CropX,CropY,CropW,CropH,WindowingMin,WindowingMax,MountItemNum,RawBase64,Thumbnail) VALUES(";
     if(useExistingPK || PrefC.RandomKeys) {
         command+=POut.Long(document.DocNum)+",";
     }
     command+=
          "'"+POut.String(document.Description)+"',"
         +    POut.Date  (document.DateCreated)+","
         +    POut.Long  (document.DocCategory)+","
         +    POut.Long  (document.PatNum)+","
         +"'"+POut.String(document.FileName)+"',"
         +    POut.Int   ((int)document.ImgType)+","
         +    POut.Bool  (document.IsFlipped)+","
         +    POut.Int   (document.DegreesRotated)+","
         +"'"+POut.String(document.ToothNumbers)+"',"
         +"'"+POut.String(document.Note)+"',"
         +    POut.Bool  (document.SigIsTopaz)+","
         +"'"+POut.String(document.Signature)+"',"
         +    POut.Int   (document.CropX)+","
         +    POut.Int   (document.CropY)+","
         +    POut.Int   (document.CropW)+","
         +    POut.Int   (document.CropH)+","
         +    POut.Int   (document.WindowingMin)+","
         +    POut.Int   (document.WindowingMax)+","
         +    POut.Long  (document.MountItemNum)+","
         //DateTStamp can only be set by MySQL
         +DbHelper.ParamChar+"paramRawBase64,"
         +DbHelper.ParamChar+"paramThumbnail)";
     if(document.RawBase64==null) {
         document.RawBase64="";
     }
     OdSqlParameter paramRawBase64=new OdSqlParameter("paramRawBase64",OdDbType.Text,document.RawBase64);
     if(document.Thumbnail==null) {
         document.Thumbnail="";
     }
     OdSqlParameter paramThumbnail=new OdSqlParameter("paramThumbnail",OdDbType.Text,document.Thumbnail);
     if(useExistingPK || PrefC.RandomKeys) {
         Db.NonQ(command,paramRawBase64,paramThumbnail);
     }
     else {
         document.DocNum=Db.NonQ(command,true,paramRawBase64,paramThumbnail);
     }
     return document.DocNum;
 }
Ejemplo n.º 53
0
        ///<summary>Inserts one Job into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(Job job, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO job (";

            if (!useExistingPK && isRandomKeys)
            {
                job.JobNum = ReplicationServers.GetKeyNoCache("job", "JobNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "JobNum,";
            }
            command += "UserNumConcept,UserNumExpert,UserNumEngineer,UserNumApproverConcept,UserNumApproverJob,UserNumApproverChange,UserNumDocumenter,UserNumCustContact,UserNumCheckout,UserNumInfo,ParentNum,DateTimeCustContact,Priority,Category,JobVersion,TimeEstimateDevelopment,TimeActual,DateTimeEntry,Implementation,Documentation,Title,PhaseCur,IsApprovalNeeded,AckDateTime,UserNumQuoter,UserNumApproverQuote,UserNumCustQuote,Requirements,UserNumTester,PriorityTesting,DateTimeTested,TimeEstimateConcept,TimeEstimateWriteup,TimeEstimateReview,RequirementsJSON,PatternReviewProject,PatternReviewStatus,ProposedVersion,DateTimeConceptApproval,DateTimeJobApproval,DateTimeImplemented,TimeTesting,IsNotTested) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(job.JobNum) + ",";
            }
            command +=
                POut.Long(job.UserNumConcept) + ","
                + POut.Long(job.UserNumExpert) + ","
                + POut.Long(job.UserNumEngineer) + ","
                + POut.Long(job.UserNumApproverConcept) + ","
                + POut.Long(job.UserNumApproverJob) + ","
                + POut.Long(job.UserNumApproverChange) + ","
                + POut.Long(job.UserNumDocumenter) + ","
                + POut.Long(job.UserNumCustContact) + ","
                + POut.Long(job.UserNumCheckout) + ","
                + POut.Long(job.UserNumInfo) + ","
                + POut.Long(job.ParentNum) + ","
                + POut.DateT(job.DateTimeCustContact) + ","
                + POut.Long(job.Priority) + ","
                + "'" + POut.String(job.Category.ToString()) + "',"
                + "'" + POut.String(job.JobVersion) + "',"
                + "'" + POut.Long(job.TimeEstimateDevelopment.Ticks) + "',"
                + "'" + POut.Long(job.TimeActual.Ticks) + "',"
                + DbHelper.Now() + ","
                + DbHelper.ParamChar + "paramImplementation,"
                + DbHelper.ParamChar + "paramDocumentation,"
                + "'" + POut.String(job.Title) + "',"
                + "'" + POut.String(job.PhaseCur.ToString()) + "',"
                + POut.Bool(job.IsApprovalNeeded) + ","
                + POut.DateT(job.AckDateTime) + ","
                + POut.Long(job.UserNumQuoter) + ","
                + POut.Long(job.UserNumApproverQuote) + ","
                + POut.Long(job.UserNumCustQuote) + ","
                + DbHelper.ParamChar + "paramRequirements,"
                + POut.Long(job.UserNumTester) + ","
                + POut.Long(job.PriorityTesting) + ","
                + POut.DateT(job.DateTimeTested) + ","
                + "'" + POut.Long(job.TimeEstimateConcept.Ticks) + "',"
                + "'" + POut.Long(job.TimeEstimateWriteup.Ticks) + "',"
                + "'" + POut.Long(job.TimeEstimateReview.Ticks) + "',"
                + DbHelper.ParamChar + "paramRequirementsJSON,"
                + POut.Int((int)job.PatternReviewProject) + ","
                + POut.Int((int)job.PatternReviewStatus) + ","
                + POut.Int((int)job.ProposedVersion) + ","
                + POut.DateT(job.DateTimeConceptApproval) + ","
                + POut.DateT(job.DateTimeJobApproval) + ","
                + POut.DateT(job.DateTimeImplemented) + ","
                + "'" + POut.Long(job.TimeTesting.Ticks) + "',"
                + POut.Bool(job.IsNotTested) + ")";
            if (job.Implementation == null)
            {
                job.Implementation = "";
            }
            OdSqlParameter paramImplementation = new OdSqlParameter("paramImplementation", OdDbType.Text, POut.StringParam(job.Implementation));

            if (job.Documentation == null)
            {
                job.Documentation = "";
            }
            OdSqlParameter paramDocumentation = new OdSqlParameter("paramDocumentation", OdDbType.Text, POut.StringParam(job.Documentation));

            if (job.Requirements == null)
            {
                job.Requirements = "";
            }
            OdSqlParameter paramRequirements = new OdSqlParameter("paramRequirements", OdDbType.Text, POut.StringParam(job.Requirements));

            if (job.RequirementsJSON == null)
            {
                job.RequirementsJSON = "";
            }
            OdSqlParameter paramRequirementsJSON = new OdSqlParameter("paramRequirementsJSON", OdDbType.Text, POut.StringParam(job.RequirementsJSON));

            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command, paramImplementation, paramDocumentation, paramRequirements, paramRequirementsJSON);
            }
            else
            {
                job.JobNum = Db.NonQ(command, true, "JobNum", "job", paramImplementation, paramDocumentation, paramRequirements, paramRequirementsJSON);
            }
            return(job.JobNum);
        }
Ejemplo n.º 54
0
        ///<summary>Inserts one EmailMessage into the database.  Provides option to use the existing priKey.  Doesn't use the cache.</summary>
        public static long InsertNoCache(EmailMessage emailMessage, bool useExistingPK)
        {
            bool   isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys);
            string command      = "INSERT INTO emailmessage (";

            if (!useExistingPK && isRandomKeys)
            {
                emailMessage.EmailMessageNum = ReplicationServers.GetKeyNoCache("emailmessage", "EmailMessageNum");
            }
            if (isRandomKeys || useExistingPK)
            {
                command += "EmailMessageNum,";
            }
            command += "PatNum,ToAddress,FromAddress,Subject,BodyText,MsgDateTime,SentOrReceived,RecipientAddress,RawEmailIn,ProvNumWebMail,PatNumSubj,CcAddress,BccAddress,HideIn,AptNum,UserNum,HtmlType) VALUES(";
            if (isRandomKeys || useExistingPK)
            {
                command += POut.Long(emailMessage.EmailMessageNum) + ",";
            }
            command +=
                POut.Long(emailMessage.PatNum) + ","
                + DbHelper.ParamChar + "paramToAddress,"
                + DbHelper.ParamChar + "paramFromAddress,"
                + DbHelper.ParamChar + "paramSubject,"
                + DbHelper.ParamChar + "paramBodyText,"
                + POut.DateT(emailMessage.MsgDateTime) + ","
                + POut.Int((int)emailMessage.SentOrReceived) + ","
                + "'" + POut.String(emailMessage.RecipientAddress) + "',"
                + DbHelper.ParamChar + "paramRawEmailIn,"
                + POut.Long(emailMessage.ProvNumWebMail) + ","
                + POut.Long(emailMessage.PatNumSubj) + ","
                + DbHelper.ParamChar + "paramCcAddress,"
                + DbHelper.ParamChar + "paramBccAddress,"
                + POut.Int((int)emailMessage.HideIn) + ","
                + POut.Long(emailMessage.AptNum) + ","
                + POut.Long(emailMessage.UserNum) + ","
                + POut.Int((int)emailMessage.HtmlType) + ")";
            if (emailMessage.ToAddress == null)
            {
                emailMessage.ToAddress = "";
            }
            OdSqlParameter paramToAddress = new OdSqlParameter("paramToAddress", OdDbType.Text, POut.StringParam(emailMessage.ToAddress));

            if (emailMessage.FromAddress == null)
            {
                emailMessage.FromAddress = "";
            }
            OdSqlParameter paramFromAddress = new OdSqlParameter("paramFromAddress", OdDbType.Text, POut.StringParam(emailMessage.FromAddress));

            if (emailMessage.Subject == null)
            {
                emailMessage.Subject = "";
            }
            OdSqlParameter paramSubject = new OdSqlParameter("paramSubject", OdDbType.Text, POut.StringParam(emailMessage.Subject));

            if (emailMessage.BodyText == null)
            {
                emailMessage.BodyText = "";
            }
            OdSqlParameter paramBodyText = new OdSqlParameter("paramBodyText", OdDbType.Text, POut.StringParam(emailMessage.BodyText));

            if (emailMessage.RawEmailIn == null)
            {
                emailMessage.RawEmailIn = "";
            }
            OdSqlParameter paramRawEmailIn = new OdSqlParameter("paramRawEmailIn", OdDbType.Text, POut.StringParam(emailMessage.RawEmailIn));

            if (emailMessage.CcAddress == null)
            {
                emailMessage.CcAddress = "";
            }
            OdSqlParameter paramCcAddress = new OdSqlParameter("paramCcAddress", OdDbType.Text, POut.StringParam(emailMessage.CcAddress));

            if (emailMessage.BccAddress == null)
            {
                emailMessage.BccAddress = "";
            }
            OdSqlParameter paramBccAddress = new OdSqlParameter("paramBccAddress", OdDbType.Text, POut.StringParam(emailMessage.BccAddress));

            if (useExistingPK || isRandomKeys)
            {
                Db.NonQ(command, paramToAddress, paramFromAddress, paramSubject, paramBodyText, paramRawEmailIn, paramCcAddress, paramBccAddress);
            }
            else
            {
                emailMessage.EmailMessageNum = Db.NonQ(command, true, "EmailMessageNum", "emailMessage", paramToAddress, paramFromAddress, paramSubject, paramBodyText, paramRawEmailIn, paramCcAddress, paramBccAddress);
            }
            return(emailMessage.EmailMessageNum);
        }
Ejemplo n.º 55
0
 ///<summary>Updates one Document 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(Document document,Document oldDocument)
 {
     string command="";
     if(document.Description != oldDocument.Description) {
         if(command!=""){ command+=",";}
         command+="Description = '"+POut.String(document.Description)+"'";
     }
     if(document.DateCreated != oldDocument.DateCreated) {
         if(command!=""){ command+=",";}
         command+="DateCreated = "+POut.Date(document.DateCreated)+"";
     }
     if(document.DocCategory != oldDocument.DocCategory) {
         if(command!=""){ command+=",";}
         command+="DocCategory = "+POut.Long(document.DocCategory)+"";
     }
     if(document.PatNum != oldDocument.PatNum) {
         if(command!=""){ command+=",";}
         command+="PatNum = "+POut.Long(document.PatNum)+"";
     }
     if(document.FileName != oldDocument.FileName) {
         if(command!=""){ command+=",";}
         command+="FileName = '"+POut.String(document.FileName)+"'";
     }
     if(document.ImgType != oldDocument.ImgType) {
         if(command!=""){ command+=",";}
         command+="ImgType = "+POut.Int   ((int)document.ImgType)+"";
     }
     if(document.IsFlipped != oldDocument.IsFlipped) {
         if(command!=""){ command+=",";}
         command+="IsFlipped = "+POut.Bool(document.IsFlipped)+"";
     }
     if(document.DegreesRotated != oldDocument.DegreesRotated) {
         if(command!=""){ command+=",";}
         command+="DegreesRotated = "+POut.Int(document.DegreesRotated)+"";
     }
     if(document.ToothNumbers != oldDocument.ToothNumbers) {
         if(command!=""){ command+=",";}
         command+="ToothNumbers = '"+POut.String(document.ToothNumbers)+"'";
     }
     if(document.Note != oldDocument.Note) {
         if(command!=""){ command+=",";}
         command+="Note = '"+POut.String(document.Note)+"'";
     }
     if(document.SigIsTopaz != oldDocument.SigIsTopaz) {
         if(command!=""){ command+=",";}
         command+="SigIsTopaz = "+POut.Bool(document.SigIsTopaz)+"";
     }
     if(document.Signature != oldDocument.Signature) {
         if(command!=""){ command+=",";}
         command+="Signature = '"+POut.String(document.Signature)+"'";
     }
     if(document.CropX != oldDocument.CropX) {
         if(command!=""){ command+=",";}
         command+="CropX = "+POut.Int(document.CropX)+"";
     }
     if(document.CropY != oldDocument.CropY) {
         if(command!=""){ command+=",";}
         command+="CropY = "+POut.Int(document.CropY)+"";
     }
     if(document.CropW != oldDocument.CropW) {
         if(command!=""){ command+=",";}
         command+="CropW = "+POut.Int(document.CropW)+"";
     }
     if(document.CropH != oldDocument.CropH) {
         if(command!=""){ command+=",";}
         command+="CropH = "+POut.Int(document.CropH)+"";
     }
     if(document.WindowingMin != oldDocument.WindowingMin) {
         if(command!=""){ command+=",";}
         command+="WindowingMin = "+POut.Int(document.WindowingMin)+"";
     }
     if(document.WindowingMax != oldDocument.WindowingMax) {
         if(command!=""){ command+=",";}
         command+="WindowingMax = "+POut.Int(document.WindowingMax)+"";
     }
     if(document.MountItemNum != oldDocument.MountItemNum) {
         if(command!=""){ command+=",";}
         command+="MountItemNum = "+POut.Long(document.MountItemNum)+"";
     }
     //DateTStamp can only be set by MySQL
     if(document.RawBase64 != oldDocument.RawBase64) {
         if(command!=""){ command+=",";}
         command+="RawBase64 = "+DbHelper.ParamChar+"paramRawBase64";
     }
     if(document.Thumbnail != oldDocument.Thumbnail) {
         if(command!=""){ command+=",";}
         command+="Thumbnail = "+DbHelper.ParamChar+"paramThumbnail";
     }
     if(command==""){
         return;
     }
     if(document.RawBase64==null) {
         document.RawBase64="";
     }
     OdSqlParameter paramRawBase64=new OdSqlParameter("paramRawBase64",OdDbType.Text,document.RawBase64);
     if(document.Thumbnail==null) {
         document.Thumbnail="";
     }
     OdSqlParameter paramThumbnail=new OdSqlParameter("paramThumbnail",OdDbType.Text,document.Thumbnail);
     command="UPDATE document SET "+command
         +" WHERE DocNum = "+POut.Long(document.DocNum);
     Db.NonQ(command,paramRawBase64,paramThumbnail);
 }
Ejemplo n.º 56
0
        ///<summary>Updates one Job in the database.</summary>
        public static void Update(Job job)
        {
            string command = "UPDATE job SET "
                             + "UserNumConcept         =  " + POut.Long(job.UserNumConcept) + ", "
                             + "UserNumExpert          =  " + POut.Long(job.UserNumExpert) + ", "
                             + "UserNumEngineer        =  " + POut.Long(job.UserNumEngineer) + ", "
                             + "UserNumApproverConcept =  " + POut.Long(job.UserNumApproverConcept) + ", "
                             + "UserNumApproverJob     =  " + POut.Long(job.UserNumApproverJob) + ", "
                             + "UserNumApproverChange  =  " + POut.Long(job.UserNumApproverChange) + ", "
                             + "UserNumDocumenter      =  " + POut.Long(job.UserNumDocumenter) + ", "
                             + "UserNumCustContact     =  " + POut.Long(job.UserNumCustContact) + ", "
                             + "UserNumCheckout        =  " + POut.Long(job.UserNumCheckout) + ", "
                             + "UserNumInfo            =  " + POut.Long(job.UserNumInfo) + ", "
                             + "ParentNum              =  " + POut.Long(job.ParentNum) + ", "
                             + "DateTimeCustContact    =  " + POut.DateT(job.DateTimeCustContact) + ", "
                             + "Priority               =  " + POut.Long(job.Priority) + ", "
                             + "Category               = '" + POut.String(job.Category.ToString()) + "', "
                             + "JobVersion             = '" + POut.String(job.JobVersion) + "', "
                             + "TimeEstimateDevelopment=  " + POut.Long(job.TimeEstimateDevelopment.Ticks) + ", "
                             + "TimeActual             =  " + POut.Long(job.TimeActual.Ticks) + ", "
                             //DateTimeEntry not allowed to change
                             + "Implementation         =  " + DbHelper.ParamChar + "paramImplementation, "
                             + "Documentation          =  " + DbHelper.ParamChar + "paramDocumentation, "
                             + "Title                  = '" + POut.String(job.Title) + "', "
                             + "PhaseCur               = '" + POut.String(job.PhaseCur.ToString()) + "', "
                             + "IsApprovalNeeded       =  " + POut.Bool(job.IsApprovalNeeded) + ", "
                             + "AckDateTime            =  " + POut.DateT(job.AckDateTime) + ", "
                             + "UserNumQuoter          =  " + POut.Long(job.UserNumQuoter) + ", "
                             + "UserNumApproverQuote   =  " + POut.Long(job.UserNumApproverQuote) + ", "
                             + "UserNumCustQuote       =  " + POut.Long(job.UserNumCustQuote) + ", "
                             + "Requirements           =  " + DbHelper.ParamChar + "paramRequirements, "
                             + "UserNumTester          =  " + POut.Long(job.UserNumTester) + ", "
                             + "PriorityTesting        =  " + POut.Long(job.PriorityTesting) + ", "
                             + "DateTimeTested         =  " + POut.DateT(job.DateTimeTested) + ", "
                             + "TimeEstimateConcept    =  " + POut.Long(job.TimeEstimateConcept.Ticks) + ", "
                             + "TimeEstimateWriteup    =  " + POut.Long(job.TimeEstimateWriteup.Ticks) + ", "
                             + "TimeEstimateReview     =  " + POut.Long(job.TimeEstimateReview.Ticks) + ", "
                             + "RequirementsJSON       =  " + DbHelper.ParamChar + "paramRequirementsJSON, "
                             + "PatternReviewProject   =  " + POut.Int((int)job.PatternReviewProject) + ", "
                             + "PatternReviewStatus    =  " + POut.Int((int)job.PatternReviewStatus) + ", "
                             + "ProposedVersion        =  " + POut.Int((int)job.ProposedVersion) + ", "
                             + "DateTimeConceptApproval=  " + POut.DateT(job.DateTimeConceptApproval) + ", "
                             + "DateTimeJobApproval    =  " + POut.DateT(job.DateTimeJobApproval) + ", "
                             + "DateTimeImplemented    =  " + POut.DateT(job.DateTimeImplemented) + ", "
                             + "TimeTesting            =  " + POut.Long(job.TimeTesting.Ticks) + ", "
                             + "IsNotTested            =  " + POut.Bool(job.IsNotTested) + " "
                             + "WHERE JobNum = " + POut.Long(job.JobNum);

            if (job.Implementation == null)
            {
                job.Implementation = "";
            }
            OdSqlParameter paramImplementation = new OdSqlParameter("paramImplementation", OdDbType.Text, POut.StringParam(job.Implementation));

            if (job.Documentation == null)
            {
                job.Documentation = "";
            }
            OdSqlParameter paramDocumentation = new OdSqlParameter("paramDocumentation", OdDbType.Text, POut.StringParam(job.Documentation));

            if (job.Requirements == null)
            {
                job.Requirements = "";
            }
            OdSqlParameter paramRequirements = new OdSqlParameter("paramRequirements", OdDbType.Text, POut.StringParam(job.Requirements));

            if (job.RequirementsJSON == null)
            {
                job.RequirementsJSON = "";
            }
            OdSqlParameter paramRequirementsJSON = new OdSqlParameter("paramRequirementsJSON", OdDbType.Text, POut.StringParam(job.RequirementsJSON));

            Db.NonQ(command, paramImplementation, paramDocumentation, paramRequirements, paramRequirementsJSON);
        }
Ejemplo n.º 57
0
		///<summary>Updates one Commlog in the database.</summary>
		public static void Update(Commlog commlog){
			string command="UPDATE commlog SET "
				+"PatNum        =  "+POut.Long  (commlog.PatNum)+", "
				+"CommDateTime  =  "+POut.DateT (commlog.CommDateTime)+", "
				+"CommType      =  "+POut.Long  (commlog.CommType)+", "
				+"Note          =  "+DbHelper.ParamChar+"paramNote, "
				+"Mode_         =  "+POut.Int   ((int)commlog.Mode_)+", "
				+"SentOrReceived=  "+POut.Int   ((int)commlog.SentOrReceived)+", "
				+"UserNum       =  "+POut.Long  (commlog.UserNum)+", "
				+"Signature     = '"+POut.String(commlog.Signature)+"', "
				+"SigIsTopaz    =  "+POut.Bool  (commlog.SigIsTopaz)+", "
				//DateTStamp can only be set by MySQL
				+"DateTimeEnd   =  "+POut.DateT (commlog.DateTimeEnd)+", "
				+"IsWebSched    =  "+POut.Bool  (commlog.IsWebSched)+" "
				+"WHERE CommlogNum = "+POut.Long(commlog.CommlogNum);
			if(commlog.Note==null) {
				commlog.Note="";
			}
			OdSqlParameter paramNote=new OdSqlParameter("paramNote",OdDbType.Text,POut.StringNote(commlog.Note));
			Db.NonQ(command,paramNote);
		}
Ejemplo n.º 58
0
        ///<summary>Updates one Job 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(Job job, Job oldJob)
        {
            string command = "";

            if (job.UserNumConcept != oldJob.UserNumConcept)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNumConcept = " + POut.Long(job.UserNumConcept) + "";
            }
            if (job.UserNumExpert != oldJob.UserNumExpert)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNumExpert = " + POut.Long(job.UserNumExpert) + "";
            }
            if (job.UserNumEngineer != oldJob.UserNumEngineer)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNumEngineer = " + POut.Long(job.UserNumEngineer) + "";
            }
            if (job.UserNumApproverConcept != oldJob.UserNumApproverConcept)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNumApproverConcept = " + POut.Long(job.UserNumApproverConcept) + "";
            }
            if (job.UserNumApproverJob != oldJob.UserNumApproverJob)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNumApproverJob = " + POut.Long(job.UserNumApproverJob) + "";
            }
            if (job.UserNumApproverChange != oldJob.UserNumApproverChange)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNumApproverChange = " + POut.Long(job.UserNumApproverChange) + "";
            }
            if (job.UserNumDocumenter != oldJob.UserNumDocumenter)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNumDocumenter = " + POut.Long(job.UserNumDocumenter) + "";
            }
            if (job.UserNumCustContact != oldJob.UserNumCustContact)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNumCustContact = " + POut.Long(job.UserNumCustContact) + "";
            }
            if (job.UserNumCheckout != oldJob.UserNumCheckout)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNumCheckout = " + POut.Long(job.UserNumCheckout) + "";
            }
            if (job.UserNumInfo != oldJob.UserNumInfo)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNumInfo = " + POut.Long(job.UserNumInfo) + "";
            }
            if (job.ParentNum != oldJob.ParentNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ParentNum = " + POut.Long(job.ParentNum) + "";
            }
            if (job.DateTimeCustContact != oldJob.DateTimeCustContact)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeCustContact = " + POut.DateT(job.DateTimeCustContact) + "";
            }
            if (job.Priority != oldJob.Priority)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Priority = " + POut.Long(job.Priority) + "";
            }
            if (job.Category != oldJob.Category)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Category = '" + POut.String(job.Category.ToString()) + "'";
            }
            if (job.JobVersion != oldJob.JobVersion)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "JobVersion = '" + POut.String(job.JobVersion) + "'";
            }
            if (job.TimeEstimateDevelopment != oldJob.TimeEstimateDevelopment)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TimeEstimateDevelopment = '" + POut.Long(job.TimeEstimateDevelopment.Ticks) + "'";
            }
            if (job.TimeActual != oldJob.TimeActual)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TimeActual = '" + POut.Long(job.TimeActual.Ticks) + "'";
            }
            //DateTimeEntry not allowed to change
            if (job.Implementation != oldJob.Implementation)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Implementation = " + DbHelper.ParamChar + "paramImplementation";
            }
            if (job.Documentation != oldJob.Documentation)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Documentation = " + DbHelper.ParamChar + "paramDocumentation";
            }
            if (job.Title != oldJob.Title)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Title = '" + POut.String(job.Title) + "'";
            }
            if (job.PhaseCur != oldJob.PhaseCur)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PhaseCur = '" + POut.String(job.PhaseCur.ToString()) + "'";
            }
            if (job.IsApprovalNeeded != oldJob.IsApprovalNeeded)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsApprovalNeeded = " + POut.Bool(job.IsApprovalNeeded) + "";
            }
            if (job.AckDateTime != oldJob.AckDateTime)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "AckDateTime = " + POut.DateT(job.AckDateTime) + "";
            }
            if (job.UserNumQuoter != oldJob.UserNumQuoter)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNumQuoter = " + POut.Long(job.UserNumQuoter) + "";
            }
            if (job.UserNumApproverQuote != oldJob.UserNumApproverQuote)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNumApproverQuote = " + POut.Long(job.UserNumApproverQuote) + "";
            }
            if (job.UserNumCustQuote != oldJob.UserNumCustQuote)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNumCustQuote = " + POut.Long(job.UserNumCustQuote) + "";
            }
            if (job.Requirements != oldJob.Requirements)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Requirements = " + DbHelper.ParamChar + "paramRequirements";
            }
            if (job.UserNumTester != oldJob.UserNumTester)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UserNumTester = " + POut.Long(job.UserNumTester) + "";
            }
            if (job.PriorityTesting != oldJob.PriorityTesting)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PriorityTesting = " + POut.Long(job.PriorityTesting) + "";
            }
            if (job.DateTimeTested != oldJob.DateTimeTested)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeTested = " + POut.DateT(job.DateTimeTested) + "";
            }
            if (job.TimeEstimateConcept != oldJob.TimeEstimateConcept)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TimeEstimateConcept = '" + POut.Long(job.TimeEstimateConcept.Ticks) + "'";
            }
            if (job.TimeEstimateWriteup != oldJob.TimeEstimateWriteup)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TimeEstimateWriteup = '" + POut.Long(job.TimeEstimateWriteup.Ticks) + "'";
            }
            if (job.TimeEstimateReview != oldJob.TimeEstimateReview)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TimeEstimateReview = '" + POut.Long(job.TimeEstimateReview.Ticks) + "'";
            }
            if (job.RequirementsJSON != oldJob.RequirementsJSON)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "RequirementsJSON = " + DbHelper.ParamChar + "paramRequirementsJSON";
            }
            if (job.PatternReviewProject != oldJob.PatternReviewProject)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatternReviewProject = " + POut.Int((int)job.PatternReviewProject) + "";
            }
            if (job.PatternReviewStatus != oldJob.PatternReviewStatus)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatternReviewStatus = " + POut.Int((int)job.PatternReviewStatus) + "";
            }
            if (job.ProposedVersion != oldJob.ProposedVersion)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ProposedVersion = " + POut.Int((int)job.ProposedVersion) + "";
            }
            if (job.DateTimeConceptApproval != oldJob.DateTimeConceptApproval)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeConceptApproval = " + POut.DateT(job.DateTimeConceptApproval) + "";
            }
            if (job.DateTimeJobApproval != oldJob.DateTimeJobApproval)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeJobApproval = " + POut.DateT(job.DateTimeJobApproval) + "";
            }
            if (job.DateTimeImplemented != oldJob.DateTimeImplemented)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateTimeImplemented = " + POut.DateT(job.DateTimeImplemented) + "";
            }
            if (job.TimeTesting != oldJob.TimeTesting)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "TimeTesting = '" + POut.Long(job.TimeTesting.Ticks) + "'";
            }
            if (job.IsNotTested != oldJob.IsNotTested)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsNotTested = " + POut.Bool(job.IsNotTested) + "";
            }
            if (command == "")
            {
                return(false);
            }
            if (job.Implementation == null)
            {
                job.Implementation = "";
            }
            OdSqlParameter paramImplementation = new OdSqlParameter("paramImplementation", OdDbType.Text, POut.StringParam(job.Implementation));

            if (job.Documentation == null)
            {
                job.Documentation = "";
            }
            OdSqlParameter paramDocumentation = new OdSqlParameter("paramDocumentation", OdDbType.Text, POut.StringParam(job.Documentation));

            if (job.Requirements == null)
            {
                job.Requirements = "";
            }
            OdSqlParameter paramRequirements = new OdSqlParameter("paramRequirements", OdDbType.Text, POut.StringParam(job.Requirements));

            if (job.RequirementsJSON == null)
            {
                job.RequirementsJSON = "";
            }
            OdSqlParameter paramRequirementsJSON = new OdSqlParameter("paramRequirementsJSON", OdDbType.Text, POut.StringParam(job.RequirementsJSON));

            command = "UPDATE job SET " + command
                      + " WHERE JobNum = " + POut.Long(job.JobNum);
            Db.NonQ(command, paramImplementation, paramDocumentation, paramRequirements, paramRequirementsJSON);
            return(true);
        }
Ejemplo n.º 59
0
		///<summary>Inserts one Commlog into the database.  Provides option to use the existing priKey.</summary>
		public static long Insert(Commlog commlog,bool useExistingPK){
			if(!useExistingPK && PrefC.RandomKeys) {
				commlog.CommlogNum=ReplicationServers.GetKey("commlog","CommlogNum");
			}
			string command="INSERT INTO commlog (";
			if(useExistingPK || PrefC.RandomKeys) {
				command+="CommlogNum,";
			}
			command+="PatNum,CommDateTime,CommType,Note,Mode_,SentOrReceived,UserNum,Signature,SigIsTopaz,DateTimeEnd,IsWebSched) VALUES(";
			if(useExistingPK || PrefC.RandomKeys) {
				command+=POut.Long(commlog.CommlogNum)+",";
			}
			command+=
				     POut.Long  (commlog.PatNum)+","
				+    POut.DateT (commlog.CommDateTime)+","
				+    POut.Long  (commlog.CommType)+","
				+    DbHelper.ParamChar+"paramNote,"
				+    POut.Int   ((int)commlog.Mode_)+","
				+    POut.Int   ((int)commlog.SentOrReceived)+","
				+    POut.Long  (commlog.UserNum)+","
				+"'"+POut.String(commlog.Signature)+"',"
				+    POut.Bool  (commlog.SigIsTopaz)+","
				//DateTStamp can only be set by MySQL
				+    POut.DateT (commlog.DateTimeEnd)+","
				+    POut.Bool  (commlog.IsWebSched)+")";
			if(commlog.Note==null) {
				commlog.Note="";
			}
			OdSqlParameter paramNote=new OdSqlParameter("paramNote",OdDbType.Text,POut.StringNote(commlog.Note));
			if(useExistingPK || PrefC.RandomKeys) {
				Db.NonQ(command,paramNote);
			}
			else {
				commlog.CommlogNum=Db.NonQ(command,true,paramNote);
			}
			return commlog.CommlogNum;
		}
Ejemplo n.º 60
0
        ///<summary>Updates one RepeatCharge 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(RepeatCharge repeatCharge, RepeatCharge oldRepeatCharge)
        {
            string command = "";

            if (repeatCharge.PatNum != oldRepeatCharge.PatNum)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "PatNum = " + POut.Long(repeatCharge.PatNum) + "";
            }
            if (repeatCharge.ProcCode != oldRepeatCharge.ProcCode)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ProcCode = '" + POut.String(repeatCharge.ProcCode) + "'";
            }
            if (repeatCharge.ChargeAmt != oldRepeatCharge.ChargeAmt)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ChargeAmt = '" + POut.Double(repeatCharge.ChargeAmt) + "'";
            }
            if (repeatCharge.DateStart.Date != oldRepeatCharge.DateStart.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateStart = " + POut.Date(repeatCharge.DateStart) + "";
            }
            if (repeatCharge.DateStop.Date != oldRepeatCharge.DateStop.Date)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "DateStop = " + POut.Date(repeatCharge.DateStop) + "";
            }
            if (repeatCharge.Note != oldRepeatCharge.Note)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Note = " + DbHelper.ParamChar + "paramNote";
            }
            if (repeatCharge.CopyNoteToProc != oldRepeatCharge.CopyNoteToProc)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CopyNoteToProc = " + POut.Bool(repeatCharge.CopyNoteToProc) + "";
            }
            if (repeatCharge.CreatesClaim != oldRepeatCharge.CreatesClaim)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "CreatesClaim = " + POut.Bool(repeatCharge.CreatesClaim) + "";
            }
            if (repeatCharge.IsEnabled != oldRepeatCharge.IsEnabled)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "IsEnabled = " + POut.Bool(repeatCharge.IsEnabled) + "";
            }
            if (repeatCharge.UsePrepay != oldRepeatCharge.UsePrepay)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UsePrepay = " + POut.Bool(repeatCharge.UsePrepay) + "";
            }
            if (repeatCharge.Npi != oldRepeatCharge.Npi)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "Npi = " + DbHelper.ParamChar + "paramNpi";
            }
            if (repeatCharge.ErxAccountId != oldRepeatCharge.ErxAccountId)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ErxAccountId = " + DbHelper.ParamChar + "paramErxAccountId";
            }
            if (repeatCharge.ProviderName != oldRepeatCharge.ProviderName)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ProviderName = " + DbHelper.ParamChar + "paramProviderName";
            }
            if (repeatCharge.ChargeAmtAlt != oldRepeatCharge.ChargeAmtAlt)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "ChargeAmtAlt = '" + POut.Double(repeatCharge.ChargeAmtAlt) + "'";
            }
            if (repeatCharge.UnearnedTypes != oldRepeatCharge.UnearnedTypes)
            {
                if (command != "")
                {
                    command += ",";
                }
                command += "UnearnedTypes = '" + POut.String(repeatCharge.UnearnedTypes) + "'";
            }
            if (command == "")
            {
                return(false);
            }
            if (repeatCharge.Note == null)
            {
                repeatCharge.Note = "";
            }
            OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(repeatCharge.Note));

            if (repeatCharge.Npi == null)
            {
                repeatCharge.Npi = "";
            }
            OdSqlParameter paramNpi = new OdSqlParameter("paramNpi", OdDbType.Text, POut.StringParam(repeatCharge.Npi));

            if (repeatCharge.ErxAccountId == null)
            {
                repeatCharge.ErxAccountId = "";
            }
            OdSqlParameter paramErxAccountId = new OdSqlParameter("paramErxAccountId", OdDbType.Text, POut.StringParam(repeatCharge.ErxAccountId));

            if (repeatCharge.ProviderName == null)
            {
                repeatCharge.ProviderName = "";
            }
            OdSqlParameter paramProviderName = new OdSqlParameter("paramProviderName", OdDbType.Text, POut.StringParam(repeatCharge.ProviderName));

            command = "UPDATE repeatcharge SET " + command
                      + " WHERE RepeatChargeNum = " + POut.Long(repeatCharge.RepeatChargeNum);
            Db.NonQ(command, paramNote, paramNpi, paramErxAccountId, paramProviderName);
            return(true);
        }