protected static FR_Guid Execute(DbConnection Connection, DbTransaction Transaction, P_L3PR_SP_1520 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_Guid();
            //Put your code here

            #region Save
            if (Parameter.CMN_CAL_EVT_PresentationID == Guid.Empty)
            {
                ORM_CMN_CAL_Event presentationEvent = new ORM_CMN_CAL_Event();
                presentationEvent.CMN_CAL_EventID = Guid.NewGuid();
                presentationEvent.StartTime       = Parameter.PresentationDate;
                presentationEvent.Tenant_RefID    = securityTicket.TenantID;
                presentationEvent.IsDeleted       = false;
                presentationEvent.Save(Connection, Transaction);

                ORM_CMN_CAL_EVT_Presentation presentation = new ORM_CMN_CAL_EVT_Presentation();
                presentation.CMN_CAL_EVT_PresentationID  = Guid.NewGuid();
                presentation.Ext_CMN_CAL_Calendar_RefID  = presentationEvent.CMN_CAL_EventID;
                presentation.MaximumNumberOfParticipants = Parameter.MaximumNumberOfParticipants;
                presentation.PresentationLocation        = Parameter.PresentationLocation;
                presentation.PresentationTitle           = Parameter.PresentationTitle;
                presentation.PresentationDescription     = Parameter.PresentationDescription;
                presentation.IsFeaturedEvent             = Parameter.IsFeaturedEvent;
                presentation.Tenant_RefID = securityTicket.TenantID;
                presentation.IsDeleted    = false;
                presentation.Save(Connection, Transaction);

                ORM_CMN_CAL_EVT_Presenter presenter = new ORM_CMN_CAL_EVT_Presenter();
                presenter.CMN_CAL_EVT_PresenterID = Guid.NewGuid();
                presenter.Presentation_RefID      = presentation.CMN_CAL_EVT_PresentationID;
                presenter.PresenterDisplayName    = Parameter.PresenterDisplayName;
                presenter.Tenant_RefID            = securityTicket.TenantID;
                presenter.IsDeleted = false;
                presenter.Save(Connection, Transaction);

                returnValue.Result = presentation.CMN_CAL_EVT_PresentationID;
            }
            #endregion
            else
            {
                var existingPresentation = ORM_CMN_CAL_EVT_Presentation.Query.Search(Connection, Transaction, new ORM_CMN_CAL_EVT_Presentation.Query
                {
                    CMN_CAL_EVT_PresentationID = Parameter.CMN_CAL_EVT_PresentationID,
                    IsDeleted    = false,
                    Tenant_RefID = securityTicket.TenantID
                }).Single();
                var existingEventDate = ORM_CMN_CAL_Event.Query.Search(Connection, Transaction, new ORM_CMN_CAL_Event.Query
                {
                    CMN_CAL_EventID = existingPresentation.Ext_CMN_CAL_Calendar_RefID,
                    IsDeleted       = false,
                    Tenant_RefID    = securityTicket.TenantID
                }).Single();
                var existingPresenter = ORM_CMN_CAL_EVT_Presenter.Query.Search(Connection, Transaction, new ORM_CMN_CAL_EVT_Presenter.Query
                {
                    Presentation_RefID = existingPresentation.CMN_CAL_EVT_PresentationID,
                    IsDeleted          = false,
                    Tenant_RefID       = securityTicket.TenantID
                }).Single();
                #region Edit
                if (!Parameter.IsDeleted)
                {
                    existingPresentation.MaximumNumberOfParticipants = Parameter.MaximumNumberOfParticipants;
                    existingPresentation.PresentationLocation        = Parameter.PresentationLocation;
                    existingPresentation.PresentationTitle           = Parameter.PresentationTitle;
                    existingPresentation.PresentationDescription     = Parameter.PresentationDescription;
                    existingPresentation.IsFeaturedEvent             = Parameter.IsFeaturedEvent;

                    existingEventDate.StartTime            = Parameter.PresentationDate;
                    existingPresenter.PresenterDisplayName = Parameter.PresenterDisplayName;
                }
                #endregion
                #region Delete
                else
                {
                    existingPresentation.IsDeleted = true;
                    existingEventDate.IsDeleted    = true;
                    existingPresenter.IsDeleted    = true;
                }
                #endregion

                existingEventDate.Save(Connection, Transaction);
                existingPresenter.Save(Connection, Transaction);
                existingPresentation.Save(Connection, Transaction);
                returnValue.Result = existingPresentation.CMN_CAL_EVT_PresentationID;
            }
            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_Guid Invoke(DbConnection Connection, DbTransaction Transaction, P_L3PR_SP_1520 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_L3PR_SP_1520 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_Presentation", 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_L3PR_SP_1520 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }