///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L3_PVfT_1458_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L3_PVfT_1458 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L3_PVfT_1458_Array functionReturn = new FR_L3_PVfT_1458_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_ParameterValues_for_Tenant", ex); } return(functionReturn); }
protected static FR_L3_PVfT_1458_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L3_PVfT_1458 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L3_PVfT_1458_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CLE_L3_PatientParameters.Atomic.Retrieval.SQL.cls_ParameterValues_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_PVfT_1458> results = new List <L3_PVfT_1458>(); 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_ParameterValueID", "Patient_RefID", "PatientParameter_RefID", "IsConfirmed", "DateOfValue", "ConfirmedBy_Doctor_RefID", "EnteredBy_Doctor_RefID", "DateOfEntry", "StringValue", "FloatValue", "Creation_Timestamp", "Tenant_RefID", "IsDeleted", "GlobalPropertyMatchingID", "Modification_TimestampPatientParameters", "Modification_TimestampParameterValues" }); while (reader.Read()) { L3_PVfT_1458 resultItem = new L3_PVfT_1458(); //0:Parameter HEC_Patient_ParameterValueID of type Guid resultItem.HEC_Patient_ParameterValueID = reader.GetGuid(0); //1:Parameter Patient_RefID of type Guid resultItem.Patient_RefID = reader.GetGuid(1); //2:Parameter PatientParameter_RefID of type Guid resultItem.PatientParameter_RefID = reader.GetGuid(2); //3:Parameter IsConfirmed of type bool resultItem.IsConfirmed = reader.GetBoolean(3); //4:Parameter DateOfValue of type DateTime resultItem.DateOfValue = reader.GetDate(4); //5:Parameter ConfirmedBy_Doctor_RefID of type Guid resultItem.ConfirmedBy_Doctor_RefID = reader.GetGuid(5); //6:Parameter EnteredBy_Doctor_RefID of type Guid resultItem.EnteredBy_Doctor_RefID = reader.GetGuid(6); //7:Parameter DateOfEntry of type DateTime resultItem.DateOfEntry = reader.GetDate(7); //8:Parameter StringValue of type String resultItem.StringValue = reader.GetString(8); //9:Parameter FloatValue of type double resultItem.FloatValue = reader.GetDouble(9); //10:Parameter Creation_Timestamp of type DateTime resultItem.Creation_Timestamp = reader.GetDate(10); //11:Parameter Tenant_RefID of type Guid resultItem.Tenant_RefID = reader.GetGuid(11); //12:Parameter IsDeleted of type bool resultItem.IsDeleted = reader.GetBoolean(12); //13:Parameter GlobalPropertyMatchingID of type String resultItem.GlobalPropertyMatchingID = reader.GetString(13); //14:Parameter Modification_TimestampPatientParameters of type DateTime resultItem.Modification_TimestampPatientParameters = reader.GetDate(14); //15:Parameter Modification_TimestampParameterValues of type DateTime resultItem.Modification_TimestampParameterValues = reader.GetDate(15); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_ParameterValues_for_Tenant", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }