///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_GADfTID_1605_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_GADfTID_1605_Array functionReturn = new FR_GADfTID_1605_Array(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, 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 ex; } return(functionReturn); }
protected static FR_GADfTID_1605_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_GADfTID_1605_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_Lucentis_Diagnosis.Atomic.Retrieval.SQL.cls_Get_AllDiagnosis_for_TenantID_Admin.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; List <GADfTID_1605_raw> results = new List <GADfTID_1605_raw>(); 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_DIA_PotentialDiagnosisID", "ICD10_Code", "PotentialDiagnosis_Description_DictID", "PotentialDiagnosis_Name_DictID", "DiagnosisState_Name_DictID", "DiagnosisState_Abbreviation", "HEC_DIA_Diagnosis_StateID", "DiagnosisLocalization_Name_DictID", "HEC_DIA_Diagnosis_LocalizationID" }); while (reader.Read()) { GADfTID_1605_raw resultItem = new GADfTID_1605_raw(); //0:Parameter HEC_DIA_PotentialDiagnosisID of type Guid resultItem.HEC_DIA_PotentialDiagnosisID = reader.GetGuid(0); //1:Parameter ICD10_Code of type String resultItem.ICD10_Code = reader.GetString(1); //2:Parameter PotentialDiagnosis_Description of type Dict resultItem.PotentialDiagnosis_Description = reader.GetDictionary(2); resultItem.PotentialDiagnosis_Description.SourceTable = "hec_dia_potentialdiagnoses"; loader.Append(resultItem.PotentialDiagnosis_Description); //3:Parameter PotentialDiagnosis_Name of type Dict resultItem.PotentialDiagnosis_Name = reader.GetDictionary(3); resultItem.PotentialDiagnosis_Name.SourceTable = "hec_dia_potentialdiagnoses"; loader.Append(resultItem.PotentialDiagnosis_Name); //4:Parameter DiagnosisState_Name of type Dict resultItem.DiagnosisState_Name = reader.GetDictionary(4); resultItem.DiagnosisState_Name.SourceTable = "hec_dia_diagnosis_states"; loader.Append(resultItem.DiagnosisState_Name); //5:Parameter DiagnosisState_Abbreviation of type String resultItem.DiagnosisState_Abbreviation = reader.GetString(5); //6:Parameter HEC_DIA_Diagnosis_StateID of type Guid resultItem.HEC_DIA_Diagnosis_StateID = reader.GetGuid(6); //7:Parameter DiagnosisLocalization_Name of type Dict resultItem.DiagnosisLocalization_Name = reader.GetDictionary(7); resultItem.DiagnosisLocalization_Name.SourceTable = "hec_dia_diagnosis_localizations"; loader.Append(resultItem.DiagnosisLocalization_Name); //8:Parameter HEC_DIA_Diagnosis_LocalizationID of type Guid resultItem.HEC_DIA_Diagnosis_LocalizationID = reader.GetGuid(8); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw ex; } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = GADfTID_1605_raw.Convert(results).ToArray(); return(returnStatus); }