From 094ccf159f072ee958578309edc299d846e51ec0 Mon Sep 17 00:00:00 2001 From: harpreet Date: Thu, 15 Feb 2018 10:07:58 +0530 Subject: [PATCH] Aia admin license search, license add, license edit, modesty settings, module settings, basic settings, site account search, site account add, site account edit, user group all screens completed. --- 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/dbo.usp_GetAccountNumber.sql | 33 --------------------------------- 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_DeleteLicenseUserGroup.sql | 43 +++++++++++++++++++++++++++++++++++++++++++ 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_DeleteSiteAccount.sql | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetAccountNumber.sql | 40 ++++++++++++++++++++++++++++++++++++++++ 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenseModestySettings.sql | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenseUserGroups.sql | 39 +++++++++++++++++++++++++++++++++++++++ 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetSiteAccountEditions.sql | 36 ++++++++++++++++++++++++++++++++++++ 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetSiteById.sql | 39 +++++++++++++++++++++++++++++++++++++++ 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_InsertUpdateLicenseUserGroup.sql | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_InsertUpdateSiteAccount.sql | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseModestySettings.sql | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseModuleStatus.sql | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseUserGroupUsers.sql | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj | 16 ++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/SiteController.cs | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs | 2 +- 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserGroupController.cs | 140 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs | 318 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx | 296 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------ 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseModestySettings_Result.cs | 20 ++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroups_Result.cs | 24 ++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountEditions_Result.cs | 20 ++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteById_Result.cs | 38 ++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 400-SOURCECODE/AIAHTML5.ADMIN.API/Models/SiteModel.cs | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserGroupModel.cs | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs | 2 ++ 400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.component.ts | 3 ++- 400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.module.ts | 34 ++++++++++++++++++++++++++++------ 400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.routing.module.ts | 29 +++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/ManageDiscountCode/managediscountcode.component.ts | 36 ++++++++---------------------------- 400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.html | 1 + 400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.ts | 12 ++++++++---- 34 files changed, 2130 insertions(+), 120 deletions(-) delete mode 100644 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/dbo.usp_GetAccountNumber.sql create mode 100644 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_DeleteLicenseUserGroup.sql create mode 100644 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_DeleteSiteAccount.sql create mode 100644 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetAccountNumber.sql create mode 100644 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenseModestySettings.sql create mode 100644 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenseUserGroups.sql create mode 100644 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetSiteAccountEditions.sql create mode 100644 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetSiteById.sql create mode 100644 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_InsertUpdateLicenseUserGroup.sql create mode 100644 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_InsertUpdateSiteAccount.sql create mode 100644 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseModestySettings.sql create mode 100644 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseModuleStatus.sql create mode 100644 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseUserGroupUsers.sql create mode 100644 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/SiteController.cs create mode 100644 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserGroupController.cs create mode 100644 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseModestySettings_Result.cs create mode 100644 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroups_Result.cs create mode 100644 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountEditions_Result.cs create mode 100644 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteById_Result.cs create mode 100644 400-SOURCECODE/AIAHTML5.ADMIN.API/Models/SiteModel.cs create mode 100644 400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserGroupModel.cs diff --git a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/dbo.usp_GetAccountNumber.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/dbo.usp_GetAccountNumber.sql deleted file mode 100644 index d99b494..0000000 --- a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/dbo.usp_GetAccountNumber.sql +++ /dev/null @@ -1,33 +0,0 @@ -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 details of all discounts --- ==================================================== -CREATE PROCEDURE [dbo].[usp_GetAccountNumber] - -- Add the parameters for the stored procedure here - -AS -BEGIN - -- SET NOCOUNT ON added to prevent extra result sets from - -- interfering with SELECT statements. - SET NOCOUNT ON; - SELECT License.Id,License.AccountNumber FROM License -INNER JOIN LicenseType ON LicenseType.Id = License.LicenseTypeId -WHERE License.IsActive = 1 -END - -GO -SET QUOTED_IDENTIFIER OFF -GO -SET ANSI_NULLS ON -GO - diff --git a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_DeleteLicenseUserGroup.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_DeleteLicenseUserGroup.sql new file mode 100644 index 0000000..194927e --- /dev/null +++ b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_DeleteLicenseUserGroup.sql @@ -0,0 +1,43 @@ +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_DeleteLicenseUserGroup]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[usp_DeleteLicenseUserGroup] +GO + +-- ==================================================== +-- Author: Magic Software +-- Create date: 14-Feb-2018 +-- Description: To insert or update a user group users of a license +-- ==================================================== +create PROCEDURE [dbo].[usp_DeleteLicenseUserGroup] + -- Add the parameters for the stored procedure here + @UserGroupId int, @Status bit out +AS +BEGIN +SET NOCOUNT ON; + + set @Status = 0; + BEGIN TRY + BEGIN TRANSACTION + + delete from UserGroupToAIAUser where UserGroupId = @UserGroupId; + delete from UserGroup where Id = @UserGroupId; + + 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/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_GetLicenseUserGroups.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenseUserGroups.sql new file mode 100644 index 0000000..dd827a2 --- /dev/null +++ b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_GetLicenseUserGroups.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_GetLicenseUserGroups]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[usp_GetLicenseUserGroups] +GO + +-- ==================================================== +-- Author: Magic Software +-- Create date: 09-Feb-2018 +-- Description: To get all user groups of a license +-- ==================================================== +create PROCEDURE [dbo].[usp_GetLicenseUserGroups] + -- Add the parameters for the stored procedure here + @LicenseId int +AS +BEGIN + -- SET NOCOUNT ON added to prevent extra result sets from + -- interfering with SELECT statements. + SET NOCOUNT ON; + + -- Insert statements for procedure here + select UG.*, UGU.TotalUsers from UserGroup UG left outer join + (select count(*) as TotalUsers, UserGroupId from UserGroupToAIAUser + group by UserGroupId) UGU on UG.Id = UGU.UserGroupId where UG.LicenseId = @LicenseId; + +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_InsertUpdateLicenseUserGroup.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_InsertUpdateLicenseUserGroup.sql new file mode 100644 index 0000000..5f216a3 --- /dev/null +++ b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_InsertUpdateLicenseUserGroup.sql @@ -0,0 +1,47 @@ +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_InsertUpdateLicenseUserGroup]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[usp_InsertUpdateLicenseUserGroup] +GO + +-- ==================================================== +-- Author: Magic Software +-- Create date: 12-Feb-2018 +-- Description: To insert or update a user group of a license +-- ==================================================== +create PROCEDURE [dbo].[usp_InsertUpdateLicenseUserGroup] + -- Add the parameters for the stored procedure here + @Id int, @LicenseId int, @Title varchar(100), @CreationDate datetime, @ModifiedDate datetime, @IsActive bit, @Status bit out +AS +BEGIN + + SET NOCOUNT ON; + set @Status = 0; + BEGIN TRY + BEGIN TRANSACTION + if(@Id = 0) + begin + insert into UserGroup(LicenseId, Title, CreationDate, ModifiedDate, IsActive) values(@LicenseId, @Title, @CreationDate, @ModifiedDate, @IsActive); + end + else + begin + update UserGroup set Title = @Title, CreationDate = @CreationDate, ModifiedDate = @ModifiedDate, @IsActive = @IsActive where Id = @Id; + 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/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_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/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseUserGroupUsers.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseUserGroupUsers.sql new file mode 100644 index 0000000..8797db8 --- /dev/null +++ b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/usp_UpdateLicenseUserGroupUsers.sql @@ -0,0 +1,63 @@ +SET QUOTED_IDENTIFIER ON +GO +SET ANSI_NULLS ON +GO + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_UpdateLicenseUserGroupUsers]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[usp_UpdateLicenseUserGroupUsers] +GO + +-- ==================================================== +-- Author: Magic Software +-- Create date: 14-Feb-2018 +-- Description: To insert or update a user group users of a license +-- ==================================================== +create PROCEDURE [dbo].[usp_UpdateLicenseUserGroupUsers] + -- Add the parameters for the stored procedure here + @UserGroupId int, @UserIds varchar(2000), @Status bit out +AS +BEGIN +SET NOCOUNT ON; + +DECLARE @pos INT, @tempUserId int; +DECLARE @len INT; +DECLARE @value varchar(10); + +if(@UserIds != '') +begin + set @UserIds = @UserIds + ','; +end + + set @Status = 0; + BEGIN TRY + BEGIN TRANSACTION + + delete UGU from UserGroupToAIAUser UGU where UserGroupId = @UserGroupId; + + set @pos = 0 + set @len = 0 + + WHILE CHARINDEX(',', @UserIds, @pos+1)>0 + BEGIN + set @len = CHARINDEX(',', @UserIds, @pos+1) - @pos; + set @value = SUBSTRING(@UserIds, @pos, @len); + set @tempUserId = convert(int, @value); + insert into UserGroupToAIAUser(UserGroupId, UserId) values(@UserGroupId, @tempUserId); + set @pos = CHARINDEX(',', @UserIds, @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 \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj b/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj index 6eb2626..ebb6f8f 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj @@ -156,6 +156,8 @@ + + @@ -697,12 +699,18 @@ AIADBEntity.tt + + AIADBEntity.tt + AIADBEntity.tt AIADBEntity.tt + + AIADBEntity.tt + AIADBEntity.tt @@ -712,6 +720,12 @@ AIADBEntity.tt + + AIADBEntity.tt + + + AIADBEntity.tt + AIADBEntity.tt @@ -744,6 +758,8 @@ + + diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs index f8fd3eb..0d4ef17 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs @@ -217,12 +217,12 @@ namespace AIAHTML5.ADMIN.API.Controllers [Route("LicenseAccounts")] [HttpGet] - public HttpResponseMessage GetLicenseAccounts() + public HttpResponseMessage GetLicenseAccounts(int LicenseType) { List> LicenseAccountList = new List>(); try { - LicenseAccountList = LicenseModel.GetLicenseAccounts(dbContext); + LicenseAccountList = LicenseModel.GetLicenseAccounts(dbContext, LicenseType); return Request.CreateResponse(HttpStatusCode.OK, LicenseAccountList); } catch (Exception ex) @@ -232,6 +232,40 @@ namespace AIAHTML5.ADMIN.API.Controllers } } + [Route("LicenseSites")] + [HttpGet] + public HttpResponseMessage GetLicenseAccounts(string AccountNo) + { + List LicenseSiteList = new List(); + try + { + LicenseSiteList = LicenseModel.GetLicenseSites(dbContext, AccountNo); + return Request.CreateResponse(HttpStatusCode.OK, LicenseSiteList); + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + + [Route("LicenseModestySettings")] + [HttpGet] + public HttpResponseMessage GetLicenseModestySettings(int LicenseId, int BuildingLevelId) + { + List> LicenseModestyList = new List>(); + try + { + LicenseModestyList = LicenseModel.GetLicenseModestySettings(dbContext, LicenseId, BuildingLevelId); + return Request.CreateResponse(HttpStatusCode.OK, LicenseModestyList); + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + [Route("UpdateLicenseBasicSettings")] [HttpPost] public HttpResponseMessage UpdateLicenseBasicSettings(JObject jsonData) @@ -270,5 +304,90 @@ namespace AIAHTML5.ADMIN.API.Controllers } } + [Route("UpdateLicenseModestySettings")] + [HttpPost] + public HttpResponseMessage UpdateLicenseModestySettings(JObject jsonData) + { + bool Status = false; + List> LicenseModestyList = new List>(); + Tuple LicenseModesty; + for (int i = 0; i < jsonData["obj"].Count(); i++) + { + LicenseModesty = new Tuple( + ((Newtonsoft.Json.Linq.JValue)(jsonData["obj"][i]["licenseEditionId"])).Value(), + ((Newtonsoft.Json.Linq.JValue)(jsonData["obj"][i]["siteId"])).Value(), + ((Newtonsoft.Json.Linq.JValue)(jsonData["obj"][i]["isModesty"])).Value()); + LicenseModestyList.Add(LicenseModesty); + } + try + { + Status = LicenseModel.UpdateLicenseModestySettings(dbContext, LicenseModestyList); + if (Status) + { + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); + } + else + { + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); + } + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + + [Route("LicenseModulesStatus")] + [HttpGet] + public HttpResponseMessage GetLicenseModulesStatus(int LicenseId) + { + List> LicenseModulesStatusList = new List>(); + try + { + LicenseModulesStatusList = LicenseModel.GetLicenseModulesStatus(dbContext, LicenseId); + return Request.CreateResponse(HttpStatusCode.OK, LicenseModulesStatusList); + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + + [Route("UpdateLicenseModulesStatus")] + [HttpPost] + public HttpResponseMessage UpdateLicenseModulesStatus(JObject jsonData) + { + bool Status = false; + List> LicenseModuleStatusList = new List>(); + Tuple LicenseModuleStatus; + for (int i = 0; i < jsonData["obj"].Count(); i++) + { + LicenseModuleStatus = new Tuple( + ((Newtonsoft.Json.Linq.JValue)(jsonData["obj"][i]["licenseId"])).Value(), + ((Newtonsoft.Json.Linq.JValue)(jsonData["obj"][i]["moduleId"])).Value(), + ((Newtonsoft.Json.Linq.JValue)(jsonData["obj"][i]["status"])).Value()); + LicenseModuleStatusList.Add(LicenseModuleStatus); + } + try + { + Status = LicenseModel.UpdateLicenseModulesStatus(dbContext, LicenseModuleStatusList); + if (Status) + { + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); + } + else + { + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); + } + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/SiteController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/SiteController.cs new file mode 100644 index 0000000..666c108 --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/SiteController.cs @@ -0,0 +1,136 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using AIAHTML5.ADMIN.API.Models; +using System.Web.Http.Cors; +using System.Web.Cors; +using AIAHTML5.Server.Constants; +using log4net; +using System.Text; +using AIAHTML5.ADMIN.API.Entity; + +namespace AIAHTML5.ADMIN.API.Controllers +{ + [EnableCors(origins: "http://localhost:4200", headers: "*", methods: "*")] + [RoutePrefix("Site")] + public class SiteController : ApiController + { + AIADatabaseV5Entities dbContext = new AIADatabaseV5Entities(); + + [Route("SiteDetail")] + [HttpGet] + public HttpResponseMessage GetSiteById(int SiteId) + { + SiteModel SiteEntity = new SiteModel(); + try + { + SiteEntity = SiteModel.GetSiteById(dbContext, SiteId); + return Request.CreateResponse(HttpStatusCode.OK, SiteEntity); + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + + [Route("SiteAccountEditions")] + [HttpGet] + public HttpResponseMessage GetSiteAccountEditions(int SiteId, int LicenseId) + { + List> SiteAccountEditionList = new List>(); + try + { + SiteAccountEditionList = SiteModel.GetSiteAccountEditions(dbContext, SiteId, LicenseId); + return Request.CreateResponse(HttpStatusCode.OK, SiteAccountEditionList); + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + + [Route("InsertUpdateSiteAccount")] + [HttpPost] + public HttpResponseMessage InsertUpdateSiteAccount(JObject jsonData) + { + bool Status = false; + SiteModel SiteEntity = new SiteModel(); + SiteEntity.LicenseId = jsonData["licenseId"].Value(); + SiteEntity.Id = jsonData["siteId"].Value(); + SiteEntity.Title = jsonData["title"].Value(); + SiteEntity.Ip = jsonData["siteUrl"].Value(); + SiteEntity.SiteIpTo = jsonData["siteUrlTo"].Value(); + SiteEntity.MasterIpTo = jsonData["siteMasterUrlTo"].Value(); + SiteEntity.InstituteName = jsonData["institutionName"].Value(); + SiteEntity.Department = jsonData["departmentName"].Value(); + SiteEntity.Address1 = jsonData["address1"].Value(); + SiteEntity.Address2 = jsonData["address2"].Value(); + SiteEntity.City = jsonData["city"].Value(); + SiteEntity.Phone = jsonData["phone"].Value(); + SiteEntity.Zip = jsonData["zip"].Value(); + SiteEntity.CountryId = jsonData["countryId"].Value(); + SiteEntity.StateId = jsonData["stateId"].Value(); + SiteEntity.SiteUserId = jsonData["userId"].Value(); + SiteEntity.IsActive = jsonData["isActive"].Value(); + SiteEntity.IsMaster = jsonData["isMaster"].Value(); + SiteEntity.SiteEditionIds = jsonData["siteEditionIds"].Value(); + SiteEntity.CreationDate = jsonData["creationDate"].Value(); + SiteEntity.ModifiedDate = jsonData["modifiedDate"].Value(); + try + { + Status = SiteModel.InsertUpdateSiteAccount(dbContext, SiteEntity); + if (Status) + { + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); + } + else + { + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); + } + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + + [Route("DeleteSiteAccount")] + [HttpGet] + public HttpResponseMessage DeleteSiteAccount(int SiteId, int LicenseId, int UserId) + { + bool Status = false; + try + { + Status = SiteModel.DeleteSiteAccount(dbContext, SiteId, LicenseId, UserId); + if (Status) + { + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); + } + else + { + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); + } + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + + protected HttpResponseMessage ToJson(dynamic obj) + { + var response = Request.CreateResponse(HttpStatusCode.OK); + response.Content = new StringContent(JsonConvert.SerializeObject(obj), Encoding.UTF8, "application/jsonP"); + return response; + } + } +} diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs index fb7d917..a6421ff 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs @@ -171,7 +171,7 @@ namespace AIAHTML5.ADMIN.API.Controllers { dbContext.Configuration.ProxyCreationEnabled = false; List AccountNumberList = new List(); - var AccountNumberEntity = dbContext.usp_GetAccountNumber().ToList(); + var AccountNumberEntity = dbContext.usp_GetAccountNumber(0).ToList(); AccountNumberList = AccountNumberEntity.Select(l => new usp_GetAccountNumber_Result() { Id = l.Id, AccountNumber = l.AccountNumber }).ToList(); //userTypelist.Insert(0, new UserType { Id = 0, Title = "All" }); return Ok(AccountNumberList); diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserGroupController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserGroupController.cs new file mode 100644 index 0000000..c4c2cd5 --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserGroupController.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Web.Http; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using AIAHTML5.ADMIN.API.Models; +using System.Web.Http.Cors; +using System.Web.Cors; +using AIAHTML5.Server.Constants; +using log4net; +using System.Text; +using AIAHTML5.ADMIN.API.Entity; + +namespace AIAHTML5.ADMIN.API.Controllers +{ + [EnableCors(origins: "http://localhost:4200", headers: "*", methods: "*")] + [RoutePrefix("UserGroup")] + public class UserGroupController : ApiController + { + AIADatabaseV5Entities dbContext = new AIADatabaseV5Entities(); + + [Route("LicenseUserGroups")] + [HttpGet] + public HttpResponseMessage GetLicenseUserGroups(int LicenseId) + { + List UserGroupList = new List(); + try + { + UserGroupList = UserGroupModel.GetLicenseUserGroups(dbContext, LicenseId); + return Request.CreateResponse(HttpStatusCode.OK, UserGroupList); + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + + [Route("LicenseUserGroupUsers")] + [HttpGet] + public HttpResponseMessage GetLicenseUserGroupUsers(int LicenseId, int UserGroupId) + { + List UserList = new List(); + try + { + UserList = UserGroupModel.GetLicenseUserGroupUsers(dbContext, LicenseId, UserGroupId); + return Request.CreateResponse(HttpStatusCode.OK, UserList); + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + + [Route("InsertUpdateLicenseUserGroup")] + [HttpPost] + public HttpResponseMessage InsertUpdateLicenseUserGroup(JObject jsonData) + { + bool Status = false; + UserGroupModel UserGroupEntity = new UserGroupModel(); + UserGroupEntity.Id = jsonData["id"].Value(); + UserGroupEntity.LicenseId = jsonData["licenseId"].Value(); + UserGroupEntity.Title = jsonData["title"].Value(); + UserGroupEntity.IsActive = jsonData["isActive"].Value(); + UserGroupEntity.CreationDate = jsonData["creationDate"].Value(); + UserGroupEntity.ModifiedDate = jsonData["modifiedDate"].Value(); + try + { + Status = UserGroupModel.InsertUpdateLicenseUserGroup(dbContext, UserGroupEntity); + if (Status) + { + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); + } + else + { + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); + } + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + + [Route("UpdateLicenseUserGroupUsers")] + [HttpPost] + public HttpResponseMessage UpdateLicenseUserGroupUsers(JObject jsonData) + { + bool Status = false; + int UserGroupId = jsonData["userGroupId"].Value(); + string UserIds = jsonData["userIds"].Value(); + try + { + Status = UserGroupModel.UpdateLicenseUserGroupUsers(dbContext, UserGroupId, UserIds); + if (Status) + { + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); + } + else + { + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); + } + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + + [Route("DeleteLicenseUserGroup")] + [HttpGet] + public HttpResponseMessage DeleteLicenseUserGroup(int UserGroupId) + { + bool Status = false; + try + { + Status = UserGroupModel.DeleteLicenseUserGroup(dbContext, UserGroupId); + if (Status) + { + return Request.CreateResponse(HttpStatusCode.OK, Status.ToString()); + } + else + { + return Request.CreateErrorResponse(HttpStatusCode.BadRequest, Status.ToString()); + } + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + } +} diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs index 7760737..5da2af0 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs @@ -2880,9 +2880,13 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_DeleteSubscriptionPlan", idParameter, status); } - public virtual ObjectResult usp_GetAccountNumber() + public virtual ObjectResult usp_GetAccountNumber(Nullable licenseType) { - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetAccountNumber"); + var licenseTypeParameter = licenseType.HasValue ? + new ObjectParameter("LicenseType", licenseType) : + new ObjectParameter("LicenseType", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetAccountNumber", licenseTypeParameter); } public virtual ObjectResult usp_GetAccountTypeList(Nullable id) @@ -2921,35 +2925,6 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetUserType", idParameter); } - public virtual int usp_InsertSubscriptionPlan(Nullable id, string title, Nullable price, Nullable duration, Nullable editionId, Nullable isActive, ObjectParameter status) - { - var idParameter = id.HasValue ? - new ObjectParameter("Id", id) : - new ObjectParameter("Id", typeof(byte)); - - var titleParameter = title != null ? - new ObjectParameter("Title", title) : - new ObjectParameter("Title", typeof(string)); - - var priceParameter = price.HasValue ? - new ObjectParameter("Price", price) : - new ObjectParameter("Price", typeof(decimal)); - - var durationParameter = duration.HasValue ? - new ObjectParameter("Duration", duration) : - new ObjectParameter("Duration", typeof(byte)); - - var editionIdParameter = editionId.HasValue ? - new ObjectParameter("EditionId", editionId) : - new ObjectParameter("EditionId", typeof(byte)); - - var isActiveParameter = isActive.HasValue ? - new ObjectParameter("IsActive", isActive) : - new ObjectParameter("IsActive", typeof(bool)); - - return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_InsertSubscriptionPlan", idParameter, titleParameter, priceParameter, durationParameter, editionIdParameter, isActiveParameter, status); - } - public virtual int usp_UpdateSubscriptionPlan(Nullable id, string title, Nullable price, Nullable duration, Nullable editionId, Nullable isActive, ObjectParameter status) { var idParameter = id.HasValue ? @@ -3257,5 +3232,286 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseBasicSettings", iLicenseIdParameter, sLicenseeFnameParameter, sLicenseeLnameParameter, sInstitutionNameParameter, sAddress1Parameter, sAddress2Parameter, sCityParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, sPhoneParameter, sEmailIdParameter, status); } + + public virtual ObjectResult usp_GetLicenseModestySettings(Nullable iLicenseId, Nullable iBuildingLevelId) + { + var iLicenseIdParameter = iLicenseId.HasValue ? + new ObjectParameter("iLicenseId", iLicenseId) : + new ObjectParameter("iLicenseId", typeof(int)); + + var iBuildingLevelIdParameter = iBuildingLevelId.HasValue ? + new ObjectParameter("iBuildingLevelId", iBuildingLevelId) : + new ObjectParameter("iBuildingLevelId", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenseModestySettings", iLicenseIdParameter, iBuildingLevelIdParameter); + } + + public virtual int usp_UpdateLicenseModestySettings(Nullable licenseEditionId, Nullable siteId, Nullable isModesty, ObjectParameter status) + { + var licenseEditionIdParameter = licenseEditionId.HasValue ? + new ObjectParameter("LicenseEditionId", licenseEditionId) : + new ObjectParameter("LicenseEditionId", typeof(int)); + + var siteIdParameter = siteId.HasValue ? + new ObjectParameter("SiteId", siteId) : + new ObjectParameter("SiteId", typeof(int)); + + var isModestyParameter = isModesty.HasValue ? + new ObjectParameter("IsModesty", isModesty) : + new ObjectParameter("IsModesty", typeof(bool)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseModestySettings", licenseEditionIdParameter, siteIdParameter, isModestyParameter, status); + } + + public virtual int usp_UpdateLicenseModuleStatus(Nullable licenseId, Nullable moduleId, Nullable moduleStatus, ObjectParameter status) + { + var licenseIdParameter = licenseId.HasValue ? + new ObjectParameter("LicenseId", licenseId) : + new ObjectParameter("LicenseId", typeof(int)); + + var moduleIdParameter = moduleId.HasValue ? + new ObjectParameter("ModuleId", moduleId) : + new ObjectParameter("ModuleId", typeof(int)); + + var moduleStatusParameter = moduleStatus.HasValue ? + new ObjectParameter("ModuleStatus", moduleStatus) : + new ObjectParameter("ModuleStatus", typeof(bool)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseModuleStatus", licenseIdParameter, moduleIdParameter, moduleStatusParameter, status); + } + + public virtual ObjectResult usp_GetSiteById(Nullable siteId) + { + var siteIdParameter = siteId.HasValue ? + new ObjectParameter("SiteId", siteId) : + new ObjectParameter("SiteId", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteById", siteIdParameter); + } + + public virtual ObjectResult usp_GetSiteAccountEditions(Nullable siteId, Nullable licenseId) + { + var siteIdParameter = siteId.HasValue ? + new ObjectParameter("SiteId", siteId) : + new ObjectParameter("SiteId", typeof(int)); + + var licenseIdParameter = licenseId.HasValue ? + new ObjectParameter("LicenseId", licenseId) : + new ObjectParameter("LicenseId", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteAccountEditions", siteIdParameter, licenseIdParameter); + } + + public virtual int usp_DeleteSiteAccount(Nullable iSiteId, Nullable licenseId, Nullable userId, ObjectParameter status) + { + var iSiteIdParameter = iSiteId.HasValue ? + new ObjectParameter("iSiteId", iSiteId) : + new ObjectParameter("iSiteId", typeof(int)); + + var licenseIdParameter = licenseId.HasValue ? + new ObjectParameter("LicenseId", licenseId) : + new ObjectParameter("LicenseId", typeof(int)); + + var userIdParameter = userId.HasValue ? + new ObjectParameter("UserId", userId) : + new ObjectParameter("UserId", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_DeleteSiteAccount", iSiteIdParameter, licenseIdParameter, userIdParameter, status); + } + + public virtual int usp_InsertSubscriptionPlan(Nullable id, string title, Nullable price, Nullable duration, Nullable editionId, Nullable isActive, ObjectParameter status) + { + var idParameter = id.HasValue ? + new ObjectParameter("Id", id) : + new ObjectParameter("Id", typeof(byte)); + + var titleParameter = title != null ? + new ObjectParameter("Title", title) : + new ObjectParameter("Title", typeof(string)); + + var priceParameter = price.HasValue ? + new ObjectParameter("Price", price) : + new ObjectParameter("Price", typeof(decimal)); + + var durationParameter = duration.HasValue ? + new ObjectParameter("Duration", duration) : + new ObjectParameter("Duration", typeof(byte)); + + var editionIdParameter = editionId.HasValue ? + new ObjectParameter("EditionId", editionId) : + new ObjectParameter("EditionId", typeof(byte)); + + var isActiveParameter = isActive.HasValue ? + new ObjectParameter("IsActive", isActive) : + new ObjectParameter("IsActive", typeof(bool)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_InsertSubscriptionPlan", idParameter, titleParameter, priceParameter, durationParameter, editionIdParameter, isActiveParameter, status); + } + + public virtual int usp_InsertUpdateSiteAccount(Nullable iSiteId, string sSiteIP, string sTitle, string sInstituteName, string sDepartment, string sAddress1, string sAddress2, string sCity, string zip, string phone, Nullable stateId, Nullable countryId, Nullable isMaster, Nullable creationDate, Nullable modifiedDate, Nullable isActive, Nullable userId, string sSiteIPTo, Nullable licenseId, string siteEditionIds, ObjectParameter status) + { + var iSiteIdParameter = iSiteId.HasValue ? + new ObjectParameter("iSiteId", iSiteId) : + new ObjectParameter("iSiteId", typeof(int)); + + var sSiteIPParameter = sSiteIP != null ? + new ObjectParameter("sSiteIP", sSiteIP) : + new ObjectParameter("sSiteIP", typeof(string)); + + var sTitleParameter = sTitle != null ? + new ObjectParameter("sTitle", sTitle) : + new ObjectParameter("sTitle", typeof(string)); + + var sInstituteNameParameter = sInstituteName != null ? + new ObjectParameter("sInstituteName", sInstituteName) : + new ObjectParameter("sInstituteName", typeof(string)); + + var sDepartmentParameter = sDepartment != null ? + new ObjectParameter("sDepartment", sDepartment) : + new ObjectParameter("sDepartment", typeof(string)); + + var sAddress1Parameter = sAddress1 != null ? + new ObjectParameter("sAddress1", sAddress1) : + new ObjectParameter("sAddress1", typeof(string)); + + var sAddress2Parameter = sAddress2 != null ? + new ObjectParameter("sAddress2", sAddress2) : + new ObjectParameter("sAddress2", typeof(string)); + + var sCityParameter = sCity != null ? + new ObjectParameter("sCity", sCity) : + new ObjectParameter("sCity", typeof(string)); + + var zipParameter = zip != null ? + new ObjectParameter("Zip", zip) : + new ObjectParameter("Zip", typeof(string)); + + var phoneParameter = phone != null ? + new ObjectParameter("Phone", phone) : + new ObjectParameter("Phone", typeof(string)); + + var stateIdParameter = stateId.HasValue ? + new ObjectParameter("StateId", stateId) : + new ObjectParameter("StateId", typeof(int)); + + var countryIdParameter = countryId.HasValue ? + new ObjectParameter("CountryId", countryId) : + new ObjectParameter("CountryId", typeof(int)); + + var isMasterParameter = isMaster.HasValue ? + new ObjectParameter("IsMaster", isMaster) : + new ObjectParameter("IsMaster", typeof(bool)); + + var creationDateParameter = creationDate.HasValue ? + new ObjectParameter("CreationDate", creationDate) : + new ObjectParameter("CreationDate", typeof(System.DateTime)); + + var modifiedDateParameter = modifiedDate.HasValue ? + new ObjectParameter("ModifiedDate", modifiedDate) : + new ObjectParameter("ModifiedDate", typeof(System.DateTime)); + + var isActiveParameter = isActive.HasValue ? + new ObjectParameter("IsActive", isActive) : + new ObjectParameter("IsActive", typeof(bool)); + + var userIdParameter = userId.HasValue ? + new ObjectParameter("UserId", userId) : + new ObjectParameter("UserId", typeof(int)); + + var sSiteIPToParameter = sSiteIPTo != null ? + new ObjectParameter("sSiteIPTo", sSiteIPTo) : + new ObjectParameter("sSiteIPTo", typeof(string)); + + var licenseIdParameter = licenseId.HasValue ? + new ObjectParameter("LicenseId", licenseId) : + new ObjectParameter("LicenseId", typeof(int)); + + var siteEditionIdsParameter = siteEditionIds != null ? + new ObjectParameter("SiteEditionIds", siteEditionIds) : + new ObjectParameter("SiteEditionIds", typeof(string)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_InsertUpdateSiteAccount", iSiteIdParameter, sSiteIPParameter, sTitleParameter, sInstituteNameParameter, sDepartmentParameter, sAddress1Parameter, sAddress2Parameter, sCityParameter, zipParameter, phoneParameter, stateIdParameter, countryIdParameter, isMasterParameter, creationDateParameter, modifiedDateParameter, isActiveParameter, userIdParameter, sSiteIPToParameter, licenseIdParameter, siteEditionIdsParameter, status); + } + + public virtual ObjectResult usp_GetLicenseUserGroups(Nullable licenseId) + { + var licenseIdParameter = licenseId.HasValue ? + new ObjectParameter("LicenseId", licenseId) : + new ObjectParameter("LicenseId", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetLicenseUserGroups", licenseIdParameter); + } + + public virtual int usp_InsertUpdateLicenseUserGroup(Nullable id, Nullable licenseId, string title, Nullable creationDate, Nullable modifiedDate, Nullable isActive, ObjectParameter status) + { + var idParameter = id.HasValue ? + new ObjectParameter("Id", id) : + new ObjectParameter("Id", typeof(int)); + + var licenseIdParameter = licenseId.HasValue ? + new ObjectParameter("LicenseId", licenseId) : + new ObjectParameter("LicenseId", typeof(int)); + + var titleParameter = title != null ? + new ObjectParameter("Title", title) : + new ObjectParameter("Title", typeof(string)); + + var creationDateParameter = creationDate.HasValue ? + new ObjectParameter("CreationDate", creationDate) : + new ObjectParameter("CreationDate", typeof(System.DateTime)); + + var modifiedDateParameter = modifiedDate.HasValue ? + new ObjectParameter("ModifiedDate", modifiedDate) : + new ObjectParameter("ModifiedDate", typeof(System.DateTime)); + + var isActiveParameter = isActive.HasValue ? + new ObjectParameter("IsActive", isActive) : + new ObjectParameter("IsActive", typeof(bool)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_InsertUpdateLicenseUserGroup", idParameter, licenseIdParameter, titleParameter, creationDateParameter, modifiedDateParameter, isActiveParameter, status); + } + + public virtual int usp_InsertDeleteUserManageRights(string roleName, Nullable activityId, Nullable userId, string requestType, ObjectParameter status) + { + var roleNameParameter = roleName != null ? + new ObjectParameter("RoleName", roleName) : + new ObjectParameter("RoleName", typeof(string)); + + var activityIdParameter = activityId.HasValue ? + new ObjectParameter("ActivityId", activityId) : + new ObjectParameter("ActivityId", typeof(int)); + + var userIdParameter = userId.HasValue ? + new ObjectParameter("UserId", userId) : + new ObjectParameter("UserId", typeof(int)); + + var requestTypeParameter = requestType != null ? + new ObjectParameter("RequestType", requestType) : + new ObjectParameter("RequestType", typeof(string)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_InsertDeleteUserManageRights", roleNameParameter, activityIdParameter, userIdParameter, requestTypeParameter, status); + } + + public virtual int usp_UpdateLicenseUserGroupUsers(Nullable userGroupId, string userIds, ObjectParameter status) + { + var userGroupIdParameter = userGroupId.HasValue ? + new ObjectParameter("UserGroupId", userGroupId) : + new ObjectParameter("UserGroupId", typeof(int)); + + var userIdsParameter = userIds != null ? + new ObjectParameter("UserIds", userIds) : + new ObjectParameter("UserIds", typeof(string)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseUserGroupUsers", userGroupIdParameter, userIdsParameter, status); + } + + public virtual int usp_DeleteLicenseUserGroup(Nullable userGroupId, ObjectParameter status) + { + var userGroupIdParameter = userGroupId.HasValue ? + new ObjectParameter("UserGroupId", userGroupId) : + new ObjectParameter("UserGroupId", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_DeleteLicenseUserGroup", userGroupIdParameter, status); + } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx index 72c08eb..67cc317 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx @@ -2616,11 +2616,23 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + + + + + + + + - + + + @@ -2628,6 +2640,10 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + + @@ -2642,6 +2658,9 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + @@ -2658,6 +2677,13 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + + + + + @@ -2678,6 +2704,13 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + + + + + @@ -2687,6 +2720,38 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2717,6 +2782,23 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + + + + + + + + + + + + + + + @@ -6156,7 +6238,9 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] - + + + @@ -6169,15 +6253,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] - - - - - - - - - @@ -6268,6 +6343,95 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7180,6 +7344,48 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -9516,7 +9722,6 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] - @@ -9641,6 +9846,73 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseModestySettings_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseModestySettings_Result.cs new file mode 100644 index 0000000..43ea5ed --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseModestySettings_Result.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AIAHTML5.ADMIN.API.Entity +{ + using System; + + public partial class usp_GetLicenseModestySettings_Result + { + public string Title { get; set; } + public Nullable IsModesty { get; set; } + public int LicenseEditionId { get; set; } + } +} diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroups_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroups_Result.cs new file mode 100644 index 0000000..4e88bff --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseUserGroups_Result.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AIAHTML5.ADMIN.API.Entity +{ + using System; + + public partial class usp_GetLicenseUserGroups_Result + { + public int Id { get; set; } + public string Title { get; set; } + public int LicenseId { get; set; } + public System.DateTime CreationDate { get; set; } + public Nullable ModifiedDate { get; set; } + public bool IsActive { get; set; } + public Nullable TotalUsers { get; set; } + } +} diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountEditions_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountEditions_Result.cs new file mode 100644 index 0000000..80b4bc9 --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountEditions_Result.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AIAHTML5.ADMIN.API.Entity +{ + using System; + + public partial class usp_GetSiteAccountEditions_Result + { + public int LicenseEditionId { get; set; } + public byte Id { get; set; } + public string Title { get; set; } + } +} diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteById_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteById_Result.cs new file mode 100644 index 0000000..2811cf3 --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteById_Result.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AIAHTML5.ADMIN.API.Entity +{ + using System; + + public partial class usp_GetSiteById_Result + { + public int Id { get; set; } + public string SiteIp { get; set; } + public string Title { get; set; } + public string SiteIPTo { get; set; } + public string SiteMasterIPTo { get; set; } + public string Address1 { get; set; } + public string Address2 { get; set; } + public string Zip { get; set; } + public string Phone { get; set; } + public string City { get; set; } + public Nullable StateId { get; set; } + public Nullable CountryId { get; set; } + public bool IsMaster { get; set; } + public string CreationDate { get; set; } + public string ModifiedDate { get; set; } + public string InstituteName { get; set; } + public string Department { get; set; } + public int UserId { get; set; } + public string FirstName { get; set; } + public string EmailId { get; set; } + public Nullable IsActive { get; set; } + } +} diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs index f320284..7c90749 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; using System.Linq; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; using System.Web; using AIAHTML5.ADMIN.API.Entity; @@ -104,14 +106,14 @@ namespace AIAHTML5.ADMIN.API.Models return LicenseList; } - public static List> GetLicenseAccounts(AIADatabaseV5Entities dbContext) + public static List> GetLicenseAccounts(AIADatabaseV5Entities dbContext, int LicenseType) { List> LicenseAccountList = new List>(); Tuple LicenseAccountObj; int i = 0; try { - var result = dbContext.usp_GetAccountNumber().ToList(); + var result = dbContext.usp_GetAccountNumber(LicenseType).ToList(); if (result.Count > 0) { foreach (var item in result) @@ -174,6 +176,61 @@ namespace AIAHTML5.ADMIN.API.Models return LicenseObj; } + public static List GetLicenseSites(AIADatabaseV5Entities dbContext, string AccountNo) + { + List LicenseSiteList = new List(); + SiteModel SiteModelObj = new SiteModel(); + try + { + var result = dbContext.GetSiteAccoutDetail(AccountNo).ToList(); + if (result.Count > 0) + { + foreach (var item in result) + { + SiteModelObj = new SiteModel(); + SiteModelObj.Id = item.Id; + SiteModelObj.Ip = item.SiteIp; + SiteModelObj.SiteIpTo = item.SiteIPTo; + SiteModelObj.MasterIpTo = item.SiteMasterIPTo; + SiteModelObj.InstituteName = item.InstituteName; + SiteModelObj.Department = item.Department; + SiteModelObj.SiteUserId = item.UserId; + SiteModelObj.SiteUserEmailId = item.EmailId; + SiteModelObj.SiteUserFirstName = item.FirstName; + SiteModelObj.Title = item.Title; + SiteModelObj.CreationDate = DateTime.ParseExact(item.CreationDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); + SiteModelObj.ModifiedDate = DateTime.ParseExact(item.ModifiedDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); + LicenseSiteList.Add(SiteModelObj); + } + } + } + catch (Exception ex) { } + return LicenseSiteList; + } + + public static List> GetLicenseModestySettings(AIADatabaseV5Entities dbContext, int LicenseId, int BuildingLevelId) + { + List> LicenseModestyList = new List>(); + Tuple LicenseModestyObj; + int i = 0; + try + { + var result = dbContext.usp_GetLicenseModestySettings(LicenseId, BuildingLevelId).ToList(); + if (result.Count > 0) + { + foreach (var item in result) + { + LicenseModestyObj = new Tuple(item.LicenseEditionId, (bool)item.IsModesty, item.Title); + LicenseModestyList.Add(LicenseModestyObj); + i++; + if (i >= 100) break; + } + } + } + catch (Exception ex) { } + return LicenseModestyList; + } + public static bool InsertLicense(AIADatabaseV5Entities dbContext, LicenseModel licenseModel) { bool status = false; @@ -308,6 +365,62 @@ namespace AIAHTML5.ADMIN.API.Models } } + public static bool UpdateLicenseModestySettings(AIADatabaseV5Entities dbContext, List> LicenseModestyList) + { + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); + try + { + foreach (var item in LicenseModestyList) + { + dbContext.usp_UpdateLicenseModestySettings(item.Item1, item.Item2, item.Item3, spStatus); + if (!(bool)spStatus.Value) break; + } + return (bool)spStatus.Value; + } + catch (Exception ex) + { + return false; + } + } + + public static List> GetLicenseModulesStatus(AIADatabaseV5Entities dbContext, int LicenseId) + { + List> LicenseModulesStatusList = new List>(); + Tuple LicenseModuleStatusObj; + try + { + var result = dbContext.GetModuleStatusByLicenseId(LicenseId).ToList(); + if (result.Count > 0) + { + foreach (var item in result) + { + LicenseModuleStatusObj = new Tuple(item.Id, (bool)item.Status, item.Title); + LicenseModulesStatusList.Add(LicenseModuleStatusObj); + } + } + } + catch (Exception ex) { } + return LicenseModulesStatusList; + } + + public static bool UpdateLicenseModulesStatus(AIADatabaseV5Entities dbContext, List> LicenseModuleStatusList) + { + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); + try + { + foreach (var item in LicenseModuleStatusList) + { + dbContext.usp_UpdateLicenseModuleStatus(item.Item1, item.Item2, item.Item3, spStatus); + if (!(bool)spStatus.Value) break; + } + return (bool)spStatus.Value; + } + catch (Exception ex) + { + return false; + } + } + } public class LicenseTypeModel diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/SiteModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/SiteModel.cs new file mode 100644 index 0000000..e74695b --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/SiteModel.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using AIAHTML5.ADMIN.API.Entity; + +namespace AIAHTML5.ADMIN.API.Models +{ + public class SiteModel + { + public int Id { get; set; } + public int LicenseId { get; set; } + public string Ip { get; set; } + public string Title { get; set; } + public string SiteIpTo { get; set; } + public string MasterIpTo { get; set; } + public DateTime CreationDate { get; set; } + public DateTime ModifiedDate { get; set; } + public string InstituteName { get; set; } + public string City { get; set; } + public string Zip { get; set; } + public string Phone { get; set; } + public string Address1 { get; set; } + public string Address2 { get; set; } + public int? StateId { get; set; } + public int? CountryId { get; set; } + public string Department { get; set; } + public int SiteUserId { get; set; } + public string SiteUserFirstName { get; set; } + public string SiteUserEmailId { get; set; } + public bool? IsActive { get; set; } + public bool IsMaster { get; set; } + public bool? IsModesty { get; set; } + public string SiteEditionIds { get; set; } + + public static SiteModel GetSiteById(AIADatabaseV5Entities dbContext, int SiteId) + { + LicenseModel LicenseObj = new LicenseModel(); + SiteModel SiteModelObj = new SiteModel(); + try + { + var result = dbContext.usp_GetSiteById(SiteId).ToList(); + SiteModelObj.Id = result[0].Id; + SiteModelObj.Ip = result[0].SiteIp; + SiteModelObj.SiteIpTo = result[0].SiteIPTo; + SiteModelObj.MasterIpTo = result[0].SiteMasterIPTo; + SiteModelObj.InstituteName = result[0].InstituteName; + SiteModelObj.Department = result[0].Department; + SiteModelObj.City = result[0].City; + SiteModelObj.Phone = result[0].Phone; + SiteModelObj.Zip = result[0].Zip; + SiteModelObj.Address1 = result[0].Address1; + SiteModelObj.Address2 = result[0].Address2; + SiteModelObj.CountryId = result[0].CountryId; + SiteModelObj.StateId = result[0].StateId; + SiteModelObj.SiteUserId = result[0].UserId; + SiteModelObj.SiteUserEmailId = result[0].EmailId; + SiteModelObj.IsMaster = result[0].IsMaster; + SiteModelObj.IsActive = result[0].IsActive; + SiteModelObj.SiteUserFirstName = result[0].FirstName; + SiteModelObj.Title = result[0].Title; + SiteModelObj.CreationDate = DateTime.ParseExact(result[0].CreationDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); + SiteModelObj.ModifiedDate = DateTime.ParseExact(result[0].ModifiedDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); + } + catch (Exception ex) { } + return SiteModelObj; + } + + public static List> GetSiteAccountEditions(AIADatabaseV5Entities dbContext, int SiteId, int LicenseId) + { + List> SiteAccountEditionList = new List>(); + Tuple SiteEditionObj; + try + { + var result = dbContext.usp_GetSiteAccountEditions(SiteId, LicenseId).ToList(); + if (result.Count > 0) + { + foreach (var item in result) + { + SiteEditionObj = new Tuple(item.LicenseEditionId, item.Id, item.Title); + SiteAccountEditionList.Add(SiteEditionObj); + } + } + } + catch (Exception ex) { } + return SiteAccountEditionList; + } + + public static bool InsertUpdateSiteAccount(AIADatabaseV5Entities dbContext, SiteModel SiteEntity) + { + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); + try + { + dbContext.usp_InsertUpdateSiteAccount(SiteEntity.Id, SiteEntity.Ip, SiteEntity.Title, + SiteEntity.InstituteName, SiteEntity.Department, SiteEntity.Address1, SiteEntity.Address2, + SiteEntity.City, SiteEntity.Zip, SiteEntity.Phone, SiteEntity.StateId, SiteEntity.CountryId, + SiteEntity.IsMaster, SiteEntity.CreationDate, SiteEntity.ModifiedDate, SiteEntity.IsActive, + SiteEntity.SiteUserId, SiteEntity.SiteIpTo, SiteEntity.LicenseId, SiteEntity.SiteEditionIds, spStatus); + return (bool)spStatus.Value; + } + catch (Exception ex) + { + return false; + } + } + + public static bool DeleteSiteAccount(AIADatabaseV5Entities dbContext, int SiteId, int LicenseId, int UserId) + { + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); + try + { + dbContext.usp_DeleteSiteAccount(SiteId, LicenseId, UserId, spStatus); + return (bool)spStatus.Value; + } + catch (Exception ex) + { + return false; + } + } + + } + +} \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserGroupModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserGroupModel.cs new file mode 100644 index 0000000..634d6c6 --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserGroupModel.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using AIAHTML5.ADMIN.API.Entity; + +namespace AIAHTML5.ADMIN.API.Models +{ + public class UserGroupModel + { + public int Id { get; set; } + public int LicenseId { get; set; } + public string Title { get; set; } + public DateTime? CreationDate { get; set; } + public DateTime? ModifiedDate { get; set; } + public bool? IsActive { get; set; } + public int? TotalUsers { get; set; } + + public static List GetLicenseUserGroups(AIADatabaseV5Entities dbContext, int LicenseId) + { + List UserGroupList = new List(); + UserGroupModel UserGroupObj = new UserGroupModel(); + try + { + var result = dbContext.usp_GetLicenseUserGroups(LicenseId).ToList(); + foreach (var item in result) + { + UserGroupObj = new UserGroupModel(); + UserGroupObj.Id = item.Id; + UserGroupObj.LicenseId = item.LicenseId; + UserGroupObj.Title = item.Title; + UserGroupObj.IsActive = item.IsActive; + UserGroupObj.ModifiedDate = item.ModifiedDate; + UserGroupObj.CreationDate = item.CreationDate; + UserGroupObj.TotalUsers = item.TotalUsers; + UserGroupList.Add(UserGroupObj); + } + } + catch (Exception ex) { } + return UserGroupList; + } + + public static List GetLicenseUserGroupUsers(AIADatabaseV5Entities dbContext, int LicenseId, int UserGroupId) + { + List UserList = new List(); + UserModel UserModelObj = new UserModel(); + try + { + var result = dbContext.GetAllUserWithGroup(LicenseId, UserGroupId).ToList(); + foreach (var item in result) + { + UserModelObj = new UserModel(); + UserModelObj.Id = item.Id; + UserModelObj.FirstName = item.FirstName; + UserModelObj.LastName = item.LastName; + UserModelObj.LoginId = item.LoginId; + UserModelObj.EmailId = item.EmailId; + UserModelObj.ProductEdition = item.Title; + UserModelObj.InGroup = item.InGroup; + UserList.Add(UserModelObj); + } + } + catch (Exception ex) { } + return UserList; + } + + public static bool InsertUpdateLicenseUserGroup(AIADatabaseV5Entities dbContext, UserGroupModel UserGroupEntity) + { + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); + try + { + dbContext.usp_InsertUpdateLicenseUserGroup(UserGroupEntity.Id, UserGroupEntity.LicenseId, UserGroupEntity.Title, + UserGroupEntity.CreationDate, UserGroupEntity.ModifiedDate, UserGroupEntity.IsActive, spStatus); + return (bool)spStatus.Value; + } + catch (Exception ex) + { + return false; + } + } + + public static bool UpdateLicenseUserGroupUsers(AIADatabaseV5Entities dbContext, int UserGroupId, string UserIds) + { + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); + try + { + dbContext.usp_UpdateLicenseUserGroupUsers(UserGroupId, UserIds, spStatus); + return (bool)spStatus.Value; + } + catch (Exception ex) + { + return false; + } + } + + public static bool DeleteLicenseUserGroup(AIADatabaseV5Entities dbContext, int UserGroupId) + { + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); + try + { + dbContext.usp_DeleteLicenseUserGroup(UserGroupId, spStatus); + return (bool)spStatus.Value; + } + catch (Exception ex) + { + return false; + } + } + + } + +} \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs index b753b45..f73ebbf 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/UserModel.cs @@ -24,6 +24,8 @@ namespace AIAHTML5.ADMIN.API.Models public DateTime ModifiedDate { get; set; } public int UserTypeId { get; set; } public bool IsActive { get; set; } + public string ProductEdition { get; set; } + public int InGroup { get; set; } public static bool UpdateUserProfile(AIADatabaseV5Entities dbContext, int intUserID, string strFirstName, string strLastName, string strEmailID) { diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.component.ts b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.component.ts index 8250e7c..b5d1191 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.component.ts +++ b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.component.ts @@ -3,11 +3,12 @@ import { UserService } from './components/UserEntity/user.service'; import { ManageDiscountCodeService } from './components/ManageDiscountCode/managediscountcode.service'; import { SubscriptionPriceService } from './components/SubscriptionPrice/subscriptionprice.service'; import { LicenseService } from './components/LicenseEntity/license.service'; +import { ReportService } from './components/Reports/report.service'; @Component({ selector: 'app-component', templateUrl: '../app/app.component.html', - providers: [UserService, ManageDiscountCodeService, SubscriptionPriceService, LicenseService] + providers: [UserService, ManageDiscountCodeService, SubscriptionPriceService, LicenseService, ReportService] }) export class AppComponent implements OnInit { diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.module.ts b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.module.ts index b409f73..c84b3ef 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.module.ts +++ b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.module.ts @@ -1,3 +1,5 @@ + + import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; @@ -13,11 +15,25 @@ import { ChangeUserPassword } from './components/UserEntity/changeuserpassword.c import { ChangeUserID } from './components/UserEntity/changeuserid.component'; import { UsersList } from './components/UserEntity/users.component'; import { AddUser } from './components/UserEntity/adduser.component'; +import { UnblockUser } from './components/UserEntity/unblockuser.component'; import { ManageDiscountCode } from './components/ManageDiscountCode/managediscountcode.component'; import { SubscriptionPrice } from './components/SubscriptionPrice/subscriptionprice.component'; import { SearchLicense } from './components/LicenseEntity/searchlicense.component'; import { AddLicense } from './components/LicenseEntity/addlicense.component'; +import { UsageReport } from './components/Reports/usagereport.component'; +import { CustomerSummaryReport } from './components/Reports/customersummaryreport.component'; +import { ExpiringSubscriptionReport } from './components/Reports/expiringsubscriptionreport.component'; +import { SubscriptionReport } from './components/Reports/subscriptionreport.component'; +import { SubscriptionCancellationReport } from './components/Reports/subscriptioncancellationreport.component'; +import { NetAdSubscriptionReport } from './components/Reports/netadsubscriptionreport.component'; +import { SiteLicenseUsageReport } from './components/Reports/sitelicenseusagereport.component'; +import { DiscountCodeReport } from './components/Reports/discountcodereport.component'; +import { ImageExportReport } from './components/Reports/imageexportreport.component'; import { EditLicenseBasicSettings } from './components/LicenseEntity/editlicensebasicsettings.component'; +import { LicenseModestySettings } from './components/LicenseEntity/licensemodestysettings.component'; +import { LicenseModuleSettings } from './components/LicenseEntity/licensemodulesettings.component'; +import { SiteLicenseAccount } from './components/LicenseEntity/sitelicenseaccount.component'; +import { UserGroup } from './components/UserEntity/usergroup.component'; import { AppComponent } from './app.component'; import { AppRoutingModule } from './app.routing.module'; @@ -30,22 +46,28 @@ import { ConfirmComponent } from "./Shared/Confirm/confirm.component" import { BsDatepickerModule, ModalModule } from 'ngx-bootstrap'; import { BsModalService } from 'ngx-bootstrap/modal'; import { ContenteditableModelDirective } from './shared/contenteditabledirective'; +import { LoadingService } from './shared/loading.service'; @NgModule({ declarations: [ ChangeUserPassword, ChangeUserID, UpdateUserProfile, UsersList, - ManageDiscountCode, AddUser, + ManageDiscountCode, AddUser, UnblockUser, AppComponent, ConfirmComponent, - SubscriptionPrice, ManageDiscountCode, - SearchLicense, AddLicense, - EditLicenseBasicSettings, ContenteditableModelDirective + SubscriptionPrice, ManageDiscountCode, ContenteditableModelDirective, + AddLicense, SearchLicense, + UsageReport, CustomerSummaryReport, + ExpiringSubscriptionReport, SubscriptionReport, + SubscriptionCancellationReport, NetAdSubscriptionReport, + SiteLicenseUsageReport, DiscountCodeReport, ImageExportReport, + EditLicenseBasicSettings, LicenseModestySettings, + LicenseModuleSettings, SiteLicenseAccount, UserGroup ], imports: [ BrowserModule, AppRoutingModule, HttpClientModule, FormsModule, ReactiveFormsModule, HttpModule, Ng2Bs3ModalModule, - BsDatepickerModule.forRoot(), ModalModule.forRoot() + BsDatepickerModule.forRoot(), ModalModule.forRoot()//ModalModule.forRoot() ], - providers: [GlobalService, ConfirmService, BsModalService, + providers: [GlobalService, ConfirmService, BsModalService, LoadingService, //AuthService, //AuthGuard, //{ diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.routing.module.ts b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.routing.module.ts index b10a512..d94ec3d 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.routing.module.ts +++ b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.routing.module.ts @@ -4,12 +4,26 @@ import { UpdateUserProfile } from './components/UserEntity/updateuserprofile.com import { ChangeUserPassword } from './components/UserEntity/changeuserpassword.component'; import { ChangeUserID } from './components/UserEntity/changeuserid.component'; import { UsersList } from './components/UserEntity/users.component'; +import { UnblockUser } from './components/UserEntity/unblockuser.component'; import { ManageDiscountCode } from './components/ManageDiscountCode/managediscountcode.component'; import { SubscriptionPrice } from './components/SubscriptionPrice/subscriptionprice.component'; import { AddUser } from './components/UserEntity/adduser.component'; import { SearchLicense } from './components/LicenseEntity/searchlicense.component'; import { AddLicense } from './components/LicenseEntity/addlicense.component'; +import { UsageReport } from './components/Reports/usagereport.component'; +import { CustomerSummaryReport } from './components/Reports/customersummaryreport.component'; +import { ExpiringSubscriptionReport } from './components/Reports/expiringsubscriptionreport.component'; +import { SubscriptionReport } from './components/Reports/subscriptionreport.component'; +import { SubscriptionCancellationReport } from './components/Reports/subscriptioncancellationreport.component'; +import { NetAdSubscriptionReport } from './components/Reports/netadsubscriptionreport.component'; +import { SiteLicenseUsageReport } from './components/Reports/sitelicenseusagereport.component'; +import { DiscountCodeReport } from './components/Reports/discountcodereport.component'; +import { ImageExportReport } from './components/Reports/imageexportreport.component'; import { EditLicenseBasicSettings } from './components/LicenseEntity/editlicensebasicsettings.component'; +import { LicenseModestySettings } from './components/LicenseEntity/licensemodestysettings.component'; +import { LicenseModuleSettings } from './components/LicenseEntity/licensemodulesettings.component'; +import { SiteLicenseAccount } from './components/LicenseEntity/sitelicenseaccount.component'; +import { UserGroup } from './components/UserEntity/usergroup.component'; const appRoutes: Routes = [ //{ path: '', redirectTo:'updateuserprofile',pathMatch } @@ -20,10 +34,25 @@ const appRoutes: Routes = [ { path: 'managediscountcode', component: ManageDiscountCode }, { path: 'subscriptionprice', component: SubscriptionPrice }, { path: 'adduser', component: AddUser }, + { path: 'unblockuser', component: UnblockUser }, { path: 'searchlicense', component: SearchLicense }, { path: 'addlicense', component: AddLicense }, { path: 'editlicense', component: AddLicense }, + { path: 'usagereport', component: UsageReport }, + { path: 'customersummaryreport', component: CustomerSummaryReport }, + { path: 'expiringsubscriptionreport', component: ExpiringSubscriptionReport }, + { path: 'subscriptionreport', component: SubscriptionReport }, + { path: 'subscriptioncancellationreport', component: SubscriptionCancellationReport }, + { path: 'netadsubscriptionreport', component: NetAdSubscriptionReport }, + { path: 'sitelicenseusagereport', component: SiteLicenseUsageReport }, + { path: 'discountcodereport', component: DiscountCodeReport }, + { path: 'imageexportreport', component: ImageExportReport }, { path: 'editlicensebasicsettings', component: EditLicenseBasicSettings }, + { path: 'licensemodestysettings', component: LicenseModestySettings }, + { path: 'licensemodulesettings', component: LicenseModuleSettings }, + { path: 'sitelicenseaccount', component: SiteLicenseAccount }, + { path: 'usergroup', component: UserGroup } + ]; @NgModule({ diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/ManageDiscountCode/managediscountcode.component.ts b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/ManageDiscountCode/managediscountcode.component.ts index 68d8654..d03df4b 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/ManageDiscountCode/managediscountcode.component.ts +++ b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/ManageDiscountCode/managediscountcode.component.ts @@ -1,13 +1,14 @@ import { Component, OnInit, AfterViewInit, Input, Output, EventEmitter, Pipe, PipeTransform, TemplateRef } from '@angular/core'; import { ManageDiscountCodeService } from './managediscountcode.service'; import { Router } from '@angular/router'; -import { FormControl, FormBuilder, FormGroup, Validators, ValidationErrors } from '@angular/forms'; +import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; import { DiscountCode } from '../UserEntity/datamodel'; import { BsDatepickerModule } from 'ngx-bootstrap'; import { Http, Response } from '@angular/http'; import { DatePipe } from '@angular/common'; import { BsModalService } from 'ngx-bootstrap/modal'; import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'; +import { ConfirmService } from '../../Shared/Confirm/confirm.service'; @Component({ templateUrl: './managediscountcode.component.html' @@ -34,7 +35,7 @@ bsValue4: Date = new Date(); selectedId: number = 0; modalRef: BsModalRef; -constructor(private manageDiscountCodeService: ManageDiscountCodeService, private router: Router, private fb: FormBuilder, private modalService: BsModalService) { } +constructor(private manageDiscountCodeService: ManageDiscountCodeService, private router: Router, private _confirmService: ConfirmService, private fb: FormBuilder, private modalService: BsModalService) { } ngOnInit(): void { this.divClass = 'col-sm-12'; @@ -42,7 +43,7 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat this.alerts = ''; this.manageDiscountCodeFrm = this.fb.group({ searchDiscountCode: [''], - searchStartDate: ['', CustomValidators.DateValidator], + searchStartDate: [''], searchEndDate: [''], discountCodes: this.fb.array([]) }); @@ -105,7 +106,8 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat AfterInsertData(data, template) { if (data.Status == "false") { - this.alerts = "Discount code save unsuccessfull"; + //this.alerts = "Discount code save unsuccessfull"; + this._confirmService.activate("Discount code insert unsuccessfull", "alertMsg"); } else { this.modalAlerts = "

Discount code saved successfully

"; this.modalRef = this.modalService.show(template); @@ -114,7 +116,8 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat AfterUpdateData(data, template) { if (data.Status == "false") { - this.alerts = "Discount code update unsuccessfull"; + //this.alerts = "Discount code update unsuccessfull"; + this._confirmService.activate("Discount code update unsuccessfull", "alertMsg"); } else { this.modalAlerts = "

Discount code updated successfully

"; this.modalRef = this.modalService.show(template); @@ -169,26 +172,3 @@ constructor(private manageDiscountCodeService: ManageDiscountCodeService, privat this.SetClickedRow(this.selectedRow, this.manageDiscountCodeFrm.controls['discountCodes'].value.find(C => C.Id == this.selectedId)); } } - -export class CustomValidators { - - static DateValidator(control: FormControl): ValidationErrors { - var isValid: boolean = true; - var DateRegex = '[0-9]{1,2}[/][0-9]{1,2}[/][0-9]{4}'; - if (!control.value.match(/DateRegex/)) { - isValid = false; - } - var numValue = control.value.split('/'); - if(parseInt(numValue[0]) > 12 && parseInt(numValue[0]) < 1){ - isValid = false; - } - if(parseInt(numValue[1]) > 31 && parseInt(numValue[1]) < 1){ - isValid = false; - } - if(parseInt(numValue[2]) < 1){ - isValid = false; - } - return isValid ? null : { 'InvalidDate': 'Date is invalid' }; - } - -} \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.html b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.html index 533e4a1..ee9e64c 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.html +++ b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.html @@ -31,6 +31,7 @@ diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.ts b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.ts index 16ac157..303e6f6 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.ts +++ b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.ts @@ -10,6 +10,7 @@ import { DatePipe } from '@angular/common'; import { ContenteditableModelDirective } from '../../shared/contenteditabledirective' import { BsModalService } from 'ngx-bootstrap/modal'; import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'; +import { ConfirmService } from '../../Shared/Confirm/confirm.service'; //import { Global } from '../../Shared/global'; //import { DBOperation } from 'S'; //import { Observable } from 'rxjs/Observable'; @@ -35,7 +36,7 @@ selectedEditionId: number = 1; divClass: string = ''; modalRef: BsModalRef; -constructor(private subscriptionPriceService: SubscriptionPriceService, private router: Router, private fb: FormBuilder, private modalService: BsModalService) { } +constructor(private subscriptionPriceService: SubscriptionPriceService, private router: Router, private _confirmService: ConfirmService, private fb: FormBuilder, private modalService: BsModalService) { } ngOnInit(): void { this.divClass = 'col-sm-12'; @@ -80,7 +81,8 @@ constructor(private subscriptionPriceService: SubscriptionPriceService, private AfterDeleteData(data, template) { if (data.Status == "false") { - this.alerts = "Subscription prices delete unsuccessfull"; + //this.alerts = "Subscription prices delete unsuccessfull"; + this._confirmService.activate("Subscription prices delete unsuccessfull", "alertMsg"); } else { this.modalAlerts = "

Subscription prices deleted successfully

"; this.modalRef = this.modalService.show(template); @@ -90,7 +92,8 @@ constructor(private subscriptionPriceService: SubscriptionPriceService, private AfterInsertData(data, template) { if (data.Status == "false") { - this.alerts = "Subscription price save unsuccessfull"; + // this.alerts = "Subscription price save unsuccessfull"; + this._confirmService.activate("Subscription prices insert unsuccessfull", "alertMsg"); } else { this.modalAlerts = "

Subscription price saved successfully

"; this.modalRef = this.modalService.show(template); @@ -99,7 +102,8 @@ constructor(private subscriptionPriceService: SubscriptionPriceService, private AfterUpdateData(data, template) { if (data.Status == "false") { - this.alerts = "Subscription prices update unsuccessfull\n"; + //this.alerts = "Subscription prices update unsuccessfull\n"; + this._confirmService.activate("Subscription prices update unsuccessfull", "alertMsg"); } else { this.modalAlerts = "

Subscription prices updated successfully

"; this.modalRef = this.modalService.show(template); -- libgit2 0.21.4