Beispiel #1
0
        protected static FR_L5CO_GCOfS_1449_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5CO_GCOfS_1449 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5CO_GCOfS_1449_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_Zugseil_CustomerOrder.Atomic.Retrieval.SQL.cls_Get_Customer_Orders_for_Status.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, "StatusGlobalPropertyMatching", Parameter.StatusGlobalPropertyMatching);



            List <L5CO_GCOfS_1449> results = new List <L5CO_GCOfS_1449>();
            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[] { "ORD_CUO_CustomerOrder_HeaderID", "CustomerOrder_Number", "ProcurementOrderITL", "CustomerOrder_Date", "Current_CustomerOrderStatus_RefID", "GlobalPropertyMatchingID", "Status_Code", "Status_Name_DictID", "OrderingCustomer_BusinessParticipant_RefID", "CustomerOrder_Currency_RefID", "TotalValue_BeforeTax", "Customer_Name", "Name_DictID", "ISO4127", "Symbol", "Number_of_Positions" });
                while (reader.Read())
                {
                    L5CO_GCOfS_1449 resultItem = new L5CO_GCOfS_1449();
                    //0:Parameter ORD_CUO_CustomerOrder_HeaderID of type Guid
                    resultItem.ORD_CUO_CustomerOrder_HeaderID = reader.GetGuid(0);
                    //1:Parameter CustomerOrder_Number of type String
                    resultItem.CustomerOrder_Number = reader.GetString(1);
                    //2:Parameter ProcurementOrderITL of type String
                    resultItem.ProcurementOrderITL = reader.GetString(2);
                    //3:Parameter CustomerOrder_Date of type DateTime
                    resultItem.CustomerOrder_Date = reader.GetDate(3);
                    //4:Parameter Current_CustomerOrderStatus_RefID of type Guid
                    resultItem.Current_CustomerOrderStatus_RefID = reader.GetGuid(4);
                    //5:Parameter GlobalPropertyMatchingID of type string
                    resultItem.GlobalPropertyMatchingID = reader.GetString(5);
                    //6:Parameter Status_Code of type String
                    resultItem.Status_Code = reader.GetString(6);
                    //7:Parameter Status_Name of type Dict
                    resultItem.Status_Name             = reader.GetDictionary(7);
                    resultItem.Status_Name.SourceTable = "ord_cuo_customerorder_statuses";
                    loader.Append(resultItem.Status_Name);
                    //8:Parameter OrderingCustomer_BusinessParticipant_RefID of type Guid
                    resultItem.OrderingCustomer_BusinessParticipant_RefID = reader.GetGuid(8);
                    //9:Parameter CustomerOrder_Currency_RefID of type Guid
                    resultItem.CustomerOrder_Currency_RefID = reader.GetGuid(9);
                    //10:Parameter TotalValue_BeforeTax of type String
                    resultItem.TotalValue_BeforeTax = reader.GetString(10);
                    //11:Parameter Customer_Name of type String
                    resultItem.Customer_Name = reader.GetString(11);
                    //12:Parameter Name of type Dict
                    resultItem.Name             = reader.GetDictionary(12);
                    resultItem.Name.SourceTable = "cmn_currencies";
                    loader.Append(resultItem.Name);
                    //13:Parameter ISO4127 of type String
                    resultItem.ISO4127 = reader.GetString(13);
                    //14:Parameter Symbol of type String
                    resultItem.Symbol = reader.GetString(14);
                    //15:Parameter Number_of_Positions of type int
                    resultItem.Number_of_Positions = reader.GetInteger(15);

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

            returnStatus.Result = results.ToArray();
            return(returnStatus);
        }
Beispiel #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_L5CO_GCOfS_1449_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L5CO_GCOfS_1449 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
Beispiel #3
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L5CO_GCOfS_1449_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5CO_GCOfS_1449 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L5CO_GCOfS_1449_Array functionReturn = new FR_L5CO_GCOfS_1449_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_Customer_Orders_for_Status", ex);
            }
            return(functionReturn);
        }
Beispiel #4
0
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_L5CO_GCOfS_1449_Array Invoke(string ConnectionString, P_L5CO_GCOfS_1449 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }