// insert record given all TableData fields public static bool InsertRecord(TableData data) { bool Retval = false; string SqlStatement = "INSERT INTO STATION_OPTIONS (DeviceIid, LoginMode, PrintTx, IntegWaste, VerifyCount, AnchorPage, PtKeepTime, TxHold, RtsMode, PtDelay, ConfirmESP, RptSortByItemId, RptSuppressUserId, MenuTimeOut, EventTimeOut, AnchorTimeOut, ServiceStatus, ServiceStatusReq, RetDrawer, RetPocket, StnAreaType) VALUES (" + (int)data.DeviceIid + ", " + (int)data.LoginMode + ", " + (int)data.PrintTx + ", " + (int)data.IntegWaste + ", " + (int)data.VerifyCount + ", " + (int)data.AnchorPage + ", " + (int)data.PtKeepTime + ", " + (int)data.TxHold + ", " + (int)data.RtsMode + ", " + (int)data.PtDelay + ", " + (int)data.ConfirmESP + ", " + (int)data.RptSortByItemId + ", " + (int)data.RptSuppressUserId + ", " + (int)data.MenuTimeOut + ", " + (int)data.EventTimeOut + ", " + (int)data.AnchorTimeOut + ", " + (int)data.ServiceStatus + ", " + (int)data.ServiceStatusReq + ", " + (int)data.RetDrawer + ", " + "'" + MainClass.FixStringForSingleQuote(data.RetPocket) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.StnAreaType) + "'" + ")"; Retval = MainClass.ExecuteSql(SqlStatement, true, TableName, "StationOptions", "InsertRecord"); return(Retval); }
// insert record and return its primary key public static bool InsertRecord(TableData data, out int NewIid) { bool Retval = false; NewIid = -1; string SqlStatement = "INSERT INTO SITE (SiteId, SiteName, Address1, Address2, City, State, ZipCode, Country, Contact, Phone, DiagLine, Fax, Description, Notes, FacilityCode, PreExpPw, ArchiveId, PwExpDelta, UserIdExpireDelta, TempUserExpDays, PwLen, PtIdFormat, ConLogOffTimeOut, RptSortByItemId, Voice, Version, ArchiveYearFormat, DbMachineName, PrintStockOut, PrintCriticalLow, PrintADTconflict, PrintIncomingDiscrep, PrintCommDown, PermitGlobalPatientList, HomeFax, HomeEmail, ClientServerSystem, ORFeatures, DodWarning, CopyReports, EmailReports, UserDoorAccessPerItem, TechDoorAccessPerItem, Ticci, PwEnableComplex, PwComplexRegex, PwComplexDesc, PwMaxLen, PwHistory, PwHistoryClamp, ORISInterface, SmtpHost, SmptPort, SmtpUserSSL, SmtpUserName, SmtpPassword, pwEnableExtended, upgrade, siteGUID, allowGLCodeTransactions, allowORISTempToTempCaseTransfer,allowAssociator, allowAutoCaseToPatientXfer, holdRFIDTxForCase, activeDirectoryOnly, logVerbosity, logMsgFormat, logServerIP, logServerPort, logEnableRemote, pwMinAge, pwMinChg) VALUES (" + "'" + MainClass.FixStringForSingleQuote(data.SiteId) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.SiteName) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.Address1) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.Address2) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.City) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.State) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.ZipCode) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.Country) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.Contact) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.Phone) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.DiagLine) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.Fax) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.Description) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.Notes) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.FacilityCode) + "'" + ", " + (int)data.PreExpPw + ", " + "'" + MainClass.FixStringForSingleQuote(data.ArchiveId) + "'" + ", " + (int)data.PwExpDelta + ", " + (int)data.UserIdExpireDelta + ", " + (int)data.TempUserExpDays + ", " + (int)data.PwLen + ", " + "'" + MainClass.FixStringForSingleQuote(data.PtIdFormat) + "'" + ", " + (int)data.ConLogOffTimeOut + ", " + (int)data.RptSortByItemId + ", " + (int)data.Voice + ", " + "'" + MainClass.FixStringForSingleQuote(data.Version) + "'" + ", " + (int)data.ArchiveYearFormat + ", " + "'" + MainClass.FixStringForSingleQuote(data.DbMachineName) + "'" + ", " + (int)data.PrintStockOut + ", " + (int)data.PrintCriticalLow + ", " + (int)data.PrintADTconflict + ", " + (int)data.PrintIncomingDiscrep + ", " + (int)data.PrintCommDown + ", " + (int)data.PermitGlobalPatientList + ", " + "'" + MainClass.FixStringForSingleQuote(data.HomeFax) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.HomeEmail) + "'" + ", " + (int)data.ClientServerSystem + ", " + (int)data.ORFeatures + ", " + (int)data.DodWarning + ", " + (bool)data.CopyReports + ", " + (bool)data.EmailReports + ", " + (int)data.UserDoorAccessPerItem + ", " + (int)data.TechDoorAccessPerItem + ", " + (int)data.Ticci + ", " + (int)data.PwEnableComplex + ", " + "'" + MainClass.FixStringForSingleQuote(data.PwComplexRegex) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(data.PwComplexDesc) + "'" + ", " + (int)data.PwMaxLen + ", " + (int)data.PwHistory + ", " + (int)data.PwHistoryClamp + ", " + (int)data.ORISInterface + ", " + "'" + MainClass.FixStringForSingleQuote(data.SmtpHost) + "'" + ", " + (int)data.SmtpPort + ", " + (bool)data.SmtpUseSSL + ", " + "'" + MainClass.FixStringForSingleQuote(data.SmtpUsername) + "'" + ", " + "'" + MainClass.FixStringForSingleQuote(ConvertToUnsecureString(data.SmtpPassword)) + "'" + ", " + (bool)data.pwEnableExtended + ", " + (bool)data.upgrade + ", " + "'" + MainClass.FixStringForSingleQuote(data.siteGUID) + "'" + ", " + (int)data.allowGLCodeTransactions + ", " + (int)data.AllowORISTempToTempCaseTransfer + ", " + (int)data.allowAssociator + ", " + (int)data.allowAutoCaseToPatientXfer + ", " + (int)data.HoldRFIDTxForCase + ", " + (int)data.ActiveDirectoryOnly + ", " + (int)data.logSeverity + ", " + MainClass.FixStringForSingleQuote(data.logMsgFormat) + ", " + MainClass.FixStringForSingleQuote(data.logServerIP) + ", " + MainClass.FixStringForSingleQuote(data.logServerPort) + ", " + (int)data.logEnableRemote + ", " + (int)data.PwMinAge + ", " + (int)data.PwMinChg + ")"; Retval = MainClass.ExecuteSql(SqlStatement, true, TableName, "Site", "InsertRecord", out NewIid); return(Retval); }
// insert record given all TableData fields public static bool InsertRecord(TableData data) { bool Retval = false; string SqlStatement = "INSERT INTO BANNER (DeviceIid, DeviceName, ColorRef, Speed, Font, Msg) VALUES (" + (int)data.DeviceIid + ", " + "'" + MainClass.FixStringForSingleQuote(data.DeviceName) + "'" + ", " + (int)data.ColorRef + ", " + (int)data.Speed + ", " + (int)data.Font + ", " + "'" + MainClass.FixStringForSingleQuote(data.Msg) + "'" + ")"; Retval = MainClass.ExecuteSql(SqlStatement, true, TableName, "Banner", "InsertRecord"); return(Retval); }