﻿-------------------------------------- Hammad 2024-02-27 --------------------------
ALTER TABLE dbo.Reports ADD
	ReportNo nvarchar(50) NULL,
	FileName nvarchar(50) NULL
GO
-------------------------------------- End 2024-02-27 -----------------------------

-------------------------------------- M.Negm 2024-02-28 ---------------------------

 
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) 
VALUES(1499,N'WorkFlow',N'PenaltyRequestApi',N'Index',0,N'get',3206)
Go

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) 
VALUES(1500,N'WorkFlow',N'PenaltyRequestApi',N'PenaltyRequest_Read',0,N'post',3207)
Go

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID])
VALUES(1501,N'WorkFlow',N'PenaltyRequestApi',N'Save',1,N'get',3208)
Go

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID])
VALUES(1502,N'WorkFlow',N'PenaltyRequestApi',N'Save',2,N'get',3209)
Go

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID])
VALUES(1503,N'WorkFlow',N'PenaltyRequestApi',N'Delete',0,N'post',3210)
Go

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) 
VALUES(1504,N'WorkFlow',N'PenaltyRequestApi',N'Save',0,N'post',3211)
Go

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID])
VALUES(1505,N'WorkFlow',N'PenaltyRequestApi',N'Cancel',0,N'post',3212)
Go


INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID])
VALUES(1506,N'WorkFlow',N'PenaltyRequestSignatureApi',N'Index',0,N'get',3213)
GO

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) 
VALUES(1507,N'WorkFlow',N'PenaltyRequestSignatureApi',N'PenaltyRequest_Read',0,N'post',3214)
GO

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) 
VALUES(1508,N'WorkFlow',N'PenaltyRequestSignatureApi',N'Save',2,N'get',3215)
GO

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID])
VALUES(1509,N'WorkFlow',N'PenaltyRequestSignatureApi',N'Save',0,N'post',3216)
GO
-------------------------------------- End 2024-02-28 ------------------------------
-------------------------------------- M.Negm 2024-02-28 ----------------------------

 update SystemMenu set ControllerName =N'/WorkFlow/PromotionRequestApi' where SystemMenuCode=89
 Go
 update SystemMenu set ControllerName =N'/WorkFlow/PromotionRequestSignatureApi' where SystemMenuCode=90
 Go

 -------------------------------------- End 2024-02-28 ------------------------------
 -------------------------------------- Hammad 2024-02-28 ---------------------------
  
CREATE TABLE [dbo].[ReportGroupColumn](
	[ReportGroupColumnCode] [int] NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[Arabic_Name] [nvarchar](100) NOT NULL,
	[ColumnName] [nvarchar](50) NOT NULL,
	[TableName] [nvarchar](50) NOT NULL,
 CONSTRAINT [PK_ReportGroupColumn] PRIMARY KEY CLUSTERED 
(
	[ReportGroupColumnCode] 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

CREATE TABLE [dbo].[ReportGroupTable](
	[ReportGroupTableCode] [int] NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
 CONSTRAINT [PK_ReportGroupTable] PRIMARY KEY CLUSTERED 
(
	[ReportGroupTableCode] 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

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[LookupTableGroup]') AND type in (N'U'))
DROP TABLE [dbo].[LookupTableGroup]
GO


INSERT [dbo].[ReportGroupColumn] ([ReportGroupColumnCode], [Name], [Arabic_Name], [ColumnName], [TableName]) VALUES (1, N'Location', N'الموقع', N'LocationCode', N'Location')
GO
INSERT [dbo].[ReportGroupColumn] ([ReportGroupColumnCode], [Name], [Arabic_Name], [ColumnName], [TableName]) VALUES (2, N'Org5', N'Org5', N'Org5Code', N'Org5')
GO
INSERT [dbo].[ReportGroupColumn] ([ReportGroupColumnCode], [Name], [Arabic_Name], [ColumnName], [TableName]) VALUES (3, N'Org4', N'Org4', N'Org4Code', N'Org4')
GO
INSERT [dbo].[ReportGroupColumn] ([ReportGroupColumnCode], [Name], [Arabic_Name], [ColumnName], [TableName]) VALUES (4, N'Divisions', N'القطاع', N'DivisionCode', N'Divisions')
GO
INSERT [dbo].[ReportGroupColumn] ([ReportGroupColumnCode], [Name], [Arabic_Name], [ColumnName], [TableName]) VALUES (5, N'Department', N'الإدارة', N'DepartmentCode', N'Departments')
GO
INSERT [dbo].[ReportGroupColumn] ([ReportGroupColumnCode], [Name], [Arabic_Name], [ColumnName], [TableName]) VALUES (6, N'Section', N'القسم', N'SectionCode', N'Sections')
GO
INSERT [dbo].[ReportGroupColumn] ([ReportGroupColumnCode], [Name], [Arabic_Name], [ColumnName], [TableName]) VALUES (7, N'Position', N'الوظيفة', N'PositionCode', N'Positions')
GO
INSERT [dbo].[ReportGroupColumn] ([ReportGroupColumnCode], [Name], [Arabic_Name], [ColumnName], [TableName]) VALUES (8, N'Level', N'المستوى الوظيفى', N'LevelCode', N'Levels')
GO
INSERT [dbo].[ReportGroupColumn] ([ReportGroupColumnCode], [Name], [Arabic_Name], [ColumnName], [TableName]) VALUES (9, N'Cost Center', N'مركز التكلفة', N'CostCenter', N'CostCenter')
GO
INSERT [dbo].[ReportGroupColumn] ([ReportGroupColumnCode], [Name], [Arabic_Name], [ColumnName], [TableName]) VALUES (10, N'General Type', N'النوع العام', N'GeneralTypeCode', N'GeneralTypes')
GO
INSERT [dbo].[ReportGroupColumn] ([ReportGroupColumnCode], [Name], [Arabic_Name], [ColumnName], [TableName]) VALUES (11, N'Project', N'المشروع', N'ProjectCode', N'Projects')
GO
INSERT [dbo].[ReportGroupTable] ([ReportGroupTableCode], [Name]) VALUES (1, N'Employees')
GO
INSERT [dbo].[ReportGroupTable] ([ReportGroupTableCode], [Name]) VALUES (2, N'ResultNet')
GO


 -------------------------------------- End 2024-02-28 ---------------------------
 -------------------------------------- mostafa 2024-02-29 ---------------------------

 INSERT  SystemMenu ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])values 
 (1045,N'Fingerprints without Project' , N'بصمات  بدون المشروع' , 1028 , N'/Attendance/FingerprintsOutsideProject', N'Index','fa fa-thumb-tack' , N'get' , 10,1,1)
 Go
  INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(1045,11)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(13135,N'بصمات  بدون المشروع',N'Fingerprints without Project',1045,1)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(13136,N'عرض بصمات  بدون المشروع',N'View Fingerprints without Project',1045,2)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(13137,N'استكمال بيانات البصمة',N'Complete Fingerprint Data',1045,2)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(13138,N'حفظ استكمال بيانات البصمة',N'Save Complete Fingerprint Data',1045,2)
Go
 -------------------------------------- end 2024-02-29 ---------------------------
  -------------------------------------- mostafa 2024-03-03 ---------------------------
INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(1046,N'BusDirections',N'اتجاهات الحافلة',1023,N'/Personal/BusDirections',N'Index','fa fa-thumb-tack',N'get',6,1,1)
Go
INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(1046,22)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4042,N'اتجاهات الحافلة',N'BusDirections',1046,1)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4043,N'عرض اتجاهات الحافلة',N'View BusDirections',1046,2)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4044,N'إضافة اتجاهات الحافلة',N'Add BusDirections',1046,2)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4045,N'تعديل اتجاهات الحافلة',N'Edit BusDirections',1046,2)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4046,N'حذف اتجاهات الحافلة',N'Delete BusDirections',1046,2)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4047,N'حفظ اتجاهات الحافلة',N'Save BusDirections',1046,2)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1514,N'Personal',N'BusDirections',N'Index',0,N'get',4042)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1515,N'Personal',N'BusDirections',N'BusDirections_Read',0,N'post',4043)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1516,N'Personal',N'BusDirections',N'Save',1,N'get',4044)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1517,N'Personal',N'BusDirections',N'Save',2,N'get',4045)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1518,N'Personal',N'BusDirections',N'Delete',0,N'post',4046)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1519,N'Personal',N'BusDirections',N'Save',0,N'post',4047)
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1000,NULL, NULL,N'BusDirections',N'GetBusDirectionsSearch',N'post')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1001,NULL, NULL,N'BusDirections',N'GetBusDirections',N'Get')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1002,NULL, NULL,N'BusDirections',N'Put',N'Put')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1003,NULL, NULL,N'BusDirections',N'post',N'post')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1004,NULL, NULL,N'BusDirections',N'Delete',N'Delete')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1005,NULL, NULL,N'BusDirections',N'Get',N'Get')
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1278,1000,4043, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1279,1001,4043, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1280,1002,4047, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1281,1003,4047, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1282,1004,4046, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1283,1005,4045, NULL)
Go

  -------------------------------------- end 2024-03-03 ---------------------------
  --------------------------------------- AK 2024-03-04 ---------
UPDATE SecurityPrivilege SET DescriptionAR=N'عدد العاملين بالشركة - شكل رئيسي', DescriptionEN='Headcount Per Company - Main chart', PrivilegeType=2 WHERE ID=1388
GO
UPDATE SecurityPrivilege SET DescriptionAR=N'عدد العاملين بالقطاع - شكل رئيسي', DescriptionEN='Headcount Per Division - Main chart' WHERE ID=1389
GO
UPDATE SecurityPrivilege SET DescriptionAR=N'المرتبات بالشركة - شكل رئيسي', DescriptionEN='Salaries Per Company - Main chart' WHERE ID=1390
GO
UPDATE SecurityPrivilege SET DescriptionAR=N'عدد العاملين - مجموع رئيسي', DescriptionEN='Headcount - Main label' WHERE ID=1391
GO
UPDATE SecurityPrivilege SET DescriptionAR=N'معدل دوران العاملين - مجموع رئيسي', DescriptionEN='Turnover - Main label' WHERE ID=1392
GO
UPDATE SecurityPrivilege SET DescriptionAR=N'تعيين جديد - مجموع رئيسي', DescriptionEN='New Hire - Main label' WHERE ID=1393
GO
UPDATE SecurityPrivilege SET DescriptionAR=N'استقالة - مجموع رئيسي', DescriptionEN='Resignation - Main label' WHERE ID=1394
GO
UPDATE SecurityPrivilege SET DescriptionAR=N'اجمالي المرتبات - مجموع رئيسي', DescriptionEN='Total Gross Salary - Main label' WHERE ID=1395
GO
UPDATE SecurityPrivilege SET DescriptionAR=N'صافي المرتبات - مجموع رئيسي', DescriptionEN='Total Net Salary - Main label' WHERE ID=1396
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1407, N'عدد العاملين بالشركة - شكل فرعي دائري', N'Headcount Per Company - SubChart Pie', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1408, N'عدد العاملين بالقطاع - شكل فرعي دائري', N'Headcount Per Division - SubChart Pie', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1409, N'عدد العاملين بالشركة - شكل فرعي أعمدة', N'Headcount Per Company - SubChart Columns', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1410, N'عدد المعينين/المستقيلين بالشركة - شكل فرعي أعمدة', N'NewHire/Resigned Per Location - SubChart Columns', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1411, N'عدد المعينين/المستقيلين بالشهر - شكل فرعي أعمدة', N'NewHire/Resigned per month - SubChart Columns', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1412, N'معدل دوران العاملين بالشهر - شكل فرعي أعمدة', N'Turnover per month - SubChart Columns', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1413, N'المرتبات بالشركة - شكل فرعي أعمدة', N'Salaries Per Company - SubChart Columns', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1414, N'صافي المرتبات شهريا - شكل فرعي أعمدة', N'Net Salary Per Month - SubChart Columns', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1415, N'صافي المرتبات بالقطاع - شكل فرعي أشرطة', N'Net Salary Per Division - SubChart Bars', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1416, N'صافي المرتبات بالشركة - شكل فرعي دائري', N'Net Salary Per Company - SubChart Pie', 1032, 2)
GO
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (1417, N'صافي المرتبات بالقطاع - شكل فرعي دائري', N'Net Salary Per Division - SubChart Pie', 1032, 2)
GO
EXEC sys.sp_dropextendedproperty @name=N'MS_Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DashboardCharts', @level2type=N'COLUMN',@level2name=N'ChartType'
GO
ALTER TABLE [dbo].[DashboardCharts] DROP CONSTRAINT [FK_DashboardCharts_SecurityPrivilege]
GO
ALTER TABLE [dbo].[DashboardCharts] DROP CONSTRAINT [FK_DashboardCharts_DashboardCategories]
GO
ALTER TABLE [dbo].[DashboardCategoriesLabels] DROP CONSTRAINT [FK_DashboardCategoriesLabels_SecurityPrivilege]
GO
ALTER TABLE [dbo].[DashboardCategoriesLabels] DROP CONSTRAINT [FK_DashboardCategoriesLabels_DashboardCategories]
GO
ALTER TABLE [dbo].[DashboardCharts] DROP CONSTRAINT [DF_DashboardCharts_BootstrapColumnsCount]
GO
ALTER TABLE [dbo].[DashboardCharts] DROP CONSTRAINT [DF_DashboardCharts_IsVisable]
GO
ALTER TABLE [dbo].[DashboardCharts] DROP CONSTRAINT [DF_DashboardCharts_IsMain]
GO
ALTER TABLE [dbo].[DashboardCharts] DROP CONSTRAINT [DF_DashboardCharts_ChartType]
GO
ALTER TABLE [dbo].[DashboardCategoriesLabels] DROP CONSTRAINT [DF_DashboardCategoriesLabels_IsMain]
GO
ALTER TABLE [dbo].[DashboardCategories] DROP CONSTRAINT [DF_DashboardCategories_IsVisable]
GO
/****** Object:  Table [dbo].[DashboardCharts]    Script Date: 04/03/2024 13:24:15 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DashboardCharts]') AND type in (N'U'))
DROP TABLE [dbo].[DashboardCharts]
GO
/****** Object:  Table [dbo].[DashboardCategoriesLabels]    Script Date: 04/03/2024 13:24:15 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DashboardCategoriesLabels]') AND type in (N'U'))
DROP TABLE [dbo].[DashboardCategoriesLabels]
GO
/****** Object:  Table [dbo].[DashboardCategories]    Script Date: 04/03/2024 13:24:15 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DashboardCategories]') AND type in (N'U'))
DROP TABLE [dbo].[DashboardCategories]
GO
/****** Object:  Table [dbo].[DashboardCategories]    Script Date: 04/03/2024 13:24:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DashboardCategories](
	[DashboardCategoryCode] [int] NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[Arabic_Name] [nvarchar](100) NOT NULL,
	[IsVisable] [bit] NOT NULL,
 CONSTRAINT [PK_DashboardCategories] PRIMARY KEY CLUSTERED 
(
	[DashboardCategoryCode] 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
/****** Object:  Table [dbo].[DashboardCategoriesLabels]    Script Date: 04/03/2024 13:24:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DashboardCategoriesLabels](
	[DashboardCategoryLabelCode] [int] NOT NULL,
	[DashboardCategoryCode] [int] NOT NULL,
	[LabelEn] [nvarchar](100) NOT NULL,
	[LabelAr] [nvarchar](100) NOT NULL,
	[Sequence] [int] NOT NULL,
	[AreaName] [nvarchar](100) NULL,
	[ControllerName] [nvarchar](100) NOT NULL,
	[ActionName] [nvarchar](100) NOT NULL,
	[SecurityPrivilegeID] [int] NOT NULL,
	[IsVisable] [bit] NOT NULL,
	[IsMain] [bit] NOT NULL,
 CONSTRAINT [PK_DashboardCategoriesLabels] PRIMARY KEY CLUSTERED 
(
	[DashboardCategoryLabelCode] 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
/****** Object:  Table [dbo].[DashboardCharts]    Script Date: 04/03/2024 13:24:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DashboardCharts](
	[DashboardChartCode] [int] NOT NULL,
	[PackageName] [varchar](50) NOT NULL,
	[ChartType] [int] NOT NULL,
	[DashboardCategoryCode] [int] NOT NULL,
	[ChartTitleEn] [nvarchar](100) NOT NULL,
	[ChartTitleAr] [nvarchar](100) NOT NULL,
	[Sequence] [int] NOT NULL,
	[IsMain] [bit] NOT NULL,
	[AreaName] [nvarchar](100) NULL,
	[ControllerName] [nvarchar](100) NOT NULL,
	[ActionName] [nvarchar](100) NOT NULL,
	[Options] [nvarchar](2000) NOT NULL,
	[ResourceKeys] [varchar](200) NOT NULL,
	[SecurityPrivilegeID] [int] NOT NULL,
	[IsVisable] [bit] NOT NULL,
	[BootstrapColumnsCount] [int] NOT NULL,
 CONSTRAINT [PK_DashboardCharts] PRIMARY KEY CLUSTERED 
(
	[DashboardChartCode] 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
INSERT [dbo].[DashboardCategories] ([DashboardCategoryCode], [Name], [Arabic_Name], [IsVisable]) VALUES (1, N'Operations', N'التشغيل', 1)
GO
INSERT [dbo].[DashboardCategories] ([DashboardCategoryCode], [Name], [Arabic_Name], [IsVisable]) VALUES (2, N'Payroll', N'المرتبات', 1)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (10, 1, N'Headcount', N'عدد العاملين', 1, NULL, N'GeneralDashboard', N'GetHeadcount', 1391, 1, 1)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (11, 1, N'Turnover', N'معدل دوران العاملين', 2, NULL, N'GeneralDashboard', N'GetTurnover', 1392, 1, 1)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (12, 1, N'New Hire', N'تعيين جديد', 3, NULL, N'GeneralDashboard', N'GetNewHire', 1393, 1, 1)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (13, 1, N'Resignation', N'استقالة', 4, NULL, N'GeneralDashboard', N'GetResignation', 1394, 1, 1)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (20, 2, N'Total Gross Salary', N'اجمالي المرتبات', 1, NULL, N'GeneralDashboard', N'GetGrossSalaries', 1395, 1, 1)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (21, 2, N'Total Net Salary', N'صافي المرتبات', 2, NULL, N'GeneralDashboard', N'GetNetSalaries', 1396, 1, 1)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (100, 1, N'Headcount', N'عدد العاملين', 1, NULL, N'GeneralDashboard', N'GetHeadcount', 1380, 1, 0)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (101, 1, N'Turnover', N'معدل دوران العاملين', 2, NULL, N'GeneralDashboard', N'GetTurnover', 1380, 1, 0)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (102, 1, N'New Hire', N'تعيين جديد', 3, NULL, N'GeneralDashboard', N'GetNewHire', 1380, 1, 0)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (103, 1, N'Resignation', N'استقالة', 4, NULL, N'GeneralDashboard', N'GetResignation', 1380, 1, 0)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (104, 1, N'Male count', N'عدد الذكور', 4, NULL, N'GeneralDashboard', N'GetMaleCount', 1380, 1, 0)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (105, 1, N'Female count', N'عدد الاناث', 5, NULL, N'GeneralDashboard', N'GetFemaleCount', 1380, 1, 0)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (106, 1, N'Company count', N'عدد الشركات', 6, NULL, N'GeneralDashboard', N'GetLocationsCount', 1380, 1, 0)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (200, 2, N'Total Gross Salary', N'اجمالي المرتبات', 1, NULL, N'GeneralDashboard', N'GetGrossSalaries', 1380, 1, 0)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (201, 2, N'Total Net Salary', N'صافي المرتبات', 2, NULL, N'GeneralDashboard', N'GetNetSalaries', 1380, 1, 0)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (202, 2, N'Taxes', N'ضرائب', 3, NULL, N'GeneralDashboard', N'GetTaxes', 1380, 1, 0)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (203, 2, N'Social Ins. - Employee', N'التأمينات - الموظف', 4, NULL, N'GeneralDashboard', N'GetSocialInsuranceEmployee', 1380, 1, 0)
GO
INSERT [dbo].[DashboardCategoriesLabels] ([DashboardCategoryLabelCode], [DashboardCategoryCode], [LabelEn], [LabelAr], [Sequence], [AreaName], [ControllerName], [ActionName], [SecurityPrivilegeID], [IsVisable], [IsMain]) VALUES (204, 2, N'Social Ins. - Company', N'التأمينات - المنشآة', 5, NULL, N'GeneralDashboard', N'GetSocialInsuranceCompany', 1380, 1, 0)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [PackageName], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable], [BootstrapColumnsCount]) VALUES (10, N'corechart', 1, 1, N'Headcount Per Company', N'عدد العاملين بالشركة', 1, 1, NULL, N'GeneralDashboard', N'GetEmployeesCountByLocation', N'{{title:''{0}'',pieSliceText:''percentage'',chartArea:{{left:''2%'',right:''2%'',top:''10%'',bottom:''2%'',}},is3D:true,}}', N'GoogleDashboardRes.HeadcountPerCompany', 1388, 1, 6)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [PackageName], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable], [BootstrapColumnsCount]) VALUES (11, N'corechart', 1, 1, N'Headcount Per Division', N'عدد العاملين بالقطاع', 2, 1, NULL, N'GeneralDashboard', N'GetEmployeesCountByDivision', N'{{title:''{0}'',pieSliceText:''percentage'',chartArea:{{left:''2%'',right:''2%'',top:''10%'',bottom:''2%'',height:''100%'',width:''100%''}},is3D:true,}}', N'GoogleDashboardRes.HeadcountPerDivision', 1389, 1, 6)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [PackageName], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable], [BootstrapColumnsCount]) VALUES (20, N'bar', 2, 2, N'Salaries Per Company', N'المرتبات بالشركة', 1, 1, NULL, N'GeneralDashboard', N'GetLocationsSalaries', N'{{title:''{0}'',bars:''horizontal'',titleTextStyle: {{color: ''545454'',fontSize: ''15'',fontWidth: ''normal'',alignment: ''center''}},hAxis: {{viewWindow: {{min: 0}}}},bar: {{ groupWidth: ''50%'' }} }}', N'GoogleDashboardRes.SalariesPerCompany', 1390, 1, 12)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [PackageName], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable], [BootstrapColumnsCount]) VALUES (100, N'corechart', 1, 1, N'Headcount Per Company', N'عدد العاملين بالشركة', 1, 0, NULL, N'GeneralDashboard', N'GetEmployeesCountByLocation', N'{{title:''{0}'',pieSliceText:''percentage'',chartArea:{{left:''2%'',right:''2%'',top:''10%'',bottom:''2%'',}},is3D:true,}}', N'GoogleDashboardRes.HeadcountPerCompany', 1407, 1, 6)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [PackageName], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable], [BootstrapColumnsCount]) VALUES (101, N'corechart', 1, 1, N'Headcount Per Division', N'عدد العاملين بالقطاع', 2, 0, NULL, N'GeneralDashboard', N'GetEmployeesCountByDivision', N'{{title:''{0}'',pieSliceText:''percentage'',chartArea:{{left:''2%'',right:''2%'',top:''10%'',bottom:''2%'',height:''100%'',width:''100%''}},is3D:true,}}', N'GoogleDashboardRes.HeadcountPerDivision', 1408, 1, 6)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [PackageName], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable], [BootstrapColumnsCount]) VALUES (102, N'bar', 2, 1, N'Headcount Per Company', N'عدد العاملين بالشركة', 3, 0, NULL, N'GeneralDashboard', N'GetEmployeesCountByLocation', N'{{title:''{0}'',titleTextStyle: {{color: ''545454'',fontSize: ''15'',fontWidth: ''normal'',alignment: ''center''}},hAxis: {{viewWindow: {{min: 0}}}},bars: ''horizontal'',bar: {{  groupWidth:''70%''}} }}', N'GoogleDashboardRes.HeadcountPerCompany', 1409, 1, 12)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [PackageName], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable], [BootstrapColumnsCount]) VALUES (103, N'bar', 2, 1, N'New hire & Resigned Per Location', N'عدد المعينين والمستقيلين بالشركة', 4, 0, NULL, N'GeneralDashboard', N'GetNewHireAndResignationPerLocation', N'{{title:'''',titleTextStyle: {{color: ''545454'',fontSize: ''15'',fontWidth: ''normal'',alignment: ''center''}},hAxis: {{viewWindow: {{min: 0}}}},bars: ''horizontal'',bar: {{  groupWidth:''70%''}} }}', N'GoogleDashboardRes.Empty', 1410, 1, 12)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [PackageName], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable], [BootstrapColumnsCount]) VALUES (104, N'bar', 2, 1, N'New hire & Resigned per month', N'عدد المعينين والمستقيلين بالشهر', 5, 0, NULL, N'GeneralDashboard', N'GetNewHireAndResignationPerMonth', N'{{title:'''',titleTextStyle: {{color: ''545454'',fontSize: ''15'',fontWidth: ''normal'',alignment: ''center''}},hAxis: {{viewWindow: {{min: 0}}}},bars: ''horizontal'',bar: {{  groupWidth:''70%''}} }}', N'GoogleDashboardRes.Empty', 1411, 1, 12)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [PackageName], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable], [BootstrapColumnsCount]) VALUES (105, N'bar', 2, 1, N'Turnover per month', N'معدل دوران العاملين بالشهر', 6, 0, NULL, N'GeneralDashboard', N'GetTurnOverPerMonth', N'{{title:'''',titleTextStyle: {{color: ''545454'',fontSize: ''15'',fontWidth: ''normal'',alignment: ''center''}},hAxis: {{viewWindow: {{min: 0}}}},bars: ''horizontal'',bar: {{  groupWidth:''70%''}} }}', N'GoogleDashboardRes.Empty', 1412, 1, 12)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [PackageName], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable], [BootstrapColumnsCount]) VALUES (200, N'corechart', 2, 2, N'Salaries Per Company', N'المرتبات بالشركة', 1, 0, NULL, N'GeneralDashboard', N'GetLocationsSalaries', N'{{title:'''',bars:''horizontal'',titleTextStyle: {{color: ''545454'',fontSize: ''15'',fontWidth: ''normal'',alignment: ''center''}},hAxis: {{viewWindow: {{min: 0}}}},bar: {{ groupWidth: ''50%'' }} }}', N'GoogleDashboardRes.Empty', 1413, 1, 12)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [PackageName], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable], [BootstrapColumnsCount]) VALUES (201, N'corechart', 2, 2, N'Net Salary Per Month', N'صافي المرتبات شهريا', 2, 0, NULL, N'GeneralDashboard', N'GetNetSalaryPerMonth', N'{{title:'''',titleTextStyle: {{color: ''545454'',fontSize: ''15'',fontWidth: ''normal'',alignment: ''center''}},hAxis: {{viewWindow: {{min: 0}}}},bars: ''horizontal'',bar: {{  groupWidth:''70%''}} }}', N'GoogleDashboardRes.Empty', 1414, 1, 12)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [PackageName], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable], [BootstrapColumnsCount]) VALUES (202, N'bar', 3, 2, N'Net Salary Per Division', N'صافي المرتبات بالقطاع', 3, 0, NULL, N'GeneralDashboard', N'GetDivisionsNetSalaries', N'{{title:'''',titleTextStyle: {{color: ''545454'',fontSize: ''15'',fontWidth: ''normal'',alignment: ''center''}},hAxis: {{viewWindow: {{min: 0}}}},bars: ''horizontal'',bar: {{  groupWidth:''70%''}} }}', N'GoogleDashboardRes.Empty', 1415, 1, 12)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [PackageName], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable], [BootstrapColumnsCount]) VALUES (203, N'corechart', 1, 2, N'Net Salary Per Location', N'صافي المرتبات بالشركة', 4, 0, NULL, N'GeneralDashboard', N'GetLocationsNetSalaries', N'{{title:'''',titleTextStyle: {{color: ''545454'',fontSize: ''15'',fontWidth: ''normal'',alignment: ''center''}},hAxis: {{viewWindow: {{min: 0}}}},bars: ''horizontal'',bar: {{  groupWidth:''70%''}},is3D:true, }}', N'GoogleDashboardRes.Empty', 1416, 1, 6)
GO
INSERT [dbo].[DashboardCharts] ([DashboardChartCode], [PackageName], [ChartType], [DashboardCategoryCode], [ChartTitleEn], [ChartTitleAr], [Sequence], [IsMain], [AreaName], [ControllerName], [ActionName], [Options], [ResourceKeys], [SecurityPrivilegeID], [IsVisable], [BootstrapColumnsCount]) VALUES (204, N'corechart', 1, 2, N'Net Salary Per Division', N'صافي المرتبات بالقطاع', 5, 0, NULL, N'GeneralDashboard', N'GetDivisionsNetSalaries', N'{{title:'''',titleTextStyle: {{color: ''545454'',fontSize: ''15'',fontWidth: ''normal'',alignment: ''center''}},hAxis: {{viewWindow: {{min: 0}}}},bars: ''horizontal'',bar: {{  groupWidth:''70%''}},is3D:true, }}', N'GoogleDashboardRes.Empty', 1417, 1, 6)
GO
ALTER TABLE [dbo].[DashboardCategories] ADD  CONSTRAINT [DF_DashboardCategories_IsVisable]  DEFAULT ((1)) FOR [IsVisable]
GO
ALTER TABLE [dbo].[DashboardCategoriesLabels] ADD  CONSTRAINT [DF_DashboardCategoriesLabels_IsMain]  DEFAULT ((1)) FOR [IsMain]
GO
ALTER TABLE [dbo].[DashboardCharts] ADD  CONSTRAINT [DF_DashboardCharts_ChartType]  DEFAULT ((1)) FOR [ChartType]
GO
ALTER TABLE [dbo].[DashboardCharts] ADD  CONSTRAINT [DF_DashboardCharts_IsMain]  DEFAULT ((0)) FOR [IsMain]
GO
ALTER TABLE [dbo].[DashboardCharts] ADD  CONSTRAINT [DF_DashboardCharts_IsVisable]  DEFAULT ((1)) FOR [IsVisable]
GO
ALTER TABLE [dbo].[DashboardCharts] ADD  CONSTRAINT [DF_DashboardCharts_BootstrapColumnsCount]  DEFAULT ((6)) FOR [BootstrapColumnsCount]
GO
ALTER TABLE [dbo].[DashboardCategoriesLabels]  WITH CHECK ADD  CONSTRAINT [FK_DashboardCategoriesLabels_DashboardCategories] FOREIGN KEY([DashboardCategoryCode])
REFERENCES [dbo].[DashboardCategories] ([DashboardCategoryCode])
GO
ALTER TABLE [dbo].[DashboardCategoriesLabels] CHECK CONSTRAINT [FK_DashboardCategoriesLabels_DashboardCategories]
GO
ALTER TABLE [dbo].[DashboardCategoriesLabels]  WITH CHECK ADD  CONSTRAINT [FK_DashboardCategoriesLabels_SecurityPrivilege] FOREIGN KEY([SecurityPrivilegeID])
REFERENCES [dbo].[SecurityPrivilege] ([ID])
GO
ALTER TABLE [dbo].[DashboardCategoriesLabels] CHECK CONSTRAINT [FK_DashboardCategoriesLabels_SecurityPrivilege]
GO
ALTER TABLE [dbo].[DashboardCharts]  WITH CHECK ADD  CONSTRAINT [FK_DashboardCharts_DashboardCategories] FOREIGN KEY([DashboardCategoryCode])
REFERENCES [dbo].[DashboardCategories] ([DashboardCategoryCode])
GO
ALTER TABLE [dbo].[DashboardCharts] CHECK CONSTRAINT [FK_DashboardCharts_DashboardCategories]
GO
ALTER TABLE [dbo].[DashboardCharts]  WITH CHECK ADD  CONSTRAINT [FK_DashboardCharts_SecurityPrivilege] FOREIGN KEY([SecurityPrivilegeID])
REFERENCES [dbo].[SecurityPrivilege] ([ID])
GO
ALTER TABLE [dbo].[DashboardCharts] CHECK CONSTRAINT [FK_DashboardCharts_SecurityPrivilege]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Pie 1
Columns 2
Bars 3' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DashboardCharts', @level2type=N'COLUMN',@level2name=N'ChartType'
GO
--------------------------------------- End AK 2024-03-04 ------------
--------------------------------------- Hammad 2024-03-04 ------------
ALTER TABLE dbo.Reports ADD
	ShowMonthAndYear2 bit NOT NULL CONSTRAINT DF_Reports_ShowMonthAndYear2 DEFAULT ((0))
GO

CREATE TABLE [dbo].[ReportSortTable](
	[ReportSortTableCode] [int] NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[Arabic_Name] [nvarchar](100) NOT NULL,
	[TableName] [nvarchar](100) NOT NULL,
	[ColumnNameEn] [nvarchar](100) NOT NULL,
	[ColumnNameAr] [nvarchar](100) NOT NULL,
 CONSTRAINT [PK_ReportSortTable] PRIMARY KEY CLUSTERED 
(
	[ReportSortTableCode] 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

CREATE TABLE [dbo].[ReportVariableFormula](
	[ReportVariableFormulaCode] [int] NOT NULL,
	[FormulaName] [nvarchar](200) NOT NULL,
	[FormulaKey] [nvarchar](200) NOT NULL,
 CONSTRAINT [PK_ReportVariableFormula] PRIMARY KEY CLUSTERED 
(
	[ReportVariableFormulaCode] 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


CREATE TABLE [dbo].[ReportsFormula](
	[ReportFormulaCode] [int] IDENTITY(1,1) NOT NULL,
	[ReportCode] [int] NOT NULL,
	[ReportVariableFormulaCode] [int] NOT NULL,
 CONSTRAINT [PK_ReportsFormula] PRIMARY KEY CLUSTERED 
(
	[ReportFormulaCode] 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].[ReportsFormula]  WITH CHECK ADD  CONSTRAINT [FK_ReportsFormula_Reports] FOREIGN KEY([ReportCode])
REFERENCES [dbo].[Reports] ([ReportCode])
GO

ALTER TABLE [dbo].[ReportsFormula] CHECK CONSTRAINT [FK_ReportsFormula_Reports]
GO

ALTER TABLE [dbo].[ReportsFormula]  WITH CHECK ADD  CONSTRAINT [FK_ReportsFormula_ReportVariableFormula] FOREIGN KEY([ReportVariableFormulaCode])
REFERENCES [dbo].[ReportVariableFormula] ([ReportVariableFormulaCode])
GO

ALTER TABLE [dbo].[ReportsFormula] CHECK CONSTRAINT [FK_ReportsFormula_ReportVariableFormula]
GO



INSERT [dbo].[ReportSortTable] ([ReportSortTableCode], [Name], [Arabic_Name], [TableName], [ColumnNameEn], [ColumnNameAr]) VALUES (1, N'Employee Name', N'أسم الموظف', N'Employees', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[ReportSortTable] ([ReportSortTableCode], [Name], [Arabic_Name], [TableName], [ColumnNameEn], [ColumnNameAr]) VALUES (2, N'Hiring Date', N'تاريخ التعيين', N'Employees', N'HiringDate', N'HiringDate')
GO
INSERT [dbo].[ReportSortTable] ([ReportSortTableCode], [Name], [Arabic_Name], [TableName], [ColumnNameEn], [ColumnNameAr]) VALUES (3, N'Contract Date', N'تاريخ بداية العقد', N'Employees', N'ContractDate', N'ContractDate')
GO
INSERT [dbo].[ReportSortTable] ([ReportSortTableCode], [Name], [Arabic_Name], [TableName], [ColumnNameEn], [ColumnNameAr]) VALUES (4, N'Contract Expire Date', N'تاريخ نهاية العقد', N'Employees ', N'ContractExpireDate', N'ContractExpireDate')
GO
INSERT [dbo].[ReportSortTable] ([ReportSortTableCode], [Name], [Arabic_Name], [TableName], [ColumnNameEn], [ColumnNameAr]) VALUES (5, N'Probation Date', N'تاريخ إنتهاء فترة الإختبار', N'Employees', N'ProbationDate', N'ProbationDate')
GO
INSERT [dbo].[ReportSortTable] ([ReportSortTableCode], [Name], [Arabic_Name], [TableName], [ColumnNameEn], [ColumnNameAr]) VALUES (6, N'Birth Date', N'تاريخ الميلاد', N'Employees', N'BirthDate', N'BirthDate')
GO
INSERT [dbo].[ReportSortTable] ([ReportSortTableCode], [Name], [Arabic_Name], [TableName], [ColumnNameEn], [ColumnNameAr]) VALUES (7, N'Org5 Name', N'أسم Org5', N'Org5', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[ReportSortTable] ([ReportSortTableCode], [Name], [Arabic_Name], [TableName], [ColumnNameEn], [ColumnNameAr]) VALUES (8, N'Org4 Name', N'أسم Org4', N'Org4', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[ReportSortTable] ([ReportSortTableCode], [Name], [Arabic_Name], [TableName], [ColumnNameEn], [ColumnNameAr]) VALUES (9, N'Division Name', N'أسم القطاع', N'Divisions', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[ReportSortTable] ([ReportSortTableCode], [Name], [Arabic_Name], [TableName], [ColumnNameEn], [ColumnNameAr]) VALUES (10, N'Department Name', N'أسم الإدارة', N'Departments', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[ReportSortTable] ([ReportSortTableCode], [Name], [Arabic_Name], [TableName], [ColumnNameEn], [ColumnNameAr]) VALUES (11, N'Section Name', N'أسم القسم', N'Sections', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[ReportSortTable] ([ReportSortTableCode], [Name], [Arabic_Name], [TableName], [ColumnNameEn], [ColumnNameAr]) VALUES (12, N'Position Name', N'أسم الوظيفة', N'Positions', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[ReportSortTable] ([ReportSortTableCode], [Name], [Arabic_Name], [TableName], [ColumnNameEn], [ColumnNameAr]) VALUES (13, N'Level Name', N'أسم المستوى الوظيفى', N'Levels', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[ReportSortTable] ([ReportSortTableCode], [Name], [Arabic_Name], [TableName], [ColumnNameEn], [ColumnNameAr]) VALUES (14, N'Cost Center Name', N'أسم مركز التكلفة', N'CostCenter', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[ReportSortTable] ([ReportSortTableCode], [Name], [Arabic_Name], [TableName], [ColumnNameEn], [ColumnNameAr]) VALUES (15, N'General Type Name', N'أسم النوع العام', N'GeneralTypes', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[ReportSortTable] ([ReportSortTableCode], [Name], [Arabic_Name], [TableName], [ColumnNameEn], [ColumnNameAr]) VALUES (16, N'Project Name', N'أسم المشروع', N'Projects', N'Name', N'Arabic_Name')
GO
INSERT [dbo].[ReportVariableFormula] ([ReportVariableFormulaCode], [FormulaName], [FormulaKey]) VALUES (1, N'Birth Month', N'BirthMonth')
GO
INSERT [dbo].[ReportVariableFormula] ([ReportVariableFormulaCode], [FormulaName], [FormulaKey]) VALUES (2, N'Start Date', N'StartDate')
GO
INSERT [dbo].[ReportVariableFormula] ([ReportVariableFormulaCode], [FormulaName], [FormulaKey]) VALUES (3, N'End Date', N'EndDate')
GO
INSERT [dbo].[ReportVariableFormula] ([ReportVariableFormulaCode], [FormulaName], [FormulaKey]) VALUES (4, N'My Month', N'MyMonth')
GO
INSERT [dbo].[ReportVariableFormula] ([ReportVariableFormulaCode], [FormulaName], [FormulaKey]) VALUES (5, N'My Year', N'MyYear')
GO
INSERT [dbo].[ReportVariableFormula] ([ReportVariableFormulaCode], [FormulaName], [FormulaKey]) VALUES (6, N'Month 2', N'Month2')
GO
INSERT [dbo].[ReportVariableFormula] ([ReportVariableFormulaCode], [FormulaName], [FormulaKey]) VALUES (7, N'Year 2', N'Year2')
GO

ALTER TABLE dbo.Reports ADD
	DependOnFinancialPrivilege bit NOT NULL CONSTRAINT DF_Reports_DependOnFinancialPrivilege DEFAULT 0,
	ShowCalcNo bit NOT NULL CONSTRAINT DF_Reports_ShowCalcNo DEFAULT 0
GO

--------------------------------------- End 2024-03-04 ------------

---------------------------------------M.Negm  2024-03-04 ---------------------------

 update SystemMenu set ControllerName =N'/WorkFlow/PenaltyRequestApi' where SystemMenuCode=124
 Go
 update SystemMenu set ControllerName =N'/WorkFlow/PenaltyRequestSignatureApi' where SystemMenuCode=126
 Go

 ----------------------------------------End 2024-03-04 -----------------------------
 ----------------------------------------Mostafa 2024-03-04 -----------------------------
 
BEGIN TRANSACTION

ALTER TABLE dbo.Cities
	DROP CONSTRAINT FK_Cities_MappingCites

ALTER TABLE dbo.MappingResources SET (LOCK_ESCALATION = TABLE)

COMMIT
BEGIN TRANSACTION

ALTER TABLE dbo.Cities
	DROP CONSTRAINT DF_Cities_CityCode

ALTER TABLE dbo.Cities
	DROP CONSTRAINT DF_Cities_TransportationAllowance

ALTER TABLE dbo.Cities
	DROP CONSTRAINT DF_Cities_OutofBusSystem

ALTER TABLE dbo.Cities
	DROP CONSTRAINT DF_Cities_Transportation2

CREATE TABLE dbo.Tmp_Cities
	(
	CityCode int NOT NULL IDENTITY (0, 1),
	Name nvarchar(150) NOT NULL,
	Arabic_Name nvarchar(150) NOT NULL,
	TransportationAllowance float(53) NULL,
	OutofBusSystem bit NULL,
	Transportation2 bit NULL,
	BusDirectionCode tinyint NULL,
	MappingCode int NULL
	)  ON [PRIMARY]

ALTER TABLE dbo.Tmp_Cities SET (LOCK_ESCALATION = TABLE)

ALTER TABLE dbo.Tmp_Cities ADD CONSTRAINT
	DF_Cities_TransportationAllowance DEFAULT ((0)) FOR TransportationAllowance

ALTER TABLE dbo.Tmp_Cities ADD CONSTRAINT
	DF_Cities_OutofBusSystem DEFAULT ((0)) FOR OutofBusSystem

ALTER TABLE dbo.Tmp_Cities ADD CONSTRAINT
	DF_Cities_Transportation2 DEFAULT ((0)) FOR Transportation2

SET IDENTITY_INSERT dbo.Tmp_Cities ON

IF EXISTS(SELECT * FROM dbo.Cities)
	 EXEC('INSERT INTO dbo.Tmp_Cities (CityCode, Name, Arabic_Name, TransportationAllowance, OutofBusSystem, Transportation2, BusDirectionCode, MappingCode)
		SELECT CityCode, Name, Arabic_Name, TransportationAllowance, OutofBusSystem, Transportation2, BusDirectionCode, MappingCode FROM dbo.Cities WITH (HOLDLOCK TABLOCKX)')

SET IDENTITY_INSERT dbo.Tmp_Cities OFF

DROP TABLE dbo.Cities

EXECUTE sp_rename N'dbo.Tmp_Cities', N'Cities', 'OBJECT' 

ALTER TABLE dbo.Cities ADD CONSTRAINT
	PK_Cities PRIMARY KEY CLUSTERED 
	(
	CityCode
	) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]


ALTER TABLE dbo.Cities ADD CONSTRAINT
	FK_Cities_MappingCites FOREIGN KEY
	(
	MappingCode
	) REFERENCES dbo.MappingResources
	(
	MappingResourceCode
	) ON UPDATE  NO ACTION 
	 ON DELETE  NO ACTION 
	

COMMIT
Go

ALTER TABLE Cities
ADD Serial int;
Go
update Cities set Serial=CityCode
Go
ALTER TABLE dbo.Cities ADD
	CreatedBy int NULL,
	CreationDate datetime NULL,
	ModifiedBy int NULL,
	ModificationDate datetime NULL
	Go





INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(1047,N'Cities',N'المدن',1023,N'/Personal/Cities',N'Index','fa fa-thumb-tack',N'get',7,1,1)
Go
INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(1047,22)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4048,N'المدن',N'Cities',1047,1)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4049,N'عرض المدن',N'View Cities',1047,2)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4050,N'إضافة المدن',N'Add Cities',1047,2)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4051,N'تعديل المدن',N'Edit Cities',1047,2)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4052,N'حذف المدن',N'Delete Cities',1047,2)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4053,N'حفظ المدن',N'Save Cities',1047,2)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1520,N'Personal',N'Cities',N'Index',0,N'get',4048)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1521,N'Personal',N'Cities',N'Cities_Read',0,N'post',4049)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1522,N'Personal',N'Cities',N'Save',1,N'get',4050)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1523,N'Personal',N'Cities',N'Save',2,N'get',4051)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1524,N'Personal',N'Cities',N'Delete',0,N'post',4052)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1525,N'Personal',N'Cities',N'Save',0,N'post',4053)
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1006,NULL, NULL,N'Cities',N'GetCitiesSearch',N'post')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1007,NULL, NULL,N'Cities',N'GetCities',N'Get')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1008,NULL, NULL,N'Cities',N'Put',N'Put')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1009,NULL, NULL,N'Cities',N'post',N'post')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1010,NULL, NULL,N'Cities',N'Delete',N'Delete')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1011,NULL, NULL,N'Cities',N'Get',N'Get')
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1284,1006,4049, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1285,1007,4049, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1286,1008,4053, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1287,1009,4053, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1288,1010,4052, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1289,1011,4051, NULL)
Go


 ----------------------------------------Ali 2024-03-05 -----------------------------
 ALTER TABLE dbo.Basis
	DROP COLUMN ShowInMonthlyEffectRequest
GO
 ----------------------------------------End 2024-03-05 -----------------------------


 ---------------------------------------M.Negm  2024-03-06 ---------------------------

	update SystemMenu set Name =N'%12', Arabic_Name=N'%12'  where SystemMenuCode=1031

 ----------------------------------------End 2024-03-06 -----------------------------
 ----------------------------------------MOstafa 2024-03-07 -----------------------------

 INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(1048,N'ContractGroup',N'مجموعة العقد',1023,N'/Personal/ContractGroup',N'Index','fa fa-thumb-tack',N'get',8,1,1)
Go
INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(1048,22)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4054,N'مجموعة العقد',N'Contract Group',1048,1)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4055,N'عرض مجموعة العقد',N'View Contract Group',1048,2)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4056,N'إضافة مجموعة العقد',N'Add Contract Group',1048,2)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4057,N'تعديل مجموعة العقد',N'Edit Contract Group',1048,2)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4058,N'حذف مجموعة العقد',N'Delete Contract Group',1048,2)
Go
INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4059,N'حفظ مجموعة العقد',N'Save Contract Group',1048,2)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1526,N'Personal',N'ContractGroup',N'Index',0,N'get',4054)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1527,N'Personal',N'ContractGroup',N'ContractGroup_Read',0,N'post',4055)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1528,N'Personal',N'ContractGroup',N'Save',1,N'get',4056)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1529,N'Personal',N'ContractGroup',N'Save',2,N'get',4057)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1530,N'Personal',N'ContractGroup',N'Delete',0,N'post',4058)
Go
INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1531,N'Personal',N'ContractGroup',N'Save',0,N'post',4059)
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1012,NULL, NULL,N'ContractGroup',N'GetContractGroupSearch',N'post')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1013,NULL, NULL,N'ContractGroup',N'GetContractGroup',N'Get')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1014,NULL, NULL,N'ContractGroup',N'Put',N'Put')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1015,NULL, NULL,N'ContractGroup',N'post',N'post')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1016,NULL, NULL,N'ContractGroup',N'Delete',N'Delete')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(1017,NULL, NULL,N'ContractGroup',N'Get',N'Get')
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1290,1012,4055, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1291,1013,4055, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1292,1014,4059, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1293,1015,4059, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1294,1016,4058, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1295,1017,4057, NULL)
Go



BEGIN TRANSACTION

ALTER TABLE dbo.SubContractGroups
	DROP CONSTRAINT DF_SubContractGroups_Closed

CREATE TABLE dbo.Tmp_SubContractGroups
	(
	SubContractGroupCode int NOT NULL IDENTITY (1, 1),
	Name nvarchar(150) NULL,
	Arabic_Name nvarchar(150) NULL,
	Closed bit NULL,
	MDT datetime NULL,
	CreatedBy int NULL,
	CreationDate datetime NULL,
	ModifiedBy int NULL,
	ModificationDate int NULL
	)  ON [PRIMARY]

ALTER TABLE dbo.Tmp_SubContractGroups SET (LOCK_ESCALATION = TABLE)

ALTER TABLE dbo.Tmp_SubContractGroups ADD CONSTRAINT
	DF_SubContractGroups_Closed DEFAULT ((0)) FOR Closed

SET IDENTITY_INSERT dbo.Tmp_SubContractGroups ON

IF EXISTS(SELECT * FROM dbo.SubContractGroups)
	 EXEC('INSERT INTO dbo.Tmp_SubContractGroups (SubContractGroupCode, Name, Arabic_Name, Closed, MDT, CreatedBy, CreationDate, ModifiedBy, ModificationDate)
		SELECT SubContractGroupCode, Name, Arabic_Name, Closed, MDT, CreatedBy, CreationDate, ModifiedBy, ModificationDate FROM dbo.SubContractGroups WITH (HOLDLOCK TABLOCKX)')

SET IDENTITY_INSERT dbo.Tmp_SubContractGroups OFF

ALTER TABLE dbo.WF_RequestTypeSubContractGroups
	DROP CONSTRAINT FK_WF_RequestTypeSubContractGroups_SubContractGroups

DROP TABLE dbo.SubContractGroups

EXECUTE sp_rename N'dbo.Tmp_SubContractGroups', N'SubContractGroups', 'OBJECT' 

ALTER TABLE dbo.SubContractGroups ADD CONSTRAINT
	PK_SubContractGroups_SubContractGroupCode PRIMARY KEY CLUSTERED 
	(
	SubContractGroupCode
	) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]


COMMIT
BEGIN TRANSACTION

ALTER TABLE dbo.WF_RequestTypeSubContractGroups ADD CONSTRAINT
	FK_WF_RequestTypeSubContractGroups_SubContractGroups FOREIGN KEY
	(
	SubContractGroupCode
	) REFERENCES dbo.SubContractGroups
	(
	SubContractGroupCode
	) ON UPDATE  NO ACTION 
	 ON DELETE  NO ACTION 
	

ALTER TABLE dbo.WF_RequestTypeSubContractGroups SET (LOCK_ESCALATION = TABLE)

COMMIT
GO
ALTER TABLE dbo.SubContractGroups ADD
	CreatedBy int NULL,
	CreationDate datetime NULL,
	ModifiedBy int NULL,
	ModificationDate datetime NULL
GO

 ----------------------------------------End 2024-03-07 -----------------------------

 ------------------------------------- M.Negm 2024-03-07 ----------------------------

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) 
VALUES(1532,N'WorkFlow',N'FingerPrintRequestApi',N'Index',0,N'get',3077)
Go

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) 
VALUES(1533,N'WorkFlow',N'FingerPrintRequestApi',N'FingerPrintRequest_Read',0,N'post',3078)
Go

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID])
VALUES(1534,N'WorkFlow',N'FingerPrintRequestApi',N'Save',1,N'get',3079)
Go

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID])
VALUES(1535,N'WorkFlow',N'FingerPrintRequestApi',N'Save',2,N'get',3080)
Go

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID])
VALUES(1536,N'WorkFlow',N'FingerPrintRequestApi',N'Delete',0,N'post',3081)
Go

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) 
VALUES(1537,N'WorkFlow',N'FingerPrintRequestApi',N'Save',0,N'post',3083)
Go

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID])
VALUES(1538,N'WorkFlow',N'FingerPrintRequestApi',N'Cancel',0,N'post',3082)
Go

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID])
VALUES(1539,N'WorkFlow',N'FingerPrintRequestSignatureApi',N'Index',0,N'get',3084)
GO

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) 
VALUES(1540,N'WorkFlow',N'FingerPrintRequestSignatureApi',N'FingerPrintRequest_Read',0,N'post',3085)
GO

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) 
VALUES(1541,N'WorkFlow',N'FingerPrintRequestSignatureApi',N'Save',2,N'get',3086)
GO

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID])
VALUES(1542,N'WorkFlow',N'FingerPrintRequestSignatureApi',N'Save',0,N'post',3087)
GO
 ------------------------------------ End 2024-03-07 --------------------------------