DECLARE @cid int
DECLARE @pid int

IF '{Language}' = 'en-US'
BEGIN
	INSERT INTO [DL_CATEGORIES]
	([Title], [Description])
	VALUES
	(N'IBN Real Time Desktop Client Software', N'Includes secure Instant Messaging, Conferencing, file exchange and other tools to help business communication. Automatically connects to IBN web portal and enables real-time notifications and alerts.');

	SET @cid = @@identity

	INSERT INTO [DL_CATEGORIES]
	([Title], [Description])
	VALUES
	(N'IBN MS Office and Wizard Toolbox', N'Enables MS Office, Desktop and Explorer integration for windows users including MS Word, MS Excell, MS PowerPoint, and MS Project. Easy to use wizards and one click toolbar buttons help facilitate group information sharing.');

	INSERT INTO [DL_CATEGORIES]
	([Title], [Description])
	VALUES
	(N'Other', N'');
END
ELSE
BEGIN
	INSERT INTO [DL_CATEGORIES]
	([Title], [Description])
	VALUES
	(N'Средства передачи информации в режиме реального времени', N'Включает системы безопасного обмена сообщениями, передачи файлов, организации конференций и некоторые дополнительные возможности, способствующие повышению эффективности коммуникаций. Автоматически подключается к IBN Порталу и используется системой уведомления для передачи сообщений.');

	SET @cid = @@identity

	INSERT INTO [DL_CATEGORIES]
	([Title], [Description])
	VALUES
	(N'Система интеграции с MS Office и Мастер инструментов', N'Позволяет интегрировать IBN с основными приложениями MS Office: MS Word, MS Excel, MS Power-Point и MS Project. Система удобных и простых в использовании мастеров сделает доступ к информации предельно быстрым и простым.');

	INSERT INTO [DL_CATEGORIES]
	([Title], [Description])
	VALUES
	(N'Дополнительно', N'');
END


INSERT INTO [DL_PRODUCTS]
([ProductGuid], [Title], [Description], [Locale], [Os], [FileName], [AutoInstall])
VALUES
('d2f6788c-4de2-48c0-bcc2-1421d8b98ba4', N'Screen Capture', N'', 'en-US', 'Windows', 'McScreenCapture_Win32_en-US.exe', 1);

SET @pid = @@identity

INSERT INTO [DL_PRODUCTS]
([ProductGuid], [Title], [Description], [Locale], [Os], [FileName], [AutoInstall])
VALUES
('d2f6788c-4de2-48c0-bcc2-1421d8b98ba4', N'Screen Capture with WM Encoder', N'', 'en-US', 'Windows', 'McScreenCaptureWithWMEnc_Win32_en-US.exe', 0);

INSERT INTO [DL_PRODUCTS]
([ProductGuid], [Title], [Description], [Locale], [Os], [FileName], [AutoInstall])
VALUES
('d919d9b2-b657-49bd-9f9f-d66c35ab3e5a', N'IBN 4.1 ToolBox', N'', 'en-US', 'Windows', 'Ibn41Toolbox_Win32_EN.exe', 1);

INSERT INTO [DL_PRODUCTS]
([ProductGuid], [Title], [Description], [Locale], [Os], [FileName], [AutoInstall])
VALUES
('dbb495f4-18fa-4572-9566-8a8d9617960f', N'IBN 4.1 Мастер инструментов', N'', 'ru-RU', 'Windows', 'Ibn41Toolbox_Win32_RU.exe', 1);

INSERT INTO [DL_PRODUCTS]
([ProductGuid], [Title], [Description], [Locale], [Os], [FileName], [AutoInstall])
VALUES
('edcacf9c-2dbe-4660-ba74-579bc3e24fba', N'IBN 4.1 Client', N'', 'en-US', 'Windows', 'Ibn41Client_Win32_EN.exe', 1);

IF '{Edition}' = 'INT'
BEGIN
	INSERT INTO [DL_PRODUCTS]
	([ProductGuid], [Title], [Description], [Locale], [Os], [FileName], [AutoInstall])
	VALUES
	('d9322b21-a268-4e38-b3c8-f991e20fdc62', N'IBN 4.1 Клиент', N'', 'ru-RU', 'Windows', 'Ibn41Client_Win32_RU.exe', 1);
END
ELSE
BEGIN
	INSERT INTO [DL_PRODUCTS]
	([ProductGuid], [Title], [Description], [Locale], [Os], [FileName], [AutoInstall])
	VALUES
	('d9322b21-a268-4e38-b3c8-f991e20fdc62', N'IBN 4.1 Клиент', N'', 'ru-RU', 'Windows', 'Ibn41Client_Win32_RU_RE.exe', 1);
END

INSERT INTO [DL_PRODUCTS]
([ProductGuid], [Title], [Description], [Locale], [Os], [FileName], [AutoInstall])
VALUES
('ea2a1cc7-98b9-4aeb-a27c-7d54b702b4ef', N'IBN 4.0 Client (Update to 4.1)', N'', 'en-US', 'Windows', 'Ibn41Client_Win32_EN.exe', 1);

INSERT INTO [DL_PRODUCTS]
([ProductGuid], [Title], [Description], [Locale], [Os], [FileName], [AutoInstall])
VALUES
('717677e0-e5c0-4a50-9735-e011e2821ccf', N'IBN 4.0 Клиент (Обновление до 4.1)', N'', 'ru-RU', 'Windows', 'Ibn41Client_Win32_RU.exe', 1);


INSERT INTO [DL_PRODUCT_CATEGORIES] ([ProductId], [CategoryId]) VALUES (@pid, @cid+2);
INSERT INTO [DL_PRODUCT_CATEGORIES] ([ProductId], [CategoryId]) VALUES (@pid+1, @cid+2);
INSERT INTO [DL_PRODUCT_CATEGORIES] ([ProductId], [CategoryId]) VALUES (@pid+3, @cid+1);
INSERT INTO [DL_PRODUCT_CATEGORIES] ([ProductId], [CategoryId]) VALUES (@pid+5, @cid);

IF '{Edition}' = 'INT'
BEGIN
	INSERT INTO [DL_PRODUCT_CATEGORIES] ([ProductId], [CategoryId]) VALUES (@pid+2, @cid+1);
	INSERT INTO [DL_PRODUCT_CATEGORIES] ([ProductId], [CategoryId]) VALUES (@pid+4, @cid);
END


INSERT INTO [DL_VERSIONS]
([ProductId], [Build], [Date])
VALUES
(@pid, 16, CONVERT(smalldatetime, '2005-06-21', 120));

INSERT INTO [DL_VERSIONS]
([ProductId], [Build], [Date])
VALUES
(@pid+1, 16, CONVERT(smalldatetime, '2005-06-21', 120));

INSERT INTO [DL_VERSIONS]
([ProductId], [Build], [Date])
VALUES
(@pid+2, 209, CONVERT(smalldatetime, '2006-09-20', 120));

INSERT INTO [DL_VERSIONS]
([ProductId], [Build], [Date])
VALUES
(@pid+3, 209, CONVERT(smalldatetime, '2006-09-20', 120));

INSERT INTO [DL_VERSIONS]
([ProductId], [Build], [Date])
VALUES
(@pid+4, 612, CONVERT(smalldatetime, '2006-09-12', 120));

INSERT INTO [DL_VERSIONS]
([ProductId], [Build], [Date])
VALUES
(@pid+5, 612, CONVERT(smalldatetime, '2006-09-12', 120));

INSERT INTO [DL_VERSIONS]
([ProductId], [Build], [Date])
VALUES
(@pid+6, 612, CONVERT(smalldatetime, '2006-09-12', 120));

INSERT INTO [DL_VERSIONS]
([ProductId], [Build], [Date])
VALUES
(@pid+7, 612, CONVERT(smalldatetime, '2006-09-12', 120));
GO
