///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_CAS_GRADoT_1007_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_CAS_GRADoT_1007_Array functionReturn = new FR_CAS_GRADoT_1007_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 new Exception("Exception occured in method cls_Get_RelevantActionData_on_Tenant", ex); } return(functionReturn); }
protected static FR_CAS_GRADoT_1007_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_CAS_GRADoT_1007_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "DataImporter.DBMethods.Case.Atomic.Retrieval.SQL.cls_Get_RelevantActionData_on_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; List <CAS_GRADoT_1007> results = new List <CAS_GRADoT_1007>(); 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[] { "IsDeleted", "IsPerformed", "IsCancelled", "Patient_RefID", "CaseID", "PlannedAction_RefID", "ActionTypeGpmID", "ToBePerformedBy_BusinessParticipant_RefID", "IsOpPerformed", "IsOpCancelled", "Localization" }); while (reader.Read()) { CAS_GRADoT_1007 resultItem = new CAS_GRADoT_1007(); //0:Parameter IsDeleted of type Boolean resultItem.IsDeleted = reader.GetBoolean(0); //1:Parameter IsPerformed of type Boolean resultItem.IsPerformed = reader.GetBoolean(1); //2:Parameter IsCancelled of type Boolean resultItem.IsCancelled = reader.GetBoolean(2); //3:Parameter Patient_RefID of type Guid resultItem.Patient_RefID = reader.GetGuid(3); //4:Parameter CaseID of type Guid resultItem.CaseID = reader.GetGuid(4); //5:Parameter PlannedAction_RefID of type Guid resultItem.PlannedAction_RefID = reader.GetGuid(5); //6:Parameter ActionTypeGpmID of type String resultItem.ActionTypeGpmID = reader.GetString(6); //7:Parameter ToBePerformedBy_BusinessParticipant_RefID of type Guid resultItem.ToBePerformedBy_BusinessParticipant_RefID = reader.GetGuid(7); //8:Parameter IsOpPerformed of type Boolean resultItem.IsOpPerformed = reader.GetBoolean(8); //9:Parameter IsOpCancelled of type Boolean resultItem.IsOpCancelled = reader.GetBoolean(9); //10:Parameter Localization of type String resultItem.Localization = reader.GetString(10); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_RelevantActionData_on_Tenant", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = results.ToArray(); return(returnStatus); }