USP_DATAFORMTEMPLATE_EDIT_CURRENCYEXCHANGERATEBATCHROW

The save procedure used by the edit dataform template "Currency Exchange Rate Batch Row Edit Form".

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN The input ID parameter indicating the ID of the record being edited.
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the procedure.
@FROMCURRENCYID uniqueidentifier IN From currency
@TOCURRENCYID uniqueidentifier IN To currency
@RATE decimal(20, 8) IN Rate
@ASOFDATE datetime IN As of date
@ASOFTIME time IN As of time
@TYPECODE tinyint IN Type
@SOURCECODEID uniqueidentifier IN Source
@SEQUENCE int IN Sequence
@TIMEZONEENTRYID uniqueidentifier IN Time zone

Definition

Copy


                    CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_CURRENCYEXCHANGERATEBATCHROW 
                    (
                        @ID uniqueidentifier,
                        @CHANGEAGENTID uniqueidentifier = null,
                        @FROMCURRENCYID uniqueidentifier,
                        @TOCURRENCYID uniqueidentifier,
                        @RATE decimal(20,8),
                        @ASOFDATE datetime,
                        @ASOFTIME time(0),
                        @TYPECODE tinyint,
                        @SOURCECODEID uniqueidentifier,
                        @SEQUENCE int,
                        @TIMEZONEENTRYID uniqueidentifier
                    )
                    as

                        set nocount on;

                        if @CHANGEAGENTID is null  
                            exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;

                        declare @CURRENTDATE datetime;
                        set @CURRENTDATE = getdate();

                        begin try
                            update dbo.BATCHCURRENCYEXCHANGERATE 
                            set
                                FROMCURRENCYID = @FROMCURRENCYID,
                                TOCURRENCYID = @TOCURRENCYID,
                                RATE = @RATE,
                                ASOFDATE = @ASOFDATE,
                                ASOFTIME = @ASOFTIME,
                                TYPECODE = @TYPECODE,
                                SOURCECODEID = @SOURCECODEID,
                                SEQUENCE = @SEQUENCE,
                                TIMEZONEENTRYID = @TIMEZONEENTRYID,
                                CHANGEDBYID = @CHANGEAGENTID,
                                DATECHANGED = @CURRENTDATE
                            where 
                                ID = @ID;
                        end try
                        begin catch
                            exec dbo.USP_RAISE_ERROR;
                            return 1;
                        end catch

                    return 0;