protected static FR_L5US_GASUPfToUID_1322_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5US_GASUPfToUID_1322 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5US_GASUPfToUID_1322_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_APOAdmin_User.Atomic.Retrieval.SQL.cls_Get_AllSystemUsers_for_TenantID.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, "ApplicationID", Parameter.ApplicationID); List <L5US_GASUPfToUID_1322_raw> results = new List <L5US_GASUPfToUID_1322_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[] { "CMN_BPT_BusinessParticipantID", "FirstName", "LastName", "USR_AccountID", "Username", "AccountSignInEmailAddress", "AccountType", "Group_Name_DictID", "USR_Account_RefID", "USR_GroupID", "Street_Name", "Street_Number", "City_PostalCode", "City_Name", "PrimaryEmail", "CMN_PER_CommunicationContactID", "Type", "Content", "IsDefaultForContactType" }); while (reader.Read()) { L5US_GASUPfToUID_1322_raw resultItem = new L5US_GASUPfToUID_1322_raw(); //0:Parameter CMN_BPT_BusinessParticipantID of type Guid resultItem.CMN_BPT_BusinessParticipantID = reader.GetGuid(0); //1:Parameter FirstName of type String resultItem.FirstName = reader.GetString(1); //2:Parameter LastName of type String resultItem.LastName = reader.GetString(2); //3:Parameter USR_AccountID of type Guid resultItem.USR_AccountID = reader.GetGuid(3); //4:Parameter Username of type String resultItem.Username = reader.GetString(4); //5:Parameter AccountSignInEmailAddress of type String resultItem.AccountSignInEmailAddress = reader.GetString(5); //6:Parameter AccountType of type int resultItem.AccountType = reader.GetInteger(6); //7:Parameter Group_Name of type Dict resultItem.Group_Name = reader.GetDictionary(7); resultItem.Group_Name.SourceTable = "usr_groups"; loader.Append(resultItem.Group_Name); //8:Parameter USR_Account_RefID of type Guid resultItem.USR_Account_RefID = reader.GetGuid(8); //9:Parameter USR_GroupID of type Guid resultItem.USR_GroupID = reader.GetGuid(9); //10:Parameter Street_Name of type String resultItem.Street_Name = reader.GetString(10); //11:Parameter Street_Number of type String resultItem.Street_Number = reader.GetString(11); //12:Parameter City_PostalCode of type String resultItem.City_PostalCode = reader.GetString(12); //13:Parameter City_Name of type String resultItem.City_Name = reader.GetString(13); //14:Parameter PrimaryEmail of type String resultItem.PrimaryEmail = reader.GetString(14); //15:Parameter CMN_PER_CommunicationContactID of type Guid resultItem.CMN_PER_CommunicationContactID = reader.GetGuid(15); //16:Parameter Type of type String resultItem.Type = reader.GetString(16); //17:Parameter Content of type String resultItem.Content = reader.GetString(17); //18:Parameter IsDefaultForContactType of type Boolean resultItem.IsDefaultForContactType = reader.GetBoolean(18); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_AllSystemUsers_for_TenantID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5US_GASUPfToUID_1322_raw.Convert(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_L5US_GASUPfToUID_1322_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L5US_GASUPfToUID_1322 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(Connection, Transaction, null, Parameter, securityTicket)); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5US_GASUPfToUID_1322_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5US_GASUPfToUID_1322 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5US_GASUPfToUID_1322_Array functionReturn = new FR_L5US_GASUPfToUID_1322_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_AllSystemUsers_for_TenantID", ex); } return(functionReturn); }
///<summary> /// Opens the connection/transaction for the given connectionString, and closes them when complete ///<summary> public static FR_L5US_GASUPfToUID_1322_Array Invoke(string ConnectionString, P_L5US_GASUPfToUID_1322 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(null, null, ConnectionString, Parameter, securityTicket)); }