﻿---------------------Hammad 2022-01-17----- 
CREATE TABLE [dbo].[EmailNotificationLog](
	[EmailNotificationLogId] [int] IDENTITY(1,1) NOT NULL,
	[TransactionCode] [bigint] NOT NULL,
	[ToUsers] [nvarchar](250) NOT NULL,
	[CCUsers] [nvarchar](250) NOT NULL,
	[Status] [bit] NOT NULL,
	[ErrorMessage] [nvarchar](1000) NOT NULL,
	[AppModuleCode] [int] NOT NULL,
	[RequestTypeId] [int] NULL,
	[CreationDate] [datetime] NOT NULL,
	[CreatedBy] [int] NOT NULL,
 CONSTRAINT [PK_EmailNotificationLog] PRIMARY KEY CLUSTERED 
(
	[EmailNotificationLogId] 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
---------------------End 2022-01-17----- 
---------------------Ali 2022-01-18----- 


ALTER TABLE dbo.WF_RequestType ADD
	IsApi bit NOT NULL CONSTRAINT DF_WF_RequestType_IsApi DEFAULT ((0))
GO
update WF_RequestType 
set IsApi = 1 where RequestTypeId in(49,44,56,50,51,47,45,43,48,23,46,28,55,46,32,33,34 ,35,36,37,38,39,40,41)
GO
---------------------End 2022-01-18----- 
---------------------AK 2022-01-18----- 
ALTER TABLE [dbo].[WF_RequestType] ADD IsMasterRequest bit NULL
GO
ALTER TABLE [dbo].[WF_RequestType] ADD NotifSignCountAction NVARCHAR(100) NULL
GO
ALTER TABLE [dbo].[WF_RequestType] ADD NotifSignCountController NVARCHAR(100) NULL
GO
ALTER TABLE [dbo].[WF_RequestType] ADD NotifSignCountArea NVARCHAR(100) NULL
GO
Update [WF_RequestType] SET IsMasterRequest=1 WHERE IsApi=1
Update [WF_RequestType] SET IsMasterRequest=0 WHERE IsApi=0
Update [WF_RequestType] SET IsMasterRequest=1 WHERE RequestTypeId in(12,15,16,19,24,25,26,27,29,30,31,42,52,53,54)
GO
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'PermissionRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=2
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'OverTimeRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=3
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'AirTicketRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=4
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'NewHireRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=5
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'FingerPrintRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=6
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'ResignationRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=7
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'CasualRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=8
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'LoanRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=9
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'PromotionRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=10
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'CombinedVacationsRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=11
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'MaintenanceRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=12
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'PenaltyRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=13
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'NewEmployeesRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=14
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'BonusRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=15
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'VehicleRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=16
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'DisclaimerRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=17
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'ChangeDayoffRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=18
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'GeneralRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=19
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'OverTimeRequestFinalSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=20
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'CompensationDayOfRestRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=21
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'CompensationRequestFinalDayRestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=22
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'PurchasesRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=23
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'RequisitionFormRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=24
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'TransferRequestFromDepartmentSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=25
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'NewJobRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=26
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'MonthlyEffectsRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=27
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'StoreRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=28
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'ResidenceRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=29
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'FinancialPaymentRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=30
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'FinancialPaymentHrRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=31
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'ResearchProfileSignature', NotifSignCountArea=N'WFAcademic' WHERE RequestTypeId=32
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'PublicationSignature', NotifSignCountArea=N'WFAcademic' WHERE RequestTypeId=33
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'ScientificActivitySignature', NotifSignCountArea=N'WFAcademic' WHERE RequestTypeId=34
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'CommitteeSignature', NotifSignCountArea=N'WFAcademic' WHERE RequestTypeId=35
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'ProfDevCommunityServiceSignature', NotifSignCountArea=N'WFAcademic' WHERE RequestTypeId=36
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'AwardSignature', NotifSignCountArea=N'WFAcademic' WHERE RequestTypeId=37
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'SponserSignature', NotifSignCountArea=N'WFAcademic' WHERE RequestTypeId=38
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'CoExtraCurricularActivitySignature', NotifSignCountArea=N'WFAcademic' WHERE RequestTypeId=39
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'PGSupervisionSignature', NotifSignCountArea=N'WFAcademic' WHERE RequestTypeId=40
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'StructInstCapBuildExpansionRequestSign', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=41
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'ChangeEmployeeDataRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=42
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'NewSectionDepartRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=43
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'ChangeSectionDepartRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=44
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'MedicalInsuranceRegisterRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=45
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'ScholarshipRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=46
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'MedicalInsuranceCancelRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=47
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'PrintBusinessCardRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=48
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'BackToWorkRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=49
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'IntroductionLetterRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=50
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'MedicalInquiryRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=51
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'ReimbursementRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=52
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'HireCandidateRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=53
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'TaskForceRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=54
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'TimeSheetRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=55
Update [WF_RequestType] SET NotifSignCountAction=N'Index', NotifSignCountController=N'ConslidatedPurchasesRequestSignature', NotifSignCountArea=N'WorkFlow' WHERE RequestTypeId=56
GO
---------------------End 2022-01-18----- 
---------------------Hammad 2022-01-19----- 
 update SecurityPrivilegeActions set HTTPMethod='post' where ActionName='Cancel'
 Go
 ---------------------End 2022-01-19----- 
 ---------------------Hammad 2022-01-23----- 
 INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (3543, N'حفظ متعدد  اعتماد نهائى لطلب التعويض', N'Save Multiple Compensation Request Final Signature', 223, 2)
INSERT [dbo].[SecurityPrivilege] ([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES (3544, N'اختيار كل الطلبات', N'Choose All Requests', 223, 2)
Go
 ---------------------End 2022-01-23----- 