protected static FR_Guid Execute(DbConnection Connection, DbTransaction Transaction, P_L2DTP_SDTP_1431 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_Guid();
            //Put your code here
            var item = new CL1_TMS_PRO.ORM_TMS_PRO_DeveloperTask_Priority();
            if (Parameter.TMS_PRO_DeveloperTask_PriorityID != Guid.Empty)
            {
                //ORM_TMS_PRO_DeveloperTask_Priority.Query.Search(Connection, Transaction, new ORM_TMS_PRO_DeveloperTask_Priority.Query()
                //{
                //    Tenant_RefID = securityTicket.TenantID,
                //    IsDeleted = false,
                //    TMS_PRO_DeveloperTask_PriorityID = Parameter.TMS_PRO_DeveloperTask_PriorityID
                //});
                var result = item.Load(Connection, Transaction, Parameter.TMS_PRO_DeveloperTask_PriorityID);
                if (result.Status != FR_Status.Success || item.TMS_PRO_DeveloperTask_PriorityID == Guid.Empty)
                {
                    var error = new FR_Guid();
                    error.ErrorMessage = "No Such ID";
                    error.Status       = FR_Status.Error_Internal;
                    return(error);
                }
            }

            if (Parameter.IsDeleted == true || Parameter.IfDeleteReplaceWith != Guid.Empty)
            {
                CL1_TMS_PRO.ORM_TMS_PRO_DeveloperTask.Query searchQuery = new CL1_TMS_PRO.ORM_TMS_PRO_DeveloperTask.Query();
                searchQuery.DeveloperTask_Type_RefID = Parameter.TMS_PRO_DeveloperTask_PriorityID;

                CL1_TMS_PRO.ORM_TMS_PRO_DeveloperTask.Query updateQuery = new CL1_TMS_PRO.ORM_TMS_PRO_DeveloperTask.Query();
                updateQuery.DeveloperTask_Type_RefID = Parameter.IfDeleteReplaceWith;

                CL1_TMS_PRO.ORM_TMS_PRO_DeveloperTask.Query.Update(Connection, Transaction, searchQuery, updateQuery);

                item.IsDeleted = true;
                item.Save(Connection, Transaction);

                //cls_Update_TMS_PRO_DTPriorityLevels_for_TenantID.Invoke(Connection, Transaction, securityTicket);

                return(new FR_Guid(item.TMS_PRO_DeveloperTask_PriorityID));
            }
            if (Parameter.TMS_PRO_DeveloperTask_PriorityID == Guid.Empty)
            {
                item.Tenant_RefID = securityTicket.TenantID;
                item.IsPersistent = true;
            }
            if (Parameter.Label != null)
            {
                item.Label = Parameter.Label;
            }
            if (Parameter.Description != null)
            {
                item.Description = Parameter.Description;
            }
            if (Parameter.IconLocationURL != null)
            {
                item.IconLocationURL = Parameter.IconLocationURL;
            }
            if (Parameter.Groups != null)
            {
                item.Groups = Parameter.Groups;
            }
            item.PriorityLevel = (int)Parameter.PriorityLevel;
            if (Parameter.Priority_Colour != null)
            {
                item.Priority_Colour = Parameter.Priority_Colour;
            }
            return(new FR_Guid(item.Save(Connection, Transaction), item.TMS_PRO_DeveloperTask_PriorityID));

            #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_Guid Invoke(DbConnection Connection, DbTransaction Transaction, P_L2DTP_SDTP_1431 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_Guid Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L2DTP_SDTP_1431 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_Guid functionReturn = new FR_Guid();

            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_DeveloperTask_Priority", ex);
            }
            return(functionReturn);
        }
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_Guid Invoke(string ConnectionString, P_L2DTP_SDTP_1431 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }