USP_DATAFORMTEMPLATE_EDITLOAD_SPONSORSHIPOPPORTUNITYCHILD
The load procedure used by the edit dataform template "Sponsorship Opportunity Child 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. |
@SPONSORSHIPOPPORTUNITYGROUPID | uniqueidentifier | INOUT | Child group |
@SPONSORSHIPLOCATIONID | uniqueidentifier | INOUT | Location |
@FIRSTNAME | nvarchar(50) | INOUT | First name |
@MIDDLENAME | nvarchar(50) | INOUT | Middle name |
@LASTNAME | nvarchar(100) | INOUT | Last name |
@GENDERCODE | int | INOUT | Gender |
@BIRTHDATE | UDT_FUZZYDATE | INOUT | Birth date |
@PICTURE | varbinary | INOUT | Image |
@PICTURETHUMBNAIL | varbinary | INOUT | Image thumbnail |
@PICTURECHANGED | bit | INOUT | Picture changed |
@ISHIVPOSITIVE | bit | INOUT | HIV positive |
@ISORPHANED | bit | INOUT | Orphaned |
@SPROPPCHILDCONDITIONCODEID | uniqueidentifier | INOUT | Disability/Illness |
@ISSPONSORED | bit | INOUT | |
@VALIDATEBIRTHDATE | bit | INOUT |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_SPONSORSHIPOPPORTUNITYCHILD
(
@ID uniqueidentifier ,
@DATALOADED bit = 0 output,
@TSLONG bigint = 0 output,
@SPONSORSHIPOPPORTUNITYGROUPID uniqueidentifier = null output,
@SPONSORSHIPLOCATIONID uniqueidentifier = null output,
@FIRSTNAME nvarchar(50) = null output,
@MIDDLENAME nvarchar(50) = null output,
@LASTNAME nvarchar(100)=null output,
@GENDERCODE int = null output,
@BIRTHDATE dbo.UDT_FUZZYDATE = null output,
--@TERMINATIONREASON nvarchar(100) = null output,
@PICTURE varbinary(max)=null output,
@PICTURETHUMBNAIL varbinary(max)= null output,
@PICTURECHANGED bit=null output,
@ISHIVPOSITIVE bit=null output,
@ISORPHANED bit=null output,
@SPROPPCHILDCONDITIONCODEID uniqueidentifier=null output,
@ISSPONSORED bit=null output,
@VALIDATEBIRTHDATE bit = null output
)
as
set nocount on;
set @DATALOADED = 0;
set @TSLONG = 0;
begin try
select
@DATALOADED = 1,
@TSLONG = SC.TSLONG,
@SPONSORSHIPOPPORTUNITYGROUPID = SP.SPONSORSHIPOPPORTUNITYGROUPID,
@SPONSORSHIPLOCATIONID = SP.SPONSORSHIPLOCATIONID,
@FIRSTNAME = C.FIRSTNAME,
@MIDDLENAME = C.MIDDLENAME,
@LASTNAME = C.KEYNAME,
@GENDERCODE = C.GENDERCODE,
@BIRTHDATE = C.BIRTHDATE,
@PICTURE = C.PICTURE,
@PICTURETHUMBNAIL = C.PICTURETHUMBNAIL,
@ISHIVPOSITIVE = SC.ISHIVPOSITIVE,
@ISORPHANED = SC.ISORPHANED,
@SPROPPCHILDCONDITIONCODEID = SC.SPROPPCHILDCONDITIONCODEID,
@ISSPONSORED = case SL.SPONSORCOUNT when 0 then 0 else 1 end
from
dbo.SPONSORSHIPOPPORTUNITYCHILD SC
inner join dbo.SPONSORSHIPOPPORTUNITY SP ON SC.ID=SP.ID
inner join dbo.CONSTITUENT C on C.ID = SC.CONSTITUENTID
inner join dbo.SPONSORSHIPOPPORTUNITYLOCK SL on SL.ID = SP.ID
where SC.ID = @ID;
set @VALIDATEBIRTHDATE = 0
end try
begin catch
exec dbo.USP_RAISE_ERROR
return 1
end catch
return 0;