spNetAccountRelation_BlockUser
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@NetAccountID | int | IN | |
@BlockedNetAccountID | int | IN |
Definition
Copy
CREATE PROCEDURE [dbo].[spNetAccountRelation_BlockUser]
(
@NetAccountID int,
@BlockedNetAccountID int
)
AS
BEGIN
DECLARE @id int
SELECT @id = ID FROM [NetAccountRelation]
WHERE
(NetAccountID = @NetAccountID AND RelationAccountID = @BlockedNetAccountID)
OR
(NetAccountID = @BlockedNetAccountID AND RelationAccountID = @NetAccountID)
if @id > 0
begin
UPDATE [NetAccountRelation] SET BlockedID = @NetAccountID WHERE ID = @id AND ISNULL(BlockedID,0)= 0
end
else
begin
EXEC dbo.[spAddUpdate_NetAccountRelation] 0, @NetAccountID, @BlockedNetAccountID, 0, @NetAccountID
end
END