USP_DATAFORMTEMPLATE_EDITLOAD_SPONSORSHIPOPPORTUNITYGROUP
The load procedure used by the edit dataform template "Sponsorship Opportunity Group Edit Form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter used to load the fields defined on the form. |
@DATALOADED | bit | INOUT | Output parameter indicating whether or not data was actually loaded. |
@TSLONG | bigint | INOUT | Output parameter indicating the TSLONG value of the record being edited. This is used to manage multi-user concurrency issues when multiple users access the same record. |
@NAME | nvarchar(100) | INOUT | Name |
@SPONSORSHIPOPPORTUNITYTYPECODE | int | INOUT | Type |
@SPONSORSPEROPPORTUNITY | int | INOUT | Maximum |
@OFFERSOLESPONSORSHIP | bit | INOUT | Offer sole sponsorship |
@OVERRIDESPONSORSPEROPPORTUNITY | xml | INOUT | |
@SPONSORSHIPLOCATIONID | uniqueidentifier | INOUT | Location |
@GENDERCODE | tinyint | INOUT | Gender |
@SPONSORSHIPOPPORTUNITYAGERANGEID | uniqueidentifier | INOUT | Age range |
@HASCONDITIONCODE | tinyint | INOUT | Disability/Illness |
@ISHIVPOSITIVECODE | tinyint | INOUT | HIV positive |
@ISORPHANEDCODE | tinyint | INOUT | Orphaned |
@SPROPPPROJECTCATEGORYCODE | uniqueidentifier | INOUT | Category |
@SPONSORSHIPOPPORTUNITIESFORGROUP | int | INOUT | Sponsorship opportunities for group |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_SPONSORSHIPOPPORTUNITYGROUP(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@TSLONG bigint = 0 output,
@NAME nvarchar(100) = null output,
@SPONSORSHIPOPPORTUNITYTYPECODE int=null output,
@SPONSORSPEROPPORTUNITY int = null output,
@OFFERSOLESPONSORSHIP bit = null output,
@OVERRIDESPONSORSPEROPPORTUNITY xml = null output,
@SPONSORSHIPLOCATIONID uniqueidentifier = null output,
@GENDERCODE tinyint=null output,
@SPONSORSHIPOPPORTUNITYAGERANGEID uniqueidentifier = null output,
@HASCONDITIONCODE tinyint=null output,
@ISHIVPOSITIVECODE tinyint=null output,
@ISORPHANEDCODE tinyint=null output,
@SPROPPPROJECTCATEGORYCODE uniqueidentifier = null output,
@SPONSORSHIPOPPORTUNITIESFORGROUP int = null output
)
as
set nocount on;
set @DATALOADED = 0
set @TSLONG = 0
select
@DATALOADED = 1,
@TSLONG = TSLONG,
@NAME = NAME,
@SPONSORSHIPOPPORTUNITYTYPECODE = SPONSORSHIPOPPORTUNITYTYPECODE,
@SPONSORSPEROPPORTUNITY = case SPONSORSPEROPPORTUNITY when 0 then null else SPONSORSPEROPPORTUNITY end,
@OFFERSOLESPONSORSHIP = OFFERSOLESPONSORSHIP,
@OVERRIDESPONSORSPEROPPORTUNITY = OVERRIDESPONSORSPEROPPORTUNITY,
@SPONSORSHIPLOCATIONID = SPONSORSHIPLOCATIONID,
@GENDERCODE = GENDERCODE,
@SPONSORSHIPOPPORTUNITYAGERANGEID = SPONSORSHIPOPPORTUNITYAGERANGEID,
@HASCONDITIONCODE = HASCONDITIONCODE,
@ISHIVPOSITIVECODE = ISHIVPOSITIVECODE,
@ISORPHANEDCODE = ISORPHANEDCODE,
@SPROPPPROJECTCATEGORYCODE = SPROPPPROJECTCATEGORYCODEID
from dbo.SPONSORSHIPOPPORTUNITYGROUP
where ID = @ID
select
@SPONSORSHIPOPPORTUNITIESFORGROUP = count(SPONSORSHIPOPPORTUNITY.ID)
from dbo.SPONSORSHIPOPPORTUNITY
inner join SPONSORSHIPOPPORTUNITYGROUP on SPONSORSHIPOPPORTUNITYGROUP.ID = SPONSORSHIPOPPORTUNITY.SPONSORSHIPOPPORTUNITYGROUPID
where SPONSORSHIPOPPORTUNITYGROUP.ID = @ID
return 0;