diff --git a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/dbo.usp_GetSearchUserList.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/dbo.usp_GetSearchUserList.sql new file mode 100644 index 0000000..ced6c2c --- /dev/null +++ b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/dbo.usp_GetSearchUserList.sql diff --git a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_DeleteSiteAccount.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_DeleteSiteAccount.sql new file mode 100644 index 0000000..582afde --- /dev/null +++ b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_DeleteSiteAccount.sql @@ -0,0 +1,48 @@ +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_DeleteSiteAccount]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[usp_DeleteSiteAccount] +GO + +-- ==================================================== +-- Author: Magic Software +-- Create date: 08-Feb-2018 +-- Description: To delete a site account for a license account and site +-- ==================================================== +create PROCEDURE [dbo].[usp_DeleteSiteAccount] + -- Add the parameters for the stored procedure here + @iSiteId int, @LicenseId int, @UserId int, + @Status bit out +AS +BEGIN + -- SET NOCOUNT ON added to prevent extra result sets from + -- interfering with SELECT statements. +SET NOCOUNT ON; + + set @Status = 0; + BEGIN TRY + BEGIN TRANSACTION + + delete SLE from SiteToLicenseEdition SLE inner join LicenseToEdition LE on SLE.LicenseEditionId = LE.Id where SLE.SiteId = @iSiteId and LicenseId = @LicenseId; + delete from AIAUserToSite where SiteId = @iSiteId and UserId = @UserId; + delete from Site where Id = @iSiteId; + + COMMIT TRANSACTION + set @Status = 1; + END TRY + BEGIN CATCH + IF @@TRANCOUNT > 0 + ROLLBACK TRANSACTION + END CATCH + +END + +GO +SET QUOTED_IDENTIFIER OFF +GO +SET ANSI_NULLS ON +GO + diff --git a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetAccountNumber.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetAccountNumber.sql new file mode 100644 index 0000000..9102522 --- /dev/null +++ b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetAccountNumber.sql @@ -0,0 +1,40 @@ +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetAccountNumber]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[usp_GetAccountNumber] +GO + +-- ==================================================== +-- Author: Magic Software +-- Create date: 23-Dec-2009 +-- Description: To get the license id and account no of licenses of a type +-- ==================================================== +CREATE PROCEDURE [dbo].[usp_GetAccountNumber] + -- Add the parameters for the stored procedure here + @LicenseType int +AS +BEGIN + -- SET NOCOUNT ON added to prevent extra result sets from + -- interfering with SELECT statements. + SET NOCOUNT ON; + if(@LicenseType = 0) + begin + SELECT License.Id,License.AccountNumber FROM License + WHERE License.IsActive = 1 + end + else + begin + SELECT License.Id,License.AccountNumber FROM License + WHERE License.IsActive = 1 and License.LicenseTypeId = @LicenseType + end +END + +GO +SET QUOTED_IDENTIFIER OFF +GO +SET ANSI_NULLS ON +GO + diff --git a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenseModestySettings.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenseModestySettings.sql new file mode 100644 index 0000000..081fabf --- /dev/null +++ b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenseModestySettings.sql @@ -0,0 +1,50 @@ +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetLicenseModestySettings]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[usp_GetLicenseModestySettings] +GO + +-- ==================================================== +-- Author: Magic Software +-- Create date: 05-Feb-2018 +-- Description: To get all the modesty settings of a license and its related editions +-- ==================================================== +create PROCEDURE [dbo].[usp_GetLicenseModestySettings] + -- Add the parameters for the stored procedure here + @iLicenseId int, @iBuildingLevelId int +AS +BEGIN + + IF 1=0 BEGIN + SET FMTONLY OFF + END + + -- SET NOCOUNT ON added to prevent extra result sets from + -- interfering with SELECT statements. + SET NOCOUNT ON; + IF @iBuildingLevelId = 0 + BEGIN + SELECT LicenseToEdition.Id as LicenseEditionId, Edition.Title, LicenseToEdition.IsModesty as IsModesty + FROM LicenseToEdition + INNER JOIN Edition ON LicenseToEdition.EditionId = Edition.Id + WHERE LicenseToEdition.LicenseId=@iLicenseId and Edition.IsActive=1 ORDER BY Edition.Priority + END + ELSE + BEGIN + SELECT LicenseToEdition.Id as LicenseEditionId, Edition.Title, SiteToLicenseEdition.IsModesty as IsModesty + FROM SiteToLicenseEdition + INNER JOIN LicenseToEdition ON SiteToLicenseEdition.LicenseEditionId = LicenseToEdition.Id + INNER JOIN Edition ON LicenseToEdition.EditionId = Edition.Id + WHERE SiteToLicenseEdition.SiteId=@iBuildingLevelId and Edition.IsActive=1 ORDER BY Edition.Priority + END + +END + +GO +SET QUOTED_IDENTIFIER OFF +GO +SET ANSI_NULLS ON +GO diff --git a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetSiteAccountEditions.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetSiteAccountEditions.sql new file mode 100644 index 0000000..ab6c5d6 --- /dev/null +++ b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetSiteAccountEditions.sql @@ -0,0 +1,36 @@ +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetSiteAccountEditions]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[usp_GetSiteAccountEditions] +GO +-- ==================================================== +-- Author: Magic Software +-- Create date: 07-Feb-2018 +-- Description: To get a site account editions on the basis of siteid and licenseid +-- ==================================================== +create PROCEDURE [dbo].[usp_GetSiteAccountEditions] + -- Add the parameters for the stored procedure here + @SiteId int, + @LicenseId int +AS +BEGIN + -- SET NOCOUNT ON added to prevent extra result sets from + -- interfering with SELECT statements. + SET NOCOUNT ON; + + Select SLE.LicenseEditionId, E.Id, E.Title from SiteToLicenseEdition SLE + inner join LicenseToEdition LE on SLE.LicenseEditionId = LE.Id + inner join License L on L.Id = LE.LicenseId + inner join Edition E on LE.EditionId = E.Id + where L.Id = @LicenseId and SLE.SiteId = @SiteId; + +END + +GO +SET QUOTED_IDENTIFIER OFF +GO +SET ANSI_NULLS ON +GO \ No newline at end of file diff --git a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetSiteById.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetSiteById.sql new file mode 100644 index 0000000..a680048 --- /dev/null +++ b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetSiteById.sql @@ -0,0 +1,39 @@ +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetSiteById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[usp_GetSiteById] +GO +-- ==================================================== +-- Author: Magic Software +-- Create date: 07-Feb-2018 +-- Description: To get a site information on the basis of siteid +-- ==================================================== +create PROCEDURE [dbo].[usp_GetSiteById] + -- Add the parameters for the stored procedure here + @SiteId int +AS +BEGIN + -- SET NOCOUNT ON added to prevent extra result sets from + -- interfering with SELECT statements. + SET NOCOUNT ON; + + Select Site.Id,Site.SiteIp,Site.Title,ISNULL(Site.SiteIPTo,'') as SiteIPTo,ISNULL(Site.SiteMasterIPTo,'') as SiteMasterIPTo, Site.Address1, Site.Address2, + Site.Zip, Site.Phone, Site.City, Site.StateId, Site.CountryId, Site.IsMaster, Site.IsActive, + CONVERT(VARCHAR,Site.CreationDate,101) as CreationDate, + CONVERT(VARCHAR,Site.ModifiedDate,101) as ModifiedDate, + Site.InstituteName,Site.Department, AIAUser.Id as UserId,AIAUser.FirstName,AIAUser.EmailId + From ((Site INNER JOIN AIAUserToSite on Site.Id=AIAUserToSite.SiteId) + INNER JOIN AIAUser on AIAUserToSite.UserId = AIAUser.Id) + Where Site.id = @SiteId; + + +END + +GO +SET QUOTED_IDENTIFIER OFF +GO +SET ANSI_NULLS ON +GO \ No newline at end of file diff --git a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_InsertUpdateSiteAccount.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_InsertUpdateSiteAccount.sql new file mode 100644 index 0000000..bf65716 --- /dev/null +++ b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_InsertUpdateSiteAccount.sql @@ -0,0 +1,107 @@ +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_InsertUpdateSiteAccount]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[usp_InsertUpdateSiteAccount] +GO + +-- ==================================================== +-- Author: Magic Software +-- Create date: 08-Feb-2018 +-- Description: To insert or update a site account for a license account and site +-- ==================================================== +create PROCEDURE [dbo].[usp_InsertUpdateSiteAccount] + -- Add the parameters for the stored procedure here + @iSiteId int, @sSiteIP varchar(2000), @sTitle varchar(100), @sInstituteName varchar(100), @sDepartment varchar(50), + @sAddress1 varchar(100), @sAddress2 varchar(100), @sCity varchar(50), @Zip varchar(20), @Phone varchar(30), + @StateId int, @CountryId int, @IsMaster bit, @CreationDate datetime, @ModifiedDate datetime, + @IsActive bit, @UserId int, @sSiteIPTo varchar(100), @LicenseId int, @SiteEditionIds varchar(1000), + @Status bit out +AS +BEGIN + -- SET NOCOUNT ON added to prevent extra result sets from + -- interfering with SELECT statements. +SET NOCOUNT ON; + +DECLARE @list varchar(1000) +DECLARE @pos INT, @tempEditionId int, @tempLicenseEditionId int; +DECLARE @len INT, @tempModesty bit; +DECLARE @value varchar(1000) + +CREATE TABLE #LocalTempTable( +SiteId int, +LicenseEditionId int, +IsModesty bit); + +if(@SiteEditionIds != '') +begin + set @SiteEditionIds = @SiteEditionIds + ','; +end +SET @list = @SiteEditionIds + + set @Status = 0; + BEGIN TRY + BEGIN TRANSACTION + + IF @iSiteId = 0 + BEGIN + INSERT INTO [dbo].[Site]([SiteIP],[Title],[InstituteName],[Department],[Address1],[Address2], + [City],[Zip],[Phone],[StateId],[CountryId],[IsMaster],[CreationDate],[ModifiedDate],[IsActive],[SiteIPTo]) + VALUES(@sSiteIP, @sTitle, @sInstituteName, @sDepartment, @sAddress1, @sAddress2, @sCity, @Zip, @Phone, + @StateId, @CountryId, @IsMaster, @CreationDate, @ModifiedDate, @IsActive, @sSiteIPTo); + -- to get the last inserted identity value in the current session + SET @iSiteId=SCOPE_IDENTITY(); + insert into AIAUserToSite values(@UserId, @iSiteId); + END + ELSE + BEGIN + UPDATE [dbo].[Site] SET [SiteIP]=@sSiteIP, [Title]=@sTitle,[InstituteName]=@sInstituteName, + [Department]=@sDepartment, [Address1]=@sAddress1, [Address2]=@sAddress2,[City]=@sCity, + [Zip]=@Zip, [Phone]=@Phone, [StateId]=@StateId, [CountryId]=@CountryId, + [ModifiedDate]=@ModifiedDate, [IsActive]=@IsActive, [SiteIPTo]=@sSiteIPTo + WHERE [Id]=@iSiteId + END + + insert into #LocalTempTable + select SLE.* from SiteToLicenseEdition SLE inner join LicenseToEdition LE on SLE.LicenseEditionId = LE.Id where + SLE.SiteId = @iSiteId and LicenseId = @LicenseId; + + delete SLE from SiteToLicenseEdition SLE inner join LicenseToEdition LE on SLE.LicenseEditionId = LE.Id where + SLE.SiteId = @iSiteId and LicenseId = @LicenseId; + + set @pos = 0 + set @len = 0 + + WHILE CHARINDEX(',', @list, @pos+1)>0 + BEGIN + set @len = CHARINDEX(',', @list, @pos+1) - @pos; + set @value = SUBSTRING(@list, @pos, @len); + set @tempEditionId = convert(int, @value); + select @tempLicenseEditionId = Id from LicenseToEdition where LicenseId = @LicenseId and EditionId = @tempEditionId; + set @tempModesty = 0; + if(exists(select * from #LocalTempTable where LicenseEditionId = @tempLicenseEditionId and SiteId = @iSiteId)) + begin + select @tempModesty = IsModesty from #LocalTempTable where LicenseEditionId = @tempLicenseEditionId and SiteId = @iSiteId; + end + insert into SiteToLicenseEdition(SiteId, LicenseEditionId, IsModesty) values(@iSiteId, @tempLicenseEditionId, @tempModesty); + set @pos = CHARINDEX(',', @list, @pos+@len) + 1; + END + + COMMIT TRANSACTION + set @Status = 1; + END TRY + BEGIN CATCH + IF @@TRANCOUNT > 0 + ROLLBACK TRANSACTION + END CATCH + +END + +GO +SET QUOTED_IDENTIFIER OFF +GO +SET ANSI_NULLS ON +GO + diff --git a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseBasicSettings.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseBasicSettings.sql new file mode 100644 index 0000000..cd3c0e8 --- /dev/null +++ b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseBasicSettings.sql @@ -0,0 +1,49 @@ +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_UpdateLicenseBasicSettings]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[usp_UpdateLicenseBasicSettings] +GO + +-- ==================================================== +-- Author: Magic Software +-- Create date: 02-Feb-2018 +-- Description: To update a license account basic values +-- ==================================================== +create PROCEDURE [dbo].[usp_UpdateLicenseBasicSettings] + -- Add the parameters for the stored procedure here + @iLicenseId int, @sLicenseeFname varchar(50), @sLicenseeLname varchar(50), + @sInstitutionName varchar(100)='', @sAddress1 varchar(100)='', + @sAddress2 varchar(100)='', @sCity varchar(50)='', @sZip varchar(20)='', @iStateId int, @iCountryId int, + @sPhone varchar(30) = '', @sEmailId varchar(50), + @Status bit out +AS +BEGIN + -- SET NOCOUNT ON added to prevent extra result sets from + -- interfering with SELECT statements. + SET NOCOUNT ON; + + set @Status = 0; + BEGIN TRY + BEGIN TRANSACTION + UPDATE License SET LicenseeFirstName = @sLicenseeFname, LicenseeLastName = @sLicenseeLname, + InstitutionName = @sInstitutionName, Address1 = @sAddress1, Address2 = @sAddress2, EmailId = @sEmailId, + City = @sCity, Zip = @sZip, Phone = @sPhone, StateId = @iStateId, CountryId = @iCountryId + where Id = @iLicenseId; + COMMIT TRANSACTION + set @Status = 1; + END TRY + BEGIN CATCH + IF @@TRANCOUNT > 0 + ROLLBACK TRANSACTION + END CATCH + +END + +GO +SET QUOTED_IDENTIFIER OFF +GO +SET ANSI_NULLS ON +GO diff --git a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseModestySettings.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseModestySettings.sql new file mode 100644 index 0000000..ddd209f --- /dev/null +++ b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseModestySettings.sql @@ -0,0 +1,52 @@ +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_UpdateLicenseModestySettings]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[usp_UpdateLicenseModestySettings] +GO + +-- ==================================================== +-- Author: Magic Software +-- Create date: 05-Feb-2018 +-- Description: To update the modesty settings of a license edition or its site +-- ==================================================== +create PROCEDURE [dbo].[usp_UpdateLicenseModestySettings] + -- Add the parameters for the stored procedure here + @LicenseEditionId int, + @SiteId int, + @IsModesty bit, + @Status bit out +AS +BEGIN + -- SET NOCOUNT ON added to prevent extra result sets from + -- interfering with SELECT statements. + SET NOCOUNT ON; + + set @Status = 0; + BEGIN TRY + BEGIN TRANSACTION + if(@SiteId = 0) + begin + UPDATE LicenseToEdition SET IsModesty = @IsModesty where Id = @LicenseEditionId; + end + else + begin + UPDATE SiteToLicenseEdition SET IsModesty = @IsModesty where SiteId = @SiteId and LicenseEditionId = @LicenseEditionId; + end + COMMIT TRANSACTION + set @Status = 1; + END TRY + BEGIN CATCH + IF @@TRANCOUNT > 0 + ROLLBACK TRANSACTION + END CATCH + +END + +GO +SET QUOTED_IDENTIFIER OFF +GO +SET ANSI_NULLS ON +GO diff --git a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseModuleStatus.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseModuleStatus.sql new file mode 100644 index 0000000..3fdc647 --- /dev/null +++ b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseModuleStatus.sql @@ -0,0 +1,51 @@ +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_UpdateLicenseModuleStatus]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[usp_UpdateLicenseModuleStatus] +GO + +-- ==================================================== +-- Author: Magic Software +-- Create date: 06-Feb-2018 +-- Description: To insert or update the module status on or off for a license +-- ==================================================== +CREATE PROCEDURE [dbo].[usp_UpdateLicenseModuleStatus] + @LicenseId int, + @ModuleId int, + @ModuleStatus bit, + @Status bit out +AS +BEGIN + + -- SET NOCOUNT ON added to prevent extra result sets from + -- interfering with SELECT statements. + SET NOCOUNT ON; + set @Status = 0; + BEGIN TRY + BEGIN TRANSACTION + if(exists(select * from ModuleToLicense where ModuleId = @ModuleId and LicenseId = @LicenseId)) + begin + UPDATE ModuleToLicense SET Status = @ModuleStatus where ModuleId = @ModuleId and LicenseId = @LicenseId; + end + else + begin + insert into ModuleToLicense(LicenseId, ModuleId, Status) values(@LicenseId, @ModuleId, @ModuleStatus); + end + COMMIT TRANSACTION + set @Status = 1; + END TRY + BEGIN CATCH + IF @@TRANCOUNT > 0 + ROLLBACK TRANSACTION + END CATCH + +END + +GO +SET QUOTED_IDENTIFIER OFF +GO +SET ANSI_NULLS ON +GO \ No newline at end of file diff --git a/400-SOURCECODE/Admin/dist/assets/styles/admin-custom.css b/400-SOURCECODE/Admin/dist/assets/styles/admin-custom.css index 739b9b8..803f7fa 100644 --- a/400-SOURCECODE/Admin/dist/assets/styles/admin-custom.css +++ b/400-SOURCECODE/Admin/dist/assets/styles/admin-custom.css @@ -163,4 +163,11 @@ .table-fixed thead { width: calc( 100% - 0em ) } +#fixed_hdr2 > tbody > tr.active > td { + background: #726D6D; + color: #FDFBFB; +} + + + /*30-1-2017*/ diff --git a/400-SOURCECODE/Admin/dist/index.html b/400-SOURCECODE/Admin/dist/index.html index aae9c53..6867edc 100644 --- a/400-SOURCECODE/Admin/dist/index.html +++ b/400-SOURCECODE/Admin/dist/index.html @@ -1,45 +1,7 @@ - - - -
- - - -