USP_DATAFORMTEMPLATE_VIEW_COMMUNITYMEMBERPAGEDATA
The load procedure used by the view dataform template "Community Member Page Expression View Form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter used to load the fields defined on the form. |
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@DATALOADED | bit | INOUT | Output parameter indicating whether or not data was actually loaded. |
@NAME | nvarchar(400) | INOUT | NAME |
@ISINACTIVE | bit | INOUT | ISINACTIVE |
@DECEASED | bit | INOUT | DECEASED |
@ISSELF | bit | INOUT | ISSELF |
@ISORG | bit | INOUT | ISORG |
@ISPROSPECT | bit | INOUT | ISPROSPECT |
@ISFUNDRAISER | bit | INOUT | ISFUNDRAISER |
@ISFORMERFUNDRAISER | bit | INOUT | ISFORMERFUNDRAISER |
@ISVOLUNTEER | bit | INOUT | ISVOLUNTEER |
@ISFORMERVOLUNTEER | bit | INOUT | ISFORMERVOLUNTEER |
@ISCOMMUNITYMEMBER | bit | INOUT | ISCOMMUNITYMEMBER |
@ISREGISTRANT | bit | INOUT | ISREGISTRANT |
@ISVENDOR | bit | INOUT | ISVENDOR |
@APPUSERID | uniqueidentifier | INOUT | APPUSERID |
@NETCOMMUNITYCLIENTUSERID | uniqueidentifier | INOUT | NETCOMMUNITYCLIENTUSERID |
@NETCOMMUNITYEMAILINFOEXISTS | bit | INOUT | NETCOMMUNITYEMAILINFOEXISTS |
@ISFORMERPROSPECT | bit | INOUT | ISFORMERPROSPECT |
@HASCOMMUNITYDATA | bit | INOUT | HASCOMMUNITYDATA |
@ISGROUPMEMBER | bit | INOUT | ISGROUPMEMBER |
@ISGROUP | bit | INOUT | ISGROUP |
@ISHOUSEHOLD | bit | INOUT | ISHOUSEHOLD |
@HASSTEWARDSHIPPLAN | bit | INOUT | HASSTEWARDSHIPPLAN |
@ISBANK | bit | INOUT | ISBANK |
@ISGRANTOR | bit | INOUT | ISGRANTOR |
@ISCOMMITTEEMEMBER | bit | INOUT | ISCOMMITTEEMEMBER |
@ISSPONSOR | bit | INOUT | ISSPONSOR |
@SPONSORTYPECODE | tinyint | INOUT | SPONSORTYPECODE |
@ISPLANNEDGIVER | bit | INOUT | ISPLANNEDGIVER |
@ISALUMNUS | bit | INOUT | ISALUMNUS |
@ISSTUDENT | bit | INOUT | ISSTUDENT |
@ISFORMERSTUDENT | bit | INOUT | ISFORMERSTUDENT |
@ISFACULTY | bit | INOUT | ISFACULTY |
@ISFORMERSPONSOR | bit | INOUT | ISFORMERSPONSOR |
@HASRECEIVEDFUNDS | bit | INOUT | HASRECEIVEDFUNDS |
@USER_GRANTED_CONSTITPERSONALINFO_EDIT | bit | INOUT |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_COMMUNITYMEMBERPAGEDATA
(
@ID uniqueidentifier,
@CURRENTAPPUSERID uniqueidentifier,
@DATALOADED bit = 0 output,
@NAME nvarchar(400) = null output,
@ISINACTIVE bit = null output,
@DECEASED bit = null output,
@ISSELF bit = null output,
@ISORG bit = null output,
@ISPROSPECT bit = null output,
@ISFUNDRAISER bit = null output,
@ISFORMERFUNDRAISER bit = null output,
@ISVOLUNTEER bit = null output,
@ISFORMERVOLUNTEER bit = null output,
@ISCOMMUNITYMEMBER bit = null output,
@ISREGISTRANT bit = null output,
@ISVENDOR bit = null output,
@APPUSERID uniqueidentifier = null output,
@NETCOMMUNITYCLIENTUSERID uniqueidentifier = null output,
@NETCOMMUNITYEMAILINFOEXISTS bit = null output,
@ISFORMERPROSPECT bit = null output,
@HASCOMMUNITYDATA bit = null output,
@ISGROUPMEMBER bit = null output,
@ISGROUP bit = null output,
@ISHOUSEHOLD bit = null output,
@HASSTEWARDSHIPPLAN bit = null output,
@ISBANK bit = null output,
@ISGRANTOR bit = null output,
@ISCOMMITTEEMEMBER bit = null output,
@ISSPONSOR bit = null output,
@SPONSORTYPECODE tinyint = null output,
@ISPLANNEDGIVER bit = null output,
@ISALUMNUS bit = null output,
@ISSTUDENT bit = null output,
@ISFORMERSTUDENT bit = null output,
@ISFACULTY bit = null output,
@ISFORMERSPONSOR bit = null output,
@HASRECEIVEDFUNDS bit = null output,
@USER_GRANTED_CONSTITPERSONALINFO_EDIT bit = null output
)
as
set nocount on;
set @DATALOADED = 0;
declare @APPUSERCONSTITUENTID uniqueidentifier;
select @APPUSERCONSTITUENTID=CONSTITUENTID from dbo.APPUSER where ID=@CURRENTAPPUSERID;
select @APPUSERID = ID from dbo.APPUSER where CONSTITUENTID = @ID;
select
@ISINACTIVE = C.ISINACTIVE,
@DECEASED = case when DECEASEDCONSTITUENT.ID is null then 0 else 1 end,
@NAME = C.NAME,
@ISSELF = case when C.ID=@APPUSERCONSTITUENTID then 1 else 0 end,
@ISORG=C.ISORGANIZATION,
@ISPROSPECT = dbo.UFN_CONSTITUENT_ISPROSPECT(@ID),
@ISFORMERPROSPECT = dbo.UFN_CONSTITUENT_ISFORMERPROSPECT(@ID),
@ISFUNDRAISER = dbo.UFN_CONSTITUENT_ISFUNDRAISER(@ID),
@ISFORMERFUNDRAISER = dbo.UFN_CONSTITUENT_ISFORMERFUNDRAISER(@ID),
@ISVOLUNTEER = dbo.UFN_CONSTITUENT_ISVOLUNTEER(@ID),
@ISFORMERVOLUNTEER = dbo.UFN_CONSTITUENT_ISFORMERVOLUNTEER(@ID),
@ISCOMMUNITYMEMBER = C.NETCOMMUNITYMEMBER,
@ISREGISTRANT = dbo.UFN_CONSTITUENT_ISREGISTRANT(@ID),
@ISVENDOR = dbo.UFN_CONSTITUENT_ISVENDOR(@ID),
@HASCOMMUNITYDATA = dbo.UFN_CONSTITUENT_HASCOMMUNITYDATA(@ID),
@ISGROUPMEMBER = dbo.UFN_CONSTITUENT_HASGROUPMEMBERRECORD(@ID),
@ISGROUP = C.ISGROUP,
@ISHOUSEHOLD = dbo.UFN_CONSTITUENT_ISHOUSEHOLD(@ID),
@HASSTEWARDSHIPPLAN = dbo.UFN_CONSTITUENT_HASSTEWARDSHIPPLAN(@ID),
@ISBANK = dbo.UFN_CONSTITUENT_ISBANK(@ID),
@ISGRANTOR = dbo.UFN_CONSTITUENT_ISGRANTOR(@ID),
@ISCOMMITTEEMEMBER = dbo.UFN_CONSTITUENT_ISCOMMITTEEMEMBER(@ID),
@ISPLANNEDGIVER = dbo.UFN_CONSTITUENT_ISPLANNEDGIVER(@ID),
@ISALUMNUS = dbo.UFN_CONSTITUENT_ISALUMNUS(@ID),
@ISSTUDENT = dbo.UFN_CONSTITUENT_ISSTUDENT(@ID),
@ISFORMERSTUDENT = dbo.UFN_CONSTITUENT_ISFORMERSTUDENT(@ID),
@ISFACULTY = dbo.UFN_CONSTITUENT_ISFACULTY(@ID)
from
dbo.CONSTITUENT AS C
left outer join dbo.DECEASEDCONSTITUENT on DECEASEDCONSTITUENT.ID = C.ID
where
C.ID = @ID;
exec dbo.USP_SPONSOR_GETINFORMATION
@ID,
@ISSPONSOR output,
@ISFORMERSPONSOR output,
@SPONSORTYPECODE output
if (@ISCOMMUNITYMEMBER = 1 or @HASCOMMUNITYDATA = 1)
begin
set @DATALOADED = 1;
set @NETCOMMUNITYCLIENTUSERID = '00000000-0000-0000-0000-000000000000'; -- Default to empty GUID so all page sections will load.
end
select top (1)
@NETCOMMUNITYCLIENTUSERID = [NETCOMMUNITYCLIENTUSER].[ID],
@NETCOMMUNITYEMAILINFOEXISTS =
case
when [NETCOMMUNITYEMAILINFO].[ID] is null then 0
else 1
end
from
dbo.NETCOMMUNITYCLIENTUSER
left join dbo.NETCOMMUNITYEMAILINFO on [NETCOMMUNITYCLIENTUSER].[ID] = [NETCOMMUNITYEMAILINFO].[NETCOMMUNITYCLIENTUSERID]
where
[NETCOMMUNITYCLIENTUSER].[CONSTITUENTID] = @ID
and [NETCOMMUNITYCLIENTUSER].[ACTIVE] = 1
and [NETCOMMUNITYCLIENTUSER].[DELETED] = 0
order by
[NETCOMMUNITYCLIENTUSER].[USERUPDATEDATE] desc;
set @HASRECEIVEDFUNDS = dbo.UFN_CONSTITUENT_HASRECEIVEDFUNDS(@ID)
if dbo.UFN_APPUSER_ISSYSADMIN(@CURRENTAPPUSERID) = 1
begin
set @USER_GRANTED_CONSTITPERSONALINFO_EDIT = 1;
end
else
begin
set @USER_GRANTED_CONSTITPERSONALINFO_EDIT =
case
when @ISORG = 1 then dbo.UFN_SECURITY_APPUSER_GRANTED_FORM_IN_SYSTEMROLE(@CURRENTAPPUSERID,'a9954902-ea62-48ae-8e6f-4e2ed3c3f4f9')
when @ISHOUSEHOLD = 1 then dbo.UFN_SECURITY_APPUSER_GRANTED_FORM_IN_SYSTEMROLE(@CURRENTAPPUSERID,'2f419cfd-9e70-406c-8277-ba2c4b7bdfba')
when @ISGROUP = 1 then dbo.UFN_SECURITY_APPUSER_GRANTED_FORM_IN_SYSTEMROLE(@CURRENTAPPUSERID,'292ee330-a63c-4cc5-98c2-a1168a1b7150')
else dbo.UFN_SECURITY_APPUSER_GRANTED_FORM_IN_SYSTEMROLE(@CURRENTAPPUSERID,'788AB947-26ED-40C4-865E-8FE29577E593')
end;
end
return 0;