USP_DATAFORMTEMPLATE_EDITLOAD_APPLICATIONUSERCMSEDIT
The load procedure used by the edit dataform template "Application User CMS 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. |
@CONSTITUENTID | uniqueidentifier | INOUT | Constituent ID |
@USERNAME | nvarchar(128) | INOUT | Application user |
@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. |
@SITEID | uniqueidentifier | INOUT | Site |
@CURRENCYSETID | uniqueidentifier | INOUT | Currency set |
@CMSUSERNAME | uniqueidentifier | INOUT | Link to an existing CMS user |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_APPLICATIONUSERCMSEDIT
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@CONSTITUENTID uniqueidentifier = null output,
@USERNAME nvarchar(128) = null output,
@TSLONG bigint = 0 output,
@SITEID uniqueidentifier = null output,
@CURRENCYSETID uniqueidentifier = null output,
@CMSUSERNAME uniqueidentifier = null output
)
as
set nocount on;
set @DATALOADED = 0;
set @TSLONG = 0;
select
@DATALOADED = 1,
@CONSTITUENTID = APPUSER.CONSTITUENTID,
@USERNAME = case when len(APPUSER.CUSTOM_AUTHENTICATION_USERID) = 0 then APPUSER.USERNAME else APPUSER.CUSTOM_AUTHENTICATION_USERID end,
@TSLONG = APPUSER.TSLONG,
@SITEID = APPUSER.SITEID,
@CMSUSERNAME = CLIENTUSERS.GUID
from
dbo.APPUSER
left outer join dbo.CONSTITUENT on APPUSER.CONSTITUENTID = CONSTITUENT.ID
left outer join dbo.BBNCUSERMAP on BBNCUSERMAP.ID = APPUSER.ID
left outer join dbo.CLIENTUSERS on BBNCUSERNAME = CLIENTUSERS.USERNAME
where
APPUSER.ID = @ID;
if @DATALOADED = 1
select
@CURRENCYSETID = APPUSERCURRENCYSET.CURRENCYSETID
from
dbo.APPUSERCURRENCYSET
where
APPUSERCURRENCYSET.APPUSERID = @ID;
return 0;