///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5ER_GREPD_1350 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5ER_GREPD_1350 functionReturn = new FR_L5ER_GREPD_1350(); 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); }
protected static FR_L5ER_GREPD_1350 Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_L5ER_GREPD_1350(); returnValue.Result = new L5ER_GREPD_1350(); ORM_RES_RealestateProperty_Type.Query propertyTypeQuery = new ORM_RES_RealestateProperty_Type.Query(); propertyTypeQuery.Tenant_RefID = securityTicket.TenantID; List <ORM_RES_RealestateProperty_Type> ormPropertyTypes = ORM_RES_RealestateProperty_Type.Query.Search(Connection, Transaction, propertyTypeQuery); List <L5ER_GREPD_1350_PropertyTypes> propertyTypes = new List <L5ER_GREPD_1350_PropertyTypes>(); foreach (var propertyType in ormPropertyTypes) { L5ER_GREPD_1350_PropertyTypes item = new L5ER_GREPD_1350_PropertyTypes(); item.RealestatePropertyType_Description = propertyType.RealestatePropertyType_Description; item.RealestatePropertyType_Name = propertyType.RealestatePropertyType_Name; item.RES_RealestateProperty_TypeID = propertyType.RES_RealestateProperty_TypeID; propertyTypes.Add(item); } returnValue.Result.PropertyTypes = propertyTypes.ToArray(); ORM_RES_RealestateProperty_SourceOfInformation.Query sourceOfInformationQuery = new ORM_RES_RealestateProperty_SourceOfInformation.Query(); sourceOfInformationQuery.Tenant_RefID = securityTicket.TenantID; List <ORM_RES_RealestateProperty_SourceOfInformation> ormSourcesOfInformation = ORM_RES_RealestateProperty_SourceOfInformation.Query.Search(Connection, Transaction, sourceOfInformationQuery); List <L5ER_GREPD_1350_SourceOfInformation> sourcesOfInformation = new List <L5ER_GREPD_1350_SourceOfInformation>(); foreach (var source in ormSourcesOfInformation) { L5ER_GREPD_1350_SourceOfInformation item = new L5ER_GREPD_1350_SourceOfInformation(); item.SourceOfInformation_Description = source.SourceOfInformation_Description; item.SourceOfInformation_Name = source.SourceOfInformation_Name; item.RES_RealestateProperty_SourceOfInformationID = source.RES_RealestateProperty_SourceOfInformationID; sourcesOfInformation.Add(item); } returnValue.Result.SourceOfInformations = sourcesOfInformation.ToArray(); ORM_RES_RealestateProperty_ConstructionType.Query constructionTypeQuery = new ORM_RES_RealestateProperty_ConstructionType.Query(); constructionTypeQuery.Tenant_RefID = securityTicket.TenantID; List <ORM_RES_RealestateProperty_ConstructionType> ormConstructionTypes = ORM_RES_RealestateProperty_ConstructionType.Query.Search(Connection, Transaction, constructionTypeQuery); List <L5ER_GREPD_1350_ConstructionType> constructionTypes = new List <L5ER_GREPD_1350_ConstructionType>(); foreach (var constructionType in ormConstructionTypes) { L5ER_GREPD_1350_ConstructionType item = new L5ER_GREPD_1350_ConstructionType(); item.ConstructionType_Description = constructionType.ConstructionType_Description; item.ConstructionType_Name = constructionType.ConstructionType_Name; item.RES_RealestateProperty_ConstructionTypeID = constructionType.RES_RealestateProperty_ConstructionTypeID; constructionTypes.Add(item); } returnValue.Result.ConstructionTypes = constructionTypes.ToArray(); //Put your code here return(returnValue); #endregion UserCode }