コード例 #1
0
        protected static FR_L3DO_GDfDTID_0840_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L3DO_GDfDTID_0840 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L3DO_GDfDTID_0840_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL3_Document.Atomic.Retrieval.SQL.cls_Get_Documents_for_DeveloperTaskID.sql";

            command.CommandText = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(commandLocation)).ReadToEnd();
            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ticket", securityTicket);
            command.CommandTimeout = QueryTimeout;

            CSV2Core_MySQL.Support.DBSQLSupport.SetParameter(command, "ID", Parameter.ID);



            List <L3DO_GDfDTID_0840_raw> results = new List <L3DO_GDfDTID_0840_raw>();
            var loader = new CSV2Core_MySQL.Dictionaries.MultiTable.Loader.DictionaryLoader(Connection, Transaction);
            var reader = new CSV2Core_MySQL.Support.DBSQLReader(command.ExecuteReader());

            try
            {
                reader.SetOrdinals(new string[] { "AssignmentID", "Structure_RefID", "StructureHeader_RefID", "DOC_DocumentID", "Alias", "PrimaryType", "DOC_DocumentRevisionID", "Document_RefID", "Revision", "File_ServerLocation", "File_Name", "IsLastRevision", "IsLocked", "File_Description", "File_SourceLocation", "File_Size_Bytes", "File_MIMEType", "File_Extension", "Creation_Timestamp" });
                while (reader.Read())
                {
                    L3DO_GDfDTID_0840_raw resultItem = new L3DO_GDfDTID_0840_raw();
                    //0:Parameter AssignmentID of type Guid
                    resultItem.AssignmentID = reader.GetGuid(0);
                    //1:Parameter Structure_RefID of type Guid
                    resultItem.Structure_RefID = reader.GetGuid(1);
                    //2:Parameter StructureHeader_RefID of type Guid
                    resultItem.StructureHeader_RefID = reader.GetGuid(2);
                    //3:Parameter DOC_DocumentID of type Guid
                    resultItem.DOC_DocumentID = reader.GetGuid(3);
                    //4:Parameter Alias of type String
                    resultItem.Alias = reader.GetString(4);
                    //5:Parameter PrimaryType of type String
                    resultItem.PrimaryType = reader.GetString(5);
                    //6:Parameter DOC_DocumentRevisionID of type Guid
                    resultItem.DOC_DocumentRevisionID = reader.GetGuid(6);
                    //7:Parameter Document_RefID of type Guid
                    resultItem.Document_RefID = reader.GetGuid(7);
                    //8:Parameter Revision of type int
                    resultItem.Revision = reader.GetInteger(8);
                    //9:Parameter File_ServerLocation of type String
                    resultItem.File_ServerLocation = reader.GetString(9);
                    //10:Parameter File_Name of type String
                    resultItem.File_Name = reader.GetString(10);
                    //11:Parameter IsLastRevision of type bool
                    resultItem.IsLastRevision = reader.GetBoolean(11);
                    //12:Parameter IsLocked of type bool
                    resultItem.IsLocked = reader.GetBoolean(12);
                    //13:Parameter File_Description of type String
                    resultItem.File_Description = reader.GetString(13);
                    //14:Parameter File_SourceLocation of type String
                    resultItem.File_SourceLocation = reader.GetString(14);
                    //15:Parameter File_Size_Bytes of type int
                    resultItem.File_Size_Bytes = reader.GetInteger(15);
                    //16:Parameter File_MIMEType of type String
                    resultItem.File_MIMEType = reader.GetString(16);
                    //17:Parameter File_Extension of type String
                    resultItem.File_Extension = reader.GetString(17);
                    //18:Parameter Creation_Timestamp of type DateTime
                    resultItem.Creation_Timestamp = reader.GetDate(18);

                    results.Add(resultItem);
                }
            }
            catch (Exception ex)
            {
                reader.Close();
                throw new Exception("Exception occured durng data retrieval in method cls_Get_Documents_for_DeveloperTaskID", ex);
            }
            reader.Close();
            //Load all the dictionaries from the datatables
            loader.Load();

            returnStatus.Result = L3DO_GDfDTID_0840_raw.Convert(results).ToArray();
            return(returnStatus);
        }
コード例 #2
0
 ///<summary>
 /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured
 ///<summary>
 public static FR_L3DO_GDfDTID_0840_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L3DO_GDfDTID_0840 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
コード例 #3
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L3DO_GDfDTID_0840_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L3DO_GDfDTID_0840 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L3DO_GDfDTID_0840_Array functionReturn = new FR_L3DO_GDfDTID_0840_Array();

            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_Documents_for_DeveloperTaskID", ex);
            }
            return(functionReturn);
        }
コード例 #4
0
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_L3DO_GDfDTID_0840_Array Invoke(string ConnectionString, P_L3DO_GDfDTID_0840 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }