USP_DATAFORMTEMPLATE_ADD_EDUCATIONALINSTITUTION

The save procedure used by the add dataform template "Educational Institution Add Form".

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier INOUT The output parameter indicating the ID of the record added.
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the procedure.
@NAME nvarchar(100) IN Name
@ISAFFILIATED bit IN This institution is affiliated with our organization

Definition

Copy


                    CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_EDUCATIONALINSTITUTION
                    (
                        @ID uniqueidentifier = null output,
                        @CHANGEAGENTID uniqueidentifier = null,    
                        @NAME nvarchar(100),
                        @ISAFFILIATED bit = 0
                    )
                    as
                        set nocount on;

                        declare @CURRENTDATE datetime;
                        declare @COUNTRYID uniqueidentifier;

                        begin try
                            if @ID is null
                                set @ID = newid();

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

                            set @CURRENTDATE = getdate();
                            set @COUNTRYID=dbo.UFN_COUNTRY_GETDEFAULT();

              exec dbo.USP_DATAFORMTEMPLATE_ADD_EDUCATIONALINSTITUTION_2 @ID, @CHANGEAGENTID, '', @NAME, @ISAFFILIATED, @COUNTRYID, '', null;

                        end try
                        begin catch
                            exec dbo.USP_RAISE_ERROR;
                            return 1;
                        end catch

                        return 0;