///<summary> /// Opens the connection/transaction for the given connectionString, and closes them when complete ///<summary> public static FR_L6PR_GPMwSIfPN_1832_Array Invoke(string ConnectionString, P_L6PR_GPMwSIfPN_1832 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(null, null, ConnectionString, Parameter, securityTicket)); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L6PR_GPMwSIfPN_1832_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L6PR_GPMwSIfPN_1832 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L6PR_GPMwSIfPN_1832_Array functionReturn = new FR_L6PR_GPMwSIfPN_1832_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_ProjectMembers_with_SharedInfo_for_ProjectNote", ex); } return(functionReturn); }
protected static FR_L6PR_GPMwSIfPN_1832_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L6PR_GPMwSIfPN_1832 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_L6PR_GPMwSIfPN_1832_Array(); //Put your code here List <L6PR_GPMwSIfPN_1832> tempResult = new List <L6PR_GPMwSIfPN_1832>(); ORM_TMS_PRO_Project_Notes projectNote = new ORM_TMS_PRO_Project_Notes(); projectNote.Load(Connection, Transaction, Parameter.ProjectNote_ID); #region ProjectMembers ORM_TMS_PRO_ProjectMember.Query membersQuery = new ORM_TMS_PRO_ProjectMember.Query(); membersQuery.Project_RefID = projectNote.Project_RefID; membersQuery.IsDeleted = false; List <ORM_TMS_PRO_ProjectMember> currentProject_Members = ORM_TMS_PRO_ProjectMember.Query.Search(Connection, Transaction, membersQuery); P_L3US_GUBIfUA_1057 userAccountInfoParameter = new P_L3US_GUBIfUA_1057(); if (currentProject_Members.Count > 0) { foreach (var currentMember in currentProject_Members) { L6PR_GPMwSIfPN_1832 tempResultItem = new L6PR_GPMwSIfPN_1832(); tempResultItem.ProjectMember_AccountID = currentMember.USR_Account_RefID; tempResultItem.ProjectMember_ID = currentMember.TMS_PRO_ProjectMemberID; userAccountInfoParameter.UserAccountID = currentMember.USR_Account_RefID; var userAccountInfoResult = cls_Get_UserBasicInfo_for_UserAccountID.Invoke(Connection, Transaction, userAccountInfoParameter, securityTicket).Result; tempResultItem.ProjectMember_FirstName = userAccountInfoResult.FirstName; tempResultItem.ProjectMember_LastName = userAccountInfoResult.LastName; tempResultItem.ProjectMember_ProfileImage_ServerLocation = userAccountInfoResult.File_ServerLocation; tempResult.Add(tempResultItem); } } #endregion #region Is member note collaborator ORM_TMS_PRO_Project_Note_Collaborators.Query noteCollaboratorsQuery = new ORM_TMS_PRO_Project_Note_Collaborators.Query(); noteCollaboratorsQuery.IsDeleted = false; noteCollaboratorsQuery.ProjectNote_RefID = Parameter.ProjectNote_ID; foreach (var currentMember in tempResult) { noteCollaboratorsQuery.Account_RefID = currentMember.ProjectMember_AccountID; currentMember.ProjectMember_IsNoteCollaborator = ORM_TMS_PRO_Project_Note_Collaborators.Query.Exists(Connection, Transaction, noteCollaboratorsQuery); } #endregion returnValue.Result = tempResult.ToArray(); return(returnValue); #endregion UserCode }
///<summary> /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured ///<summary> public static FR_L6PR_GPMwSIfPN_1832_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L6PR_GPMwSIfPN_1832 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(Connection, Transaction, null, Parameter, securityTicket)); }