// make a TableData object from a SADataReader record #if !NO_ASA static void MakeDataRec(SADataReader myDataReader, out TableData data) { data = new TableData( myDataReader["ConsoleName"].ToString() , MainClass.ToInt(TableName, myDataReader["LogComm"]) , MainClass.ToInt(TableName, myDataReader["LogTaskSched"]) , MainClass.ToInt(TableName, myDataReader["PtDischInactiveDays"]) , MainClass.ToInt(TableName, myDataReader["PtNotDischInactiveDays"]) , MainClass.ToInt(TableName, myDataReader["DiscrepKeepDays"]) , MainClass.ToInt(TableName, myDataReader["TrxKeepDays"]) , MainClass.ToInt(TableName, myDataReader["UserHistKeepDays"]) , MainClass.ToInt(TableName, myDataReader["PtHistKeepDays"]) , MainClass.ToInt(TableName, myDataReader["SvcMsgKeepDays"]) , MainClass.ToInt(TableName, myDataReader["RefillTblKeepHours"]) , MainClass.ToInt(TableName, myDataReader["itemHistKeepDays"]) , myDataReader["DbServerName"].ToString() , myDataReader["ConsoleToken0"].ToString() , myDataReader["SoftwareVersion"].ToString() , MainClass.ToInt(TableName, myDataReader["ParsePatientName"]) , MainClass.ToInt(TableName, myDataReader["StnMaxTrxKeepDays"]) , MainClass.ToInt(TableName, myDataReader["MaxItemAliases"]) , MainClass.ToInt(TableName, myDataReader["SummaryTblKeepDays"]) , MainClass.ToInt(TableName, myDataReader["TimeBias"]) , myDataReader["MyDeviceName"].ToString() , MainClass.ToInt(TableName, myDataReader["ArchiveKeepDays"]) , MainClass.ToInt(TableName, myDataReader["HandheldNonCommHours"]) , MainClass.ToInt(TableName, myDataReader["CaseKeepDays"]) , MainClass.ToInt(TableName, myDataReader["SavedReportKeepDays"]) , MainClass.ToBool(TableName, myDataReader["LogService"]) , MainClass.ToInt(TableName, myDataReader["MaxPVSClients"]) , MainClass.ToInt(TableName, myDataReader["TempTransactionKeepDays"]) , MainClass.ToInt(TableName, myDataReader["MyCaseListKeepDays"])); }
// make a TableData object from a SADataReader record #if !NO_ASA static void MakeDataRec(SADataReader myDataReader, out TableData data) { data = new TableData( MainClass.ToInt(TableName, myDataReader["TaskId"]) , myDataReader["Directory"].ToString() , myDataReader["FileName"].ToString() , MainClass.ToBool(TableName, myDataReader["AllowMultipleFlag"]) , myDataReader["MsgQueue"].ToString()); }
static void MakeDataRec(SADataReader reader, out TableData data) { data = new TableData( reader["DomainName"].ToString(), MainClass.ToInt(TableName, reader["DomainIid"]), reader["SystemAccountName"].ToString(), reader["DataBlock"].ToString(), reader["CreatorID"].ToString(), MainClass.ToBool(TableName, reader["IsDefault"])); }
// make a TableData object from a SADataReader object #if !NO_ASA static void MakeDataRec(SADataReader myDataReader, out TableData data) { data = new TableData( MainClass.ToInt(TableName, myDataReader["pathId"]), myDataReader["dirDescription"].ToString(), myDataReader["dirPath"].ToString(), MainClass.ToBool(TableName, myDataReader["isBatch"]), MainClass.ToInt(TableName, myDataReader["parentId"]), MainClass.ToBool(TableName, myDataReader["purge"]), MainClass.ToBool(TableName, myDataReader["isNetworkDrive"])); }
// get a record // integer vals are returned as -1 if they're null public static bool GetRecord(int PathId, out TableData data) { bool Retval = true; data = new TableData(); #if !NO_ASA SAConnection _conn; SADataReader myDataReader; string SqlStatement = "SELECT * from DIR_PATH_TREE WHERE pathId=" + PathId; if (MainClass.ExecuteSelect(SqlStatement, true, TableName, "DirPathTree", "GetRecord", out _conn, out myDataReader)) { try { if (myDataReader.Read()) { data = new TableData( PathId, myDataReader["dirDescription"].ToString(), myDataReader["dirPath"].ToString(), MainClass.ToBool(TableName, myDataReader["isBatch"]), MainClass.ToInt(TableName, myDataReader["parentId"]), MainClass.ToBool(TableName, myDataReader["purge"]), MainClass.ToBool(TableName, myDataReader["isNetworkDrive"])); } } catch (Exception ex) { Retval = false; string err = String.Format(MainClass.StringTable.GetString("DatabaseError"), TableName, ex.Message.ToString() + "(" + SqlStatement + ")"); ServiceMessages.InsertRec(MainClass.AppName, TableName, "GetRecord", err); } finally { if (myDataReader != null) { myDataReader.Close(); myDataReader.Dispose(); myDataReader = null; } if (_conn != null) { _conn.Close(); _conn.Dispose(); _conn = null; } } } #endif return(Retval); }
// make a TableData object from a SADataReader object static void MakeDataRec(SADataReader myDataReader, out TableData data) { data = new TableData( MainClass.ToInt(TableName, myDataReader["ReportIid"]), myDataReader["reportFile"].ToString(), (ReportTypeEnum)MainClass.ToInt(TableName, myDataReader["reportType"]), (PrintStatusEnum)MainClass.ToInt(TableName, myDataReader["printStatus"]), MainClass.ToInt(TableName, myDataReader["PrintPathIid"]), MainClass.ToInt(TableName, myDataReader["numCopy"]), MainClass.ToBool(TableName, myDataReader["sendMessage"]), MainClass.ToBool(TableName, myDataReader["graph"]), (SortDirectionEnum)MainClass.ToInt(TableName, myDataReader["groupDirection1"]), (SortDirectionEnum)MainClass.ToInt(TableName, myDataReader["groupDirection2"]), (SortDirectionEnum)MainClass.ToInt(TableName, myDataReader["groupDirection3"]), myDataReader["groupHeader1"].ToString(), myDataReader["groupHeader2"].ToString(), myDataReader["groupHeader3"].ToString(), myDataReader["groupTable1"].ToString(), myDataReader["groupTable2"].ToString(), myDataReader["groupTable3"].ToString(), (SortDirectionEnum)MainClass.ToInt(TableName, myDataReader["sortDirection1"]), (SortDirectionEnum)MainClass.ToInt(TableName, myDataReader["sortDirection2"]), (SortDirectionEnum)MainClass.ToInt(TableName, myDataReader["sortDirection3"]), myDataReader["sortHeader1"].ToString(), myDataReader["sortHeader2"].ToString(), myDataReader["sortHeader3"].ToString(), myDataReader["sortTable1"].ToString(), myDataReader["sortTable2"].ToString(), myDataReader["sortTable3"].ToString(), MainClass.ToInt(TableName, myDataReader["bulletinNumber"]), myDataReader["batchName"].ToString(), MainClass.ToInt(TableName, myDataReader["batchUser"]), MainClass.ToInt(TableName, myDataReader["batchPathId"]), MainClass.ToInt(TableName, myDataReader["emailId"]), (OutputEnum)MainClass.ToInt(TableName, myDataReader["outputType"]), MainClass.ToInt(TableName, myDataReader["dirPathId"]), myDataReader["completedReportFile"].ToString(), (CopyStatusEnum)MainClass.ToInt(TableName, myDataReader["copyStatus"]), (EmailStatusEnum)MainClass.ToInt(TableName, myDataReader["emailStatus"]), (RunStatusEnum)MainClass.ToInt(TableName, myDataReader["runStatus"]), MainClass.ToInt(TableName, myDataReader["eMailType"]) ); }
// make a TableData object from a SADataReader record #if !NO_ASA static void MakeDataRec(SADataReader myDataReader, out TableData data) { data = new TableData( MainClass.ToInt(TableName, myDataReader["taskScheduleIid"]), MainClass.ToInt(TableName, myDataReader["taskId"]), myDataReader["taskName"].ToString(), MainClass.ToInt(TableName, myDataReader["argId"]), myDataReader["userName"].ToString(), MainClass.ToBool(TableName, myDataReader["enabled"]), (TimeUnitEnum)(Int16)myDataReader["timeUnit"], MainClass.ToInt(TableName, myDataReader["intervalNum"]), MainClass.ToDate(TableName, myDataReader["startTime"]), MainClass.ToDate(TableName, myDataReader["endTime"]), MainClass.ToInt(TableName, myDataReader["dayOfWeekMask"]), MainClass.ToInt(TableName, myDataReader["monthOfYearMask"]), MainClass.ToInt(TableName, myDataReader["dayOfMonth"]), (FirstLastEnum)MainClass.ToInt(TableName, myDataReader["firstLast"]), MainClass.ToBool(TableName, myDataReader["deleteWhenDone"]), myDataReader["taskComment"].ToString(), MainClass.ToBool(TableName, myDataReader["execMissedTasks"]), myDataReader["schedString"].ToString(), MainClass.ToDate(TableName, myDataReader["lastSuccess"]), MainClass.ToDate(TableName, myDataReader["nextExecTime"])); }
// return all records // -1 for an int or enum arg means that DB field was NULL // DateTime.MinTime for a DateTime arg means that DB field was NULL public static bool GetRecs(List <TableData> list) { bool Retval = true; list.Clear(); #if !NO_ASA TableData data; SAConnection _conn; SADataReader myDataReader; string SqlStatement = "SELECT * from Reports"; if (MainClass.ExecuteSelect(SqlStatement, true, TableName, "Reports", "GetData", out _conn, out myDataReader)) { try { while (myDataReader.Read()) { data = new TableData( MainClass.ToInt(TableName, myDataReader["ReportIid"]), myDataReader["reportFile"].ToString(), myDataReader["recordFilter"].ToString(), MainClass.ToInt(TableName, myDataReader["numCopy"]), MainClass.ToBool(TableName, myDataReader["sendMessage"]), myDataReader["dateFrom"].ToString(), myDataReader["dateTo"].ToString(), myDataReader["dateRange"].ToString(), (SortDirectionEnum)MainClass.ToInt(TableName, myDataReader["groupDirection1"]), (SortDirectionEnum)MainClass.ToInt(TableName, myDataReader["groupDirection2"]), (SortDirectionEnum)MainClass.ToInt(TableName, myDataReader["groupDirection3"]), myDataReader["groupHeader1"].ToString(), myDataReader["groupHeader2"].ToString(), myDataReader["groupHeader3"].ToString(), myDataReader["groupTable1"].ToString(), myDataReader["groupTable2"].ToString(), myDataReader["groupTable3"].ToString(), (SortDirectionEnum)MainClass.ToInt(TableName, myDataReader["sortDirection1"]), (SortDirectionEnum)MainClass.ToInt(TableName, myDataReader["sortDirection2"]), (SortDirectionEnum)MainClass.ToInt(TableName, myDataReader["sortDirection3"]), myDataReader["sortHeader1"].ToString(), myDataReader["sortHeader2"].ToString(), myDataReader["sortHeader3"].ToString(), myDataReader["sortTable1"].ToString(), myDataReader["sortTable2"].ToString(), myDataReader["sortTable3"].ToString(), myDataReader["filterText1"].ToString(), myDataReader["filterText2"].ToString(), myDataReader["filterText3"].ToString(), myDataReader["filterText4"].ToString(), myDataReader["filterText5"].ToString(), myDataReader["filterText6"].ToString(), myDataReader["filterText7"].ToString(), myDataReader["filterText8"].ToString(), myDataReader["filterText9"].ToString(), myDataReader["filterText10"].ToString(), myDataReader["filterText11"].ToString(), myDataReader["filterText12"].ToString(), myDataReader["filterText13"].ToString(), myDataReader["filterText14"].ToString(), myDataReader["filterText15"].ToString(), myDataReader["batchName"].ToString(), MainClass.ToBool(TableName, myDataReader["reportDelete"]) ); list.Add(data); } } catch (Exception ex) { Retval = false; string err = String.Format(MainClass.StringTable.GetString("DatabaseError"), TableName, ex.Message.ToString() + "(" + SqlStatement + ")"); ServiceMessages.InsertRec(MainClass.AppName, "Reports", "GetRecs", err); } finally { if (myDataReader != null) { myDataReader.Close(); myDataReader.Dispose(); myDataReader = null; } if (_conn != null) { _conn.Close(); _conn.Dispose(); _conn = null; } } } #endif return(Retval); }
// make a TableData object from a SADataReader record #if !NO_ASA static void MakeDataRec(SADataReader myDataReader, out TableData data) { SecureString secureSmtpPass = new SecureString(); char[] smtpPass = myDataReader["SmtpPassword"].ToString().ToCharArray(); foreach (char c in smtpPass) { secureSmtpPass.AppendChar(c); } Array.Clear(smtpPass, 0, smtpPass.Length); data = new TableData( MainClass.ToInt(TableName, myDataReader["SIid"]) , myDataReader["SiteId"].ToString() , myDataReader["SiteName"].ToString() , myDataReader["Address1"].ToString() , myDataReader["Address2"].ToString() , myDataReader["City"].ToString() , myDataReader["State"].ToString() , myDataReader["ZipCode"].ToString() , myDataReader["Country"].ToString() , myDataReader["Contact"].ToString() , myDataReader["Phone"].ToString() , myDataReader["DiagLine"].ToString() , myDataReader["Fax"].ToString() , myDataReader["Description"].ToString() , myDataReader["Notes"].ToString() , myDataReader["FacilityCode"].ToString() , MainClass.ToInt(TableName, myDataReader["PreExpPw"]) , myDataReader["ArchiveId"].ToString() , MainClass.ToInt(TableName, myDataReader["PwExpDelta"]) , MainClass.ToInt(TableName, myDataReader["UserIdExpireDelta"]) , MainClass.ToInt(TableName, myDataReader["TempUserExpDays"]) , MainClass.ToInt(TableName, myDataReader["PwLen"]) , myDataReader["PtIdFormat"].ToString() , MainClass.ToInt(TableName, myDataReader["ConLogOffTimeOut"]) , MainClass.ToInt(TableName, myDataReader["RptSortByItemId"]) , MainClass.ToInt(TableName, myDataReader["Voice"]) , myDataReader["Version"].ToString() , MainClass.ToInt(TableName, myDataReader["ArchiveYearFormat"]) , myDataReader["DbMachineName"].ToString() , MainClass.ToInt(TableName, myDataReader["PrintStockOut"]) , MainClass.ToInt(TableName, myDataReader["PrintCriticalLow"]) , MainClass.ToInt(TableName, myDataReader["PrintADTconflict"]) , MainClass.ToInt(TableName, myDataReader["PrintIncomingDiscrep"]) , MainClass.ToInt(TableName, myDataReader["PrintCommDown"]) , MainClass.ToInt(TableName, myDataReader["PermitGlobalPatientList"]) , myDataReader["HomeFax"].ToString() , myDataReader["HomeEmail"].ToString() , MainClass.ToInt(TableName, myDataReader["ClientServerSystem"]) , MainClass.ToInt(TableName, myDataReader["ORFeatures"]) , MainClass.ToInt(TableName, myDataReader["DodWarning"]) , MainClass.ToBool(TableName, myDataReader["CopyReports"]) , MainClass.ToBool(TableName, myDataReader["EmailReports"]) , MainClass.ToInt(TableName, myDataReader["UserDoorAccessPerItem"]) , MainClass.ToInt(TableName, myDataReader["TechDoorAccessPerItem"]) , MainClass.ToInt(TableName, myDataReader["Ticci"]) , MainClass.ToInt(TableName, myDataReader["PwEnableComplex"]) , myDataReader["PwComplexRegex"].ToString() , myDataReader["PwComplexDesc"].ToString() , MainClass.ToInt(TableName, myDataReader["PwMaxLen"]) , MainClass.ToInt(TableName, myDataReader["PwHistory"]) , MainClass.ToInt(TableName, myDataReader["PwHistoryClamp"]) , MainClass.ToInt(TableName, myDataReader["ORISInterface"]) , myDataReader["SmtpHost"].ToString() , MainClass.ToInt(TableName, myDataReader["SmtpPort"]) , MainClass.ToBool(TableName, myDataReader["SmtpUseSSL"]) , myDataReader["SmtpUsername"].ToString() , secureSmtpPass , MainClass.ToBool(TableName, myDataReader["pwEnableExtended"]) , MainClass.ToBool(TableName, myDataReader["upgrade"]) , myDataReader["siteGUID"].ToString() , MainClass.ToInt(TableName, myDataReader["allowGLCodeTransactions"]) , MainClass.ToInt(TableName, myDataReader["AllowORISTempToTempCaseTransfer"]) , MainClass.ToInt(TableName, myDataReader["allowAssociator"]) , MainClass.ToInt(TableName, myDataReader["allowAutoCaseToPatientXfer"]) , MainClass.ToInt(TableName, myDataReader["holdRFIDTxForCase"]) , MainClass.ToInt(TableName, myDataReader["activeDirectoryOnly"]) , MainClass.ToInt(TableName, myDataReader["logVerbosity"]) , myDataReader["logMsgFormat"].ToString() , myDataReader["logServerIP"].ToString() , myDataReader["logServerPort"].ToString() , MainClass.ToInt(TableName, myDataReader["logEnableRemote"]) , MainClass.ToInt(TableName, myDataReader["PwMinAge"]) , MainClass.ToInt(TableName, myDataReader["PwMinChg"]) ); }