///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L3TX_GTOFTO_1006 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L3TX_GTOFTO_1006 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L3TX_GTOFTO_1006 functionReturn = new FR_L3TX_GTOFTO_1006(); 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_TaxOffices_For_TaxOfficeID", ex); } return(functionReturn); }
///<summary> /// Opens the connection/transaction for the given connectionString, and closes them when complete ///<summary> public static FR_L3TX_GTOFTO_1006 Invoke(string ConnectionString, P_L3TX_GTOFTO_1006 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(null, null, ConnectionString, Parameter, securityTicket)); }
///<summary> /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured ///<summary> public static FR_L3TX_GTOFTO_1006 Invoke(DbConnection Connection, DbTransaction Transaction, P_L3TX_GTOFTO_1006 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { return(Invoke(Connection, Transaction, null, Parameter, securityTicket)); }
protected static FR_L3TX_GTOFTO_1006 Execute(DbConnection Connection, DbTransaction Transaction, P_L3TX_GTOFTO_1006 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_L3TX_GTOFTO_1006(); returnValue.Result = new L3TX_GTOFTO_1006(); var item = new ORM_ACC_TAX_TaxOffice(); returnValue.Result.TaxOffice = new L3TX_GTOFT_0914(); var result = item.Load(Connection, Transaction, Parameter.ACC_TAX_TaxOfficeID); ORM_CMN_BPT_BusinessParticipant bparticipant = new ORM_CMN_BPT_BusinessParticipant(); bparticipant.Load(Connection, Transaction, item.CMN_BPT_BusinessParticipant_RefID); returnValue.Result.TaxOffice.DisplayName = bparticipant.DisplayName; ORM_CMN_COM_CompanyInfo companyInfo = new ORM_CMN_COM_CompanyInfo(); companyInfo.Load(Connection, Transaction, bparticipant.IfCompany_CMN_COM_CompanyInfo_RefID); ORM_CMN_UniversalContactDetail ucd = new ORM_CMN_UniversalContactDetail(); ucd.Load(Connection, Transaction, companyInfo.Contact_UCD_RefID); returnValue.Result.TaxOffice.VATIdentificationNumber = companyInfo.VATIdentificationNumber; returnValue.Result.TaxOffice.ACC_TAX_TaxOfficeID = item.ACC_TAX_TaxOfficeID; returnValue.Result.TaxOffice.Country_639_1_ISOCode = ucd.Country_639_1_ISOCode; //Put your code here return(returnValue); #endregion UserCode }