init
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
DECLARE @UserId INT
|
||||
DECLARE @PropertyId INT
|
||||
DECLARE @PropertyValue [NVARCHAR] (MAX)
|
||||
|
||||
SELECT @UserId = ID FROM Users WHERE UserName = 'TSRAIRUser'
|
||||
IF (@UserId IS NOT NULL)
|
||||
BEGIN
|
||||
SELECT @PropertyId = PropertyId FROM [dbo].[DefaultProperties] WHERE PropertyName = 'DefaultDownloadAll'
|
||||
IF (@PropertyId IS NULL)
|
||||
BEGIN
|
||||
INSERT INTO [dbo].[DefaultProperties] (PropertyName, DefaultValue) VALUES ('DefaultDownloadAll', 'False')
|
||||
SELECT @PropertyId = PropertyId FROM [dbo].[DefaultProperties] WHERE PropertyName = 'DefaultDownloadAll'
|
||||
END
|
||||
IF (@PropertyId IS NOT NULL)
|
||||
BEGIN
|
||||
SELECT @PropertyValue = PropertyValue FROM [dbo].[UserProperties] WHERE UserId = @UserId AND PropertyId = @PropertyId
|
||||
IF (@PropertyValue IS NULL)
|
||||
BEGIN
|
||||
INSERT INTO [dbo].[UserProperties] VALUES (@UserId, @PropertyId, 'True')
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
UPDATE [dbo].[UserProperties] SET PropertyValue = 'True' WHERE UserId = @UserId AND PropertyId = @PropertyId;
|
||||
END
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
DECLARE @UserId INT
|
||||
DECLARE @PropertyId INT
|
||||
DECLARE @PropertyValue [NVARCHAR] (MAX)
|
||||
|
||||
SELECT @UserId = ID FROM Users WHERE UserName = 'TSRAIRUser'
|
||||
IF (@UserId IS NOT NULL)
|
||||
BEGIN
|
||||
SELECT @PropertyId = PropertyId FROM [dbo].[DefaultProperties] WHERE PropertyName = 'DefaultExport'
|
||||
IF (@PropertyId IS NULL)
|
||||
BEGIN
|
||||
INSERT INTO [dbo].[DefaultProperties] (PropertyName, DefaultValue) VALUES ('DefaultExport', 'False')
|
||||
SELECT @PropertyId = PropertyId FROM [dbo].[DefaultProperties] WHERE PropertyName = 'DefaultExport'
|
||||
END
|
||||
IF (@PropertyId IS NOT NULL)
|
||||
BEGIN
|
||||
SELECT @PropertyValue = PropertyValue FROM [dbo].[UserProperties] WHERE UserId = @UserId AND PropertyId = @PropertyId
|
||||
IF (@PropertyValue IS NULL)
|
||||
BEGIN
|
||||
INSERT INTO [dbo].[UserProperties] VALUES (@UserId, @PropertyId, 'True')
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
UPDATE [dbo].[UserProperties] SET PropertyValue = 'True' WHERE UserId = @UserId AND PropertyId = @PropertyId;
|
||||
END
|
||||
END
|
||||
END
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
DECLARE @UserId INT
|
||||
DECLARE @PropertyId INT
|
||||
DECLARE @PropertyValue [NVARCHAR] (MAX)
|
||||
|
||||
SELECT @UserId = ID FROM Users WHERE UserName = 'TSRAIRUser'
|
||||
IF (@UserId IS NOT NULL)
|
||||
BEGIN
|
||||
SELECT @PropertyId = PropertyId FROM [dbo].[DefaultProperties] WHERE PropertyName = 'ExportCSVUnfiltered'
|
||||
IF (@PropertyId IS NULL)
|
||||
BEGIN
|
||||
INSERT INTO [dbo].[DefaultProperties] (PropertyName, DefaultValue) VALUES ('ExportCSVUnfiltered', 'False')
|
||||
SELECT @PropertyId = PropertyId FROM [dbo].[DefaultProperties] WHERE PropertyName = 'ExportCSVUnfiltered'
|
||||
END
|
||||
IF (@PropertyId IS NOT NULL)
|
||||
BEGIN
|
||||
SELECT @PropertyValue = PropertyValue FROM [dbo].[UserProperties] WHERE UserId = @UserId AND PropertyId = @PropertyId
|
||||
IF (@PropertyValue IS NULL)
|
||||
BEGIN
|
||||
INSERT INTO [dbo].[UserProperties] VALUES (@UserId, @PropertyId, 'True')
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
UPDATE [dbo].[UserProperties] SET PropertyValue = 'True' WHERE UserId = @UserId AND PropertyId = @PropertyId;
|
||||
END
|
||||
END
|
||||
END
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
DECLARE @UserId INT
|
||||
DECLARE @PropertyId INT
|
||||
DECLARE @PropertyValue [NVARCHAR] (MAX)
|
||||
|
||||
SELECT @UserId = ID FROM Users WHERE UserName = 'TSRAIRUser'
|
||||
IF (@UserId IS NOT NULL)
|
||||
BEGIN
|
||||
SELECT @PropertyId = PropertyId FROM [dbo].[DefaultProperties] WHERE PropertyName = 'DefaultViewAll'
|
||||
IF (@PropertyId IS NULL)
|
||||
BEGIN
|
||||
INSERT INTO [dbo].[DefaultProperties] (PropertyName, DefaultValue) VALUES ('DefaultViewAll', 'False')
|
||||
SELECT @PropertyId = PropertyId FROM [dbo].[DefaultProperties] WHERE PropertyName = 'DefaultViewAll'
|
||||
END
|
||||
IF (@PropertyId IS NOT NULL)
|
||||
BEGIN
|
||||
SELECT @PropertyValue = PropertyValue FROM [dbo].[UserProperties] WHERE UserId = @UserId AND PropertyId = @PropertyId
|
||||
IF (@PropertyValue IS NULL)
|
||||
BEGIN
|
||||
INSERT INTO [dbo].[UserProperties] VALUES (@UserId, @PropertyId, 'True')
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
UPDATE [dbo].[UserProperties] SET PropertyValue = 'True' WHERE UserId = @UserId AND PropertyId = @PropertyId;
|
||||
END
|
||||
END
|
||||
END
|
||||
Reference in New Issue
Block a user