protected static FR_Bool Execute(DbConnection Connection, DbTransaction Transaction, P_L3DT_SPDT_1644 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_Bool(); //Put your code here foreach (P_L3DT_SPDT_1644a asgn in Parameter.Assignments) { var item = new CL1_TMS_PRO.ORM_TMS_PRO_Peers_Development(); if (asgn.AssignmentID != Guid.Empty) { var result = item.Load(Connection, Transaction, asgn.AssignmentID); if (result.Status != FR_Status.Success || item.AssignmentID == Guid.Empty) { var error = new FR_Bool(false); error.ErrorMessage = "No Such ID"; error.Status = FR_Status.Error_Internal; return(error); } } if (asgn.IsDeleted == true) { item.IsDeleted = true; } //Creation specific parameters (Tenant, Account ... ) if (asgn.AssignmentID == Guid.Empty) { item.Tenant_RefID = securityTicket.TenantID; item.ProjectMember_RefID = Parameter.AssignedBy_ProjectMemberID; } item.DeveloperTask_RefID = Parameter.DeveloperTask_RefID; item.ProjectMember_RefID = asgn.ProjectMember_RefID; item.Save(Connection, Transaction); } returnValue.Result = true; return(returnValue); #endregion UserCode }
///<summary> /// Ivokes the method with the given Connection, leaving it open if no exceptions occured ///<summary> public static FR_Bool Invoke(DbConnection Connection, P_L3DT_SPDT_1644 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(Connection, null, null, Parameter, securityTicket)); }
///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_Bool Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L3DT_SPDT_1644 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_Bool functionReturn = new FR_Bool(); 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_Save_TMS_PRO_Peers_Development", ex); } return(functionReturn); }