﻿
----------------------------------------------------M.Negm 16-01-2024 -------------------------------------------------------------------------


INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(1039,N'Basic Data Configuration',N'إعدادات البيانات الأساسية ',52,N'',N'','fa fa-thumb-tack',N'',11,1,1)
Go 
INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(1039,6)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType])
VALUES(1387,N'إعدادات البيانات الأساسية',N'Basic Data Configuration',1039,1)
Go

update SystemMenu set ParentID = 1039 where  SystemMenuCode = 215
Go
update SystemMenu set ParentID = 1039 where  SystemMenuCode = 201
Go
update SystemMenu set ParentID = 1039 where  SystemMenuCode = 1038
Go
update SystemMenu set ParentID = 1039 where  SystemMenuCode = 1037
Go
update SystemMenu set ParentID = 1039 where  SystemMenuCode = 467
Go


	INSERT INTO SecurityUserDetail ( SecurityUserID,PrivilegeID, CreationDate, CreatedBy)
	SELECT sec.SecurityUserID,1387, GETDATE(), 1
	FROM SecurityUserDetail sec 
	WHERE  sec.PrivilegeID in
	(3365,3366,3545,3361,3360,3359,3965,3966,3967,1384,1385,1386,1381,1382,1383);
	Go


	INSERT INTO SecurityGroupDetail( SecurityGroupID,PrivilegeID, CreationDate, CreatedBy)
	    SELECT gr.SecurityGroupID,1387, GETDATE(), 1
	    FROM SecurityGroupDetail gr 
		WHERE  gr.PrivilegeID in
	(3365,3366,3545,3361,3360,3359,3965,3966,3967,1384,1385,1386,1381,1382,1383);
	Go

-------------------------------------------------------- End  16-01-2024 -----------------------------------------------------------------------
-------------------------------------------------------- Ali  16-01-2024 -----------------------------------------------------------------------

INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage]) 
VALUES (1036, N'Projects', N'المشاريع', 1028, N'/Attendence/FingerAreaProjects', N'Index', N'fa fa-thumb-tack', N'get', 1, 0, 1)
Go

INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(1036,11)
Go
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (13120, N'المشاريع', N'Projects', 1036, 1)
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (13121, N'عرض المشاريع', N'View Projects', 1036, 2)
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (13122, N'إضافة المشاريع', N'Add Projects', 1036, 2)
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (13123, N'تعديل المشاريع', N'Edit Projects', 1036, 2)
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (13124, N'حذف المشاريع', N'Delete Projects', 1036, 2)
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (13125, N'حفظ المشاريع', N'Save Projects', 1036, 2)
Go

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1444,N'Attendance',N'FingerAreaProjects',N'Index',0,N'get',13121)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1445,N'Attendance',N'FingerAreaProjects',N'FingerAreaProjects_Read',0,N'post',13121)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1446,N'Attendance',N'FingerAreaProjects',N'Save',1,N'get',13122)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1447,N'Attendance',N'FingerAreaProjects',N'Save',2,N'get',13123)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1448,N'Attendance',N'FingerAreaProjects',N'Delete',0,N'post',13124)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1449,N'Attendance',N'FingerAreaProjects',N'Save',0,N'post',13125)
Go
-------------------------------------------------------- End  16-01-2024 -----------------------------------------------------------------------
-------------------------------------------------------- Ali  17-01-2024 -----------------------------------------------------------------------

CREATE TABLE [dbo].[FingerAreaUnits](
	[FingerAreaUnitCode] [int] IDENTITY(1,1) NOT NULL,
	[FingerAreaProjectCode] [int] NOT NULL,
	[UnitCode] [nvarchar](500) NOT NULL,
	[UnitNumber] [nvarchar](500) NOT NULL,
	[CreationDate] [datetime] NOT NULL,
	[CreatedBy] [int] NOT NULL,
	[ModificationDate] [datetime] NULL,
	[ModifiedBy] [int] NULL,
 CONSTRAINT [PK_FingerAreaUnits] PRIMARY KEY CLUSTERED 
(
	[FingerAreaUnitCode] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[FingerAreaUnits]  WITH CHECK ADD  CONSTRAINT [FK_FingerAreaUnits_FingerAreaProjects] FOREIGN KEY([FingerAreaProjectCode])
REFERENCES [dbo].[FingerAreaProjects] ([FingerAreaProjectsCode])
GO

ALTER TABLE [dbo].[FingerAreaUnits] CHECK CONSTRAINT [FK_FingerAreaUnits_FingerAreaProjects]
GO

INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage]) 
VALUES (1040, N'Units', N'الوحدات', 1028, N'/Attendence/FingerAreaUnit', N'Index', N'fa fa-thumb-tack', N'get', 1, 0, 1)
Go
INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(1040,11)
Go

INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (13126, N'الوحدات', N'Unit', 1040, 1)
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (13127, N'عرض الوحدات', N'View Unit', 1040, 2)
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (13128, N'إضافة الوحدات', N'Add Unit', 1040, 2)
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (13129, N'حذف الوحدات', N'Delete Unit', 1040, 2)
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (13130, N'حفظ الوحدات', N'Save Unit', 1040, 2)
Go
 
 select * from [SecurityPrivilegeActions]
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1450,N'Attendance',N'FingerAreaUnit',N'Index',0,N'get',13126)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1451,N'Attendance',N'FingerAreaUnit',N'FingerAreaUnit_Read',0,N'post',13127)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1452,N'Attendance',N'FingerAreaUnit',N'Save',1,N'get',13128)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1453,N'Attendance',N'FingerAreaUnit',N'Delete',0,N'post',13129)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1454,N'Attendance',N'FingerAreaUnit',N'Save',0,N'post',13130)
Go


-------------------------------------------------------- End  17-01-2024 -----------------------------------------------------------------------

