spAddUpdate_ShoppingCartPart

Parameters

Parameter Parameter Type Mode Description
@PKID int INOUT
@SiteContentID int IN
@AllowCreditCard bit IN
@AllowDirectDebit bit IN
@AllowPledge bit IN
@MerchantAccountID int IN
@Active bit IN
@ExpirationDays int IN
@ShowPaymentFormImmediately bit IN
@EmailTemplateID int IN

Definition

Copy


            CREATE procedure dbo.spAddUpdate_ShoppingCartPart (
                @PKID                int output,
                @SiteContentID        int,
                @AllowCreditCard    bit,
                @AllowDirectDebit    bit,
                @AllowPledge        bit,
                @MerchantAccountID    int,
                @Active                bit,
                @ExpirationDays        int,
                @ShowPaymentFormImmediately bit,
                @EmailTemplateID    int
            ) as
                begin transaction
                    if (@PKID<=0) begin
                        insert into ShoppingCartPart
                        (
                            SiteContentID,
                            AllowCreditCard,
                            AllowDirectDebit,
                            AllowPledge,
                            MerchantAccountID,
                            Active,
                            ExpirationDays,
                            ShowPaymentFormImmediately,
                            EmailTemplateID
                        )
                        values
                        (
                            @SiteContentID,
                            @AllowCreditCard,
                            @AllowDirectDebit,
                            @AllowPledge,
                            @MerchantAccountID,
                            @Active,
                            @ExpirationDays,
                            @ShowPaymentFormImmediately,
                            @EmailTemplateID
                        );
                        select @PKID = @@Identity;
                    end else begin
                        update [dbo].ShoppingCartPart set
                            SiteContentID = @SiteContentID,
                            AllowCreditCard = @AllowCreditCard,
                            AllowDirectDebit = @AllowDirectDebit,
                            AllowPledge = @AllowPledge,
                            MerchantAccountID = @MerchantAccountID,
                            Active = @Active,
                            ExpirationDays = @ExpirationDays,
                            ShowPaymentFormImmediately = @ShowPaymentFormImmediately,
                            EmailTemplateID = @EmailTemplateID
                        where 
                            ID = @PKID;
                    end
                commit transaction;