///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5MC_GMfGID_1608 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5MC_GMfGID_1608 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5MC_GMfGID_1608 functionReturn = new FR_L5MC_GMfGID_1608(); 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_Members_for_GroupID", ex); } return(functionReturn); }
protected static FR_L5MC_GMfGID_1608 Execute(DbConnection Connection, DbTransaction Transaction, P_L5MC_GMfGID_1608 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { var returnStatus = new FR_L5MC_GMfGID_1608(); DbCommand command = Connection.CreateCommand(); command.Connection = Connection; command.Transaction = Transaction; var commandLocation = "CL5_MPC_Community.Atomic.Retrieval.SQL.cls_Get_Members_for_GroupID.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, "GroupID", Parameter.GroupID); List <L5MC_GMfGID_1608_raw> results = new List <L5MC_GMfGID_1608_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_CommunityGroupID", "IsPrivate", "CommunityGroupCode", "CommunityGroup_Name_DictID", "CommunityGroup_Description_DictID", "CMN_BPT_USR_UserID", "HEC_CMT_MembershipID", "IsAvailableFor_Tenants", "IsAvailableFor_Doctors", "FirstName", "LastName", "PrimaryEmail", "HEC_CMT_OfferedRoleID", "GlobalPropertyMatchingID" }); while (reader.Read()) { L5MC_GMfGID_1608_raw resultItem = new L5MC_GMfGID_1608_raw(); //0:Parameter HEC_CMT_CommunityGroupID of type Guid resultItem.HEC_CMT_CommunityGroupID = reader.GetGuid(0); //1:Parameter IsPrivate of type bool resultItem.IsPrivate = reader.GetBoolean(1); //2:Parameter CommunityGroupCode of type string resultItem.CommunityGroupCode = reader.GetString(2); //3:Parameter CommunityGroup_Name of type Dict resultItem.CommunityGroup_Name = reader.GetDictionary(3); resultItem.CommunityGroup_Name.SourceTable = "hec_cmt_communitygroups"; loader.Append(resultItem.CommunityGroup_Name); //4:Parameter CommunityGroup_Description of type Dict resultItem.CommunityGroup_Description = reader.GetDictionary(4); resultItem.CommunityGroup_Description.SourceTable = "hec_cmt_communitygroups"; loader.Append(resultItem.CommunityGroup_Description); //5:Parameter CMN_BPT_USR_UserID of type Guid resultItem.CMN_BPT_USR_UserID = reader.GetGuid(5); //6:Parameter HEC_CMT_MembershipID of type Guid resultItem.HEC_CMT_MembershipID = reader.GetGuid(6); //7:Parameter IsAvailableFor_Tenants of type bool resultItem.IsAvailableFor_Tenants = reader.GetBoolean(7); //8:Parameter IsAvailableFor_Doctors of type bool resultItem.IsAvailableFor_Doctors = reader.GetBoolean(8); //9:Parameter FirstName of type string resultItem.FirstName = reader.GetString(9); //10:Parameter LastName of type string resultItem.LastName = reader.GetString(10); //11:Parameter PrimaryEmail of type string resultItem.PrimaryEmail = reader.GetString(11); //12:Parameter HEC_CMT_OfferedRoleID of type Guid resultItem.HEC_CMT_OfferedRoleID = reader.GetGuid(12); //13:Parameter GlobalPropertyMatchingID of type string resultItem.GlobalPropertyMatchingID = reader.GetString(13); results.Add(resultItem); } } catch (Exception ex) { reader.Close(); throw new Exception("Exception occured durng data retrieval in method cls_Get_Members_for_GroupID", ex); } reader.Close(); //Load all the dictionaries from the datatables loader.Load(); returnStatus.Result = L5MC_GMfGID_1608_raw.Convert(results).FirstOrDefault(); return(returnStatus); }