///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L6DO_GDfP_1552_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L6DO_GDfP_1552 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L6DO_GDfP_1552_Array functionReturn = new FR_L6DO_GDfP_1552_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 ex; } return(functionReturn); }
protected static FR_L6DO_GDfP_1552_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L6DO_GDfP_1552 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L6DO_GDfP_1552_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL6_Lucenits_Document.Atomic.Retrieval.SQL.cls_Get_Documents_for_PatientID.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, "PatientID", Parameter.PatientID); List <L6DO_GDfP_1552> results = new List <L6DO_GDfP_1552>(); 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[] { "DOC_DocumentID", "File_ServerLocation", "File_Name", "DOC_DocumentRevisionID", "File_Size_Bytes", "File_MIMEType", "File_Extension", "HEC_Patient_DocumentID", "IsDocument_Standard", "IsDocument_PatientConsent", "IsDocument_PatientParticipationPolicy" }); while (reader.Read()) { L6DO_GDfP_1552 resultItem = new L6DO_GDfP_1552(); //0:Parameter DOC_DocumentID of type Guid resultItem.DOC_DocumentID = reader.GetGuid(0); //1:Parameter File_ServerLocation of type String resultItem.File_ServerLocation = reader.GetString(1); //2:Parameter File_Name of type String resultItem.File_Name = reader.GetString(2); //3:Parameter DOC_DocumentRevisionID of type Guid resultItem.DOC_DocumentRevisionID = reader.GetGuid(3); //4:Parameter File_Size_Bytes of type String resultItem.File_Size_Bytes = reader.GetString(4); //5:Parameter File_MIMEType of type String resultItem.File_MIMEType = reader.GetString(5); //6:Parameter File_Extension of type String resultItem.File_Extension = reader.GetString(6); //7:Parameter HEC_Patient_DocumentID of type Guid resultItem.HEC_Patient_DocumentID = reader.GetGuid(7); //8:Parameter IsDocument_Standard of type bool resultItem.IsDocument_Standard = reader.GetBoolean(8); //9:Parameter IsDocument_PatientConsent of type bool resultItem.IsDocument_PatientConsent = reader.GetBoolean(9); //10:Parameter IsDocument_PatientParticipationPolicy of type bool resultItem.IsDocument_PatientParticipationPolicy = reader.GetBoolean(10); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw ex; } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }