﻿--------------------------------------- Mostafa  17-01-2023 ------------
ALTER TABLE ConfigParameter
ADD ConfigDescription  nvarchar(500) DEFAULT NULL ;
go
UPDATE ConfigParameter SET ConfigDescription =Arabic_Name ;
GO
--------------------------------------- End  17-01-2023 ------------
--------------------------------------- Hammad  17-01-2023 ---------
INSERT [dbo].[ConfigParameter] ([ConfigKey], [Name], [Arabic_Name], [ConfigValue], [ConfigCategoryCode], [OrderNo], [ConfigType], [IsVisible], [ModifiedBy], [ModificationDate], [RequestTypeId], [ConfigDescription])
 VALUES (N'VacCheckCalculationWays', N'Check Calculation Ways', N'الاعتماد على طرق إحتساب الاجازة', N'false', 2, 48, 1, 1, NULL, NULL, 11, N'الاعتماد على طرق إحتساب الاجازة')
GO
--------------------------------------- End------------

--------------------------------------- Mostafa  22-01-2023 ---------
ALTER TABLE WF_GeneralRequestType ADD MaxGeneralRequestTypePerDay int NOT NULL DEFAULT 1;
go
ALTER TABLE WF_GeneralRequestType ADD MaxGeneralRequestTypePerMonth int NOT NULL DEFAULT 1;
go
UPDATE WF_GeneralRequestType SET MaxGeneralRequestTypePerDay = ConfigParameter.ConfigValue
FROM ConfigParameter ConfigParameter
WHERE   ConfigParameter.ConfigKey='WFMaximumRequestNumberPerDay'  and RequestTypeId=19 
GO
UPDATE WF_GeneralRequestType SET MaxGeneralRequestTypePerMonth = ConfigParameter.ConfigValue
FROM ConfigParameter ConfigParameter
WHERE   ConfigParameter.ConfigKey='WFRequestNumberPerMonth'  and RequestTypeId=19 
GO
delete   ConfigParameter where  ConfigKey='WFMaximumRequestNumberPerDay'  and RequestTypeId=19
GO
delete   ConfigParameter where  ConfigKey='WFRequestNumberPerMonth'  and RequestTypeId=19
GO
--------------------------------------- End  22-01-2023 ---------
