コード例 #1
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L6DD_GQfRGI Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L6DD_GQfRGI_1503 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L6DD_GQfRGI functionReturn = new FR_L6DD_GQfRGI();

            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_Questionnaires_for_RevisionGroupID", ex);
            }
            return(functionReturn);
        }
コード例 #2
0
        protected static FR_L6DD_GQfRGI Execute(DbConnection Connection, DbTransaction Transaction, P_L6DD_GQfRGI_1503 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L6DD_GQfRGI();
            returnValue.Result = new L6DD_GQfRGI();
            //Put your code here
            var revisions = ORM_RES_DUD_Revision.Query.Search(Connection, Transaction, new ORM_RES_DUD_Revision.Query()
            {
                RevisionGroup_RefID = Parameter.RevisionGroupID,
                Tenant_RefID        = securityTicket.TenantID
            });
            if (revisions == null || revisions.Count == 0)
            {
                return(null);
            }
            returnValue.Result.QuestionnaireVersions = revisions.Select(x => x.QuestionnaireVersion_RefID).Distinct().ToArray();


            return(returnValue);

            #endregion UserCode
        }