USP_DATAFORMTEMPLATE_EDITLOAD_BENEFIT
The load procedure used by the edit dataform template "Benefit 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. |
@NAME | nvarchar(100) | INOUT | Name |
@DESCRIPTION | nvarchar(255) | INOUT | Description |
@BENEFITCATEGORYCODEID | uniqueidentifier | INOUT | Category |
@VALUE | money | INOUT | Value |
@SENDBENEFITCODE | tinyint | INOUT | Send benefit when pledge is |
@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. |
@USEPERCENT | bit | INOUT | Use percent |
@VALUEPERCENT | numeric(20, 2) | INOUT | Percent |
@SITES | xml | INOUT | Sites |
@SITEREQUIRED | bit | INOUT | Site required |
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@BASECURRENCYID | uniqueidentifier | INOUT | Base currency ID |
@BENEFITVENDORID | uniqueidentifier | INOUT | |
@FULFILLMENTVENDORID | uniqueidentifier | INOUT | |
@BENEFITDESC | nvarchar(100) | INOUT | |
@COST | money | INOUT |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_BENEFIT
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@NAME nvarchar(100) = null output,
@DESCRIPTION nvarchar(255) = null output,
@BENEFITCATEGORYCODEID uniqueidentifier = null output,
@VALUE money = null output,
@SENDBENEFITCODE tinyint = null output,
@TSLONG bigint = 0 output,
@USEPERCENT bit = null output,
@VALUEPERCENT numeric(20, 2) = null output,
@SITES xml = null output,
@SITEREQUIRED bit = null output,
@CURRENTAPPUSERID uniqueidentifier = null,
@BASECURRENCYID uniqueidentifier = null output,
@BENEFITVENDORID uniqueidentifier = null output,
@FULFILLMENTVENDORID uniqueidentifier = null output,
@BENEFITDESC nvarchar(100) = null output,
@COST money = null output
)
as
begin
set nocount on;
set @DATALOADED = 0;
set @TSLONG = 0;
set @SITEREQUIRED = dbo.UFN_SITEREQUIREDFORUSER(@CURRENTAPPUSERID);
select
@DATALOADED = 1,
@NAME = NAME,
@DESCRIPTION = DESCRIPTION,
@BENEFITCATEGORYCODEID = BENEFITCATEGORYCODEID,
@VALUE = VALUE,
@SENDBENEFITCODE = SENDBENEFITCODE,
@TSLONG=TSLONG,
@USEPERCENT = USEPERCENT,
@VALUEPERCENT = VALUEPERCENT,
@SITES = dbo.UFN_BENEFITSITE_GETSITES_TOITEMLISTXML(@ID),
@BASECURRENCYID = coalesce(BASECURRENCYID, dbo.UFN_APPUSER_GETBASECURRENCY(@CURRENTAPPUSERID)),
@BENEFITVENDORID = BENEFITVENDORID,
@FULFILLMENTVENDORID = FULFILLMENTVENDORID,
@BENEFITDESC = BENEFITDESC,
@COST = COST
from
dbo.BENEFIT
where
ID = @ID
return 0
end