Ejemplo n.º 1
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L5DR_RDIaV_1458_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L5DR_RDIaV_1458_Array functionReturn = new FR_L5DR_RDIaV_1458_Array();

            try
            {
                if (cleanupConnection == true)
                {
                    Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
                    Connection.Open();
                }
                if (cleanupTransaction == true)
                {
                    Transaction = Connection.BeginTransaction();
                }

                functionReturn = Execute(Connection, Transaction, 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 ex;
            }
            return(functionReturn);
        }
Ejemplo n.º 2
0
        protected static FR_L5DR_RDIaV_1458_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5DR_RDIaV_1458_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL6_BBV_Driver.Complex.Retrieval.SQL.cls_Retrieve_Driver_Info_and_VerCode.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;
            List <L5DR_RDIaV_1458_raw> results = new List <L5DR_RDIaV_1458_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[] { "CMN_BPT_BusinessParticipantID", "AssociatedBusinessParticipant_RefID", "AccountCode_Value", "CMN_PER_PersonInfoID", "FirstName", "LastName", "PrimaryEmail", "Street_Name", "Street_Number", "City_PostalCode", "Province_Name", "Salutation_General", "City_Name", "Contact_Email", "CMN_UniversalContactDetailID", "CMN_BPT_BusinessParticipant_AssociatedBusinessParticipantID", "CMN_AddressID", "CMN_PER_CommunicationContactID", "USR_AccountID", "USR_Device_AccountCode_UsageHistoryID", "USR_Device_AccountCodeID", "CMN_BPT_SupplierID", "CMN_PER_CommunicationContact_TypeID", "Content" });
                while (reader.Read())
                {
                    L5DR_RDIaV_1458_raw resultItem = new L5DR_RDIaV_1458_raw();
                    //0:Parameter CMN_BPT_BusinessParticipantID of type Guid
                    resultItem.CMN_BPT_BusinessParticipantID = reader.GetGuid(0);
                    //1:Parameter AssociatedBusinessParticipant_RefID of type Guid
                    resultItem.AssociatedBusinessParticipant_RefID = reader.GetGuid(1);
                    //2:Parameter AccountCode_Value of type String
                    resultItem.AccountCode_Value = reader.GetString(2);
                    //3:Parameter CMN_PER_PersonInfoID of type Guid
                    resultItem.CMN_PER_PersonInfoID = reader.GetGuid(3);
                    //4:Parameter FirstName of type String
                    resultItem.FirstName = reader.GetString(4);
                    //5:Parameter LastName of type String
                    resultItem.LastName = reader.GetString(5);
                    //6:Parameter PrimaryEmail of type String
                    resultItem.PrimaryEmail = reader.GetString(6);
                    //7:Parameter Street_Name of type String
                    resultItem.Street_Name = reader.GetString(7);
                    //8:Parameter Street_Number of type String
                    resultItem.Street_Number = reader.GetString(8);
                    //9:Parameter City_PostalCode of type String
                    resultItem.City_PostalCode = reader.GetString(9);
                    //10:Parameter Province_Name of type String
                    resultItem.Province_Name = reader.GetString(10);
                    //11:Parameter Salutation_General of type String
                    resultItem.Salutation_General = reader.GetString(11);
                    //12:Parameter City_Name of type String
                    resultItem.City_Name = reader.GetString(12);
                    //13:Parameter Contact_Email of type String
                    resultItem.Contact_Email = reader.GetString(13);
                    //14:Parameter CMN_UniversalContactDetailID of type Guid
                    resultItem.CMN_UniversalContactDetailID = reader.GetGuid(14);
                    //15:Parameter CMN_BPT_BusinessParticipant_AssociatedBusinessParticipantID of type Guid
                    resultItem.CMN_BPT_BusinessParticipant_AssociatedBusinessParticipantID = reader.GetGuid(15);
                    //16:Parameter CMN_AddressID of type Guid
                    resultItem.CMN_AddressID = reader.GetGuid(16);
                    //17:Parameter CMN_PER_CommunicationContactID of type Guid
                    resultItem.CMN_PER_CommunicationContactID = reader.GetGuid(17);
                    //18:Parameter USR_AccountID of type Guid
                    resultItem.USR_AccountID = reader.GetGuid(18);
                    //19:Parameter USR_Device_AccountCode_UsageHistoryID of type Guid
                    resultItem.USR_Device_AccountCode_UsageHistoryID = reader.GetGuid(19);
                    //20:Parameter USR_Device_AccountCodeID of type Guid
                    resultItem.USR_Device_AccountCodeID = reader.GetGuid(20);
                    //21:Parameter CMN_BPT_SupplierID of type Guid
                    resultItem.CMN_BPT_SupplierID = reader.GetGuid(21);
                    //22:Parameter CMN_PER_CommunicationContact_TypeID of type Guid
                    resultItem.CMN_PER_CommunicationContact_TypeID = reader.GetGuid(22);
                    //23:Parameter Content of type String
                    resultItem.Content = reader.GetString(23);

                    results.Add(resultItem);
                }
            }
            catch (Exception ex)
            {
                reader.Close();
                throw ex;
            }
            reader.Close();
            //Load all the dictionaries from the datatables
            loader.Load();

            returnStatus.Result = L5DR_RDIaV_1458_raw.Convert(results).ToArray();
            return(returnStatus);
        }