예제 #1
0
        protected static FR_L5US_GBPfToID_1419_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5US_GBPfToID_1419 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            var returnStatus = new FR_L5US_GBPfToID_1419_Array();

            DbCommand command = Connection.CreateCommand();

            command.Connection  = Connection;
            command.Transaction = Transaction;
            var commandLocation = "CL5_APOAdmin_User.Atomic.Manipulation.SQL.cls_Get_BusinessParticipant_for_Tenant_or_ID.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 <L5US_GBPfToID_1419> results = new List <L5US_GBPfToID_1419>();
            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", "Tenant_RefID", "DisplayName", "IsNaturalPerson", "IsCompany", "IfNaturalPerson_CMN_PER_PersonInfo_RefID", "IfCompany_CMN_COM_CompanyInfo_RefID", "DisplayImage_RefID", "DefaultLanguage_RefID", "DefaultCurrency_RefID", "LastContacted_Date", "LastContacted_ByBusinessPartner_RefID", "Audit_UpdatedByAccount_RefID", "Audit_UpdatedOn", "Audit_CreatedByAccount_RefID" });
                while (reader.Read())
                {
                    L5US_GBPfToID_1419 resultItem = new L5US_GBPfToID_1419();
                    //0:Parameter CMN_BPT_BusinessParticipantID of type Guid
                    resultItem.CMN_BPT_BusinessParticipantID = reader.GetGuid(0);
                    //1:Parameter Tenant_RefID of type Guid
                    resultItem.Tenant_RefID = reader.GetGuid(1);
                    //2:Parameter DisplayName of type String
                    resultItem.DisplayName = reader.GetString(2);
                    //3:Parameter IsNaturalPerson of type bool
                    resultItem.IsNaturalPerson = reader.GetBoolean(3);
                    //4:Parameter IsCompany of type bool
                    resultItem.IsCompany = reader.GetBoolean(4);
                    //5:Parameter IfNaturalPerson_CMN_PER_PersonInfo_RefID of type Guid
                    resultItem.IfNaturalPerson_CMN_PER_PersonInfo_RefID = reader.GetGuid(5);
                    //6:Parameter IfCompany_CMN_COM_CompanyInfo_RefID of type Guid
                    resultItem.IfCompany_CMN_COM_CompanyInfo_RefID = reader.GetGuid(6);
                    //7:Parameter DisplayImage_RefID of type Guid
                    resultItem.DisplayImage_RefID = reader.GetGuid(7);
                    //8:Parameter DefaultLanguage_RefID of type Guid
                    resultItem.DefaultLanguage_RefID = reader.GetGuid(8);
                    //9:Parameter DefaultCurrency_RefID of type Guid
                    resultItem.DefaultCurrency_RefID = reader.GetGuid(9);
                    //10:Parameter LastContacted_Date of type DateTime
                    resultItem.LastContacted_Date = reader.GetDate(10);
                    //11:Parameter LastContacted_ByBusinessPartner_RefID of type Guid
                    resultItem.LastContacted_ByBusinessPartner_RefID = reader.GetGuid(11);
                    //12:Parameter Audit_UpdatedByAccount_RefID of type Guid
                    resultItem.Audit_UpdatedByAccount_RefID = reader.GetGuid(12);
                    //13:Parameter Audit_UpdatedOn of type String
                    resultItem.Audit_UpdatedOn = reader.GetString(13);
                    //14:Parameter Audit_CreatedByAccount_RefID of type Guid
                    resultItem.Audit_CreatedByAccount_RefID = reader.GetGuid(14);

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

            returnStatus.Result = 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_L5US_GBPfToID_1419_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L5US_GBPfToID_1419 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_L5US_GBPfToID_1419_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5US_GBPfToID_1419 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

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