protected static FR_L5DC_GDCfCID_0213_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5DI_GDCfCID_1555 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5DC_GDCfCID_0213_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_MPC_DIagnosisCatalog.Atomic.Retrieval.SQL.cls_Get_DiagnosesCatalog_for_CatalogID.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, "CatalogID", Parameter.CatalogID); List <L5DC_GDCfCID_0213> results = new List <L5DC_GDCfCID_0213>(); 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[] { "PotentialDiagnosis_Name_DictID", "ICD10_Code", "HEC_DIA_PotentialDiagnosisID", "PotentialDiagnosis_Description_DictID", "PotentialDiagnosisITL", "Tenant_RefID", "IsDeleted", "DefaultTimeUntillDeactivation_InDays", "IsAllergy", "Creation_Timestamp" }); while (reader.Read()) { L5DC_GDCfCID_0213 resultItem = new L5DC_GDCfCID_0213(); //0:Parameter PotentialDiagnosis_Name of type Dict resultItem.PotentialDiagnosis_Name = reader.GetDictionary(0); resultItem.PotentialDiagnosis_Name.SourceTable = "hec_dia_potentialdiagnoses"; loader.Append(resultItem.PotentialDiagnosis_Name); //1:Parameter ICD10_Code of type string resultItem.ICD10_Code = reader.GetString(1); //2:Parameter HEC_DIA_PotentialDiagnosisID of type Guid resultItem.HEC_DIA_PotentialDiagnosisID = reader.GetGuid(2); //3:Parameter PotentialDiagnosis_Description of type Dict resultItem.PotentialDiagnosis_Description = reader.GetDictionary(3); resultItem.PotentialDiagnosis_Description.SourceTable = "hec_dia_potentialdiagnoses"; loader.Append(resultItem.PotentialDiagnosis_Description); //4:Parameter PotentialDiagnosisITL of type string resultItem.PotentialDiagnosisITL = reader.GetString(4); //5:Parameter Tenant_RefID of type Guid resultItem.Tenant_RefID = reader.GetGuid(5); //6:Parameter IsDeleted of type bool resultItem.IsDeleted = reader.GetBoolean(6); //7:Parameter DefaultTimeUntillDeactivation_InDays of type int resultItem.DefaultTimeUntillDeactivation_InDays = reader.GetInteger(7); //8:Parameter IsAllergy of type bool resultItem.IsAllergy = reader.GetBoolean(8); //9:Parameter Creation_Timestamp of type DateTime resultItem.Creation_Timestamp = reader.GetDate(9); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_DiagnosesCatalog_for_CatalogID", 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_L5DC_GDCfCID_0213_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L5DI_GDCfCID_1555 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(Connection, Transaction, null, Parameter, securityTicket)); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5DC_GDCfCID_0213_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5DI_GDCfCID_1555 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5DC_GDCfCID_0213_Array functionReturn = new FR_L5DC_GDCfCID_0213_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_Get_DiagnosesCatalog_for_CatalogID", ex); } return(functionReturn); }
///<summary> /// Opens the connection/transaction for the given connectionString, and closes them when complete ///<summary> public static FR_L5DC_GDCfCID_0213_Array Invoke(string ConnectionString, P_L5DI_GDCfCID_1555 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(null, null, ConnectionString, Parameter, securityTicket)); }