 --------------------------Hammad 2021-02-22--------------------------------
 CREATE TABLE [dbo].[WF_FingerPrintType](
	[FingerPrintTypeCode] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](200) NOT NULL,
	[Arabic_Name] [nvarchar](200) NOT NULL,
	[RequestMaxNumberInMonth] [int] NOT NULL,
 CONSTRAINT [PK_WF_FingerPrintType] PRIMARY KEY CLUSTERED 
(
	[FingerPrintTypeCode] 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

SET IDENTITY_INSERT [dbo].[WF_FingerPrintType] ON 
INSERT [dbo].[WF_FingerPrintType] ([FingerPrintTypeCode], [Name], [Arabic_Name], [RequestMaxNumberInMonth]) VALUES (1, N'Default', N'إفتراضى', 2)
SET IDENTITY_INSERT [dbo].[WF_FingerPrintType] OFF


alter table WF_FingerPrintRequest add
FingerPrintTypeCode int null
Go
update WF_FingerPrintRequest set FingerPrintTypeCode=1
Go

ALTER TABLE [dbo].[WF_FingerPrintRequest]  WITH CHECK ADD  CONSTRAINT [FK_WF_FingerPrintRequest_WF_FingerPrintType] FOREIGN KEY([FingerPrintTypeCode])
REFERENCES [dbo].[WF_FingerPrintType] ([FingerPrintTypeCode])
GO

ALTER TABLE [dbo].[WF_FingerPrintRequest] CHECK CONSTRAINT [FK_WF_FingerPrintRequest_WF_FingerPrintType]
GO
update ConfigParameter set IsVisible=0 where ConfigKey='WFCheckRequestMaxNumber'
Go
update WF_FingerPrintType set RequestMaxNumberInMonth= (select top (1) ConfigValue from ConfigParameter where ConfigKey='WFCheckRequestMaxNumber' )
where FingerPrintTypeCode=1
Go

INSERT [dbo].[SystemMenu] ([SystemMenuCode], [Name], [Arabic_Name], [ParentID], [ControllerName], [ActionName], [ImageURL], [HTTPMethod], [Sequence], [IsVisible], [ShowInPrivilegePage])
VALUES(469,N'Finger Print Type',N'انواع البصمات',28,N'/WorkFlow/FingerPrintType',N'Index','fa fa-thumb-tack',N'get',24,1,1)
Go

INSERT[dbo].[SystemMenuModule]( [SystemMenuCode], [AppModuleCode]) VALUES(469,1)
Go

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(3968,N'انواع البصمات',N'Finger Print Type',469,1)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(3969,N'عرض انواع البصمات',N'View Finger Print Type',469,2)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(3970,N'إضافة انواع البصمات',N'Add Finger Print Type',469,2)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(3971,N'تعديل انواع البصمات',N'Edit Finger Print Type',469,2)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(3972,N'حذف انواع البصمات',N'Delete Finger Print Type',469,2)

INSERT[dbo].[SecurityPrivilege]([ID], [DescriptionAR], [DescriptionEN], [SystemMenuCode], [PrivilegeType]) VALUES(3973,N'حفظ انواع البصمات',N'Save Finger Print Type',469,2)
Go

 --------------------------End 2021-02-22---------------------------------