protected static FR_L3_PTfT_1429_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L3_PTfT_1429 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L3_PTfT_1429_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CLE_L3_PatientParameters.Atomic.Retrieval.SQL.cls_ParameterTypes_for_Tenant.sql"; command.CommandText = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(commandLocation)).ReadToEnd(); CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ticket", securityTicket); command.CommandTimeout = QueryTimeout; CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "Tenant", Parameter.Tenant); List <L3_PTfT_1429> results = new List <L3_PTfT_1429>(); var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction); var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader()); try { reader.SetOrdinals(new string[] { "HEC_Patient_ParameterID", "PatientParameterITL", "GlobalPropertyMatchingID", "Parameter_Name_DictID", "IsFloat", "IsFloat_ApplicableUnit_RefID", "IsString", "IsVitalParameter", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "HasHighRelevance", "Modification_Timestamp", "ParameterType_RefID", "HEC_Patient_ParameterTypeID", "GlobalPropertyMatchingIDParameterTypes", "Name_DictID", "Creation_TimestampParameterTypes", "IsDeletedParameterTypes", "Modification_TimestampParameterTypes", "IfFloat_MinValue", "IfFloat_MaxValue" }); while (reader.Read()) { L3_PTfT_1429 resultItem = new L3_PTfT_1429(); //0:Parameter HEC_Patient_ParameterID of type Guid resultItem.HEC_Patient_ParameterID = reader.GetGuid(0); //1:Parameter PatientParameterITL of type String resultItem.PatientParameterITL = reader.GetString(1); //2:Parameter GlobalPropertyMatchingID of type String resultItem.GlobalPropertyMatchingID = reader.GetString(2); //3:Parameter Parameter_Name of type Dict resultItem.Parameter_Name = reader.GetDictionary(3); resultItem.Parameter_Name.SourceTable = "hec_patient_parameters"; loader.Append(resultItem.Parameter_Name); //4:Parameter IsFloat of type bool resultItem.IsFloat = reader.GetBoolean(4); //5:Parameter IsFloat_ApplicableUnit_RefID of type Guid resultItem.IsFloat_ApplicableUnit_RefID = reader.GetGuid(5); //6:Parameter IsString of type bool resultItem.IsString = reader.GetBoolean(6); //7:Parameter IsVitalParameter of type bool resultItem.IsVitalParameter = reader.GetBoolean(7); //8:Parameter Creation_Timestamp of type DateTime resultItem.Creation_Timestamp = reader.GetDate(8); //9:Parameter Tenant_RefID of type Guid resultItem.Tenant_RefID = reader.GetGuid(9); //10:Parameter IsDeleted of type bool resultItem.IsDeleted = reader.GetBoolean(10); //11:Parameter HasHighRelevance of type bool resultItem.HasHighRelevance = reader.GetBoolean(11); //12:Parameter Modification_Timestamp of type DateTime resultItem.Modification_Timestamp = reader.GetDate(12); //13:Parameter ParameterType_RefID of type Guid resultItem.ParameterType_RefID = reader.GetGuid(13); //14:Parameter HEC_Patient_ParameterTypeID of type Guid resultItem.HEC_Patient_ParameterTypeID = reader.GetGuid(14); //15:Parameter GlobalPropertyMatchingIDParameterTypes of type String resultItem.GlobalPropertyMatchingIDParameterTypes = reader.GetString(15); //16:Parameter Name of type Dict resultItem.Name = reader.GetDictionary(16); resultItem.Name.SourceTable = "hec_patient_parametertypes"; loader.Append(resultItem.Name); //17:Parameter Creation_TimestampParameterTypes of type DateTime resultItem.Creation_TimestampParameterTypes = reader.GetDate(17); //18:Parameter IsDeletedParameterTypes of type bool resultItem.IsDeletedParameterTypes = reader.GetBoolean(18); //19:Parameter Modification_TimestampParameterTypes of type DateTime resultItem.Modification_TimestampParameterTypes = reader.GetDate(19); //20:Parameter IfFloat_MinValue of type double resultItem.IfFloat_MinValue = reader.GetDouble(20); //21:Parameter IfFloat_MaxValue of type double resultItem.IfFloat_MaxValue = reader.GetDouble(21); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_ParameterTypes_for_Tenant", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }
///<summary> /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured ///<summary> public static FR_L3_PTfT_1429_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L3_PTfT_1429 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(Connection, Transaction, null, Parameter, securityTicket)); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L3_PTfT_1429_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L3_PTfT_1429 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L3_PTfT_1429_Array functionReturn = new FR_L3_PTfT_1429_Array(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, Parameter, securityTicket); #region Cleanup Connection/Transaction //Commit the transaction if (cleanupTransaction == true) { Transaction.Commit(); } //Close the connection if (cleanupConnection == true) { Connection.Close(); } #endregion } catch (Exception ex) { try { if (cleanupTransaction == true && Transaction != null) { Transaction.Rollback(); } } catch { } try { if (cleanupConnection == true && Connection != null) { Connection.Close(); } } catch { } throw new Exception("Exception occured in method cls_ParameterTypes_for_Tenant", ex); } return(functionReturn); }
///<summary> /// Opens the connection/transaction for the given connectionString, and closes them when complete ///<summary> public static FR_L3_PTfT_1429_Array Invoke(string ConnectionString, P_L3_PTfT_1429 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(null, null, ConnectionString, Parameter, securityTicket)); }