﻿----------------------------------- Negm 19-11-2023-------------------------
CREATE TABLE dbo.Tmp_HolidaysMap
	(
	DayDate datetime NULL,
	Name nvarchar(30) NULL,
	Arabic_Name nvarchar(30) NULL,
	Type tinyint default(1) NULL,
	Serial bigint NOT NULL IDENTITY (1, 1) primary Key,
	MyYear int NULL,
	OnlyReligionCode tinyint NULL,
	DayDateHijri nvarchar(10)  NULL
	)  ON [PRIMARY]
GO

Insert into Tmp_HolidaysMap (DayDate, Name, Arabic_Name, Type,  MyYear, OnlyReligionCode, DayDateHijri)
SELECT DayDate, Name, Arabic_Name, Type, MyYear, OnlyReligionCode, DayDateHijri
FROM HolidaysMap;
GO

DROP TABLE dbo.HolidaysMap
GO

EXECUTE sp_rename N'dbo.Tmp_HolidaysMap', N'HolidaysMap'
GO

ALTER TABLE dbo.HolidaysMap ADD
	CreatedBy int NOT NULL CONSTRAINT DF_HolidaysMap_CreatedBy DEFAULT (1),
	CreationDate datetime NOT NULL CONSTRAINT DF_HolidaysMap_CreationDate DEFAULT (getdate()),
	ModifiedBy int NULL,
	ModificationDate datetime NULL
GO

----------------------------------------------------------------------------

----------------------------------------- Negm 21-11-2023 -------------------------------------


INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(1025,N'Holidays Map',N'خريطة الأعياد',1023,N'/Personal/HolidaysMap',N'Index','fa fa-thumb-tack',N'get',2,1,1)
Go

INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(1025,22)
Go

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4017,N'خريطة الأعياد',N'Holidays Map',1025,1)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4018,N'عرض خريطة الأعياد',N'View Holidays Map',1025,2)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4019,N'إضافة خريطة الأعياد',N'Add Holidays Map',1025,2)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4020,N'تعديل خريطة الأعياد',N'Edit Holidays Map',1025,2)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4021,N'حذف خريطة الأعياد',N'Delete Holidays Map',1025,2)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(4022,N'حفظ خريطة الأعياد',N'Save Holidays Map',1025,2)
Go


INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1333,N'Personal',N'HolidaysMap',N'Index',0,N'get',4017)

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1334,N'Personal',N'HolidaysMap',N'HolidaysMap_Read',0,N'post',4018)

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1335,N'Personal',N'HolidaysMap',N'Save',1,N'get',4019)

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1336,N'Personal',N'HolidaysMap',N'Save',2,N'get',4020)

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1337,N'Personal',N'HolidaysMap',N'Delete',0,N'post',4021)

INSERT [dbo].[SecurityPrivilegeActions] ([ID], [AreaName], [ControllerName], [ActionName], [ActionType], [HTTPMethod], [SecurityPrivilegeID]) VALUES(1338,N'Personal',N'HolidaysMap',N'Save',0,N'post',4022)



INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(899,NULL, NULL,N'HolidaysMap',N'GetHolidaysMapSearch',N'post')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(900,NULL, NULL,N'HolidaysMap',N'GetHolidaysMap',N'Get')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(901,NULL, NULL,N'HolidaysMap',N'Put',N'Put')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(902,NULL, NULL,N'HolidaysMap',N'post',N'post')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(903,NULL, NULL,N'HolidaysMap',N'Delete',N'Delete')
Go
INSERT [dbo].[SecurityPrivilegeEndPoints] ([Id], [ApiName], [AreaName], [ControllerName], [ActionName], [HTTPMethod]) VALUES(904,NULL, NULL,N'HolidaysMap',N'Get',N'Get')
Go



INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1126,899,4018, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1127,900,4018, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1128,901,4022, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1129,902,4022, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1130,903,4021, NULL)
Go
INSERT [dbo].[SecurityPrivilegeEndPointsDetails] ([Id], [SecurityPrivilegeEndPointId], [SecurityPrivilegeId], [RequestTypeId]) VALUES(1131,904,4020, NULL)
Go
-----------------------------------------End ------------------------------------
--------------------------------------- AK 2023-11-21 ---------
BEGIN TRANSACTION
GO
ALTER TABLE dbo.Employees ADD IsInternalTrainer bit NOT NULL CONSTRAINT DF_Employees_IsInternalTrainer DEFAULT 0
GO
ALTER TABLE dbo.Employees SET (LOCK_ESCALATION = TABLE)
GO
COMMIT
--------------------------------------- End AK 2023-11-21 ------------
--------------------------------------- Ali  2023-11-21 ------------

update [AppModule] set IsLicensed=0 where AppModuleCode=22
Go
--------------------------------------- End 2023-11-21 ------------