///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L3OC_GOCfnLM_1602_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L3OC_GOCfnLM_1602_Array functionReturn = new FR_L3OC_GOCfnLM_1602_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_OrderCollectives_for_not_LeadMember", ex); } return(functionReturn); }
protected static FR_L3OC_GOCfnLM_1602_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_L3OC_GOCfnLM_1602_Array(); var results = new List <L3OC_GOCfnLM_1602>(); #region Get Order Collectives for which current Tenant ISN'T a Lead var orderCollectives = cls_Get_OrderCollective_for_Member.Invoke( Connection, Transaction, new P_L3OC_GOCfM_1544() { IsMemberLead = false }, securityTicket); if (orderCollectives == null || orderCollectives.Result == null || orderCollectives.Result.Count() < 1) { returnValue.Result = results.ToArray(); returnValue.Status = FR_Status.Success; return(returnValue); } #endregion #region Get Tenant Business Participant var tenantBusinessParticipant = ORM_CMN_BPT_BusinessParticipant.Query.Search(Connection, Transaction, new ORM_CMN_BPT_BusinessParticipant.Query() { IfTenant_Tenant_RefID = securityTicket.TenantID, IsDeleted = false }).FirstOrDefault(); if (tenantBusinessParticipant == null) { returnValue.Result = results.ToArray(); returnValue.Status = FR_Status.Error_Internal; return(returnValue); } #endregion foreach (var orderCollective in orderCollectives.Result) { #region Get Tenant Order Collective Member var tenantMember = ORM_OCL_OrderCollective_Member.Query.Search( Connection, Transaction, new ORM_OCL_OrderCollective_Member.Query() { BusinessParticipant_RefID = tenantBusinessParticipant.CMN_BPT_BusinessParticipantID, OrderCollective_RefID = orderCollective.OCL_OrderCollectiveID, Tenant_RefID = securityTicket.TenantID }).FirstOrDefault(); if (tenantMember == null) { returnValue.Result = results.ToArray(); returnValue.Status = FR_Status.Error_Internal; return(returnValue); } #endregion results.Add(new L3OC_GOCfnLM_1602() { OrderCollective = orderCollective, CurrentOrderCollectiveMemberID = tenantMember.OCL_OrderCollective_MemberID, CurrentOrderCollectiveMemberJoinDate = tenantMember.MemberSince }); } returnValue.Status = FR_Status.Success; returnValue.Result = results.ToArray(); return(returnValue); #endregion UserCode }