Esempio n. 1
0
        ///<summary>Inserts one Dunning into the database.  Provides option to use the existing priKey.</summary>
        internal static long Insert(Dunning dunning, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                dunning.DunningNum = ReplicationServers.GetKey("dunning", "DunningNum");
            }
            string command = "INSERT INTO dunning (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "DunningNum,";
            }
            command += "DunMessage,BillingType,AgeAccount,InsIsPending,MessageBold) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(dunning.DunningNum) + ",";
            }
            command +=
                "'" + POut.String(dunning.DunMessage) + "',"
                + POut.Long(dunning.BillingType) + ","
                + POut.Byte(dunning.AgeAccount) + ","
                + POut.Int((int)dunning.InsIsPending) + ","
                + "'" + POut.String(dunning.MessageBold) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                dunning.DunningNum = Db.NonQ(command, true);
            }
            return(dunning.DunningNum);
        }
Esempio n. 2
0
        ///<summary>Inserts one JobLink into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(JobLink jobLink, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                jobLink.JobLinkNum = ReplicationServers.GetKey("joblink", "JobLinkNum");
            }
            string command = "INSERT INTO joblink (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "JobLinkNum,";
            }
            command += "JobNum,FKey,LinkType,Tag,DisplayOverride) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(jobLink.JobLinkNum) + ",";
            }
            command +=
                POut.Long(jobLink.JobNum) + ","
                + POut.Long(jobLink.FKey) + ","
                + POut.Int((int)jobLink.LinkType) + ","
                + "'" + POut.String(jobLink.Tag) + "',"
                + "'" + POut.String(jobLink.DisplayOverride) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                jobLink.JobLinkNum = Db.NonQ(command, true, "JobLinkNum", "jobLink");
            }
            return(jobLink.JobLinkNum);
        }
Esempio n. 3
0
        ///<summary>Inserts one AutoNote into the database.  Provides option to use the existing priKey.</summary>
        internal static long Insert(AutoNote autoNote, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                autoNote.AutoNoteNum = ReplicationServers.GetKey("autonote", "AutoNoteNum");
            }
            string command = "INSERT INTO autonote (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "AutoNoteNum,";
            }
            command += "AutoNoteName,MainText) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(autoNote.AutoNoteNum) + ",";
            }
            command +=
                "'" + POut.String(autoNote.AutoNoteName) + "',"
                + "'" + POut.String(autoNote.MainText) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                autoNote.AutoNoteNum = Db.NonQ(command, true);
            }
            return(autoNote.AutoNoteNum);
        }
Esempio n. 4
0
        ///<summary>Inserts one ResellerService into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(ResellerService resellerService, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                resellerService.ResellerServiceNum = ReplicationServers.GetKey("resellerservice", "ResellerServiceNum");
            }
            string command = "INSERT INTO resellerservice (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "ResellerServiceNum,";
            }
            command += "ResellerNum,CodeNum,Fee) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(resellerService.ResellerServiceNum) + ",";
            }
            command +=
                POut.Long(resellerService.ResellerNum) + ","
                + POut.Long(resellerService.CodeNum) + ","
                + "'" + POut.Double(resellerService.Fee) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                resellerService.ResellerServiceNum = Db.NonQ(command, true, "ResellerServiceNum", "resellerService");
            }
            return(resellerService.ResellerServiceNum);
        }
Esempio n. 5
0
        ///<summary>Inserts one Contact into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(Contact contact, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                contact.ContactNum = ReplicationServers.GetKey("contact", "ContactNum");
            }
            string command = "INSERT INTO contact (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "ContactNum,";
            }
            command += "LName,FName,WkPhone,Fax,Category,Notes) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(contact.ContactNum) + ",";
            }
            command +=
                "'" + POut.String(contact.LName) + "',"
                + "'" + POut.String(contact.FName) + "',"
                + "'" + POut.String(contact.WkPhone) + "',"
                + "'" + POut.String(contact.Fax) + "',"
                + POut.Long(contact.Category) + ","
                + "'" + POut.String(contact.Notes) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                contact.ContactNum = Db.NonQ(command, true);
            }
            return(contact.ContactNum);
        }
Esempio n. 6
0
        ///<summary>Inserts one ElectID into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(ElectID electID, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                electID.ElectIDNum = ReplicationServers.GetKey("electid", "ElectIDNum");
            }
            string command = "INSERT INTO electid (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "ElectIDNum,";
            }
            command += "PayorID,CarrierName,IsMedicaid,ProviderTypes,Comments) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(electID.ElectIDNum) + ",";
            }
            command +=
                "'" + POut.String(electID.PayorID) + "',"
                + "'" + POut.String(electID.CarrierName) + "',"
                + POut.Bool(electID.IsMedicaid) + ","
                + "'" + POut.String(electID.ProviderTypes) + "',"
                + "'" + POut.String(electID.Comments) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                electID.ElectIDNum = Db.NonQ(command, true);
            }
            return(electID.ElectIDNum);
        }
Esempio n. 7
0
        ///<summary>Inserts one ProcMultiVisit into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(ProcMultiVisit procMultiVisit, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                procMultiVisit.ProcMultiVisitNum = ReplicationServers.GetKey("procmultivisit", "ProcMultiVisitNum");
            }
            string command = "INSERT INTO procmultivisit (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "ProcMultiVisitNum,";
            }
            command += "GroupProcMultiVisitNum,ProcNum,ProcStatus,IsInProcess) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(procMultiVisit.ProcMultiVisitNum) + ",";
            }
            command +=
                POut.Long(procMultiVisit.GroupProcMultiVisitNum) + ","
                + POut.Long(procMultiVisit.ProcNum) + ","
                + POut.Int((int)procMultiVisit.ProcStatus) + ","
                + POut.Bool(procMultiVisit.IsInProcess) + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                procMultiVisit.ProcMultiVisitNum = Db.NonQ(command, true, "ProcMultiVisitNum", "procMultiVisit");
            }
            return(procMultiVisit.ProcMultiVisitNum);
        }
Esempio n. 8
0
        ///<summary>Inserts one PayPeriod into the database.  Provides option to use the existing priKey.</summary>
        internal static long Insert(PayPeriod payPeriod, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                payPeriod.PayPeriodNum = ReplicationServers.GetKey("payperiod", "PayPeriodNum");
            }
            string command = "INSERT INTO payperiod (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "PayPeriodNum,";
            }
            command += "DateStart,DateStop,DatePaycheck) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(payPeriod.PayPeriodNum) + ",";
            }
            command +=
                POut.Date(payPeriod.DateStart) + ","
                + POut.Date(payPeriod.DateStop) + ","
                + POut.Date(payPeriod.DatePaycheck) + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                payPeriod.PayPeriodNum = Db.NonQ(command, true);
            }
            return(payPeriod.PayPeriodNum);
        }
Esempio n. 9
0
        ///<summary>Inserts one AutomationCondition into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(AutomationCondition automationCondition, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                automationCondition.AutomationConditionNum = ReplicationServers.GetKey("automationcondition", "AutomationConditionNum");
            }
            string command = "INSERT INTO automationcondition (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "AutomationConditionNum,";
            }
            command += "AutomationNum,CompareField,Comparison,CompareString) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(automationCondition.AutomationConditionNum) + ",";
            }
            command +=
                POut.Long(automationCondition.AutomationNum) + ","
                + POut.Int((int)automationCondition.CompareField) + ","
                + POut.Int((int)automationCondition.Comparison) + ","
                + "'" + POut.String(automationCondition.CompareString) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                automationCondition.AutomationConditionNum = Db.NonQ(command, true, "AutomationConditionNum", "automationCondition");
            }
            return(automationCondition.AutomationConditionNum);
        }
Esempio n. 10
0
        ///<summary>Inserts one AllergyDef into the database.  Provides option to use the existing priKey.</summary>
        internal static long Insert(AllergyDef allergyDef, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                allergyDef.AllergyDefNum = ReplicationServers.GetKey("allergydef", "AllergyDefNum");
            }
            string command = "INSERT INTO allergydef (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "AllergyDefNum,";
            }
            command += "Description,IsHidden,Snomed,MedicationNum) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(allergyDef.AllergyDefNum) + ",";
            }
            command +=
                "'" + POut.String(allergyDef.Description) + "',"
                + POut.Bool(allergyDef.IsHidden) + ","
                //DateTStamp can only be set by MySQL
                + POut.Int((int)allergyDef.Snomed) + ","
                + POut.Long(allergyDef.MedicationNum) + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                allergyDef.AllergyDefNum = Db.NonQ(command, true);
            }
            return(allergyDef.AllergyDefNum);
        }
Esempio n. 11
0
        ///<summary>Inserts one VaccineDef into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(VaccineDef vaccineDef, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                vaccineDef.VaccineDefNum = ReplicationServers.GetKey("vaccinedef", "VaccineDefNum");
            }
            string command = "INSERT INTO vaccinedef (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "VaccineDefNum,";
            }
            command += "CVXCode,VaccineName,DrugManufacturerNum) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(vaccineDef.VaccineDefNum) + ",";
            }
            command +=
                "'" + POut.String(vaccineDef.CVXCode) + "',"
                + "'" + POut.String(vaccineDef.VaccineName) + "',"
                + POut.Long(vaccineDef.DrugManufacturerNum) + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                vaccineDef.VaccineDefNum = Db.NonQ(command, true, "VaccineDefNum", "vaccineDef");
            }
            return(vaccineDef.VaccineDefNum);
        }
Esempio n. 12
0
		///<summary>Inserts one Letter into the database.  Provides option to use the existing priKey.</summary>
		public 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,POut.StringParam(letter.BodyText));
			if(useExistingPK || PrefC.RandomKeys) {
				Db.NonQ(command,paramBodyText);
			}
			else {
				letter.LetterNum=Db.NonQ(command,true,"LetterNum","letter",paramBodyText);
			}
			return letter.LetterNum;
		}
Esempio n. 13
0
        ///<summary>Inserts one FamilyHealth into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(FamilyHealth familyHealth, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                familyHealth.FamilyHealthNum = ReplicationServers.GetKey("familyhealth", "FamilyHealthNum");
            }
            string command = "INSERT INTO familyhealth (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "FamilyHealthNum,";
            }
            command += "PatNum,Relationship,DiseaseDefNum,PersonName) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(familyHealth.FamilyHealthNum) + ",";
            }
            command +=
                POut.Long(familyHealth.PatNum) + ","
                + POut.Int((int)familyHealth.Relationship) + ","
                + POut.Long(familyHealth.DiseaseDefNum) + ","
                + "'" + POut.String(familyHealth.PersonName) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                familyHealth.FamilyHealthNum = Db.NonQ(command, true, "FamilyHealthNum", "familyHealth");
            }
            return(familyHealth.FamilyHealthNum);
        }
Esempio n. 14
0
        ///<summary>Inserts one CustRefEntry into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(CustRefEntry custRefEntry, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                custRefEntry.CustRefEntryNum = ReplicationServers.GetKey("custrefentry", "CustRefEntryNum");
            }
            string command = "INSERT INTO custrefentry (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "CustRefEntryNum,";
            }
            command += "PatNumCust,PatNumRef,DateEntry,Note) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(custRefEntry.CustRefEntryNum) + ",";
            }
            command +=
                POut.Long(custRefEntry.PatNumCust) + ","
                + POut.Long(custRefEntry.PatNumRef) + ","
                + POut.Date(custRefEntry.DateEntry) + ","
                + "'" + POut.String(custRefEntry.Note) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                custRefEntry.CustRefEntryNum = Db.NonQ(command, true);
            }
            return(custRefEntry.CustRefEntryNum);
        }
Esempio n. 15
0
        ///<summary>Inserts one ConnGroupAttach into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(ConnGroupAttach connGroupAttach, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                connGroupAttach.ConnGroupAttachNum = ReplicationServers.GetKey("conngroupattach", "ConnGroupAttachNum");
            }
            string command = "INSERT INTO conngroupattach (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "ConnGroupAttachNum,";
            }
            command += "ConnectionGroupNum,CentralConnectionNum) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(connGroupAttach.ConnGroupAttachNum) + ",";
            }
            command +=
                POut.Long(connGroupAttach.ConnectionGroupNum) + ","
                + POut.Long(connGroupAttach.CentralConnectionNum) + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                connGroupAttach.ConnGroupAttachNum = Db.NonQ(command, true, "ConnGroupAttachNum", "connGroupAttach");
            }
            return(connGroupAttach.ConnGroupAttachNum);
        }
Esempio n. 16
0
        ///<summary>Inserts one Employee into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(Employee employee, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                employee.EmployeeNum = ReplicationServers.GetKey("employee", "EmployeeNum");
            }
            string command = "INSERT INTO employee (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "EmployeeNum,";
            }
            command += "LName,FName,MiddleI,IsHidden,ClockStatus,PhoneExt,PayrollID) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(employee.EmployeeNum) + ",";
            }
            command +=
                "'" + POut.String(employee.LName) + "',"
                + "'" + POut.String(employee.FName) + "',"
                + "'" + POut.String(employee.MiddleI) + "',"
                + POut.Bool(employee.IsHidden) + ","
                + "'" + POut.String(employee.ClockStatus) + "',"
                + POut.Int(employee.PhoneExt) + ","
                + "'" + POut.String(employee.PayrollID) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                employee.EmployeeNum = Db.NonQ(command, true, "EmployeeNum", "employee");
            }
            return(employee.EmployeeNum);
        }
Esempio n. 17
0
        ///<summary>Inserts one Automation into the database.  Provides option to use the existing priKey.</summary>
        internal static long Insert(Automation automation, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                automation.AutomationNum = ReplicationServers.GetKey("automation", "AutomationNum");
            }
            string command = "INSERT INTO automation (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "AutomationNum,";
            }
            command += "Description,Autotrigger,ProcCodes,AutoAction,SheetDefNum,CommType,MessageContent) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(automation.AutomationNum) + ",";
            }
            command +=
                "'" + POut.String(automation.Description) + "',"
                + POut.Int((int)automation.Autotrigger) + ","
                + "'" + POut.String(automation.ProcCodes) + "',"
                + POut.Int((int)automation.AutoAction) + ","
                + POut.Long(automation.SheetDefNum) + ","
                + POut.Long(automation.CommType) + ","
                + "'" + POut.String(automation.MessageContent) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                automation.AutomationNum = Db.NonQ(command, true);
            }
            return(automation.AutomationNum);
        }
Esempio n. 18
0
        ///<summary>Inserts one EvaluationDef into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(EvaluationDef evaluationDef, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                evaluationDef.EvaluationDefNum = ReplicationServers.GetKey("evaluationdef", "EvaluationDefNum");
            }
            string command = "INSERT INTO evaluationdef (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "EvaluationDefNum,";
            }
            command += "SchoolCourseNum,EvalTitle,GradingScaleNum) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(evaluationDef.EvaluationDefNum) + ",";
            }
            command +=
                POut.Long(evaluationDef.SchoolCourseNum) + ","
                + "'" + POut.String(evaluationDef.EvalTitle) + "',"
                + POut.Long(evaluationDef.GradingScaleNum) + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                evaluationDef.EvaluationDefNum = Db.NonQ(command, true, "EvaluationDefNum", "evaluationDef");
            }
            return(evaluationDef.EvaluationDefNum);
        }
Esempio n. 19
0
        ///<summary>Inserts one EduResource into the database.  Provides option to use the existing priKey.</summary>
        internal static long Insert(EduResource eduResource, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                eduResource.EduResourceNum = ReplicationServers.GetKey("eduresource", "EduResourceNum");
            }
            string command = "INSERT INTO eduresource (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "EduResourceNum,";
            }
            command += "DiseaseDefNum,MedicationNum,LabResultID,LabResultName,LabResultCompare,ResourceUrl,Icd9Num) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(eduResource.EduResourceNum) + ",";
            }
            command +=
                POut.Long(eduResource.DiseaseDefNum) + ","
                + POut.Long(eduResource.MedicationNum) + ","
                + "'" + POut.String(eduResource.LabResultID) + "',"
                + "'" + POut.String(eduResource.LabResultName) + "',"
                + "'" + POut.String(eduResource.LabResultCompare) + "',"
                + "'" + POut.String(eduResource.ResourceUrl) + "',"
                + POut.Long(eduResource.Icd9Num) + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                eduResource.EduResourceNum = Db.NonQ(command, true);
            }
            return(eduResource.EduResourceNum);
        }
Esempio n. 20
0
        ///<summary>Inserts one ReminderRule into the database.  Provides option to use the existing priKey.</summary>
        internal static long Insert(ReminderRule reminderRule, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                reminderRule.ReminderRuleNum = ReplicationServers.GetKey("reminderrule", "ReminderRuleNum");
            }
            string command = "INSERT INTO reminderrule (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "ReminderRuleNum,";
            }
            command += "ReminderCriterion,CriterionFK,CriterionValue,Message) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(reminderRule.ReminderRuleNum) + ",";
            }
            command +=
                POut.Int((int)reminderRule.ReminderCriterion) + ","
                + POut.Long(reminderRule.CriterionFK) + ","
                + "'" + POut.String(reminderRule.CriterionValue) + "',"
                + "'" + POut.String(reminderRule.Message) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                reminderRule.ReminderRuleNum = Db.NonQ(command, true);
            }
            return(reminderRule.ReminderRuleNum);
        }
Esempio n. 21
0
        ///<summary>Inserts one LabTurnaround into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(LabTurnaround labTurnaround, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                labTurnaround.LabTurnaroundNum = ReplicationServers.GetKey("labturnaround", "LabTurnaroundNum");
            }
            string command = "INSERT INTO labturnaround (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "LabTurnaroundNum,";
            }
            command += "LaboratoryNum,Description,DaysPublished,DaysActual) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(labTurnaround.LabTurnaroundNum) + ",";
            }
            command +=
                POut.Long(labTurnaround.LaboratoryNum) + ","
                + "'" + POut.String(labTurnaround.Description) + "',"
                + POut.Int(labTurnaround.DaysPublished) + ","
                + POut.Int(labTurnaround.DaysActual) + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                labTurnaround.LabTurnaroundNum = Db.NonQ(command, true);
            }
            return(labTurnaround.LabTurnaroundNum);
        }
Esempio n. 22
0
        ///<summary>Inserts one JobPermission into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(JobPermission jobPermission, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                jobPermission.JobPermissionNum = ReplicationServers.GetKey("jobpermission", "JobPermissionNum");
            }
            string command = "INSERT INTO jobpermission (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "JobPermissionNum,";
            }
            command += "UserNum,JobPermType) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(jobPermission.JobPermissionNum) + ",";
            }
            command +=
                POut.Long(jobPermission.UserNum) + ","
                + "'" + POut.String(jobPermission.JobPermType.ToString()) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                jobPermission.JobPermissionNum = Db.NonQ(command, true, "JobPermissionNum", "jobPermission");
            }
            return(jobPermission.JobPermissionNum);
        }
Esempio n. 23
0
        ///<summary>Inserts one SupplyOrder into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(SupplyOrder supplyOrder, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                supplyOrder.SupplyOrderNum = ReplicationServers.GetKey("supplyorder", "SupplyOrderNum");
            }
            string command = "INSERT INTO supplyorder (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "SupplyOrderNum,";
            }
            command += "SupplierNum,DatePlaced,Note,AmountTotal) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(supplyOrder.SupplyOrderNum) + ",";
            }
            command +=
                POut.Long(supplyOrder.SupplierNum) + ","
                + POut.Date(supplyOrder.DatePlaced) + ","
                + "'" + POut.String(supplyOrder.Note) + "',"
                + "'" + POut.Double(supplyOrder.AmountTotal) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                supplyOrder.SupplyOrderNum = Db.NonQ(command, true);
            }
            return(supplyOrder.SupplyOrderNum);
        }
Esempio n. 24
0
        ///<summary>Inserts one Referral into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(Referral referral, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                referral.ReferralNum = ReplicationServers.GetKey("referral", "ReferralNum");
            }
            string command = "INSERT INTO referral (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "ReferralNum,";
            }
            command += "LName,FName,MName,SSN,UsingTIN,Specialty,ST,Telephone,Address,Address2,City,Zip,Note,Phone2,IsHidden,NotPerson,Title,EMail,PatNum,NationalProvID,Slip,IsDoctor,IsTrustedDirect,IsPreferred) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(referral.ReferralNum) + ",";
            }
            command +=
                "'" + POut.String(referral.LName) + "',"
                + "'" + POut.String(referral.FName) + "',"
                + "'" + POut.String(referral.MName) + "',"
                + "'" + POut.String(referral.SSN) + "',"
                + POut.Bool(referral.UsingTIN) + ","
                + POut.Long(referral.Specialty) + ","
                + "'" + POut.String(referral.ST) + "',"
                + "'" + POut.String(referral.Telephone) + "',"
                + "'" + POut.String(referral.Address) + "',"
                + "'" + POut.String(referral.Address2) + "',"
                + "'" + POut.String(referral.City) + "',"
                + "'" + POut.String(referral.Zip) + "',"
                + DbHelper.ParamChar + "paramNote,"
                + "'" + POut.String(referral.Phone2) + "',"
                + POut.Bool(referral.IsHidden) + ","
                + POut.Bool(referral.NotPerson) + ","
                + "'" + POut.String(referral.Title) + "',"
                + "'" + POut.String(referral.EMail) + "',"
                + POut.Long(referral.PatNum) + ","
                + "'" + POut.String(referral.NationalProvID) + "',"
                + POut.Long(referral.Slip) + ","
                + POut.Bool(referral.IsDoctor) + ","
                + POut.Bool(referral.IsTrustedDirect) + ","
                //DateTStamp can only be set by MySQL
                + POut.Bool(referral.IsPreferred) + ")";
            if (referral.Note == null)
            {
                referral.Note = "";
            }
            OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(referral.Note));

            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command, paramNote);
            }
            else
            {
                referral.ReferralNum = Db.NonQ(command, true, "ReferralNum", "referral", paramNote);
            }
            return(referral.ReferralNum);
        }
Esempio n. 25
0
        ///<summary>Inserts one Provider into the database.  Provides option to use the existing priKey.</summary>
        internal static long Insert(Provider provider, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                provider.ProvNum = ReplicationServers.GetKey("provider", "ProvNum");
            }
            string command = "INSERT INTO provider (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "ProvNum,";
            }
            command += "Abbr,ItemOrder,LName,FName,MI,Suffix,FeeSched,Specialty,SSN,StateLicense,DEANum,IsSecondary,ProvColor,IsHidden,UsingTIN,BlueCrossID,SigOnFile,MedicaidID,OutlineColor,SchoolClassNum,NationalProvID,CanadianOfficeNum,AnesthProvType,TaxonomyCodeOverride,IsCDAnet,EcwID,EhrKey,StateRxID,EhrHasReportAccess,IsNotPerson) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(provider.ProvNum) + ",";
            }
            command +=
                "'" + POut.String(provider.Abbr) + "',"
                + POut.Int(provider.ItemOrder) + ","
                + "'" + POut.String(provider.LName) + "',"
                + "'" + POut.String(provider.FName) + "',"
                + "'" + POut.String(provider.MI) + "',"
                + "'" + POut.String(provider.Suffix) + "',"
                + POut.Long(provider.FeeSched) + ","
                + POut.Int((int)provider.Specialty) + ","
                + "'" + POut.String(provider.SSN) + "',"
                + "'" + POut.String(provider.StateLicense) + "',"
                + "'" + POut.String(provider.DEANum) + "',"
                + POut.Bool(provider.IsSecondary) + ","
                + POut.Int(provider.ProvColor.ToArgb()) + ","
                + POut.Bool(provider.IsHidden) + ","
                + POut.Bool(provider.UsingTIN) + ","
                + "'" + POut.String(provider.BlueCrossID) + "',"
                + POut.Bool(provider.SigOnFile) + ","
                + "'" + POut.String(provider.MedicaidID) + "',"
                + POut.Int(provider.OutlineColor.ToArgb()) + ","
                + POut.Long(provider.SchoolClassNum) + ","
                + "'" + POut.String(provider.NationalProvID) + "',"
                + "'" + POut.String(provider.CanadianOfficeNum) + "',"
                //DateTStamp can only be set by MySQL
                + POut.Long(provider.AnesthProvType) + ","
                + "'" + POut.String(provider.TaxonomyCodeOverride) + "',"
                + POut.Bool(provider.IsCDAnet) + ","
                + "'" + POut.String(provider.EcwID) + "',"
                + "'" + POut.String(provider.EhrKey) + "',"
                + "'" + POut.String(provider.StateRxID) + "',"
                + POut.Bool(provider.EhrHasReportAccess) + ","
                + POut.Bool(provider.IsNotPerson) + ")";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                provider.ProvNum = Db.NonQ(command, true);
            }
            return(provider.ProvNum);
        }
Esempio n. 26
0
        ///<summary>Inserts one Payment into the database.  Provides option to use the existing priKey.</summary>
        public 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,SecUserNumEntry,PaymentSource,ProcessStatus,RecurringChargeDate) 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) + "',"
                + DbHelper.ParamChar + "paramPayNote,"
                + 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) + ","
                + POut.Long(payment.SecUserNumEntry) + ","
                //SecDateTEdit can only be set by MySQL
                + POut.Int((int)payment.PaymentSource) + ","
                + POut.Int((int)payment.ProcessStatus) + ","
                + POut.Date(payment.RecurringChargeDate) + ")";
            if (payment.PayNote == null)
            {
                payment.PayNote = "";
            }
            OdSqlParameter paramPayNote = new OdSqlParameter("paramPayNote", OdDbType.Text, POut.StringNote(payment.PayNote));

            if (payment.Receipt == null)
            {
                payment.Receipt = "";
            }
            OdSqlParameter paramReceipt = new OdSqlParameter("paramReceipt", OdDbType.Text, POut.StringParam(payment.Receipt));

            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command, paramPayNote, paramReceipt);
            }
            else
            {
                payment.PayNum = Db.NonQ(command, true, "PayNum", "payment", paramPayNote, paramReceipt);
            }
            return(payment.PayNum);
        }
Esempio n. 27
0
        ///<summary>Inserts one LanguageForeign into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(LanguageForeign languageForeign, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                languageForeign.LanguageForeignNum = ReplicationServers.GetKey("languageforeign", "LanguageForeignNum");
            }
            string command = "INSERT INTO languageforeign (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "LanguageForeignNum,";
            }
            command += "ClassType,English,Culture,Translation,Comments) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(languageForeign.LanguageForeignNum) + ",";
            }
            command +=
                DbHelper.ParamChar + "paramClassType,"
                + DbHelper.ParamChar + "paramEnglish,"
                + "'" + POut.String(languageForeign.Culture) + "',"
                + DbHelper.ParamChar + "paramTranslation,"
                + DbHelper.ParamChar + "paramComments)";
            if (languageForeign.ClassType == null)
            {
                languageForeign.ClassType = "";
            }
            OdSqlParameter paramClassType = new OdSqlParameter("paramClassType", OdDbType.Text, POut.StringParam(languageForeign.ClassType));

            if (languageForeign.English == null)
            {
                languageForeign.English = "";
            }
            OdSqlParameter paramEnglish = new OdSqlParameter("paramEnglish", OdDbType.Text, POut.StringParam(languageForeign.English));

            if (languageForeign.Translation == null)
            {
                languageForeign.Translation = "";
            }
            OdSqlParameter paramTranslation = new OdSqlParameter("paramTranslation", OdDbType.Text, POut.StringParam(languageForeign.Translation));

            if (languageForeign.Comments == null)
            {
                languageForeign.Comments = "";
            }
            OdSqlParameter paramComments = new OdSqlParameter("paramComments", OdDbType.Text, POut.StringParam(languageForeign.Comments));

            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command, paramClassType, paramEnglish, paramTranslation, paramComments);
            }
            else
            {
                languageForeign.LanguageForeignNum = Db.NonQ(command, true, "LanguageForeignNum", "languageForeign", paramClassType, paramEnglish, paramTranslation, paramComments);
            }
            return(languageForeign.LanguageForeignNum);
        }
Esempio n. 28
0
        ///<summary>Inserts one ComputerPref into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(ComputerPref computerPref, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                computerPref.ComputerPrefNum = ReplicationServers.GetKey("computerpref", "ComputerPrefNum");
            }
            string command = "INSERT INTO computerpref (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "ComputerPrefNum,";
            }
            command += "ComputerName,GraphicsUseHardware,GraphicsSimple,SensorType,SensorBinned,SensorPort,SensorExposure,GraphicsDoubleBuffering,PreferredPixelFormatNum,AtoZpath,TaskKeepListHidden,TaskDock,TaskX,TaskY,DirectXFormat,ScanDocSelectSource,ScanDocShowOptions,ScanDocDuplex,ScanDocGrayscale,ScanDocResolution,ScanDocQuality,ClinicNum,ApptViewNum,RecentApptView,PatSelectSearchMode,NoShowLanguage,NoShowDecimal,ComputerOS,HelpButtonXAdjustment) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(computerPref.ComputerPrefNum) + ",";
            }
            command +=
                "'" + POut.String(computerPref.ComputerName) + "',"
                + POut.Bool(computerPref.GraphicsUseHardware) + ","
                + POut.Int((int)computerPref.GraphicsSimple) + ","
                + "'" + POut.String(computerPref.SensorType) + "',"
                + POut.Bool(computerPref.SensorBinned) + ","
                + POut.Int(computerPref.SensorPort) + ","
                + POut.Int(computerPref.SensorExposure) + ","
                + POut.Bool(computerPref.GraphicsDoubleBuffering) + ","
                + POut.Int(computerPref.PreferredPixelFormatNum) + ","
                + "'" + POut.String(computerPref.AtoZpath) + "',"
                + POut.Bool(computerPref.TaskKeepListHidden) + ","
                + POut.Int(computerPref.TaskDock) + ","
                + POut.Int(computerPref.TaskX) + ","
                + POut.Int(computerPref.TaskY) + ","
                + "'" + POut.String(computerPref.DirectXFormat) + "',"
                + POut.Bool(computerPref.ScanDocSelectSource) + ","
                + POut.Bool(computerPref.ScanDocShowOptions) + ","
                + POut.Bool(computerPref.ScanDocDuplex) + ","
                + POut.Bool(computerPref.ScanDocGrayscale) + ","
                + POut.Int(computerPref.ScanDocResolution) + ","
                + POut.Byte(computerPref.ScanDocQuality) + ","
                + POut.Long(computerPref.ClinicNum) + ","
                + POut.Long(computerPref.ApptViewNum) + ","
                + POut.Byte(computerPref.RecentApptView) + ","
                + POut.Int((int)computerPref.PatSelectSearchMode) + ","
                + POut.Bool(computerPref.NoShowLanguage) + ","
                + POut.Bool(computerPref.NoShowDecimal) + ","
                + "'" + POut.String(computerPref.ComputerOS.ToString()) + "',"
                + "'" + POut.Double(computerPref.HelpButtonXAdjustment) + "')";
            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command);
            }
            else
            {
                computerPref.ComputerPrefNum = Db.NonQ(command, true, "ComputerPrefNum", "computerPref");
            }
            return(computerPref.ComputerPrefNum);
        }
Esempio n. 29
0
        ///<summary>Inserts one MedLabResult into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(MedLabResult medLabResult, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                medLabResult.MedLabResultNum = ReplicationServers.GetKey("medlabresult", "MedLabResultNum");
            }
            string command = "INSERT INTO medlabresult (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "MedLabResultNum,";
            }
            command += "MedLabNum,ObsID,ObsText,ObsLoinc,ObsLoincText,ObsIDSub,ObsValue,ObsSubType,ObsUnits,ReferenceRange,AbnormalFlag,ResultStatus,DateTimeObs,FacilityID,DocNum,Note) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(medLabResult.MedLabResultNum) + ",";
            }
            command +=
                POut.Long(medLabResult.MedLabNum) + ","
                + "'" + POut.String(medLabResult.ObsID) + "',"
                + "'" + POut.String(medLabResult.ObsText) + "',"
                + "'" + POut.String(medLabResult.ObsLoinc) + "',"
                + "'" + POut.String(medLabResult.ObsLoincText) + "',"
                + "'" + POut.String(medLabResult.ObsIDSub) + "',"
                + DbHelper.ParamChar + "paramObsValue,"
                + "'" + POut.String(medLabResult.ObsSubType.ToString()) + "',"
                + "'" + POut.String(medLabResult.ObsUnits) + "',"
                + "'" + POut.String(medLabResult.ReferenceRange) + "',"
                + "'" + POut.String(medLabResult.AbnormalFlag.ToString()) + "',"
                + "'" + POut.String(medLabResult.ResultStatus.ToString()) + "',"
                + POut.DateT(medLabResult.DateTimeObs) + ","
                + "'" + POut.String(medLabResult.FacilityID) + "',"
                + POut.Long(medLabResult.DocNum) + ","
                + DbHelper.ParamChar + "paramNote)";
            if (medLabResult.ObsValue == null)
            {
                medLabResult.ObsValue = "";
            }
            OdSqlParameter paramObsValue = new OdSqlParameter("paramObsValue", OdDbType.Text, POut.StringParam(medLabResult.ObsValue));

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

            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command, paramObsValue, paramNote);
            }
            else
            {
                medLabResult.MedLabResultNum = Db.NonQ(command, true, "MedLabResultNum", "medLabResult", paramObsValue, paramNote);
            }
            return(medLabResult.MedLabResultNum);
        }
Esempio n. 30
0
        ///<summary>Inserts one Automation into the database.  Provides option to use the existing priKey.</summary>
        public static long Insert(Automation automation, bool useExistingPK)
        {
            if (!useExistingPK && PrefC.RandomKeys)
            {
                automation.AutomationNum = ReplicationServers.GetKey("automation", "AutomationNum");
            }
            string command = "INSERT INTO automation (";

            if (useExistingPK || PrefC.RandomKeys)
            {
                command += "AutomationNum,";
            }
            command += "Description,Autotrigger,ProcCodes,AutoAction,SheetDefNum,CommType,MessageContent,AptStatus,AppointmentTypeNum,PatStatus) VALUES(";
            if (useExistingPK || PrefC.RandomKeys)
            {
                command += POut.Long(automation.AutomationNum) + ",";
            }
            command +=
                DbHelper.ParamChar + "paramDescription,"
                + POut.Int((int)automation.Autotrigger) + ","
                + DbHelper.ParamChar + "paramProcCodes,"
                + POut.Int((int)automation.AutoAction) + ","
                + POut.Long(automation.SheetDefNum) + ","
                + POut.Long(automation.CommType) + ","
                + DbHelper.ParamChar + "paramMessageContent,"
                + POut.Int((int)automation.AptStatus) + ","
                + POut.Long(automation.AppointmentTypeNum) + ","
                + POut.Int((int)automation.PatStatus) + ")";
            if (automation.Description == null)
            {
                automation.Description = "";
            }
            OdSqlParameter paramDescription = new OdSqlParameter("paramDescription", OdDbType.Text, POut.StringParam(automation.Description));

            if (automation.ProcCodes == null)
            {
                automation.ProcCodes = "";
            }
            OdSqlParameter paramProcCodes = new OdSqlParameter("paramProcCodes", OdDbType.Text, POut.StringParam(automation.ProcCodes));

            if (automation.MessageContent == null)
            {
                automation.MessageContent = "";
            }
            OdSqlParameter paramMessageContent = new OdSqlParameter("paramMessageContent", OdDbType.Text, POut.StringParam(automation.MessageContent));

            if (useExistingPK || PrefC.RandomKeys)
            {
                Db.NonQ(command, paramDescription, paramProcCodes, paramMessageContent);
            }
            else
            {
                automation.AutomationNum = Db.NonQ(command, true, "AutomationNum", "automation", paramDescription, paramProcCodes, paramMessageContent);
            }
            return(automation.AutomationNum);
        }