///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L6OB_GAPOaMOfPAID_1639 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L6OB_GAPOaMOfPAID_1639 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L6OB_GAPOaMOfPAID_1639 functionReturn = new FR_L6OB_GAPOaMOfPAID_1639();

            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_All_PotentialObservations_and_MadeObservations_for_PerformedActionID", ex);
            }
            return(functionReturn);
        }
 ///<summary>
 /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured
 ///<summary>
 public static FR_L6OB_GAPOaMOfPAID_1639 Invoke(DbConnection Connection, DbTransaction Transaction, P_L6OB_GAPOaMOfPAID_1639 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
        protected static FR_L6OB_GAPOaMOfPAID_1639 Execute(DbConnection Connection, DbTransaction Transaction, P_L6OB_GAPOaMOfPAID_1639 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L6OB_GAPOaMOfPAID_1639();
            L6OB_GAPOaMOfPAID_1639 madeAndPotentialObservations = new L6OB_GAPOaMOfPAID_1639();
            var allPotentialObservations = ORM_HEC_PotentialObservation.Query.Search(Connection, Transaction, new ORM_HEC_PotentialObservation.Query()
            {
                IsDeleted    = false,
                Tenant_RefID = securityTicket.TenantID
            }).ToArray();
            var madeObservationsForPerformedActionID = ORM_HEC_ACT_PerformedAction_MadeObservation.Query.Search(Connection, Transaction, new ORM_HEC_ACT_PerformedAction_MadeObservation.Query()
            {
                IsDeleted    = false,
                Tenant_RefID = securityTicket.TenantID,
                HEC_ACT_PerformedAction_RefID = Parameter.PerformedActionID
            }).ToArray();

            List <L6OB_GAPOaMOfPAID_1639MadeObservations> madeObservations = new List <L6OB_GAPOaMOfPAID_1639MadeObservations>();
            foreach (var observation in madeObservationsForPerformedActionID)
            {
                L6OB_GAPOaMOfPAID_1639MadeObservations newObservation = new L6OB_GAPOaMOfPAID_1639MadeObservations();
                newObservation.Comment = observation.Comment;
                newObservation.PotentialObservationRef_ID = observation.PotentialObservation_RefID;
                madeObservations.Add(newObservation);
            }

            madeAndPotentialObservations.MadeObservations      = madeObservations.ToArray();
            madeAndPotentialObservations.PotentialObservations = allPotentialObservations.ToArray();
            returnValue.Result = madeAndPotentialObservations;
            //Put your code here
            return(returnValue);

            #endregion UserCode
        }
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_L6OB_GAPOaMOfPAID_1639 Invoke(string ConnectionString, P_L6OB_GAPOaMOfPAID_1639 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }
Exemplo n.º 5
0
        protected static FR_L6OB_GAPOaMOfPAID_1639 Execute(DbConnection Connection, DbTransaction Transaction, P_L6OB_GAPOaMOfPAID_1639 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            //Leave UserCode region to enable user code saving
            #region UserCode
            var returnValue = new FR_L6OB_GAPOaMOfPAID_1639();
            //Put your code here

            return(returnValue);

            #endregion UserCode
        }