///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L5AT_GAFA_1001 Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5AT_GAFA_1001 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L5AT_GAFA_1001 functionReturn = new FR_L5AT_GAFA_1001(); 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_Action_For_ActionID", ex); } return(functionReturn); }
protected static FR_L5AT_GAFA_1001 Execute(DbConnection Connection, DbTransaction Transaction, P_L5AT_GAFA_1001 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { #region UserCode var returnValue = new FR_L5AT_GAFA_1001(); //Put your code here returnValue.Result = new L5AT_GAFA_1001(); ORM_RES_ACT_Action action = new ORM_RES_ACT_Action(); action.Load(Connection, Transaction, Parameter.ActionID); ORM_RES_ACT_Action_Version version = new ORM_RES_ACT_Action_Version(); version.Load(Connection, Transaction, action.CurrentVersion_RefID); returnValue.Result.RES_ACT_ActionID = action.RES_ACT_ActionID; returnValue.Result.RES_ACT_Action_VersionID = action.CurrentVersion_RefID; returnValue.Result.Action_Name = version.Action_Name; returnValue.Result.Action_Description = version.Action_Description; returnValue.Result.Default_PricePerUnit_RefID = version.Default_PricePerUnit_RefID; returnValue.Result.Default_Unit_RefID = version.Default_Unit_RefID; returnValue.Result.Default_UnitAmount = version.Default_UnitAmount; returnValue.Result.Action_Version = version.Action_Version; ORM_RES_STR_Apartment_Property_AvailableAction.Query apartmentQuery = new ORM_RES_STR_Apartment_Property_AvailableAction.Query(); apartmentQuery.Tenant_RefID = securityTicket.TenantID; apartmentQuery.IsDeleted = false; apartmentQuery.RES_ACT_Action_RefID = action.RES_ACT_ActionID; List <ORM_RES_STR_Apartment_Property_AvailableAction> apartments = ORM_RES_STR_Apartment_Property_AvailableAction.Query.Search(Connection, Transaction, apartmentQuery); List <L5AT_GAFA_1001_Apartment_Property> apartmentList = new List <L5AT_GAFA_1001_Apartment_Property>(); foreach (var buildingPart in apartments) { L5AT_GAFA_1001_Apartment_Property item = new L5AT_GAFA_1001_Apartment_Property(); item.RES_STR_Apartment_Property_AvailableActionID = buildingPart.RES_STR_Apartment_Property_AvailableActionID; item.RES_STR_Apartment_Property_RefID = buildingPart.RES_STR_Apartment_Property_RefID; apartmentList.Add(item); } returnValue.Result.Apartment_Property = apartmentList.ToArray(); ORM_RES_STR_Attic_Property_AvailableAction.Query atticQuery = new ORM_RES_STR_Attic_Property_AvailableAction.Query(); atticQuery.Tenant_RefID = securityTicket.TenantID; atticQuery.IsDeleted = false; atticQuery.RES_ACT_Action_RefID = action.RES_ACT_ActionID; List <ORM_RES_STR_Attic_Property_AvailableAction> attics = ORM_RES_STR_Attic_Property_AvailableAction.Query.Search(Connection, Transaction, atticQuery); List <L5AT_GAFA_1001_Attic_Property> atticList = new List <L5AT_GAFA_1001_Attic_Property>(); foreach (var buildingPart in attics) { L5AT_GAFA_1001_Attic_Property item = new L5AT_GAFA_1001_Attic_Property(); item.RES_STR_Attic_Property_AvailableActionID = buildingPart.RES_STR_Attic_Property_AvailableActionID; item.RES_STR_Attic_Property_RefID = buildingPart.RES_STR_Attic_Property_RefID; atticList.Add(item); } returnValue.Result.Attic_Property = atticList.ToArray(); ORM_RES_STR_Basement_Property_AvailableAction.Query basementQuery = new ORM_RES_STR_Basement_Property_AvailableAction.Query(); basementQuery.Tenant_RefID = securityTicket.TenantID; basementQuery.IsDeleted = false; basementQuery.RES_ACT_Action_RefID = action.RES_ACT_ActionID; List <ORM_RES_STR_Basement_Property_AvailableAction> basements = ORM_RES_STR_Basement_Property_AvailableAction.Query.Search(Connection, Transaction, basementQuery); List <L5AT_GAFA_1001_Basement_Property> basementList = new List <L5AT_GAFA_1001_Basement_Property>(); foreach (var buildingPart in basements) { L5AT_GAFA_1001_Basement_Property item = new L5AT_GAFA_1001_Basement_Property(); item.RES_STR_Basement_Property_AvailableActionID = buildingPart.RES_STR_Basement_Property_AvailableActionID; item.RES_STR_Basement_Property_RefID = buildingPart.RES_STR_Basement_Property_RefID; basementList.Add(item); } returnValue.Result.Basement_Property = basementList.ToArray(); ORM_RES_STR_Facade_Property_AvailableAction.Query facadeQuery = new ORM_RES_STR_Facade_Property_AvailableAction.Query(); facadeQuery.Tenant_RefID = securityTicket.TenantID; facadeQuery.IsDeleted = false; facadeQuery.RES_ACT_Action_RefID = action.RES_ACT_ActionID; List <ORM_RES_STR_Facade_Property_AvailableAction> facades = ORM_RES_STR_Facade_Property_AvailableAction.Query.Search(Connection, Transaction, facadeQuery); List <L5AT_GAFA_1001_Facade_Property> facadeList = new List <L5AT_GAFA_1001_Facade_Property>(); foreach (var buildingPart in facades) { L5AT_GAFA_1001_Facade_Property item = new L5AT_GAFA_1001_Facade_Property(); item.RES_STR_Facade_Property_AvailableActionID = buildingPart.RES_STR_Facade_Property_AvailableActionID; item.RES_STR_Facade_Property_RefID = buildingPart.RES_STR_Facade_Property_RefID; facadeList.Add(item); } returnValue.Result.Facade_Property = facadeList.ToArray(); ORM_RES_STR_HVACR_Property_AvailableAction.Query hvacrQuery = new ORM_RES_STR_HVACR_Property_AvailableAction.Query(); hvacrQuery.Tenant_RefID = securityTicket.TenantID; hvacrQuery.IsDeleted = false; hvacrQuery.RES_ACT_Action_RefID = action.RES_ACT_ActionID; List <ORM_RES_STR_HVACR_Property_AvailableAction> hvacrs = ORM_RES_STR_HVACR_Property_AvailableAction.Query.Search(Connection, Transaction, hvacrQuery); List <L5AT_GAFA_1001_HVACR_Property> hvacrList = new List <L5AT_GAFA_1001_HVACR_Property>(); foreach (var buildingPart in hvacrs) { L5AT_GAFA_1001_HVACR_Property item = new L5AT_GAFA_1001_HVACR_Property(); item.RES_STR_HVACR_Property_AvailableActionID = buildingPart.RES_STR_HVACR_Property_AvailableActionID; item.RES_STR_HVACR_Property_RefID = buildingPart.RES_STR_HVACR_Property_RefID; hvacrList.Add(item); } returnValue.Result.HVACR_Property = hvacrList.ToArray(); ORM_RES_STR_OutdoorFacility_Property_AvailableAction.Query outdoorQuery = new ORM_RES_STR_OutdoorFacility_Property_AvailableAction.Query(); outdoorQuery.Tenant_RefID = securityTicket.TenantID; outdoorQuery.IsDeleted = false; outdoorQuery.RES_ACT_Action_RefID = action.RES_ACT_ActionID; List <ORM_RES_STR_OutdoorFacility_Property_AvailableAction> outdoors = ORM_RES_STR_OutdoorFacility_Property_AvailableAction.Query.Search(Connection, Transaction, outdoorQuery); List <L5AT_GAFA_1001_OutdoorFacility_Property> outdoorList = new List <L5AT_GAFA_1001_OutdoorFacility_Property>(); foreach (var buildingPart in outdoors) { L5AT_GAFA_1001_OutdoorFacility_Property item = new L5AT_GAFA_1001_OutdoorFacility_Property(); item.RES_STR_OutdoorFacility_Property_AvailableActionID = buildingPart.RES_STR_OutdoorFacility_Property_AvailableActionID; item.RES_STR_OutdoorFacility_Property_RefID = buildingPart.RES_STR_OutdoorFacility_Property_RefID; outdoorList.Add(item); } returnValue.Result.OutdoorFacility_Property = outdoorList.ToArray(); ORM_RES_STR_Roof_Property_AvailableAction.Query roofQuery = new ORM_RES_STR_Roof_Property_AvailableAction.Query(); roofQuery.Tenant_RefID = securityTicket.TenantID; roofQuery.IsDeleted = false; roofQuery.RES_ACT_Action_RefID = action.RES_ACT_ActionID; List <ORM_RES_STR_Roof_Property_AvailableAction> roofs = ORM_RES_STR_Roof_Property_AvailableAction.Query.Search(Connection, Transaction, roofQuery); List <L5AT_GAFA_1001_Roof_Property> roofList = new List <L5AT_GAFA_1001_Roof_Property>(); foreach (var buildingPart in roofs) { L5AT_GAFA_1001_Roof_Property item = new L5AT_GAFA_1001_Roof_Property(); item.RES_STR_Roof_Property_AvailableActionID = buildingPart.RES_STR_Roof_Property_AvailableActionID; item.RES_STR_Roof_Property_RefID = buildingPart.RES_STR_Roof_Property_RefID; roofList.Add(item); } returnValue.Result.Roof_Property = roofList.ToArray(); ORM_RES_STR_Staircase_Property_AvailableAction.Query staircaseQuery = new ORM_RES_STR_Staircase_Property_AvailableAction.Query(); staircaseQuery.Tenant_RefID = securityTicket.TenantID; staircaseQuery.IsDeleted = false; staircaseQuery.RES_ACT_Action_RefID = action.RES_ACT_ActionID; List <ORM_RES_STR_Staircase_Property_AvailableAction> staircases = ORM_RES_STR_Staircase_Property_AvailableAction.Query.Search(Connection, Transaction, staircaseQuery); List <L5AT_GAFA_1001_Staircase_Property> staircaseList = new List <L5AT_GAFA_1001_Staircase_Property>(); foreach (var buildingPart in staircases) { L5AT_GAFA_1001_Staircase_Property item = new L5AT_GAFA_1001_Staircase_Property(); item.RES_STR_Staircase_Property_AvailableActionsID = action.RES_ACT_ActionID; item.RES_STR_Staircase_Property_RefID = buildingPart.RES_STR_Staircase_Property_RefID; staircaseList.Add(item); } returnValue.Result.Staircase_Property = staircaseList.ToArray(); return(returnValue); #endregion UserCode }