///<summary>Inserts one InsVerifyHist into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(InsVerifyHist insVerifyHist, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO insverifyhist ("; if (!useExistingPK && isRandomKeys) { insVerifyHist.InsVerifyHistNum = ReplicationServers.GetKeyNoCache("insverifyhist", "InsVerifyHistNum"); } if (isRandomKeys || useExistingPK) { command += "InsVerifyHistNum,"; } command += "VerifyUserNum,InsVerifyNum,DateLastVerified,UserNum,VerifyType,FKey,DefNum,DateLastAssigned,Note,DateTimeEntry,HoursAvailableForVerification) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(insVerifyHist.InsVerifyHistNum) + ","; } command += POut.Long(insVerifyHist.VerifyUserNum) + "," + POut.Long(insVerifyHist.InsVerifyNum) + "," + POut.Date(insVerifyHist.DateLastVerified) + "," + POut.Long(insVerifyHist.UserNum) + "," + POut.Int((int)insVerifyHist.VerifyType) + "," + POut.Long(insVerifyHist.FKey) + "," + POut.Long(insVerifyHist.DefNum) + "," + POut.Date(insVerifyHist.DateLastAssigned) + "," + DbHelper.ParamChar + "paramNote," + DbHelper.Now() + "," + "'" + POut.Double(insVerifyHist.HoursAvailableForVerification) + "')"; if (insVerifyHist.Note == null) { insVerifyHist.Note = ""; } OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringNote(insVerifyHist.Note)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramNote); } else { insVerifyHist.InsVerifyHistNum = Db.NonQ(command, true, "InsVerifyHistNum", "insVerifyHist", paramNote); } return(insVerifyHist.InsVerifyHistNum); }
///<summary>Inserts one Schedule into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Schedule schedule, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO schedule ("; if (!useExistingPK && isRandomKeys) { schedule.ScheduleNum = ReplicationServers.GetKeyNoCache("schedule", "ScheduleNum"); } if (isRandomKeys || useExistingPK) { command += "ScheduleNum,"; } command += "SchedDate,StartTime,StopTime,SchedType,ProvNum,BlockoutType,Note,Status,EmployeeNum,ClinicNum) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(schedule.ScheduleNum) + ","; } command += POut.Date(schedule.SchedDate) + "," + POut.Time(schedule.StartTime) + "," + POut.Time(schedule.StopTime) + "," + POut.Int((int)schedule.SchedType) + "," + POut.Long(schedule.ProvNum) + "," + POut.Long(schedule.BlockoutType) + "," + DbHelper.ParamChar + "paramNote," + POut.Int((int)schedule.Status) + "," + POut.Long(schedule.EmployeeNum) + "," //DateTStamp can only be set by MySQL + POut.Long(schedule.ClinicNum) + ")"; if (schedule.Note == null) { schedule.Note = ""; } OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(schedule.Note)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramNote); } else { schedule.ScheduleNum = Db.NonQ(command, true, "ScheduleNum", "schedule", paramNote); } return(schedule.ScheduleNum); }
///<summary>Inserts one MedicationPat into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(MedicationPat medicationPat, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO medicationpat ("; if (!useExistingPK && isRandomKeys) { medicationPat.MedicationPatNum = ReplicationServers.GetKeyNoCache("medicationpat", "MedicationPatNum"); } if (isRandomKeys || useExistingPK) { command += "MedicationPatNum,"; } command += "PatNum,MedicationNum,PatNote,DateStart,DateStop,ProvNum,MedDescript,RxCui,ErxGuid,IsCpoe) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(medicationPat.MedicationPatNum) + ","; } command += POut.Long(medicationPat.PatNum) + "," + POut.Long(medicationPat.MedicationNum) + "," + DbHelper.ParamChar + "paramPatNote," //DateTStamp can only be set by MySQL + POut.Date(medicationPat.DateStart) + "," + POut.Date(medicationPat.DateStop) + "," + POut.Long(medicationPat.ProvNum) + "," + "'" + POut.String(medicationPat.MedDescript) + "'," + POut.Long(medicationPat.RxCui) + "," + "'" + POut.String(medicationPat.ErxGuid) + "'," + POut.Bool(medicationPat.IsCpoe) + ")"; if (medicationPat.PatNote == null) { medicationPat.PatNote = ""; } OdSqlParameter paramPatNote = new OdSqlParameter("paramPatNote", OdDbType.Text, POut.StringParam(medicationPat.PatNote)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramPatNote); } else { medicationPat.MedicationPatNum = Db.NonQ(command, true, "MedicationPatNum", "medicationPat", paramPatNote); } return(medicationPat.MedicationPatNum); }
///<summary>Inserts one Laboratory into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Laboratory laboratory, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO laboratory ("; if (!useExistingPK && isRandomKeys) { laboratory.LaboratoryNum = ReplicationServers.GetKeyNoCache("laboratory", "LaboratoryNum"); } if (isRandomKeys || useExistingPK) { command += "LaboratoryNum,"; } command += "Description,Phone,Notes,Slip,Address,City,State,Zip,Email,WirelessPhone,IsHidden) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(laboratory.LaboratoryNum) + ","; } command += "'" + POut.String(laboratory.Description) + "'," + "'" + POut.String(laboratory.Phone) + "'," + DbHelper.ParamChar + "paramNotes," + POut.Long(laboratory.Slip) + "," + "'" + POut.String(laboratory.Address) + "'," + "'" + POut.String(laboratory.City) + "'," + "'" + POut.String(laboratory.State) + "'," + "'" + POut.String(laboratory.Zip) + "'," + "'" + POut.String(laboratory.Email) + "'," + "'" + POut.String(laboratory.WirelessPhone) + "'," + POut.Bool(laboratory.IsHidden) + ")"; if (laboratory.Notes == null) { laboratory.Notes = ""; } OdSqlParameter paramNotes = new OdSqlParameter("paramNotes", OdDbType.Text, POut.StringParam(laboratory.Notes)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramNotes); } else { laboratory.LaboratoryNum = Db.NonQ(command, true, "LaboratoryNum", "laboratory", paramNotes); } return(laboratory.LaboratoryNum); }
///<summary>Inserts one CentralConnection into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(CentralConnection centralConnection, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO centralconnection ("; if (!useExistingPK && isRandomKeys) { centralConnection.CentralConnectionNum = ReplicationServers.GetKeyNoCache("centralconnection", "CentralConnectionNum"); } if (isRandomKeys || useExistingPK) { command += "CentralConnectionNum,"; } command += "ServerName,DatabaseName,MySqlUser,MySqlPassword,ServiceURI,OdUser,OdPassword,Note,ItemOrder,WebServiceIsEcw,ConnectionStatus) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(centralConnection.CentralConnectionNum) + ","; } command += "'" + POut.String(centralConnection.ServerName) + "'," + "'" + POut.String(centralConnection.DatabaseName) + "'," + "'" + POut.String(centralConnection.MySqlUser) + "'," + "'" + POut.String(centralConnection.MySqlPassword) + "'," + "'" + POut.String(centralConnection.ServiceURI) + "'," + "'" + POut.String(centralConnection.OdUser) + "'," + "'" + POut.String(centralConnection.OdPassword) + "'," + DbHelper.ParamChar + "paramNote," + POut.Int(centralConnection.ItemOrder) + "," + POut.Bool(centralConnection.WebServiceIsEcw) + "," + "'" + POut.String(centralConnection.ConnectionStatus) + "')"; if (centralConnection.Note == null) { centralConnection.Note = ""; } OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(centralConnection.Note)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramNote); } else { centralConnection.CentralConnectionNum = Db.NonQ(command, true, "CentralConnectionNum", "centralConnection", paramNote); } return(centralConnection.CentralConnectionNum); }
///<summary>Inserts one Phone into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Phone phone, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO phone ("; if (!useExistingPK && isRandomKeys) { phone.PhoneNum = ReplicationServers.GetKeyNoCache("phone", "PhoneNum"); } if (isRandomKeys || useExistingPK) { command += "PhoneNum,"; } command += "Extension,EmployeeName,ClockStatus,Description,ColorBar,ColorText,EmployeeNum,CustomerNumber,InOrOut,PatNum,DateTimeStart,CustomerNumberRaw,LastCallTimeStart,RingGroups,IsProximal,DateTimeNeedsHelpStart,DateTProximal) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(phone.PhoneNum) + ","; } command += POut.Int(phone.Extension) + "," + "'" + POut.String(phone.EmployeeName) + "'," + "'" + POut.String(phone.ClockStatus.ToString()) + "'," + "'" + POut.String(phone.Description) + "'," + POut.Int(phone.ColorBar.ToArgb()) + "," + POut.Int(phone.ColorText.ToArgb()) + "," + POut.Long(phone.EmployeeNum) + "," + "'" + POut.String(phone.CustomerNumber) + "'," + "'" + POut.String(phone.InOrOut) + "'," + POut.Long(phone.PatNum) + "," + POut.DateT(phone.DateTimeStart) + "," + "'" + POut.String(phone.CustomerNumberRaw) + "'," + POut.DateT(phone.LastCallTimeStart) + "," + POut.Int((int)phone.RingGroups) + "," + POut.Bool(phone.IsProximal) + "," + POut.Date(phone.DateTimeNeedsHelpStart) + "," + POut.Date(phone.DateTProximal) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { phone.PhoneNum = Db.NonQ(command, true, "PhoneNum", "phone"); } return(phone.PhoneNum); }
///<summary>Inserts one WikiListHist into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(WikiListHist wikiListHist, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO wikilisthist ("; if (!useExistingPK && isRandomKeys) { wikiListHist.WikiListHistNum = ReplicationServers.GetKeyNoCache("wikilisthist", "WikiListHistNum"); } if (isRandomKeys || useExistingPK) { command += "WikiListHistNum,"; } command += "UserNum,ListName,ListHeaders,ListContent,DateTimeSaved) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(wikiListHist.WikiListHistNum) + ","; } command += POut.Long(wikiListHist.UserNum) + "," + "'" + POut.String(wikiListHist.ListName) + "'," + DbHelper.ParamChar + "paramListHeaders," + DbHelper.ParamChar + "paramListContent," + POut.DateT(wikiListHist.DateTimeSaved) + ")"; if (wikiListHist.ListHeaders == null) { wikiListHist.ListHeaders = ""; } OdSqlParameter paramListHeaders = new OdSqlParameter("paramListHeaders", OdDbType.Text, POut.StringParam(wikiListHist.ListHeaders)); if (wikiListHist.ListContent == null) { wikiListHist.ListContent = ""; } OdSqlParameter paramListContent = new OdSqlParameter("paramListContent", OdDbType.Text, POut.StringParam(wikiListHist.ListContent)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramListHeaders, paramListContent); } else { wikiListHist.WikiListHistNum = Db.NonQ(command, true, "WikiListHistNum", "wikiListHist", paramListHeaders, paramListContent); } return(wikiListHist.WikiListHistNum); }
///<summary>Inserts one Pharmacy into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Pharmacy pharmacy, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO pharmacy ("; if (!useExistingPK && isRandomKeys) { pharmacy.PharmacyNum = ReplicationServers.GetKeyNoCache("pharmacy", "PharmacyNum"); } if (isRandomKeys || useExistingPK) { command += "PharmacyNum,"; } command += "PharmID,StoreName,Phone,Fax,Address,Address2,City,State,Zip,Note) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(pharmacy.PharmacyNum) + ","; } command += "'" + POut.String(pharmacy.PharmID) + "'," + "'" + POut.String(pharmacy.StoreName) + "'," + "'" + POut.String(pharmacy.Phone) + "'," + "'" + POut.String(pharmacy.Fax) + "'," + "'" + POut.String(pharmacy.Address) + "'," + "'" + POut.String(pharmacy.Address2) + "'," + "'" + POut.String(pharmacy.City) + "'," + "'" + POut.String(pharmacy.State) + "'," + "'" + POut.String(pharmacy.Zip) + "'," + DbHelper.ParamChar + "paramNote)"; //DateTStamp can only be set by MySQL if (pharmacy.Note == null) { pharmacy.Note = ""; } OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(pharmacy.Note)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramNote); } else { pharmacy.PharmacyNum = Db.NonQ(command, true, "PharmacyNum", "pharmacy", paramNote); } return(pharmacy.PharmacyNum); }
///<summary>Inserts one SecurityLog into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(SecurityLog securityLog, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO securitylog ("; if (!useExistingPK && isRandomKeys) { securityLog.SecurityLogNum = ReplicationServers.GetKeyNoCache("securitylog", "SecurityLogNum"); } if (isRandomKeys || useExistingPK) { command += "SecurityLogNum,"; } command += "PermType,UserNum,LogDateTime,LogText,PatNum,CompName,FKey,LogSource,DefNum,DefNumError,DateTPrevious) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(securityLog.SecurityLogNum) + ","; } command += POut.Int((int)securityLog.PermType) + "," + POut.Long(securityLog.UserNum) + "," + DbHelper.Now() + "," + DbHelper.ParamChar + "paramLogText," + POut.Long(securityLog.PatNum) + "," + "'" + POut.String(securityLog.CompName) + "'," + POut.Long(securityLog.FKey) + "," + POut.Int((int)securityLog.LogSource) + "," + POut.Long(securityLog.DefNum) + "," + POut.Long(securityLog.DefNumError) + "," + POut.DateT(securityLog.DateTPrevious) + ")"; if (securityLog.LogText == null) { securityLog.LogText = ""; } OdSqlParameter paramLogText = new OdSqlParameter("paramLogText", OdDbType.Text, POut.StringParam(securityLog.LogText)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramLogText); } else { securityLog.SecurityLogNum = Db.NonQ(command, true, "SecurityLogNum", "securityLog", paramLogText); } return(securityLog.SecurityLogNum); }
///<summary>Inserts one Question into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Question question, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO question ("; if (!useExistingPK && isRandomKeys) { question.QuestionNum = ReplicationServers.GetKeyNoCache("question", "QuestionNum"); } if (isRandomKeys || useExistingPK) { command += "QuestionNum,"; } command += "PatNum,ItemOrder,Description,Answer,FormPatNum) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(question.QuestionNum) + ","; } command += POut.Long(question.PatNum) + "," + POut.Int(question.ItemOrder) + "," + DbHelper.ParamChar + "paramDescription," + DbHelper.ParamChar + "paramAnswer," + POut.Long(question.FormPatNum) + ")"; 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)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramDescription, paramAnswer); } else { question.QuestionNum = Db.NonQ(command, true, "QuestionNum", "question", paramDescription, paramAnswer); } return(question.QuestionNum); }
///<summary>Inserts one Screen into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Screen screen, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO screen ("; if (!useExistingPK && isRandomKeys) { screen.ScreenNum = ReplicationServers.GetKeyNoCache("screen", "ScreenNum"); } if (isRandomKeys || useExistingPK) { command += "ScreenNum,"; } command += "Gender,RaceOld,GradeLevel,Age,Urgency,HasCaries,NeedsSealants,CariesExperience,EarlyChildCaries,ExistingSealants,MissingAllTeeth,Birthdate,ScreenGroupNum,ScreenGroupOrder,Comments,ScreenPatNum,SheetNum) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(screen.ScreenNum) + ","; } command += POut.Int((int)screen.Gender) + "," + POut.Int((int)screen.RaceOld) + "," + POut.Int((int)screen.GradeLevel) + "," + POut.Byte(screen.Age) + "," + POut.Int((int)screen.Urgency) + "," + POut.Int((int)screen.HasCaries) + "," + POut.Int((int)screen.NeedsSealants) + "," + POut.Int((int)screen.CariesExperience) + "," + POut.Int((int)screen.EarlyChildCaries) + "," + POut.Int((int)screen.ExistingSealants) + "," + POut.Int((int)screen.MissingAllTeeth) + "," + POut.Date(screen.Birthdate) + "," + POut.Long(screen.ScreenGroupNum) + "," + POut.Int(screen.ScreenGroupOrder) + "," + "'" + POut.String(screen.Comments) + "'," + POut.Long(screen.ScreenPatNum) + "," + POut.Long(screen.SheetNum) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { screen.ScreenNum = Db.NonQ(command, true, "ScreenNum", "screen"); } return(screen.ScreenNum); }
///<summary>Inserts one FHIRSubscription into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(FHIRSubscription fHIRSubscription, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO fhirsubscription ("; if (!useExistingPK && isRandomKeys) { fHIRSubscription.FHIRSubscriptionNum = ReplicationServers.GetKeyNoCache("fhirsubscription", "FHIRSubscriptionNum"); } if (isRandomKeys || useExistingPK) { command += "FHIRSubscriptionNum,"; } command += "Criteria,Reason,SubStatus,ErrorNote,ChannelType,ChannelEndpoint,ChannelPayLoad,ChannelHeader,DateEnd,APIKeyHash) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(fHIRSubscription.FHIRSubscriptionNum) + ","; } command += "'" + POut.String(fHIRSubscription.Criteria) + "'," + "'" + POut.String(fHIRSubscription.Reason) + "'," + POut.Int((int)fHIRSubscription.SubStatus) + "," + DbHelper.ParamChar + "paramErrorNote," + POut.Int((int)fHIRSubscription.ChannelType) + "," + "'" + POut.String(fHIRSubscription.ChannelEndpoint) + "'," + "'" + POut.String(fHIRSubscription.ChannelPayLoad) + "'," + "'" + POut.String(fHIRSubscription.ChannelHeader) + "'," + POut.DateT(fHIRSubscription.DateEnd) + "," + "'" + POut.String(fHIRSubscription.APIKeyHash) + "')"; if (fHIRSubscription.ErrorNote == null) { fHIRSubscription.ErrorNote = ""; } OdSqlParameter paramErrorNote = new OdSqlParameter("paramErrorNote", OdDbType.Text, POut.StringParam(fHIRSubscription.ErrorNote)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramErrorNote); } else { fHIRSubscription.FHIRSubscriptionNum = Db.NonQ(command, true, "FHIRSubscriptionNum", "fHIRSubscription", paramErrorNote); } return(fHIRSubscription.FHIRSubscriptionNum); }
///<summary>Inserts one OrthoCase into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(OrthoCase orthoCase, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO orthocase ("; if (!useExistingPK && isRandomKeys) { orthoCase.OrthoCaseNum = ReplicationServers.GetKeyNoCache("orthocase", "OrthoCaseNum"); } if (isRandomKeys || useExistingPK) { command += "OrthoCaseNum,"; } command += "PatNum,ProvNum,ClinicNum,Fee,FeeInsPrimary,FeePat,BandingDate,DebondDate,DebondDateExpected,IsTransfer,OrthoType,SecDateTEntry,SecUserNumEntry,IsActive,FeeInsSecondary) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(orthoCase.OrthoCaseNum) + ","; } command += POut.Long(orthoCase.PatNum) + "," + POut.Long(orthoCase.ProvNum) + "," + POut.Long(orthoCase.ClinicNum) + "," + "'" + POut.Double(orthoCase.Fee) + "'," + "'" + POut.Double(orthoCase.FeeInsPrimary) + "'," + "'" + POut.Double(orthoCase.FeePat) + "'," + POut.Date(orthoCase.BandingDate) + "," + POut.Date(orthoCase.DebondDate) + "," + POut.Date(orthoCase.DebondDateExpected) + "," + POut.Bool(orthoCase.IsTransfer) + "," + POut.Long(orthoCase.OrthoType) + "," + DbHelper.Now() + "," + POut.Long(orthoCase.SecUserNumEntry) + "," //SecDateTEdit can only be set by MySQL + POut.Bool(orthoCase.IsActive) + "," + "'" + POut.Double(orthoCase.FeeInsSecondary) + "')"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { orthoCase.OrthoCaseNum = Db.NonQ(command, true, "OrthoCaseNum", "orthoCase"); } return(orthoCase.OrthoCaseNum); }
///<summary>Inserts one PaySplit into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(PaySplit paySplit, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO paysplit ("; if (!useExistingPK && isRandomKeys) { paySplit.SplitNum = ReplicationServers.GetKeyNoCache("paysplit", "SplitNum"); } if (isRandomKeys || useExistingPK) { command += "SplitNum,"; } command += "SplitAmt,PatNum,ProcDate,PayNum,IsDiscount,DiscountType,ProvNum,PayPlanNum,DatePay,ProcNum,DateEntry,UnearnedType,ClinicNum,SecUserNumEntry,FSplitNum) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(paySplit.SplitNum) + ","; } command += "'" + POut.Double(paySplit.SplitAmt) + "'," + POut.Long(paySplit.PatNum) + "," + POut.Date(paySplit.ProcDate) + "," + POut.Long(paySplit.PayNum) + "," + POut.Bool(paySplit.IsDiscount) + "," + POut.Byte(paySplit.DiscountType) + "," + POut.Long(paySplit.ProvNum) + "," + POut.Long(paySplit.PayPlanNum) + "," + POut.Date(paySplit.DatePay) + "," + POut.Long(paySplit.ProcNum) + "," + DbHelper.Now() + "," + POut.Long(paySplit.UnearnedType) + "," + POut.Long(paySplit.ClinicNum) + "," + POut.Long(paySplit.SecUserNumEntry) + "," //SecDateTEdit can only be set by MySQL + POut.Long(paySplit.FSplitNum) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { paySplit.SplitNum = Db.NonQ(command, true, "SplitNum", "paySplit"); } return(paySplit.SplitNum); }
///<summary>Inserts one RxDef into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(RxDef rxDef, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO rxdef ("; if (!useExistingPK && isRandomKeys) { rxDef.RxDefNum = ReplicationServers.GetKeyNoCache("rxdef", "RxDefNum"); } if (isRandomKeys || useExistingPK) { command += "RxDefNum,"; } command += "Drug,Sig,Disp,Refills,Notes,IsControlled,RxCui,IsProcRequired,PatientInstruction) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(rxDef.RxDefNum) + ","; } command += "'" + POut.String(rxDef.Drug) + "'," + "'" + POut.String(rxDef.Sig) + "'," + "'" + POut.String(rxDef.Disp) + "'," + "'" + POut.String(rxDef.Refills) + "'," + "'" + POut.String(rxDef.Notes) + "'," + POut.Bool(rxDef.IsControlled) + "," + POut.Long(rxDef.RxCui) + "," + POut.Bool(rxDef.IsProcRequired) + "," + DbHelper.ParamChar + "paramPatientInstruction)"; if (rxDef.PatientInstruction == null) { rxDef.PatientInstruction = ""; } OdSqlParameter paramPatientInstruction = new OdSqlParameter("paramPatientInstruction", OdDbType.Text, POut.StringParam(rxDef.PatientInstruction)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramPatientInstruction); } else { rxDef.RxDefNum = Db.NonQ(command, true, "RxDefNum", "rxDef", paramPatientInstruction); } return(rxDef.RxDefNum); }
///<summary>Inserts one RegistrationKey into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(RegistrationKey registrationKey, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO registrationkey ("; if (!useExistingPK && isRandomKeys) { registrationKey.RegistrationKeyNum = ReplicationServers.GetKeyNoCache("registrationkey", "RegistrationKeyNum"); } if (isRandomKeys || useExistingPK) { command += "RegistrationKeyNum,"; } command += "PatNum,RegKey,Note,DateStarted,DateDisabled,DateEnded,IsForeign,UsesServerVersion,IsFreeVersion,IsOnlyForTesting,VotesAllotted,IsResellerCustomer,HasEarlyAccess,DateTBackupScheduled,BackupPassCode) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(registrationKey.RegistrationKeyNum) + ","; } command += POut.Long(registrationKey.PatNum) + "," + "'" + POut.String(registrationKey.RegKey) + "'," + "'" + POut.String(registrationKey.Note) + "'," + POut.Date(registrationKey.DateStarted) + "," + POut.Date(registrationKey.DateDisabled) + "," + POut.Date(registrationKey.DateEnded) + "," + POut.Bool(registrationKey.IsForeign) + "," + POut.Bool(registrationKey.UsesServerVersion) + "," + POut.Bool(registrationKey.IsFreeVersion) + "," + POut.Bool(registrationKey.IsOnlyForTesting) + "," + POut.Int(registrationKey.VotesAllotted) + "," + POut.Bool(registrationKey.IsResellerCustomer) + "," + POut.Bool(registrationKey.HasEarlyAccess) + "," + POut.DateT(registrationKey.DateTBackupScheduled) + "," + "'" + POut.String(registrationKey.BackupPassCode) + "')"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { registrationKey.RegistrationKeyNum = Db.NonQ(command, true, "RegistrationKeyNum", "registrationKey"); } return(registrationKey.RegistrationKeyNum); }
///<summary>Inserts one TimeAdjust into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(TimeAdjust timeAdjust, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO timeadjust ("; if (!useExistingPK && isRandomKeys) { timeAdjust.TimeAdjustNum = ReplicationServers.GetKeyNoCache("timeadjust", "TimeAdjustNum"); } if (isRandomKeys || useExistingPK) { command += "TimeAdjustNum,"; } command += "EmployeeNum,TimeEntry,RegHours,OTimeHours,Note,IsAuto,ClinicNum,PtoDefNum,PtoHours) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(timeAdjust.TimeAdjustNum) + ","; } command += POut.Long(timeAdjust.EmployeeNum) + "," + POut.DateT(timeAdjust.TimeEntry) + "," + "'" + POut.TSpan(timeAdjust.RegHours) + "'," + "'" + POut.TSpan(timeAdjust.OTimeHours) + "'," + DbHelper.ParamChar + "paramNote," + POut.Bool(timeAdjust.IsAuto) + "," + POut.Long(timeAdjust.ClinicNum) + "," + POut.Long(timeAdjust.PtoDefNum) + "," + "'" + POut.TSpan(timeAdjust.PtoHours) + "')"; if (timeAdjust.Note == null) { timeAdjust.Note = ""; } OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(timeAdjust.Note)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramNote); } else { timeAdjust.TimeAdjustNum = Db.NonQ(command, true, "TimeAdjustNum", "timeAdjust", paramNote); } return(timeAdjust.TimeAdjustNum); }
///<summary>Inserts one ClaimPayment into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(ClaimPayment claimPayment, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO claimpayment ("; if (!useExistingPK && isRandomKeys) { claimPayment.ClaimPaymentNum = ReplicationServers.GetKeyNoCache("claimpayment", "ClaimPaymentNum"); } if (isRandomKeys || useExistingPK) { command += "ClaimPaymentNum,"; } command += "CheckDate,CheckAmt,CheckNum,BankBranch,Note,ClinicNum,DepositNum,CarrierName,DateIssued,IsPartial,PayType,SecUserNumEntry,SecDateEntry,PayGroup) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(claimPayment.ClaimPaymentNum) + ","; } command += POut.Date(claimPayment.CheckDate) + "," + "'" + POut.Double(claimPayment.CheckAmt) + "'," + "'" + POut.String(claimPayment.CheckNum) + "'," + "'" + POut.String(claimPayment.BankBranch) + "'," + "'" + POut.String(claimPayment.Note) + "'," + POut.Long(claimPayment.ClinicNum) + "," + POut.Long(claimPayment.DepositNum) + "," + "'" + POut.String(claimPayment.CarrierName) + "'," + POut.Date(claimPayment.DateIssued) + "," + POut.Bool(claimPayment.IsPartial) + "," + POut.Long(claimPayment.PayType) + "," + POut.Long(claimPayment.SecUserNumEntry) + "," + DbHelper.Now() + "," //SecDateTEdit can only be set by MySQL + POut.Long(claimPayment.PayGroup) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { claimPayment.ClaimPaymentNum = Db.NonQ(command, true, "ClaimPaymentNum", "claimPayment"); } return(claimPayment.ClaimPaymentNum); }
///<summary>Inserts one LabPanel into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(LabPanel labPanel, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO labpanel ("; if (!useExistingPK && isRandomKeys) { labPanel.LabPanelNum = ReplicationServers.GetKeyNoCache("labpanel", "LabPanelNum"); } if (isRandomKeys || useExistingPK) { command += "LabPanelNum,"; } command += "PatNum,RawMessage,LabNameAddress,SpecimenCondition,SpecimenSource,ServiceId,ServiceName,MedicalOrderNum) VALUES("; if (isRandomKeys || useExistingPK) { 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, POut.StringParam(labPanel.RawMessage)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramRawMessage); } else { labPanel.LabPanelNum = Db.NonQ(command, true, "LabPanelNum", "labPanel", paramRawMessage); } return(labPanel.LabPanelNum); }
///<summary>Inserts one Evaluation into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Evaluation evaluation, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO evaluation ("; if (!useExistingPK && isRandomKeys) { evaluation.EvaluationNum = ReplicationServers.GetKeyNoCache("evaluation", "EvaluationNum"); } if (isRandomKeys || useExistingPK) { command += "EvaluationNum,"; } command += "InstructNum,StudentNum,SchoolCourseNum,EvalTitle,DateEval,GradingScaleNum,OverallGradeShowing,OverallGradeNumber,Notes) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(evaluation.EvaluationNum) + ","; } command += POut.Long(evaluation.InstructNum) + "," + POut.Long(evaluation.StudentNum) + "," + POut.Long(evaluation.SchoolCourseNum) + "," + "'" + POut.String(evaluation.EvalTitle) + "'," + POut.Date(evaluation.DateEval) + "," + POut.Long(evaluation.GradingScaleNum) + "," + "'" + POut.String(evaluation.OverallGradeShowing) + "'," + POut.Float(evaluation.OverallGradeNumber) + "," + DbHelper.ParamChar + "paramNotes)"; if (evaluation.Notes == null) { evaluation.Notes = ""; } OdSqlParameter paramNotes = new OdSqlParameter("paramNotes", OdDbType.Text, POut.StringParam(evaluation.Notes)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramNotes); } else { evaluation.EvaluationNum = Db.NonQ(command, true, "EvaluationNum", "evaluation", paramNotes); } return(evaluation.EvaluationNum); }
///<summary>Inserts one EmailAutograph into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(EmailAutograph emailAutograph, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO emailautograph ("; if (!useExistingPK && isRandomKeys) { emailAutograph.EmailAutographNum = ReplicationServers.GetKeyNoCache("emailautograph", "EmailAutographNum"); } if (isRandomKeys || useExistingPK) { command += "EmailAutographNum,"; } command += "Description,EmailAddress,AutographText) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(emailAutograph.EmailAutographNum) + ","; } command += DbHelper.ParamChar + "paramDescription," + "'" + POut.String(emailAutograph.EmailAddress) + "'," + DbHelper.ParamChar + "paramAutographText)"; if (emailAutograph.Description == null) { emailAutograph.Description = ""; } OdSqlParameter paramDescription = new OdSqlParameter("paramDescription", OdDbType.Text, POut.StringParam(emailAutograph.Description)); if (emailAutograph.AutographText == null) { emailAutograph.AutographText = ""; } OdSqlParameter paramAutographText = new OdSqlParameter("paramAutographText", OdDbType.Text, POut.StringParam(emailAutograph.AutographText)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramDescription, paramAutographText); } else { emailAutograph.EmailAutographNum = Db.NonQ(command, true, "EmailAutographNum", "emailAutograph", paramDescription, paramAutographText); } return(emailAutograph.EmailAutographNum); }
///<summary>Inserts one Disease into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Disease disease, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO disease ("; if (!useExistingPK && isRandomKeys) { disease.DiseaseNum = ReplicationServers.GetKeyNoCache("disease", "DiseaseNum"); } if (isRandomKeys || useExistingPK) { command += "DiseaseNum,"; } command += "PatNum,DiseaseDefNum,PatNote,ProbStatus,DateStart,DateStop,SnomedProblemType,FunctionStatus) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(disease.DiseaseNum) + ","; } command += POut.Long(disease.PatNum) + "," + POut.Long(disease.DiseaseDefNum) + "," + DbHelper.ParamChar + "paramPatNote," //DateTStamp can only be set by MySQL + POut.Int((int)disease.ProbStatus) + "," + POut.Date(disease.DateStart) + "," + POut.Date(disease.DateStop) + "," + "'" + POut.String(disease.SnomedProblemType) + "'," + POut.Int((int)disease.FunctionStatus) + ")"; if (disease.PatNote == null) { disease.PatNote = ""; } OdSqlParameter paramPatNote = new OdSqlParameter("paramPatNote", OdDbType.Text, POut.StringParam(disease.PatNote)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramPatNote); } else { disease.DiseaseNum = Db.NonQ(command, true, "DiseaseNum", "disease", paramPatNote); } return(disease.DiseaseNum); }
///<summary>Inserts one Pref into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Pref pref, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO preference ("; if (!useExistingPK && isRandomKeys) { pref.PrefNum = ReplicationServers.GetKeyNoCache("preference", "PrefNum"); } if (isRandomKeys || useExistingPK) { command += "PrefNum,"; } command += "PrefName,ValueString,Comments) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(pref.PrefNum) + ","; } command += "'" + POut.String(pref.PrefName) + "'," + DbHelper.ParamChar + "paramValueString," + DbHelper.ParamChar + "paramComments)"; if (pref.ValueString == null) { pref.ValueString = ""; } OdSqlParameter paramValueString = new OdSqlParameter("paramValueString", OdDbType.Text, POut.StringParam(pref.ValueString)); if (pref.Comments == null) { pref.Comments = ""; } OdSqlParameter paramComments = new OdSqlParameter("paramComments", OdDbType.Text, POut.StringParam(pref.Comments)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramValueString, paramComments); } else { pref.PrefNum = Db.NonQ(command, true, "PrefNum", "pref", paramValueString, paramComments); } return(pref.PrefNum); }
///<summary>Inserts one EvaluationCriterion into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(EvaluationCriterion evaluationCriterion, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO evaluationcriterion ("; if (!useExistingPK && isRandomKeys) { evaluationCriterion.EvaluationCriterionNum = ReplicationServers.GetKeyNoCache("evaluationcriterion", "EvaluationCriterionNum"); } if (isRandomKeys || useExistingPK) { command += "EvaluationCriterionNum,"; } command += "EvaluationNum,CriterionDescript,IsCategoryName,GradingScaleNum,GradeShowing,GradeNumber,Notes,ItemOrder,MaxPointsPoss) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(evaluationCriterion.EvaluationCriterionNum) + ","; } command += POut.Long(evaluationCriterion.EvaluationNum) + "," + "'" + POut.String(evaluationCriterion.CriterionDescript) + "'," + POut.Bool(evaluationCriterion.IsCategoryName) + "," + POut.Long(evaluationCriterion.GradingScaleNum) + "," + "'" + POut.String(evaluationCriterion.GradeShowing) + "'," + POut.Float(evaluationCriterion.GradeNumber) + "," + DbHelper.ParamChar + "paramNotes," + POut.Int(evaluationCriterion.ItemOrder) + "," + POut.Float(evaluationCriterion.MaxPointsPoss) + ")"; if (evaluationCriterion.Notes == null) { evaluationCriterion.Notes = ""; } OdSqlParameter paramNotes = new OdSqlParameter("paramNotes", OdDbType.Text, POut.StringParam(evaluationCriterion.Notes)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramNotes); } else { evaluationCriterion.EvaluationCriterionNum = Db.NonQ(command, true, "EvaluationCriterionNum", "evaluationCriterion", paramNotes); } return(evaluationCriterion.EvaluationCriterionNum); }
///<summary>Inserts one Site into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Site site, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO site ("; if (!useExistingPK && isRandomKeys) { site.SiteNum = ReplicationServers.GetKeyNoCache("site", "SiteNum"); } if (isRandomKeys || useExistingPK) { command += "SiteNum,"; } command += "Description,Note,Address,Address2,City,State,Zip,ProvNum,PlaceService) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(site.SiteNum) + ","; } command += "'" + POut.String(site.Description) + "'," + DbHelper.ParamChar + "paramNote," + "'" + POut.String(site.Address) + "'," + "'" + POut.String(site.Address2) + "'," + "'" + POut.String(site.City) + "'," + "'" + POut.String(site.State) + "'," + "'" + POut.String(site.Zip) + "'," + POut.Long(site.ProvNum) + "," + POut.Int((int)site.PlaceService) + ")"; if (site.Note == null) { site.Note = ""; } OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(site.Note)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramNote); } else { site.SiteNum = Db.NonQ(command, true, "SiteNum", "site", paramNote); } return(site.SiteNum); }
///<summary>Inserts one XChargeTransaction into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(XChargeTransaction xChargeTransaction, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO xchargetransaction ("; if (!useExistingPK && isRandomKeys) { xChargeTransaction.XChargeTransactionNum = ReplicationServers.GetKeyNoCache("xchargetransaction", "XChargeTransactionNum"); } if (isRandomKeys || useExistingPK) { command += "XChargeTransactionNum,"; } command += "TransType,Amount,CCEntry,PatNum,Result,ClerkID,ResultCode,Expiration,CCType,CreditCardNum,BatchNum,ItemNum,ApprCode,TransactionDateTime) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(xChargeTransaction.XChargeTransactionNum) + ","; } command += "'" + POut.String(xChargeTransaction.TransType) + "'," + "'" + POut.Double(xChargeTransaction.Amount) + "'," + "'" + POut.String(xChargeTransaction.CCEntry) + "'," + POut.Long(xChargeTransaction.PatNum) + "," + "'" + POut.String(xChargeTransaction.Result) + "'," + "'" + POut.String(xChargeTransaction.ClerkID) + "'," + "'" + POut.String(xChargeTransaction.ResultCode) + "'," + "'" + POut.String(xChargeTransaction.Expiration) + "'," + "'" + POut.String(xChargeTransaction.CCType) + "'," + "'" + POut.String(xChargeTransaction.CreditCardNum) + "'," + "'" + POut.String(xChargeTransaction.BatchNum) + "'," + "'" + POut.String(xChargeTransaction.ItemNum) + "'," + "'" + POut.String(xChargeTransaction.ApprCode) + "'," + POut.DateT(xChargeTransaction.TransactionDateTime) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { xChargeTransaction.XChargeTransactionNum = Db.NonQ(command, true, "XChargeTransactionNum", "xChargeTransaction"); } return(xChargeTransaction.XChargeTransactionNum); }
///<summary>Inserts one WikiPage into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(WikiPage wikiPage, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO wikipage ("; if (!useExistingPK && isRandomKeys) { wikiPage.WikiPageNum = ReplicationServers.GetKeyNoCache("wikipage", "WikiPageNum"); } if (isRandomKeys || useExistingPK) { command += "WikiPageNum,"; } command += "UserNum,PageTitle,KeyWords,PageContent,DateTimeSaved,IsDeleted,IsDraft,IsLocked) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(wikiPage.WikiPageNum) + ","; } command += POut.Long(wikiPage.UserNum) + "," + "'" + POut.String(wikiPage.PageTitle) + "'," + "'" + POut.String(wikiPage.KeyWords) + "'," + DbHelper.ParamChar + "paramPageContent," + DbHelper.Now() + "," + POut.Bool(wikiPage.IsDeleted) + "," + POut.Bool(wikiPage.IsDraft) + "," + POut.Bool(wikiPage.IsLocked) + ")"; if (wikiPage.PageContent == null) { wikiPage.PageContent = ""; } OdSqlParameter paramPageContent = new OdSqlParameter("paramPageContent", OdDbType.Text, POut.StringParam(wikiPage.PageContent)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramPageContent); } else { wikiPage.WikiPageNum = Db.NonQ(command, true, "WikiPageNum", "wikiPage", paramPageContent); } return(wikiPage.WikiPageNum); }
///<summary>Inserts one Supply into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Supply supply, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO supply ("; if (!useExistingPK && isRandomKeys) { supply.SupplyNum = ReplicationServers.GetKeyNoCache("supply", "SupplyNum"); } if (isRandomKeys || useExistingPK) { command += "SupplyNum,"; } command += "SupplierNum,CatalogNumber,Descript,Category,ItemOrder,LevelDesired,IsHidden,Price,BarCodeOrID,DispDefaultQuant,DispUnitsCount,DispUnitDesc,LevelOnHand,OrderQty) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(supply.SupplyNum) + ","; } command += POut.Long(supply.SupplierNum) + "," + "'" + POut.String(supply.CatalogNumber) + "'," + "'" + POut.String(supply.Descript) + "'," + POut.Long(supply.Category) + "," + POut.Int(supply.ItemOrder) + "," + POut.Float(supply.LevelDesired) + "," + POut.Bool(supply.IsHidden) + "," + "'" + POut.Double(supply.Price) + "'," + "'" + POut.String(supply.BarCodeOrID) + "'," + POut.Float(supply.DispDefaultQuant) + "," + POut.Int(supply.DispUnitsCount) + "," + "'" + POut.String(supply.DispUnitDesc) + "'," + POut.Float(supply.LevelOnHand) + "," + POut.Int(supply.OrderQty) + ")"; if (useExistingPK || isRandomKeys) { Db.NonQ(command); } else { supply.SupplyNum = Db.NonQ(command, true, "SupplyNum", "supply"); } return(supply.SupplyNum); }
///<summary>Inserts one Mount into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Mount mount, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO mount ("; if (!useExistingPK && isRandomKeys) { mount.MountNum = ReplicationServers.GetKeyNoCache("mount", "MountNum"); } if (isRandomKeys || useExistingPK) { command += "MountNum,"; } command += "PatNum,DocCategory,DateCreated,Description,Note,ImgType,Width,Height) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(mount.MountNum) + ","; } command += POut.Long(mount.PatNum) + "," + POut.Long(mount.DocCategory) + "," + POut.Date(mount.DateCreated) + "," + "'" + POut.String(mount.Description) + "'," + DbHelper.ParamChar + "paramNote," + POut.Int((int)mount.ImgType) + "," + POut.Int(mount.Width) + "," + POut.Int(mount.Height) + ")"; if (mount.Note == null) { mount.Note = ""; } OdSqlParameter paramNote = new OdSqlParameter("paramNote", OdDbType.Text, POut.StringParam(mount.Note)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramNote); } else { mount.MountNum = Db.NonQ(command, true, "MountNum", "mount", paramNote); } return(mount.MountNum); }
///<summary>Inserts one Popup into the database. Provides option to use the existing priKey. Doesn't use the cache.</summary> public static long InsertNoCache(Popup popup, bool useExistingPK) { bool isRandomKeys = Prefs.GetBoolNoCache(PrefName.RandomPrimaryKeys); string command = "INSERT INTO popup ("; if (!useExistingPK && isRandomKeys) { popup.PopupNum = ReplicationServers.GetKeyNoCache("popup", "PopupNum"); } if (isRandomKeys || useExistingPK) { command += "PopupNum,"; } command += "PatNum,Description,IsDisabled,PopupLevel,UserNum,DateTimeEntry,IsArchived,PopupNumArchive) VALUES("; if (isRandomKeys || useExistingPK) { command += POut.Long(popup.PopupNum) + ","; } command += POut.Long(popup.PatNum) + "," + DbHelper.ParamChar + "paramDescription," + POut.Bool(popup.IsDisabled) + "," + POut.Int((int)popup.PopupLevel) + "," + POut.Long(popup.UserNum) + "," + DbHelper.Now() + "," + POut.Bool(popup.IsArchived) + "," + POut.Long(popup.PopupNumArchive) + ")"; if (popup.Description == null) { popup.Description = ""; } OdSqlParameter paramDescription = new OdSqlParameter("paramDescription", OdDbType.Text, POut.StringParam(popup.Description)); if (useExistingPK || isRandomKeys) { Db.NonQ(command, paramDescription); } else { popup.PopupNum = Db.NonQ(command, true, "PopupNum", "popup", paramDescription); } return(popup.PopupNum); }