spAddUpdate_BackofficeSystem

Parameters

Parameter Parameter Type Mode Description
@id int IN
@Name nvarchar(50) IN
@Guid uniqueidentifier IN
@SysOptions ntext IN
@OptionsDisplayControl nvarchar(256) IN
@UserPropertiesControl nvarchar(256) IN

Definition

Copy


CREATE procedure [dbo].[spAddUpdate_BackofficeSystem]
(
        @id             integer,
        @Name             nvarchar(50),
        @Guid             Uniqueidentifier,
        @SysOptions     ntext,
        @OptionsDisplayControl nvarchar(256),
        @UserPropertiesControl nvarchar(256)
    )
    as
    begin
        set nocount on
        begin tran T1

        declare @sql_error        int
        --RE=0
        if (@id < 0)
        begin
            insert into BackOfficeSystems(Name, Guid, SysOptions, DisplayControl, UserPropertiesControl)
            values (@Name, @Guid, @SysOptions, @OptionsDisplayControl, @UserPropertiesControl)

            select @sql_error = @@error
        end
        else
        begin
            update BackOfficeSystems
            set 
            Name = @Name
            Guid = @Guid
            SysOptions = @SysOptions
            DisplayControl = @OptionsDisplayControl
            UserPropertiesControl=@UserPropertiesControl
            where ID = @Id

            select @sql_error = @@error
        end

        if (@sql_error = 0
            commit tran T1
           else
               rollback tran T1

    end