
-- Panshin, 2003.08.19
declare @ufRoot int, @Class varchar(24), @Human Name varchar(128), @Com Root int, @Class UDN int
select @Class = 'First'
select @Human Name = 'Первый класс'
if not exists (select * from Class where Name=@Class)
begin exec Obj Create Class @Class, @Human Name, 'AutoDoc', 0, 0, 0, 0, 0, 0 end
select @Com Root = (select UDN from Roots where Root Name='Seller')
if not exists (select * from Roots where Root Name='First') begin
exec Doc Create Enlisted @Com Root, 'Первый класс', 'Enlisted', @ufRoot output
insert into Roots (UDN, Root Name, Comment) values (@ufRoot, 'First', 'Первый класс')
select @Class UDN = UDN from Docs where No=@Class and Class='Class'
delete from Folder Class where UDN=@Class UDN
insert into Folder Class (UDN,Folder,Class) select @Class UDN,@ufRoot,@Class
end
GO
exec Ins Privilege 'edit_First','Редактирование Первый класс','Первый класс'
exec Ins Privilege 'view_First','Просмотр Первый класс','Первый класс'
exec Ins Privilege 'First_PRE','Шаг назад... Первый класс','Первый класс'
exec Ins Privilege 'First_POST','Шаг вперед... Первый класс','Первый класс'
GO
if exists (select * from sysobjects where xtype='U' and name='TFirst') drop table TFirst
CREATE TABLE TFirst(
UDN int NOT NULL primary key,
num int NULL,
status int NULL,
substatus int NULL,
comment varchar (128) NULL,
f_one int,
f_two int,
f_three int,
eend int
)
GO
declare @udn int
exec Doc Create Numerator 'Нумератор Первый класс', 'First','First',@udn
GO