Ejemplo n.º 1
0
 ///<summary>
 /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured
 ///<summary>
 public static FR_L5AAS_GCPfBPCC_0849_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L5AAS_GCPfBPCC_0849 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
Ejemplo n.º 2
0
        protected static FR_L5AAS_GCPfBPCC_0849_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L5AAS_GCPfBPCC_0849 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L5AAS_GCPfBPCC_0849_Array();
            P_L5AAS_GCPIfBP_1607 ParamGetContactPerson = new P_L5AAS_GCPIfBP_1607();
            ParamGetContactPerson.BusinessParticipantID = Parameter.BusinessParticipantID;
            var contactPersons = cls_Get_Contact_Person_Info_for_BusinessParticipantID.Invoke(Connection, Transaction, ParamGetContactPerson, securityTicket).Result;
            List <L5AAS_GCPfBPCC_0849> transformedContacts = new List <L5AAS_GCPfBPCC_0849>();
            foreach (var cp in contactPersons)
            {
                L5AAS_GCPfBPCC_0849 transformedContact = new L5AAS_GCPfBPCC_0849();
                transformedContact.CMN_BPT_BusinessParticipantID = cp.CMN_BPT_BusinessParticipantID;
                transformedContact.IsDeleted = cp.IsDeleted;
                transformedContact.AssociatedBusinessParticipant_RefID = cp.AssociatedBusinessParticipant_RefID;
                transformedContact.AssociatedParticipant_FunctionName  = cp.AssociatedParticipant_FunctionName;
                transformedContact.CMN_PER_PersonInfoID = cp.CMN_PER_PersonInfoID;
                transformedContact.FirstName            = cp.FirstName;
                transformedContact.LastName             = cp.LastName;
                transformedContact.CMN_AddressID        = cp.CMN_AddressID;
                transformedContact.Street_Name          = cp.Street_Name;
                transformedContact.Street_Number        = cp.Street_Number;
                transformedContact.City_Name            = cp.City_Name;
                transformedContact.City_PostalCode      = cp.City_PostalCode;
                transformedContact.Country_ISOCode      = cp.Country_ISOCode;
                transformedContact.Email = GetContentByContentType(EnumUtils.GetEnumDescription(EComunactionContactType.Email), cp.ContactTypes);
                transformedContact.Phone = GetContentByContentType(EnumUtils.GetEnumDescription(EComunactionContactType.Phone), cp.ContactTypes);
                transformedContact.Fax   = GetContentByContentType(EnumUtils.GetEnumDescription(EComunactionContactType.Fax), cp.ContactTypes);
                transformedContacts.Add(transformedContact);
            }
            returnValue.Result = transformedContacts.ToArray();
            returnValue.Status = FR_Status.Success;
            return(returnValue);

            #endregion UserCode
        }
Ejemplo n.º 3
0
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_L5AAS_GCPfBPCC_0849_Array Invoke(string ConnectionString, P_L5AAS_GCPfBPCC_0849 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }
Ejemplo n.º 4
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L5AAS_GCPfBPCC_0849_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5AAS_GCPfBPCC_0849 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L5AAS_GCPfBPCC_0849_Array functionReturn = new FR_L5AAS_GCPfBPCC_0849_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_Contact_Person_for_BusinessParticipantID_CommunicationContact", ex);
            }
            return(functionReturn);
        }