///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5QT_GQFQI_1517 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5QT_GQFQI_1517 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5QT_GQFQI_1517 functionReturn = new FR_L5QT_GQFQI_1517(); 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_Questionnaires_For_QuestionnaireID", ex); } return(functionReturn); }
protected static FR_L5QT_GQFQI_1517 Execute(DbConnection Connection, DbTransaction Transaction, P_L5QT_GQFQI_1517 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_L5QT_GQFQI_1517(); returnValue.Result = new L5QT_GQFQI_1517(); ORM_RES_QST_Questionnaire questionnaire = new ORM_RES_QST_Questionnaire(); questionnaire.Load(Connection, Transaction, Parameter.QuestionnaireID); returnValue.Result.Questionnaire = questionnaire; ORM_RES_QST_Questionnaire_Version version = new ORM_RES_QST_Questionnaire_Version(); version.Load(Connection, Transaction, questionnaire.Current_QuestionnaireVersion_RefID); returnValue.Result.QuestionnaireVersion = version; ORM_RES_QST_Apartment_AvailableProperty.Query apartmentQuery = new ORM_RES_QST_Apartment_AvailableProperty.Query(); apartmentQuery.Tenant_RefID = securityTicket.TenantID; apartmentQuery.IsDeleted = false; apartmentQuery.RES_QST_Questionnaire_Version_RefID = version.RES_QST_Questionnaire_VersionID; List <ORM_RES_QST_Apartment_AvailableProperty> apartments = ORM_RES_QST_Apartment_AvailableProperty.Query.Search(Connection, Transaction, apartmentQuery); returnValue.Result.Apartments = apartments.ToArray(); ORM_RES_QST_Attic_AvailableProperty.Query atticQuery = new ORM_RES_QST_Attic_AvailableProperty.Query(); atticQuery.Tenant_RefID = securityTicket.TenantID; atticQuery.IsDeleted = false; atticQuery.RES_QST_Questionnaire_Version_RefID = version.RES_QST_Questionnaire_VersionID; List <ORM_RES_QST_Attic_AvailableProperty> attics = ORM_RES_QST_Attic_AvailableProperty.Query.Search(Connection, Transaction, atticQuery); returnValue.Result.Attics = attics.ToArray(); ORM_RES_QST_Basement_AvailableProperty.Query basementQuery = new ORM_RES_QST_Basement_AvailableProperty.Query(); basementQuery.Tenant_RefID = securityTicket.TenantID; basementQuery.IsDeleted = false; basementQuery.RES_QST_Questionnaire_Version_RefID = version.RES_QST_Questionnaire_VersionID; List <ORM_RES_QST_Basement_AvailableProperty> basements = ORM_RES_QST_Basement_AvailableProperty.Query.Search(Connection, Transaction, basementQuery); returnValue.Result.Basements = basements.ToArray(); ORM_RES_QST_Facade_AvailableProperty.Query facadeQuery = new ORM_RES_QST_Facade_AvailableProperty.Query(); facadeQuery.Tenant_RefID = securityTicket.TenantID; facadeQuery.IsDeleted = false; facadeQuery.RES_QST_Questionnaire_Version_RefID = version.RES_QST_Questionnaire_VersionID; List <ORM_RES_QST_Facade_AvailableProperty> facades = ORM_RES_QST_Facade_AvailableProperty.Query.Search(Connection, Transaction, facadeQuery); returnValue.Result.Facades = facades.ToArray(); ORM_RES_QST_HVACR_AvailableProperty.Query hvacrQuery = new ORM_RES_QST_HVACR_AvailableProperty.Query(); hvacrQuery.Tenant_RefID = securityTicket.TenantID; hvacrQuery.IsDeleted = false; hvacrQuery.RES_QST_Questionnaire_Version_RefID = version.RES_QST_Questionnaire_VersionID; List <ORM_RES_QST_HVACR_AvailableProperty> hvacrs = ORM_RES_QST_HVACR_AvailableProperty.Query.Search(Connection, Transaction, hvacrQuery); returnValue.Result.Hvacr = hvacrs.ToArray(); ORM_RES_QST_OutdoorFacility_AvailableProperty.Query outdoorQuery = new ORM_RES_QST_OutdoorFacility_AvailableProperty.Query(); outdoorQuery.Tenant_RefID = securityTicket.TenantID; outdoorQuery.IsDeleted = false; outdoorQuery.RES_QST_Questionnaire_Version_RefID = version.RES_QST_Questionnaire_VersionID; List <ORM_RES_QST_OutdoorFacility_AvailableProperty> outdoors = ORM_RES_QST_OutdoorFacility_AvailableProperty.Query.Search(Connection, Transaction, outdoorQuery); returnValue.Result.OutdoorFacilities = outdoors.ToArray(); ORM_RES_QST_Roof_AvailableProperty.Query roofQuery = new ORM_RES_QST_Roof_AvailableProperty.Query(); roofQuery.Tenant_RefID = securityTicket.TenantID; roofQuery.IsDeleted = false; roofQuery.RES_QST_Questionnaire_Version_RefID = version.RES_QST_Questionnaire_VersionID; List <ORM_RES_QST_Roof_AvailableProperty> roofs = ORM_RES_QST_Roof_AvailableProperty.Query.Search(Connection, Transaction, roofQuery); returnValue.Result.Roofs = roofs.ToArray(); ORM_RES_QST_Staircase_AvailableProperty.Query staircaseQuery = new ORM_RES_QST_Staircase_AvailableProperty.Query(); staircaseQuery.Tenant_RefID = securityTicket.TenantID; staircaseQuery.IsDeleted = false; staircaseQuery.RES_QST_Questionnaire_Version_RefID = version.RES_QST_Questionnaire_VersionID; List <ORM_RES_QST_Staircase_AvailableProperty> staircases = ORM_RES_QST_Staircase_AvailableProperty.Query.Search(Connection, Transaction, staircaseQuery); returnValue.Result.Staircases = staircases.ToArray(); //Put your code here return(returnValue); #endregion UserCode }