///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5AC_GRfGIDs_1555_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5AC_GRfGIDs_1555 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5AC_GRfGIDs_1555_Array functionReturn = new FR_L5AC_GRfGIDs_1555_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_Requests_for_GroupIDs", ex); } return(functionReturn); }
protected static FR_L5AC_GRfGIDs_1555_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5AC_GRfGIDs_1555 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5AC_GRfGIDs_1555_Array(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_MPC_Community.Atomic.Retrieval.SQL.cls_Get_Requests_for_GroupIDs.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; command.CommandText = System.Text.RegularExpressions.Regex.Replace(command.CommandText, "=[ \t]*@GroupIDs", " IN $$GroupIDs$$"); CSV2Core_MySQL.Support.DBSQLSupport.AppendINStatement(command, "$GroupIDs$", Parameter.GroupIDs); List <L5AC_GRfGIDs_1555_raw> results = new List <L5AC_GRfGIDs_1555_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_CMT_GroupSubscription_RequestID", "HEC_CMT_MembershipID", "CMN_BPT_USR_UserID", "Member_FirstName", "Member_LastName", "CommunityGroup_RefID", "Role_GlobalPropertyMatchingID", "HEC_CMT_GroupSubscriptionID", "FromSubscritpion_GroupID" }); while (reader.Read()) { L5AC_GRfGIDs_1555_raw resultItem = new L5AC_GRfGIDs_1555_raw(); //0:Parameter HEC_CMT_GroupSubscription_RequestID of type Guid resultItem.HEC_CMT_GroupSubscription_RequestID = reader.GetGuid(0); //1:Parameter HEC_CMT_MembershipID of type Guid resultItem.HEC_CMT_MembershipID = reader.GetGuid(1); //2:Parameter CMN_BPT_USR_UserID of type Guid resultItem.CMN_BPT_USR_UserID = reader.GetGuid(2); //3:Parameter Member_FirstName of type string resultItem.Member_FirstName = reader.GetString(3); //4:Parameter Member_LastName of type string resultItem.Member_LastName = reader.GetString(4); //5:Parameter CommunityGroup_RefID of type Guid resultItem.CommunityGroup_RefID = reader.GetGuid(5); //6:Parameter Role_GlobalPropertyMatchingID of type string resultItem.Role_GlobalPropertyMatchingID = reader.GetString(6); //7:Parameter HEC_CMT_GroupSubscriptionID of type Guid resultItem.HEC_CMT_GroupSubscriptionID = reader.GetGuid(7); //8:Parameter FromSubscritpion_GroupID of type Guid resultItem.FromSubscritpion_GroupID = reader.GetGuid(8); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Requests_for_GroupIDs", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5AC_GRfGIDs_1555_raw.Convert(results).ToArray(); return(returnStatus); }