From aea2ab0329e33b1f59298ea1e2326958d4ebb5d2 Mon Sep 17 00:00:00 2001 From: gagan.deep Date: Fri, 9 Feb 2018 12:54:41 +0530 Subject: [PATCH] Site Account and Profile --- 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/dbo.usp_GetSearchUserList.sql | Bin 0 -> 17490 bytes 400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj | 12 +++++++++++- 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs | 181 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs | 18 ++++++++++-------- 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/SiteController.cs | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs | 2 +- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs | 232 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx | 227 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseModestySettings_Result.cs | 20 ++++++++++++++++++++ 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 | 193 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------- 400-SOURCECODE/AIAHTML5.ADMIN.API/Models/SiteModel.cs | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/Admin/dist/assets/styles/admin-custom.css | 7 +++++++ 400-SOURCECODE/Admin/dist/index.html | 59 +++++------------------------------------------------------ 400-SOURCECODE/Admin/src/app/app.component.html | 14 +++++++------- 400-SOURCECODE/Admin/src/app/app.module.ts | 10 +++++++++- 400-SOURCECODE/Admin/src/app/app.routing.module.ts | 10 +++++++++- 400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.html | 523 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.ts | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts | 165 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.html | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.ts | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodulesettings.component.html | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodulesettings.component.ts | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.html | 376 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.ts | 343 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.html | 4 ++++ 400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.ts | 30 ++++++++++++++++++++++++------ 400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.html | 4 ++++ 400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts | 26 ++++++++++++++++++++++---- 400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.html | 4 ++++ 400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.ts | 28 +++++++++++++++++++++++----- 400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.html | 4 ++++ 400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts | 26 +++++++++++++++++++++----- 400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.html | 4 ++++ 400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.ts | 25 +++++++++++++++++++------ 400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.html | 4 ++++ 400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.ts | 25 ++++++++++++++++++++----- 400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.html | 4 ++++ 400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.ts | 29 ++++++++++++++++++++++++----- 400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.html | 4 ++++ 400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.ts | 26 ++++++++++++++++++++++---- 400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.html | 4 ++++ 400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.ts | 32 +++++++++++++++++++++++++------- 400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html | 20 ++++++++++++-------- 400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts | 50 ++++++++++++++++++++++++++++++++++++++------------ 400-SOURCECODE/Admin/src/app/shared/global.ts | 15 ++++++++------- 400-SOURCECODE/Admin/src/assets/styles/admin-custom.css | 7 +++++++ 49 files changed, 3134 insertions(+), 589 deletions(-) create mode 100644 150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/dbo.usp_GetSearchUserList.sql create mode 100644 400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/SiteController.cs create mode 100644 400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetLicenseModestySettings_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/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.ts create mode 100644 400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.html create mode 100644 400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.ts create mode 100644 400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodulesettings.component.html create mode 100644 400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodulesettings.component.ts create mode 100644 400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.html create mode 100644 400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.ts diff --git a/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/dbo.usp_GetSearchUserList.sql b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/dbo.usp_GetSearchUserList.sql new file mode 100644 index 0000000..ced6c2c Binary files /dev/null and b/150-DOCUMENTATION/002-DBScripts/Admin/Store Procedure/dbo.usp_GetSearchUserList.sql differ diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj b/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj index 77d6a81..739f66e 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj @@ -160,11 +160,11 @@ - + @@ -722,6 +722,9 @@ AIADBEntity.tt + + AIADBEntity.tt + AIADBEntity.tt @@ -737,6 +740,12 @@ AIADBEntity.tt + + AIADBEntity.tt + + + AIADBEntity.tt + AIADBEntity.tt @@ -777,6 +786,7 @@ + diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs index 7b34f3a..6b71f6e 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs @@ -38,12 +38,12 @@ namespace AIAHTML5.ADMIN.API.Controllers return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); } } - + [Route("Licenses")] [HttpGet] public HttpResponseMessage GetLicenses(string accountNumber, string licenseeFirstName, string licenseeLastName, byte licenseTypeId, - string institutionName, int stateId, int countryId, string emailId, DateTime subscriptionStartDate, DateTime subscriptionEndDate, - bool isActive) + string institutionName, int stateId, int countryId, string emailId, DateTime subscriptionStartDate, DateTime subscriptionEndDate, + bool isActive) { List LicenseList = new List(); try @@ -214,5 +214,180 @@ namespace AIAHTML5.ADMIN.API.Controllers return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); } } + + [Route("LicenseAccounts")] + [HttpGet] + public HttpResponseMessage GetLicenseAccounts(int LicenseType) + { + List> LicenseAccountList = new List>(); + try + { + LicenseAccountList = LicenseModel.GetLicenseAccounts(dbContext, LicenseType); + return Request.CreateResponse(HttpStatusCode.OK, LicenseAccountList); + } + catch (Exception ex) + { + // Log exception code goes here + return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + } + } + + [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) + { + bool Status = false; + LicenseModel licenseModel = new LicenseModel(); + licenseModel.LicenseId = jsonData["licenseId"].Value(); + licenseModel.AccountNumber = jsonData["accountNumber"].Value(); + licenseModel.LicenseeFirstName = jsonData["licenseeFirstName"].Value(); + licenseModel.LicenseeLastName = jsonData["licenseeLastName"].Value(); + licenseModel.InstitutionName = jsonData["institutionName"].Value(); + licenseModel.Address1 = jsonData["address1"].Value(); + licenseModel.Address2 = jsonData["address2"].Value(); + licenseModel.City = jsonData["city"].Value(); + licenseModel.Zip = jsonData["zip"].Value(); + licenseModel.StateId = jsonData["stateId"].Value(); + licenseModel.CountryId = jsonData["countryId"].Value(); + licenseModel.Phone = jsonData["phone"].Value(); + licenseModel.EmailId = jsonData["email"].Value(); + try + { + Status = LicenseModel.UpdateLicenseBasicSettings(dbContext, licenseModel); + 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("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/ReportController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs index 711a9d8..012acba 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/ReportController.cs @@ -20,13 +20,15 @@ namespace AIAHTML5.ADMIN.API.Controllers public class ReportController : ApiController { AIADatabaseV5Entities dbContext = new AIADatabaseV5Entities(); + [Route("GetUsageReport")] + [HttpGet] public IHttpActionResult GetUsageReport(string sFromDate, string sToDate, string sAccoutNumber, string sZip, int iState, int iCountry) { var lstUsageReport = dbContext.GetUsageReport(sFromDate, sToDate, sAccoutNumber, sZip, iState, iCountry).ToList(); return Ok(lstUsageReport); } - [Route("Api/GetCustomerSummeryReport")] + [Route("GetCustomerSummeryReport")] [HttpGet] public IHttpActionResult GetCustomerSummeryReport(string sAccoutNumber, string sLicenseeFullName, Nullable iStartPrice, Nullable iEndPrice, int iLicenseType, int iAccountType, string sZip, int iState, int iCountry) { @@ -35,7 +37,7 @@ namespace AIAHTML5.ADMIN.API.Controllers } - [Route("Api/GetExpiringSubscriptionReport")] + [Route("GetExpiringSubscriptionReport")] [HttpGet] public IHttpActionResult GetExpiringSubscriptionReport(string sFromDate, string sToDate, Nullable iStartPrice, Nullable iEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId) { @@ -43,7 +45,7 @@ namespace AIAHTML5.ADMIN.API.Controllers return Ok(lstExpiringSubscriptionReport); } - [Route("Api/GetSubscriptionReport")] + [Route("GetSubscriptionReport")] [HttpGet] public IHttpActionResult GetSubscriptionReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId) { @@ -51,7 +53,7 @@ namespace AIAHTML5.ADMIN.API.Controllers var lstExpiringSubscriptionReport = dbContext.GetSubscribedLicenses(sFromDate, sToDate, icStartPrice, icEndPrice, (byte)iLicenseTypeId, (byte)iAccountTypeId, sZip, iStateId, iCountryId).ToList(); return Ok(lstExpiringSubscriptionReport); } - [Route("Api/GetSubscriptionCancellationReport")] + [Route("GetSubscriptionCancellationReport")] [HttpGet] public IHttpActionResult GetSubscriptionCancellationReport(string sFromDate, string sToDate, decimal icStartPrice, decimal icEndPrice, int iLicenseTypeId, int iAccountTypeId, string sZip, int iStateId, int iCountryId) { @@ -60,7 +62,7 @@ namespace AIAHTML5.ADMIN.API.Controllers return Ok(lstExpiringSubscriptionReport); } - [Route("Api/GetNetAdSummaryReport")] + [Route("GetNetAdSummaryReport")] [HttpGet] public IHttpActionResult GetNetAdSummaryReport(string sFromDate, string sToDate, decimal iStartPrice, decimal iEndPrice, int iLicenseTypeId) { @@ -75,7 +77,7 @@ namespace AIAHTML5.ADMIN.API.Controllers } } - [Route("Api/GetSiteLicenseUsageReport")] + [Route("GetSiteLicenseUsageReport")] [HttpGet] public IHttpActionResult GetSiteLicenseUsageReport(string sFromDate, string sToDate, string sAccountNumber, int iEdition) { @@ -90,7 +92,7 @@ namespace AIAHTML5.ADMIN.API.Controllers } } - [Route("Api/GetDiscountReport")] + [Route("GetDiscountReport")] [HttpGet] public IHttpActionResult GetDiscountReport(string sFromDate, string sToDate, int iDiscountCode, string sAccountNumber) { @@ -105,7 +107,7 @@ namespace AIAHTML5.ADMIN.API.Controllers } } - [Route("Api/GetImageExportReport")] + [Route("GetImageExportReport")] [HttpGet] public IHttpActionResult GetImageExportReport(string sFromDate, string sToDate, string sAccountNumber) { 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..a35a97c --- /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 fde23c0..f4ef93f 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/UserController.cs @@ -237,7 +237,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/Entity/AIADBEntity.Context.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs index babca1b..8450fa7 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs @@ -2923,9 +2923,13 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateUserId", idParameter, userIdParameter, olduserIdParameter, 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_GetProductEditionByLicense(Nullable iLicenseId) @@ -3221,5 +3225,229 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetManageRights", userIdParameter, roleNameParameter); } + + 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 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 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 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 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 int usp_UpdateLicenseBasicSettings(Nullable iLicenseId, string sLicenseeFname, string sLicenseeLname, string sInstitutionName, string sAddress1, string sAddress2, string sCity, string sZip, Nullable iStateId, Nullable iCountryId, string sPhone, string sEmailId, ObjectParameter status) + { + var iLicenseIdParameter = iLicenseId.HasValue ? + new ObjectParameter("iLicenseId", iLicenseId) : + new ObjectParameter("iLicenseId", typeof(int)); + + var sLicenseeFnameParameter = sLicenseeFname != null ? + new ObjectParameter("sLicenseeFname", sLicenseeFname) : + new ObjectParameter("sLicenseeFname", typeof(string)); + + var sLicenseeLnameParameter = sLicenseeLname != null ? + new ObjectParameter("sLicenseeLname", sLicenseeLname) : + new ObjectParameter("sLicenseeLname", typeof(string)); + + var sInstitutionNameParameter = sInstitutionName != null ? + new ObjectParameter("sInstitutionName", sInstitutionName) : + new ObjectParameter("sInstitutionName", 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 sZipParameter = sZip != null ? + new ObjectParameter("sZip", sZip) : + new ObjectParameter("sZip", typeof(string)); + + var iStateIdParameter = iStateId.HasValue ? + new ObjectParameter("iStateId", iStateId) : + new ObjectParameter("iStateId", typeof(int)); + + var iCountryIdParameter = iCountryId.HasValue ? + new ObjectParameter("iCountryId", iCountryId) : + new ObjectParameter("iCountryId", typeof(int)); + + var sPhoneParameter = sPhone != null ? + new ObjectParameter("sPhone", sPhone) : + new ObjectParameter("sPhone", typeof(string)); + + var sEmailIdParameter = sEmailId != null ? + new ObjectParameter("sEmailId", sEmailId) : + new ObjectParameter("sEmailId", typeof(string)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_UpdateLicenseBasicSettings", iLicenseIdParameter, sLicenseeFnameParameter, sLicenseeLnameParameter, sInstitutionNameParameter, sAddress1Parameter, sAddress2Parameter, sCityParameter, sZipParameter, iStateIdParameter, iCountryIdParameter, sPhoneParameter, sEmailIdParameter, status); + } + + 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); + } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx index 0a8356b..ef07853 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx @@ -2616,11 +2616,19 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + + + + - + + + @@ -2628,6 +2636,10 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + + @@ -2658,6 +2670,13 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + + + + + @@ -2687,6 +2706,29 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + + + + + + + + + + + + + + + + + + + + + @@ -2702,6 +2744,33 @@ warning 6002: The table/view 'AIADatabaseV5.dbo.VocabTermNumberToSystemMap' does + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6154,7 +6223,9 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] - + + + @@ -6223,7 +6294,7 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] - + @@ -6243,6 +6314,73 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7163,6 +7301,39 @@ FROM [dbo].[VocabTermNumberToSystemMap] AS [VocabTermNumberToSystemMap] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -9624,6 +9795,56 @@ 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..a79b4bd --- /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 int LicenseEditionId { get; set; } + public string Title { get; set; } + public Nullable IsModesty { 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..b05740b --- /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 Nullable IsActive { 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; } + } +} diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs index ffa9c76..dae84e7 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; @@ -16,7 +18,7 @@ namespace AIAHTML5.ADMIN.API.Models public string LicenseeLastName { get; set; } public string LicenseeName { get; set; } public byte LicenseTypeId { get; set; } - public string LicenseTypeName { get; set; } + public string LicenseTypeName { get; set; } public string InstitutionName { get; set; } public int? StateId { get; set; } public int? CountryId { get; set; } @@ -54,8 +56,8 @@ namespace AIAHTML5.ADMIN.API.Models public byte? TestLicenseEditionId { get; set; } public bool IsRenew { get; set; } - public static List GetLicenses(AIADatabaseV5Entities dbContext, string accountNumber, string licenseeFirstName, - string licenseeLastName, byte licenseTypeId, string institutionName, int stateId, int countryId, string emailId, + public static List GetLicenses(AIADatabaseV5Entities dbContext, string accountNumber, string licenseeFirstName, + string licenseeLastName, byte licenseTypeId, string institutionName, int stateId, int countryId, string emailId, DateTime subscriptionStartDate, DateTime subscriptionEndDate, bool isActive) { List LicenseList = new List(); @@ -65,9 +67,9 @@ namespace AIAHTML5.ADMIN.API.Models { var result = dbContext.usp_GetLicenses( (subscriptionStartDate > DateTime.MinValue ? subscriptionStartDate.ToShortDateString() : "01/01/01"), - (subscriptionEndDate > DateTime.MinValue ? subscriptionEndDate.ToShortDateString() : "01/01/01"), + (subscriptionEndDate > DateTime.MinValue ? subscriptionEndDate.ToShortDateString() : "01/01/01"), (accountNumber == null ? "" : accountNumber), (licenseeFirstName == null ? "" : licenseeFirstName), - (licenseeLastName == null ? "" : licenseeLastName), licenseTypeId, (institutionName == null ? "" : institutionName), + (licenseeLastName == null ? "" : licenseeLastName), licenseTypeId, (institutionName == null ? "" : institutionName), (emailId == null ? "" : emailId), stateId, countryId, isActive).ToList(); if (result.Count > 0) { @@ -104,6 +106,29 @@ namespace AIAHTML5.ADMIN.API.Models return LicenseList; } + public static List> GetLicenseAccounts(AIADatabaseV5Entities dbContext, int LicenseType) + { + List> LicenseAccountList = new List>(); + Tuple LicenseAccountObj; + int i = 0; + try + { + var result = dbContext.usp_GetAccountNumber(LicenseType).ToList(); + if (result.Count > 0) + { + foreach (var item in result) + { + LicenseAccountObj = new Tuple(item.Id, item.AccountNumber); + LicenseAccountList.Add(LicenseAccountObj); + i++; + if (i >= 100) break; + } + } + } + catch (Exception ex) { } + return LicenseAccountList; + } + public static LicenseModel GetLicenseById(AIADatabaseV5Entities dbContext, int LicenseId) { LicenseModel LicenseObj = new LicenseModel(); @@ -151,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; @@ -163,7 +243,7 @@ namespace AIAHTML5.ADMIN.API.Models licenseModel.LicenseTypeId, licenseModel.AccountTypeId, licenseModel.InstitutionName, licenseModel.Address1, licenseModel.Address2, licenseModel.City, licenseModel.Zip, licenseModel.StateId, licenseModel.CountryId, licenseModel.Phone, licenseModel.EmailId, licenseModel.TotalLogins, licenseModel.SubscriptionStartDate.ToString("MM/dd/yyyy"), licenseModel.SubscriptionEndDate.ToString("MM/dd/yyyy"), - licenseModel.MasterSiteUrl, licenseModel.EditionLogins, licenseModel.Price, licenseModel.ProductKey, licenseModel.SiteUrlTo, + licenseModel.MasterSiteUrl, licenseModel.EditionLogins, licenseModel.Price, licenseModel.ProductKey, licenseModel.SiteUrlTo, licenseModel.SiteUrlFrom, licenseModel.NoOfImages); if (result.Count() > 0) { @@ -174,8 +254,8 @@ namespace AIAHTML5.ADMIN.API.Models result = dbContext.InsertSingleLicenseAccount(licenseModel.AccountNumber, licenseModel.LicenseeFirstName, licenseModel.LicenseeLastName, licenseModel.AccountTypeId, licenseModel.InstitutionName, licenseModel.Address1, licenseModel.Address2, licenseModel.City, licenseModel.Zip, licenseModel.StateId, licenseModel.CountryId, licenseModel.Phone, licenseModel.EmailId, licenseModel.TotalLogins, - licenseModel.SubscriptionStartDate.ToString("MM/dd/yyyy"), licenseModel.SubscriptionEndDate.ToString("MM/dd/yyyy"), - licenseModel.EditionLogins, licenseModel.Price, licenseModel.ProductKey, licenseModel.LoginId, licenseModel.Password, + licenseModel.SubscriptionStartDate.ToString("MM/dd/yyyy"), licenseModel.SubscriptionEndDate.ToString("MM/dd/yyyy"), + licenseModel.EditionLogins, licenseModel.Price, licenseModel.ProductKey, licenseModel.LoginId, licenseModel.Password, licenseModel.SecurityQuestionId, licenseModel.Answer, licenseModel.CreatorId, licenseModel.NoOfImages); if (result.Count() > 0) { @@ -209,7 +289,7 @@ namespace AIAHTML5.ADMIN.API.Models result = dbContext.InsertTestLicenseAccount(licenseModel.AccountNumber, licenseModel.LicenseeFirstName, licenseModel.LicenseeLastName, licenseModel.LoginId, licenseModel.Password, licenseModel.EmailId, licenseModel.AccountTypeId, licenseModel.TestLicenseEditionId, licenseModel.Address1, licenseModel.City, licenseModel.Zip, licenseModel.StateId, licenseModel.CountryId, licenseModel.Phone, - licenseModel.SubscriptionStartDate.ToString("MM/dd/yyyy"), licenseModel.SubscriptionEndDate.ToString("MM/dd/yyyy"), + licenseModel.SubscriptionStartDate.ToString("MM/dd/yyyy"), licenseModel.SubscriptionEndDate.ToString("MM/dd/yyyy"), licenseModel.CreatorId, licenseModel.NoOfImages); if (result.Count() > 0) { @@ -233,9 +313,9 @@ namespace AIAHTML5.ADMIN.API.Models var result = dbContext.UpdateLicenseAccount(licenseModel.LicenseId, licenseModel.LicenseeFirstName, licenseModel.LicenseeLastName, licenseModel.LicenseTypeId, licenseModel.AccountTypeId, licenseModel.InstitutionName, licenseModel.Address1, licenseModel.Address2, licenseModel.City, licenseModel.Zip, licenseModel.StateId, licenseModel.CountryId, licenseModel.Phone, licenseModel.EmailId, - (byte)(licenseModel.IsActive == false ? 0 : 1), licenseModel.TotalLogins, (byte)(licenseModel.IsRenew == false ? 0 : 1), - licenseModel.SubscriptionStartDate.ToString("MM/dd/yyyy"), licenseModel.SubscriptionEndDate.ToString("MM/dd/yyyy"), - licenseModel.RenewDate.ToString("MM/dd/yyyy"), licenseModel.MasterSiteUrl, licenseModel.EditionLogins, licenseModel.Price, + (byte)(licenseModel.IsActive == false ? 0 : 1), licenseModel.TotalLogins, (byte)(licenseModel.IsRenew == false ? 0 : 1), + licenseModel.SubscriptionStartDate.ToString("MM/dd/yyyy"), licenseModel.SubscriptionEndDate.ToString("MM/dd/yyyy"), + licenseModel.RenewDate.ToString("MM/dd/yyyy"), licenseModel.MasterSiteUrl, licenseModel.EditionLogins, licenseModel.Price, licenseModel.ProductKey, licenseModel.SiteUrlTo, licenseModel.SiteUrlFrom, licenseModel.NoOfImages); if (result.Count() > 0) { @@ -254,20 +334,93 @@ namespace AIAHTML5.ADMIN.API.Models try { var spStatus = dbContext.DeleteLicense(LicenseId); - if (spStatus.Count() > 0) - { - return true; - } - else - { - return false; - } + if (spStatus.Count() > 0) + { + return true; + } + else + { + return false; + } } catch (Exception ex) { return false; } } + + public static bool UpdateLicenseBasicSettings(AIADatabaseV5Entities dbContext, LicenseModel licenseModel) + { + var spStatus = new System.Data.Objects.ObjectParameter("Status", 0); + try + { + var result = dbContext.usp_UpdateLicenseBasicSettings(licenseModel.LicenseId, licenseModel.LicenseeFirstName, licenseModel.LicenseeLastName, + licenseModel.InstitutionName, licenseModel.Address1, licenseModel.Address2, licenseModel.City, licenseModel.Zip, + licenseModel.StateId, licenseModel.CountryId, licenseModel.Phone, licenseModel.EmailId, spStatus); + return (bool)spStatus.Value; + } + catch (Exception ex) + { + return false; + } + } + + 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/Admin/dist/assets/styles/admin-custom.css b/400-SOURCECODE/Admin/dist/assets/styles/admin-custom.css index a4a3fdb..75bc717 100644 --- a/400-SOURCECODE/Admin/dist/assets/styles/admin-custom.css +++ b/400-SOURCECODE/Admin/dist/assets/styles/admin-custom.css @@ -164,4 +164,11 @@ .table-fixed thead { width: calc( 100% - 0em ) } +#fixed_hdr2 > tbody > tr.active > td { + background: #726D6D; + color: #FDFBFB; +} + + + /*30-1-2017*/ diff --git a/400-SOURCECODE/Admin/dist/index.html b/400-SOURCECODE/Admin/dist/index.html index aae9c53..6867edc 100644 --- a/400-SOURCECODE/Admin/dist/index.html +++ b/400-SOURCECODE/Admin/dist/index.html @@ -1,45 +1,7 @@ - - - - - - - - A.D.A.M. Interactive Anatomy - - - - - - - - - - - - - - - - - -
-
-
- -
- - - - - - - - - - - - - - + }) \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/app.component.html b/400-SOURCECODE/Admin/src/app/app.component.html index e7212a5..b7ee5cb 100644 --- a/400-SOURCECODE/Admin/src/app/app.component.html +++ b/400-SOURCECODE/Admin/src/app/app.component.html @@ -33,10 +33,10 @@ @@ -81,15 +81,15 @@
  • Product
  • diff --git a/400-SOURCECODE/Admin/src/app/app.module.ts b/400-SOURCECODE/Admin/src/app/app.module.ts index 78e33e5..74843c2 100644 --- a/400-SOURCECODE/Admin/src/app/app.module.ts +++ b/400-SOURCECODE/Admin/src/app/app.module.ts @@ -29,6 +29,10 @@ import { NetAdSubscriptionReport } from './components/Reports/netadsubscriptionr 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 { AppComponent } from './app.component'; import { AppRoutingModule } from './app.routing.module'; //import { AuthGuard } from '../app/authguard.service'; @@ -50,7 +54,11 @@ import { LoadingService } from './shared/loading.service'; AppComponent, ConfirmComponent, SubscriptionPrice, ManageDiscountCode, ContenteditableModelDirective, AddLicense, SearchLicense, UsageReport, CustomerSummaryReport, - ExpiringSubscriptionReport, SubscriptionReport, SubscriptionCancellationReport, NetAdSubscriptionReport, SiteLicenseUsageReport, DiscountCodeReport, ImageExportReport + ExpiringSubscriptionReport, SubscriptionReport, + SubscriptionCancellationReport, NetAdSubscriptionReport, + SiteLicenseUsageReport, DiscountCodeReport, ImageExportReport, + EditLicenseBasicSettings, LicenseModestySettings, + LicenseModuleSettings, SiteLicenseAccount, ], imports: [ BrowserModule, AppRoutingModule, HttpClientModule, FormsModule, ReactiveFormsModule, HttpModule, Ng2Bs3ModalModule, diff --git a/400-SOURCECODE/Admin/src/app/app.routing.module.ts b/400-SOURCECODE/Admin/src/app/app.routing.module.ts index a411a35..45ce696 100644 --- a/400-SOURCECODE/Admin/src/app/app.routing.module.ts +++ b/400-SOURCECODE/Admin/src/app/app.routing.module.ts @@ -19,6 +19,10 @@ import { NetAdSubscriptionReport } from './components/Reports/netadsubscriptionr 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'; const appRoutes: Routes = [ //{ path: '', redirectTo:'updateuserprofile',pathMatch } { path: 'updateuserprofile', component: UpdateUserProfile }, @@ -40,7 +44,11 @@ const appRoutes: Routes = [ { path: 'netadsubscriptionreport', component: NetAdSubscriptionReport }, { path: 'sitelicenseusagereport', component: SiteLicenseUsageReport }, { path: 'discountcodereport', component: DiscountCodeReport }, - { path: 'imageexportreport', component: ImageExportReport } + { path: 'imageexportreport', component: ImageExportReport }, + { path: 'editlicensebasicsettings', component: EditLicenseBasicSettings }, + { path: 'licensemodestysettings', component: LicenseModestySettings }, + { path: 'licensemodulesettings', component: LicenseModuleSettings }, + { path: 'sitelicenseaccount', component: SiteLicenseAccount } ]; @NgModule({ diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.html b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.html index ae245b9..e26758b 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.html +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.html @@ -18,474 +18,171 @@ -
    - -
    - -
    - -
    - -
    -
    -
    -
    -
    -
    - + +
    +
    -
    - -
    - - - -
    -
    -
    - -
    - - -
    -
    -
    -
    - -
    -
    - - - - - - - - - - - - - - - -
     ProductNo of Login
    - - {{item.Title}}{{item.Login}}
    -
    -
    - -
    -
    -
    - - - {{license.TotalLogins}} -
    -
    - - - {{license.TotalRenewals}} -
    -
    - -
    -
    -
    - -
    - -
    - -
    -
    - -
    - -
    Account number is required
    -
    -
    -
    +
    -
    -
    - -
    - -
    -
    -
    - -
    -
    - -
    - -
    +
    +
    +
    -
    -
    - -
    - -
    - -
    -
    - -
    - -
    Licensee first name is required
    -
    -
    -
    - -
    -
    - -
    - -
    Licensee last name is required
    -
    -
    -
    - -
    +
    -
    +
    -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - -
    Institution name is required
    -
    -
    -
    -
    -
    +
    -
    -
    -
    -
    - -
    - -
    Address is required
    -
    -
    -
    -
    -
    - -
    - -
    City is required
    -
    -
    -
    + + + +
    + +
    +
    - -
    -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    - -
    -
    +
    + +
    + +
    Licensee first name is required
    -
    -
    -
    -
    -
    - -
    - -
    Zip is required
    -
    -
    -
    -
    -
    - -
    - -
    Phone is required
    -
    -
    -
    +
    + +
    + +
    Licensee first name is required
    -
    -
    -
    -
    - -
    - -
    Email is required
    -
    -
    -
    +
    + +
    + +
    Institution name is required
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    Subscription start date is required
    - - - -
    -
    +
    + +
    + +
    Email is required
    -
    -
    - -
    -
    - -
    Subscription start date is required
    - - - -
    -
    +
    + +
    + +
    Address 1 is required
    -
    -
    - -
    -
    - -
    Renew date is required
    - - - -
    -
    +
    + +
    +
    -
    -
    - -
    - -
    Subscription price is required
    -
    Subscription price must be numeric
    -
    +
    + +
    + +
    City is required
    -
    -
    - -
    - -
    Number of export images is required
    -
    Number of export images must be numeric
    -
    +
    + +
    + +
    Zip is required
    -
    -
    - -
    - -
    -
    -
    - -
    -
    - -
    - -
    -
    -
    - -
    -
    - -
    - -
    +
    + +
    +
    -
    -
    - -
    - -
    User name is required
    -
    +
    + +
    +
    -
    -
    - -
    - -
    Password is required
    -
    +
    + +
    + +
    Phone is required
    -
    +
    -
    -
    - -
    - -
    +
    +
    +
    -
    -
    - -
    - -
    Answer is required
    + + + + +
    - - - - -
    -
    +
    +
    \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.ts b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.ts new file mode 100644 index 0000000..051ef71 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/editlicensebasicsettings.component.ts @@ -0,0 +1,125 @@ +import { Component, OnInit, AfterViewInit, Input, Output, EventEmitter, Pipe, PipeTransform, TemplateRef } from '@angular/core'; +import { LicenseService } from './license.service'; +import { GlobalService } from '../../Shared/global'; +import { Router, ActivatedRoute } from '@angular/router'; +import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { License } 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 { ContenteditableModelDirective } from '../../shared/contenteditabledirective' + +@Component({ + templateUrl: './editlicensebasicsettings.component.html' +}) + +export class EditLicenseBasicSettings implements OnInit { + + lstAccountNumbers: any; + lstCountry: any; + lstState: any; + license: License; + updateLicenseBasicSettingsFrm: FormGroup; + error: any; + alerts: string; + modalAlerts: string; + modalRef: BsModalRef; + + constructor(private licenseService: LicenseService, private globalService: GlobalService, private router: Router, private activeRoute: ActivatedRoute, private fb: FormBuilder, private modalService: BsModalService) { } + + ngOnInit(): void + { + this.license = new License(); + this.alerts = ''; + this.updateLicenseBasicSettingsFrm = this.fb.group({ + licenseId: [0], + accountNumber: ['', Validators.required], + licenseeFirstName: ['', Validators.required], + licenseeLastName: ['', Validators.required], + institutionName: ['', Validators.required], + address1: ['', Validators.required], + address2: [''], + city: ['', Validators.required], + stateId: [0], + countryId: [0], + zip: ['', Validators.required], + emailId: ['', Validators.required], + phone: ['', Validators.required], + }); + this.GetCountry(); + this.GetState(); + this.GetLicenseAccounts(); + } + + openModal(template: TemplateRef) { + this.modalRef = this.modalService.show(template); + } + + GetCountry() { + this.licenseService.GetCountry() + .subscribe(y => { this.lstCountry = y; }, error => this.error = error); + } + + GetState() { + this.licenseService.GetState() + .subscribe(st => { this.lstState = st; }, error => this.error = error); + } + + GetLicenseAccounts() { + this.licenseService.GetLicenseAccounts(0) + .subscribe(st => { this.lstAccountNumbers = st; console.log(this.lstAccountNumbers); }, error => this.error = error); + } + + GetLicenseById() { + if(this.license.LicenseId != 0) + { + this.licenseService.GetLicenseById(this.license.LicenseId) + .subscribe(st => { + this.license = st; + this.updateLicenseBasicSettingsFrm.controls['licenseId'].setValue(this.license.LicenseId); + this.updateLicenseBasicSettingsFrm.controls['accountNumber'].setValue(this.license.AccountNumber); + this.updateLicenseBasicSettingsFrm.controls['licenseeFirstName'].setValue(this.license.LicenseeFirstName); + this.updateLicenseBasicSettingsFrm.controls['licenseeLastName'].setValue(this.license.LicenseeLastName); + this.updateLicenseBasicSettingsFrm.controls['institutionName'].setValue(this.license.InstitutionName); + this.updateLicenseBasicSettingsFrm.controls['address1'].setValue(this.license.Address1); + this.updateLicenseBasicSettingsFrm.controls['address2'].setValue(this.license.Address2); + this.updateLicenseBasicSettingsFrm.controls['city'].setValue(this.license.City); + this.updateLicenseBasicSettingsFrm.controls['stateId'].setValue(this.license.StateId); + this.updateLicenseBasicSettingsFrm.controls['countryId'].setValue(this.license.CountryId); + this.updateLicenseBasicSettingsFrm.controls['zip'].setValue(this.license.Zip); + this.updateLicenseBasicSettingsFrm.controls['emailId'].setValue(this.license.EmailId); + this.updateLicenseBasicSettingsFrm.controls['phone'].setValue(this.license.Phone); + }, + error => this.error = error); + } + } + + AccountNumberChanged(LicenseId: number){ + this.license.LicenseId = LicenseId; + this.GetLicenseById(); + } + + AfterUpdateData(data, template) { + if (data.Status == "false") { + this.alerts = "License update unsuccessfull"; + } else { + this.modalAlerts = "

    License updated successfully

    "; + this.modalRef = this.modalService.show(template); + } + } + + UpdateLicenseBasicSettings(template: TemplateRef){ + this.alerts = ''; + if(this.alerts == ''){ + var obj = this.updateLicenseBasicSettingsFrm.value; + return this.licenseService.UpdateLicenseBasicSettings(obj) + .subscribe( + n => (this.AfterUpdateData(n, template)), + error => this.error = error); + } + } + + +} diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts index b957c09..0570f02 100644 --- a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/license.service.ts @@ -79,6 +79,42 @@ export class LicenseService{ .catch((res: Response) => this.handleError(res)); } + GetLicenseAccounts(licenseType: Number) { + return this.http.get(this.commonService.resourceBaseUrl + "/License/LicenseAccounts?LicenseType=" + licenseType) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + + GetSiteById(siteId: number) { + return this.http.get(this.commonService.resourceBaseUrl + "/Site/SiteDetail?SiteId=" + siteId) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + + GetSiteAccountEditions(siteId: number, licenseId: number) { + return this.http.get(this.commonService.resourceBaseUrl + "/Site/SiteAccountEditions?SiteId=" + siteId + "&LicenseId=" + licenseId) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + + GetLicenseSites(accountNo: string) { + return this.http.get(this.commonService.resourceBaseUrl + "/License/LicenseSites?AccountNo=" + accountNo) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + + GetLicenseModestySettings(licenseId: number, buildingLevelId: number) { + return this.http.get(this.commonService.resourceBaseUrl + "/License/LicenseModestySettings?LicenseId=" + licenseId + "&BuildingLevelId=" + buildingLevelId) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + + GetLicenseModulesStatus(licenseId: number) { + return this.http.get(this.commonService.resourceBaseUrl + "/License/LicenseModulesStatus?LicenseId=" + licenseId) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + InsertLicense(obj: any) { //let options = new RequestOptions({ headers: this.headers }); var jsonData = { @@ -174,11 +210,138 @@ export class LicenseService{ .catch((res: Response) => this.handleError(res)); } + UpdateLicenseBasicSettings(obj: any) { + //let options = new RequestOptions({ headers: this.headers }); + var jsonData = { + 'licenseId': obj.licenseId, + 'accountNumber': obj.accountNumber, + 'licenseeFirstName': obj.licenseeFirstName, + 'licenseeLastName': obj.licenseeLastName, + 'institutionName': obj.institutionName, + 'address1': obj.address1, + 'address2': obj.address2, + 'city': obj.city, + 'zip': obj.zip, + 'stateId': obj.stateId, + 'countryId': obj.countryId, + 'phone': obj.phone, + 'email': obj.emailId + }; + var headers = new Headers({ + 'Content-Type': 'application/json' + }); + return this.http.post(this.commonService.resourceBaseUrl + "/License/UpdateLicenseBasicSettings", + JSON.stringify(jsonData), {headers: headers}) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + + UpdateLicenseModestySettings(jsonObj: any) { + //let options = new RequestOptions({ headers: this.headers }); + var obj = []; + jsonObj.lstModesty.forEach(element => { + obj.push( + { + 'siteId': jsonObj.siteId, + 'licenseEditionId': element.m_Item1, + 'isModesty': element.m_Item2 + } + ); + }); + var jsonData = { obj }; + var headers = new Headers({ + 'Content-Type': 'application/json' + }); + return this.http.post(this.commonService.resourceBaseUrl + "/License/UpdateLicenseModestySettings", + JSON.stringify(jsonData), {headers: headers}) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + + UpdateLicenseModulesStatus(jsonObj: any) { + //let options = new RequestOptions({ headers: this.headers }); + var obj = []; + jsonObj.lstModuleStatus.forEach(element => { + obj.push( + { + 'licenseId': jsonObj.licenseId, + 'moduleId': element.m_Item1, + 'status': element.m_Item2 + } + ); + }); + var jsonData = { obj }; + var headers = new Headers({ + 'Content-Type': 'application/json' + }); + return this.http.post(this.commonService.resourceBaseUrl + "/License/UpdateLicenseModulesStatus", + JSON.stringify(jsonData), {headers: headers}) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + DeleteLicense(obj: any) { return this.http.get(this.commonService.resourceBaseUrl + "/License/DeleteLicense?LicenseId=" + obj.LicenseId) .map(this.extractData) .catch((res: Response) => this.handleError(res)); - } + } + + InsertUpdateSiteAccount(obj: any) { + //let options = new RequestOptions({ headers: this.headers }); + var temptext = ''; + obj.editionLoginArr.forEach(element => { + if(element.Login == 1){ + temptext += element.Id + ','; + } + }); + if(temptext != ''){ + temptext = temptext.substr(0, temptext.length - 1); + } + if(obj.siteId == 0){ + obj.creationDate = new Date(); + obj.modifiedDate = new Date(); + } + else{ + obj.modifiedDate = new Date(); + } + var jsonData = { + 'licenseId': obj.licenseId, + 'siteId': obj.siteId, + 'title': obj.buildAccName, + 'siteUrl': obj.siteUrl, + 'siteUrlTo': obj.siteUrlTo, + 'siteMasterUrlTo': obj.siteMasterUrlTo, + 'institutionName': obj.institutionName, + 'departmentName': obj.departmentName, + 'address1': obj.address1, + 'address2': obj.address2, + 'city': obj.city, + 'phone': obj.phone, + 'zip': obj.zip, + 'countryId': obj.countryId, + 'stateId': obj.stateId, + 'userId': obj.clientAdminId, + 'isActive': obj.isActive, + 'isMaster': obj.isMaster, + 'creationDate': obj.creationDate, + 'modifiedDate': obj.modifiedDate, + 'siteEditionIds': temptext + }; + var headers = new Headers({ + 'Content-Type': 'application/json' + }); + return this.http.post(this.commonService.resourceBaseUrl + "/Site/InsertUpdateSiteAccount", + JSON.stringify(jsonData), {headers: headers}) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } + + DeleteSiteAccount(obj: any) { + return this.http.get(this.commonService.resourceBaseUrl + "/Site/DeleteSiteAccount?SiteId=" + + obj.Id + "&LicenseId=" + obj.LicenseId + "&UserId=" + obj.SiteUserId) + .map(this.extractData) + .catch((res: Response) => this.handleError(res)); + } extractData(res: Response) { //debugger; diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.html b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.html new file mode 100644 index 0000000..d4ee4fb --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.html @@ -0,0 +1,164 @@ + +
    + +
    +

    Manage Modesty Settings

    +
    + + + + + + + +
    + +
    + +
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    + +
    +
    + +
    + +
    + +
    + + +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + {{item.m_Item3}} +
    + +
    + + + +
    +
    + +
    +
    +
    +
    + + + +
    + +
    +
    + +
    + + + + + + + + + + +
    +
    +
    +
    +
    +
    +
    + + + + +
    + \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.ts b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.ts new file mode 100644 index 0000000..fc51375 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodestysettings.component.ts @@ -0,0 +1,129 @@ +import { Component, OnInit, AfterViewInit, Input, Output, EventEmitter, Pipe, PipeTransform, TemplateRef } from '@angular/core'; +import { LicenseService } from './license.service'; +import { GlobalService } from '../../Shared/global'; +import { Router, ActivatedRoute } from '@angular/router'; +import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { License } 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 { ContenteditableModelDirective } from '../../shared/contenteditabledirective' + +@Component({ + templateUrl: './licensemodestysettings.component.html' +}) + +export class LicenseModestySettings implements OnInit { + + lstAccountNumbers: any; + lstLicenseSites: any; + lstLicenseEditionModesty: any; + license: License; + updateModestySettingsFrm: FormGroup; + error: any; + alerts: string; + modalAlerts: string; + modalRef: BsModalRef; + selectedSiteId: number = 0; + isBuildingLevel: boolean = false; + + constructor(private licenseService: LicenseService, private globalService: GlobalService, private router: Router, private activeRoute: ActivatedRoute, private fb: FormBuilder, private modalService: BsModalService) { } + + ngOnInit(): void + { + this.license = new License(); + this.alerts = ''; + this.updateModestySettingsFrm = this.fb.group({ + licenseId: [0], + accountNumber: ['', Validators.required], + siteId: [0], + lstModesty: [this.fb.array([])], + }); + this.GetLicenseAccounts(); + } + + openModal(template: TemplateRef) { + this.modalRef = this.modalService.show(template); + } + + GetLicenseAccounts() { + this.licenseService.GetLicenseAccounts(0) + .subscribe(st => { this.lstAccountNumbers = st; }, error => this.error = error); + } + + ShowModestyorSites() { + this.lstLicenseEditionModesty = null; + this.lstLicenseSites = null; + this.selectedSiteId = 0; + if(!this.isBuildingLevel){ + this.GetLicenseEditionModesty(); + } + else{ + this.licenseService.GetLicenseSites(this.license.AccountNumber) + .subscribe(st => { this.lstLicenseSites = st; }, error => this.error = error); + } + } + + GetLicenseEditionModesty() { + this.licenseService.GetLicenseModestySettings(this.license.LicenseId, this.selectedSiteId) + .subscribe(st => { + this.lstLicenseEditionModesty = st; + this.updateModestySettingsFrm.setControl('lstModesty', this.fb.array(this.lstLicenseEditionModesty)); + }, error => this.error = error); + } + + LicenseSiteChanged(siteId: number){ + this.selectedSiteId = siteId; + if(this.selectedSiteId == 0) { + this.lstLicenseEditionModesty = null; + return; + } + this.GetLicenseEditionModesty(); + } + + GetLicenseById() { + if(this.license.LicenseId != 0) + { + this.licenseService.GetLicenseById(this.license.LicenseId) + .subscribe(st => { + this.license = st; + this.updateModestySettingsFrm.controls['licenseId'].setValue(this.license.LicenseId); + this.updateModestySettingsFrm.controls['accountNumber'].setValue(this.license.AccountNumber); + }, + error => this.error = error); + } + } + + AccountNumberChanged(LicenseId: number){ + this.license.LicenseId = LicenseId; + this.lstLicenseEditionModesty = null; + this.lstLicenseSites = null; + this.selectedSiteId = 0; + this.isBuildingLevel = false; + this.GetLicenseById(); + } + + AfterUpdateData(data, template) { + if (data.Status == "false") { + this.alerts = "License modesty setings update unsuccessfull"; + } else { + this.modalAlerts = "

    License modesty setings updated successfully

    "; + this.modalRef = this.modalService.show(template); + } + } + + UpdateLicenseModestySettings(template: TemplateRef){ + this.alerts = ''; + if(this.alerts == ''){ + var obj = this.updateModestySettingsFrm.value; + return this.licenseService.UpdateLicenseModestySettings(obj) + .subscribe( + n => (this.AfterUpdateData(n, template)), + error => this.error = error); + } + } + + +} diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodulesettings.component.html b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodulesettings.component.html new file mode 100644 index 0000000..675a664 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodulesettings.component.html @@ -0,0 +1,120 @@ + +
    + +
    +

    Manage Modesty Settings

    +
    + + + + + + + +
    + +
    + +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + {{item.m_Item3}} +
    + +
    + + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + + + + + + +
    +
    +
    +
    + + + +
    +
    +
    + \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodulesettings.component.ts b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodulesettings.component.ts new file mode 100644 index 0000000..1941221 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/licensemodulesettings.component.ts @@ -0,0 +1,101 @@ +import { Component, OnInit, AfterViewInit, Input, Output, EventEmitter, Pipe, PipeTransform, TemplateRef } from '@angular/core'; +import { LicenseService } from './license.service'; +import { GlobalService } from '../../Shared/global'; +import { Router, ActivatedRoute } from '@angular/router'; +import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { License } 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 { ContenteditableModelDirective } from '../../shared/contenteditabledirective' + +@Component({ + templateUrl: './licensemodulesettings.component.html' +}) + +export class LicenseModuleSettings implements OnInit { + + lstAccountNumbers: any; + lstModuleStatus: any; + license: License; + updateModuleSettingsFrm: FormGroup; + error: any; + alerts: string; + modalAlerts: string; + modalRef: BsModalRef; + + constructor(private licenseService: LicenseService, private globalService: GlobalService, private router: Router, private activeRoute: ActivatedRoute, private fb: FormBuilder, private modalService: BsModalService) { } + + ngOnInit(): void + { + this.license = new License(); + this.alerts = ''; + this.updateModuleSettingsFrm = this.fb.group({ + licenseId: [0], + accountNumber: [''], + lstModuleStatus: [this.fb.array([])], + }); + this.GetLicenseAccounts(); + } + + openModal(template: TemplateRef) { + this.modalRef = this.modalService.show(template); + } + + GetLicenseAccounts() { + this.licenseService.GetLicenseAccounts(0) + .subscribe(st => { this.lstAccountNumbers = st; }, error => this.error = error); + } + + GetLicenseModulesStatus() { + this.licenseService.GetLicenseModulesStatus(this.license.LicenseId) + .subscribe(st => { + this.lstModuleStatus = st; + this.updateModuleSettingsFrm.setControl('lstModuleStatus', this.fb.array(this.lstModuleStatus)); + }, error => this.error = error); + } + + GetLicenseById() { + if(this.license.LicenseId != 0) + { + this.licenseService.GetLicenseById(this.license.LicenseId) + .subscribe(st => { + this.license = st; + this.updateModuleSettingsFrm.controls['licenseId'].setValue(this.license.LicenseId); + this.updateModuleSettingsFrm.controls['accountNumber'].setValue(this.license.AccountNumber); + this.GetLicenseModulesStatus(); + }, + error => this.error = error); + } + } + + AccountNumberChanged(LicenseId: number){ + this.license.LicenseId = LicenseId; + this.lstModuleStatus = null; + this.GetLicenseById(); + } + + AfterUpdateData(data, template) { + if (data.Status == "false") { + this.alerts = "License module status update unsuccessfull"; + } else { + this.modalAlerts = "

    License module status updated successfully

    "; + this.modalRef = this.modalService.show(template); + } + } + + UpdateLicenseModulesStatus(template: TemplateRef){ + this.alerts = ''; + if(this.alerts == ''){ + var obj = this.updateModuleSettingsFrm.value; + return this.licenseService.UpdateLicenseModulesStatus(obj) + .subscribe( + n => (this.AfterUpdateData(n, template)), + error => this.error = error); + } + } + + +} diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.html b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.html new file mode 100644 index 0000000..fdfffea --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.html @@ -0,0 +1,376 @@ + +
    + +
    +

    Add Building Level Account

    +
    + + + + + + + + + + + + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Site UrlSite Url ToAccount NameInstitution NameDepartment NameClient AdminClient Admin Email IDOriginal Entry DateLast Modified Date
    + {{item.Ip}} + {{item.SiteIpTo}}{{item.Title}}{{item.InstituteName}}{{item.Department}}{{item.SiteUserFirstName}}{{item.SiteUserEmailId}}{{item.CreationDate | date: 'MM/dd/yyyy'}}{{item.ModifiedDate | date: 'MM/dd/yyyy'}}
    +
    +
    + + + +
    +
    +
    + + + + + + + +
    + +
    + +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    + +
    Site url is required
    +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    +
    + +
    + +
    + +
    + +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + +
    Institution name is required
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + +
    Address is required
    +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    +
    + +
    + +
    City is required
    +
    +
    +
    + +
    +
    + +
    + +
    State is required
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    Country is required
    +
    +
    + +
    +
    + +
    + +
    Zip is required
    +
    +
    +
    + +
    +
    + +
    +
    + +
    Phone is required
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + +
    +
    +
    +
    +
    + +
    + + +
    + + +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.ts b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.ts new file mode 100644 index 0000000..f4925c3 --- /dev/null +++ b/400-SOURCECODE/Admin/src/app/components/LicenseEntity/sitelicenseaccount.component.ts @@ -0,0 +1,343 @@ +import { Component, OnInit, AfterViewInit, Input, Output, EventEmitter, Pipe, PipeTransform, TemplateRef } from '@angular/core'; +import { LicenseService } from './license.service'; +import { Router, ActivatedRoute } from '@angular/router'; +import { FormControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { License } 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'; + +declare var $:any; + +@Component({ + templateUrl: './sitelicenseaccount.component.html' +}) + +export class SiteLicenseAccount implements OnInit { + + lstCountry: any; + lstState: any; + lstAccountNumbers: any; + lstLicenseSites: any; + licenseSite: any; + mode: string = 'Search'; + license: License; + insertUpdateSiteLicenseFrm: FormGroup; + error: any; + alerts: string; + modalAlerts: string; + divClass: string = ''; + topPos: string = '2000px'; + selectedRow: number = 0; + selectedId: number = 0; + modalRef: BsModalRef; + lstEdition: any; + lstEditionLogins: any; + lstSiteAccountEditions: any; + lstClientAdmin: any; + + constructor(private licenseService: LicenseService, private router: Router, private activeRoute: ActivatedRoute, private fb: FormBuilder, private modalService: BsModalService) { } + + ngOnInit(): void + { + this.divClass = 'col-sm-12'; + this.license = new License(); + this.alerts = ''; + this.insertUpdateSiteLicenseFrm = this.fb.group({ + licenseId: [0], + accountNumber: [{value: '', disabled: true}], + siteId: [0], + siteUrl: ['', Validators.required], + siteUrlTo: [''], + siteMasterUrlTo: [''], + buildAccName: [''], + institutionName: ['', Validators.required], + departmentName: [''], + address1: ['', Validators.required], + address2: [''], + city: ['', Validators.required], + countryId: [0, Validators.min(1)], + stateId: [0, Validators.min(1)], + zip: ['', Validators.required], + phone: ['', Validators.required], + clientAdminId: [0, Validators.min(1)], + clientAdminEmail: [{value: '', disabled: true}, Validators.email], + isActive: [0], + isMaster: [0], + creationDate: [''], + modifiedDate: [''], + editionLoginArr: this.fb.array([]), + }); + this.GetCountry(); + this.GetState(); + this.GetEditions(); + this.GetLicenseAccounts(); + $('#fixed_hdr2').fxdHdrCol({ + fixedCols: 0, + width: "100%", + height: 330, + colModal: [ + { width: 200, align: 'center' }, + { width: 200, align: 'center' }, + { width: 200, align: 'Center' }, + { width: 200, align: 'Center' }, + { width: 250, align: 'Center' }, + { width: 200, align: 'Center' }, + { width: 200, align: 'Center' }, + { width: 200, align: 'Center' }, + { width: 200, align: 'Center' }, + ], + sort: true + }); + + document.getElementById("fixed_table_rc").remove(); + var testScript = document.createElement("script"); + testScript.setAttribute("id", "fixed_table_rc"); + testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); + testScript.setAttribute("type", "text/javascript"); + document.body.appendChild(testScript); + } + + openModal(template: TemplateRef) { + this.modalRef = this.modalService.show(template); + } + + public SetClickedRow(i: number, item: any) { + this.selectedRow = i; + this.selectedId = item['Id']; + this.licenseSite = item; + } + + BindFormFields(data){ + this.selectedRow = 0; + this.lstLicenseSites = data; + this.selectedId = this.lstLicenseSites[this.selectedRow].siteId; + } + + GetLicenseAccounts() { + this.licenseService.GetLicenseAccounts(3) + .subscribe(st => { this.lstAccountNumbers = st; }, error => this.error = error); + } + + AccountNumberChanged(LicenseId: number){ + this.license.LicenseId = LicenseId; + this.lstLicenseSites = null; + this.GetLicenseById(); + } + + GetCountry() { + this.licenseService.GetCountry() + .subscribe(y => { this.lstCountry = y; }, error => this.error = error); + } + + GetState() { + this.licenseService.GetState() + .subscribe(st => { this.lstState = st; }, error => this.error = error); + } + + GetSiteById(){ + this.licenseService.GetSiteById(this.selectedId) + .subscribe(st => { + this.licenseSite = st; + this.insertUpdateSiteLicenseFrm.controls['siteId'].setValue(this.licenseSite.Id); + this.insertUpdateSiteLicenseFrm.controls['buildAccName'].setValue(this.licenseSite.Title); + this.insertUpdateSiteLicenseFrm.controls['siteUrl'].setValue(this.licenseSite.Ip); + this.insertUpdateSiteLicenseFrm.controls['siteUrlTo'].setValue(this.licenseSite.SiteIpTo); + this.insertUpdateSiteLicenseFrm.controls['siteMasterUrlTo'].setValue(this.licenseSite.MasterIpTo); + this.insertUpdateSiteLicenseFrm.controls['institutionName'].setValue(this.licenseSite.InstituteName); + this.insertUpdateSiteLicenseFrm.controls['departmentName'].setValue(this.licenseSite.Department); + this.insertUpdateSiteLicenseFrm.controls['address1'].setValue(this.licenseSite.Address1); + this.insertUpdateSiteLicenseFrm.controls['address2'].setValue(this.licenseSite.Address2); + this.insertUpdateSiteLicenseFrm.controls['city'].setValue(this.licenseSite.City); + this.insertUpdateSiteLicenseFrm.controls['phone'].setValue(this.licenseSite.Phone); + this.insertUpdateSiteLicenseFrm.controls['zip'].setValue(this.licenseSite.Zip); + this.insertUpdateSiteLicenseFrm.controls['countryId'].setValue(this.licenseSite.CountryId); + this.insertUpdateSiteLicenseFrm.controls['stateId'].setValue(this.licenseSite.StateId); + this.insertUpdateSiteLicenseFrm.controls['isActive'].setValue(this.licenseSite.IsActive); + this.insertUpdateSiteLicenseFrm.controls['isMaster'].setValue(this.licenseSite.IsMaster); + this.insertUpdateSiteLicenseFrm.controls['creationDate'].setValue(this.licenseSite.CreationDate); + this.insertUpdateSiteLicenseFrm.controls['modifiedDate'].setValue(this.licenseSite.ModifiedDate); + this.insertUpdateSiteLicenseFrm.controls['clientAdminId'].setValue(this.lstLicenseSites[0].SiteUserId); + this.GetSiteAccountEditions(); + }, error => this.error = error); + } + + GetSiteAccountEditions(){ + this.licenseService.GetSiteAccountEditions(this.licenseSite.Id, this.license.LicenseId) + .subscribe(st => { + this.lstSiteAccountEditions = st; + this.lstEditionLogins.forEach(element => { + this.lstSiteAccountEditions.forEach(elm => { + if(elm.m_Item2 == element.Id){ + element.Login = 1; + } + }); + }); + this.insertUpdateSiteLicenseFrm.setControl('editionLoginArr', this.fb.array(this.lstEditionLogins)); + }, error => this.error = error); + } + + GetLicenseSites(){ + this.licenseService.GetLicenseSites(this.license.AccountNumber) + .subscribe(st => { + this.lstLicenseSites = st; + this.insertUpdateSiteLicenseFrm.controls['clientAdminId'].setValue(this.lstLicenseSites[0].SiteUserId); + this.insertUpdateSiteLicenseFrm.controls['clientAdminEmail'].setValue(this.lstLicenseSites[0].SiteUserEmailId); + var tempArr = []; + tempArr.push( + { + "Id": this.lstLicenseSites[0].SiteUserId, + "Name": this.lstLicenseSites[0].SiteUserFirstName + }); + this.lstClientAdmin = tempArr; + }, error => this.error = error); + } + + GetEditions() { + this.licenseService.GetEditions() + .subscribe(x => { + this.lstEdition = x; + }, error => this.error = error); + } + + onChange(item: any, isChecked: boolean){ + if(this.license.LicenseTypeId == 3){ + if(isChecked){ + item.Login = 1; + } + else{ + item.Login = 0; + } + } + } + + GetLicenseById() { + if(this.license.LicenseId != 0) + { + this.licenseService.GetLicenseById(this.license.LicenseId) + .subscribe(st => { + this.license = st; + this.insertUpdateSiteLicenseFrm.controls['licenseId'].setValue(this.license.LicenseId); + this.insertUpdateSiteLicenseFrm.controls['accountNumber'].setValue(this.license.AccountNumber); + if(this.license.EditionLogins == null) return; + var TempArr = this.license.EditionLogins.split('|'); + this.lstEditionLogins = new Array(); + this.lstEdition.forEach(element => { + TempArr.forEach(elm => { + var TempInnerArr = elm.split('-'); + if(TempInnerArr[0] == element.Id){ + this.lstEditionLogins.push({Id: element.Id, Title: element.Title, Login: 0}); + } + }); + }); + this.insertUpdateSiteLicenseFrm.setControl('editionLoginArr', this.fb.array(this.lstEditionLogins)); + }, + error => this.error = error); + } + } + + AfterDeleteData(data, template) { + if (data.Status == "false") { + this.alerts = "Site account delete unsuccessfull"; + } else { + this.modalAlerts = "

    Site account deleted successfully

    "; + this.modalRef = this.modalService.show(template); + this.GetLicenseSites(); + } + } + + AfterInsertData(data, template) { + if (data.Status == "false") { + this.alerts = "License site save unsuccessfull"; + } else { + this.modalAlerts = "

    License site saved successfully

    "; + this.modalRef = this.modalService.show(template); + } + } + + AfterUpdateData(data, template) { + if (data.Status == "false") { + this.alerts = "License site update unsuccessfull"; + } else { + this.modalAlerts = "

    License site updated successfully

    "; + this.modalRef = this.modalService.show(template); + } + } + + InsertUpdateSiteAccount(template: TemplateRef) { + this.alerts = ''; + var obj = this.insertUpdateSiteLicenseFrm.value; + var temptext = ''; + obj.editionLoginArr.forEach(element => { + if(element.Login == 1){ + temptext += element.Id + ','; + } + }); + if(temptext == ''){ + this.alerts = "Please select a product edition"; + } + if(this.alerts == ''){ + return this.licenseService.InsertUpdateSiteAccount(obj) + .subscribe( + n => (this.AfterInsertData(n, template)), + error => this.error = error); + } + } + + DeleteSiteAccount(template: TemplateRef){ + this.modalRef.hide(); + this.alerts = ''; + if(this.alerts == ''){ + var obj = this.licenseSite; + obj.LicenseId = this.license.LicenseId; + return this.licenseService.DeleteSiteAccount(obj) + .subscribe( + data => (this.AfterDeleteData(data, template)), + error => { + this.error = error; + this.alerts = "" + this.error + ""; + }); + } + } + + AddLicenseSite(template: TemplateRef){ + this.mode = 'Add'; + this.topPos = '100px'; + this.alerts = ''; + this.insertUpdateSiteLicenseFrm.controls['siteId'].setValue(0); + this.insertUpdateSiteLicenseFrm.controls['buildAccName'].setValue(''); + this.insertUpdateSiteLicenseFrm.controls['siteUrl'].setValue(''); + this.insertUpdateSiteLicenseFrm.controls['siteUrlTo'].setValue(''); + this.insertUpdateSiteLicenseFrm.controls['institutionName'].setValue(''); + this.insertUpdateSiteLicenseFrm.controls['departmentName'].setValue(''); + this.insertUpdateSiteLicenseFrm.controls['address1'].setValue(''); + this.insertUpdateSiteLicenseFrm.controls['address2'].setValue(''); + this.insertUpdateSiteLicenseFrm.controls['city'].setValue(''); + this.insertUpdateSiteLicenseFrm.controls['phone'].setValue(''); + this.insertUpdateSiteLicenseFrm.controls['zip'].setValue(''); + this.insertUpdateSiteLicenseFrm.controls['countryId'].setValue(0); + this.insertUpdateSiteLicenseFrm.controls['stateId'].setValue(0); + this.insertUpdateSiteLicenseFrm.controls['isActive'].setValue(1); + this.insertUpdateSiteLicenseFrm.controls['isMaster'].setValue(0); + this.insertUpdateSiteLicenseFrm.controls['creationDate'].setValue(''); + this.insertUpdateSiteLicenseFrm.controls['modifiedDate'].setValue(''); + this.insertUpdateSiteLicenseFrm.controls['clientAdminId'].setValue(0); +} + + EditLicenseSite(template: TemplateRef){ + this.mode = 'Edit'; + this.topPos = '100px'; + this.alerts = ''; + this.GetSiteById(); + } + + CancelAddEdit(){ + this.mode = 'Search'; + this.topPos = '2000px'; + this.GetLicenseSites(); + this.selectedRow = this.lstLicenseSites.findIndex(C => C.Id == this.selectedId); + this.SetClickedRow(this.selectedRow, this.lstLicenseSites[this.selectedRow]); + } +} diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.html index ed4ff12..81ce34d 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.html @@ -174,6 +174,10 @@ + + + + {{csr.AccountNumber}} {{csr.LicenseeName}} diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.ts index 9be4dfe..ae06a3b 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.ts @@ -15,7 +15,7 @@ import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'; import { DatePipe } from '@angular/common'; import { BsDatepickerModule } from 'ngx-bootstrap'; import { Http, Response } from '@angular/http'; - +import { LoadingService } from '../../shared/loading.service'; declare var $: any; @@ -48,10 +48,12 @@ export class CustomerSummaryReport implements OnInit { modalRef: BsModalRef; date = new Date(); previousdate = new Date(); - - constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, private modalService: BsModalService) { } + NoRecord: string; + constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, + private modalService: BsModalService, private global: GlobalService, private _loadingService: LoadingService) { } ngOnInit(): void { + this.NoRecord = this.global.NoRecords; let CustomerSummaryReport = new CustomerSummaryReports(); this.previousdate.setDate(this.previousdate.getDate() - 365); this.CustomerSummaryReportForm = this.fb.group({ @@ -65,6 +67,7 @@ export class CustomerSummaryReport implements OnInit { sSubscriptionEnd: [0.00], iCountry: [0] }); + this.GetCountry(); this.GetState(); this.GetAccountType(); @@ -104,6 +107,7 @@ export class CustomerSummaryReport implements OnInit { testScript.setAttribute("type", "text/javascript"); document.body.appendChild(testScript); //this.GetUsageReport(); + this._loadingService.HideLoading("global-loading"); } GetCountry() { @@ -122,9 +126,23 @@ export class CustomerSummaryReport implements OnInit { } GetCustomerSummeryReport(this) { - this.customersummaryreport = this.CustomerSummaryReportForm.value; - var obj = this.customersummaryreport; + this._loadingService.ShowLoading("global-loading"); + this.customersummaryreport = this.CustomerSummaryReportForm.value; + var obj = this.customersummaryreport; - this.reportservice.GetCustomerSummeryReport(obj).subscribe((CustomerSummaryReports: CustomerSummaryReports[]) => { this.lstCustomerSummaryReport = CustomerSummaryReports; this.numberOfUsageReport = this.lstCustomerSummaryReport.length; this.limit = this.lstCustomerSummaryReport.length; }, error => this.error = error); + this.reportservice.GetCustomerSummeryReport(obj).subscribe((CustomerSummaryReports: CustomerSummaryReports[]) => { this.BindFormFields(CustomerSummaryReports); }, error => this.error = error); } + BindFormFields(data) { + this.lstCustomerSummaryReport = data + this.numberOfCustomerSummaryReport = this.lstCustomerSummaryReport.length; this.limit = this.lstCustomerSummaryReport.length; + if (this.lstCustomerSummaryReport.length > 0) { + this.NoRecord = ''; + this._loadingService.HideLoading("global-loading"); + } + if (this.lstCustomerSummaryReport.length == 0) { + this.NoRecord = this.global.NoRecords; + this._loadingService.HideLoading("global-loading"); + } + } + } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.html index e4e8261..8c76f8c 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.html @@ -129,6 +129,10 @@ + + + + {{item.DiscountCode}} {{item.Percentage}}% diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts index e1b4860..816c9e6 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts @@ -15,6 +15,7 @@ import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'; import { DatePipe } from '@angular/common'; import { BsDatepickerModule } from 'ngx-bootstrap'; import { Http, Response } from '@angular/http'; +import { LoadingService } from '../../shared/loading.service'; declare var $: any; @@ -41,10 +42,12 @@ export class DiscountCodeReport implements OnInit { modalRef: BsModalRef; date = new Date(); previousdate = new Date(); - - constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, private modalService: BsModalService) { } + NoRecord: string; + constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, + private modalService: BsModalService, private global: GlobalService, private _loadingService: LoadingService) { } ngOnInit(): void { + this.NoRecord = this.global.NoRecords; let DiscountCodeReport = new DiscountCodeReports(); this.previousdate.setDate(this.previousdate.getDate() - 365); this.DiscountCodeReportForm = this.fb.group({ @@ -53,8 +56,9 @@ export class DiscountCodeReport implements OnInit { iDiscountCode: [0], iAccountNumber: [] }); - + this._loadingService.ShowLoading("global-loading"); this.GetDiscountCode(); + this._loadingService.HideLoading("global-loading"); //this.GetSubscriptionReport(); $('#fixed_hdr2').fxdHdrCol({ fixedCols: 0, @@ -90,6 +94,7 @@ export class DiscountCodeReport implements OnInit { testScript.setAttribute("type", "text/javascript"); document.body.appendChild(testScript); //this.GetSubscriptionCancellationReport(); + } @@ -100,8 +105,21 @@ export class DiscountCodeReport implements OnInit { GetDiscountReport(this) { + this._loadingService.ShowLoading("global-loading"); this.NewSubscription = this.DiscountCodeReportForm.value; var obj = this.NewSubscription; - this.reportservice.GetDiscountReport(obj).subscribe((DiscountCodeReports: DiscountCodeReports[]) => { this.lstDiscountCodeReport = DiscountCodeReports; this.numberOfDiscountCodeReport = this.lstDiscountCodeReport.length; this.limit = this.lstDiscountCodeReport.length; }, error => this.error = error); + this.reportservice.GetDiscountReport(obj).subscribe((DiscountCodeReports: DiscountCodeReports[]) => { this.BindFormFields(DiscountCodeReports); }, error => this.error = error); + } + BindFormFields(data) { + this.lstDiscountCodeReport = data + this.numberOfDiscountCodeReport = this.lstDiscountCodeReport.length; this.limit = this.lstDiscountCodeReport.length; + if (this.lstDiscountCodeReport.length > 0) { + this.NoRecord = ''; + this._loadingService.HideLoading("global-loading"); + } + if (this.lstDiscountCodeReport.length == 0) { + this.NoRecord = this.global.NoRecords; + this._loadingService.HideLoading("global-loading"); + } } } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.html index 3dfe667..2ff74f2 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.html @@ -181,6 +181,10 @@ + + + + {{esr.AccountNumber}} {{esr.LicenseeName}} diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.ts index c23559b..6b13f2c 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.ts @@ -15,7 +15,7 @@ import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'; import { DatePipe } from '@angular/common'; import { BsDatepickerModule } from 'ngx-bootstrap'; import { Http, Response } from '@angular/http'; - +import { LoadingService } from '../../shared/loading.service'; declare var $: any; @@ -46,10 +46,13 @@ export class ExpiringSubscriptionReport implements OnInit { modalRef: BsModalRef; date = new Date(); previousdate = new Date(); - - constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, private modalService: BsModalService) { } + NoRecord: string; + constructor(private router: Router, private reportservice: ReportService, + private fb: FormBuilder, private modalService: BsModalService, + private global: GlobalService, private _loadingService: LoadingService) { } ngOnInit(): void { + this.NoRecord = this.global.NoRecords; let ExpiringSubscriptionReport = new ExpiringSubscriptionReports(); this.previousdate.setDate(this.previousdate.getDate() - 365); this.ExpiringSubscriptionReportForm = this.fb.group({ @@ -63,10 +66,12 @@ export class ExpiringSubscriptionReport implements OnInit { iEndPrice: [0.00], iCountryId: [0] }); + this._loadingService.ShowLoading("global-loading"); this.GetCountry(); this.GetState(); this.GetAccountType(); this.GetLicenceType(); + this._loadingService.HideLoading("global-loading"); //this.GetCustomerSummeryReport(); $('#fixed_hdr2').fxdHdrCol({ fixedCols: 0, @@ -120,10 +125,23 @@ export class ExpiringSubscriptionReport implements OnInit { this.reportservice.GetAccountType().subscribe(st => { this.lstAccountType = st; }, error => this.error = error); } - GetExpiringSubscriptionReport(this) { + GetExpiringSubscriptionReport(this) { + this._loadingService.ShowLoading("global-loading"); this.ExpiringSubscription = this.ExpiringSubscriptionReportForm.value; var obj = this.ExpiringSubscription; - this.reportservice.GetExpiringSubscriptionReport(obj).subscribe((ExpiringSubscriptionReports: ExpiringSubscriptionReports[]) => { this.lstExpiringSubscriptionReport = ExpiringSubscriptionReports; this.numberOfExpiringSubscriptionReport = this.lstExpiringSubscriptionReport.length; this.limit = this.lstExpiringSubscriptionReport.length; }, error => this.error = error); + this.reportservice.GetExpiringSubscriptionReport(obj).subscribe((ExpiringSubscriptionReports: ExpiringSubscriptionReports[]) => { this.BindFormFields(ExpiringSubscriptionReports); }, error => this.error = error); } + BindFormFields(data) { + this.lstExpiringSubscriptionReport = data + this.numberOfExpiringSubscriptionReport = this.lstExpiringSubscriptionReport.length; this.limit = this.lstExpiringSubscriptionReport.length; + if (this.lstExpiringSubscriptionReport.length > 0) { + this.NoRecord = ''; + this._loadingService.HideLoading("global-loading"); + } + if (this.lstExpiringSubscriptionReport.length == 0) { + this.NoRecord = this.global.NoRecords; + this._loadingService.HideLoading("global-loading"); + } + } } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.html index a182b8a..699485d 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.html @@ -115,6 +115,10 @@ + + + + {{item.Title}} {{item.ImageName}} diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts index c52c4e0..ddb31f6 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts @@ -15,7 +15,7 @@ import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'; import { DatePipe } from '@angular/common'; import { BsDatepickerModule } from 'ngx-bootstrap'; import { Http, Response } from '@angular/http'; - +import { LoadingService } from '../../shared/loading.service'; declare var $: any; @Component({ @@ -41,10 +41,13 @@ export class ImageExportReport implements OnInit { modalRef: BsModalRef; date = new Date(); previousdate = new Date(); - - constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, private modalService: BsModalService) { } + NoRecord: string; + constructor(private router: Router, private reportservice: ReportService, + private fb: FormBuilder, private modalService: BsModalService, + private global: GlobalService, private _loadingService: LoadingService) { } ngOnInit(): void { + this.NoRecord = this.global.NoRecords; let ImageExportReport = new ImageExportReports(); this.previousdate.setDate(this.previousdate.getDate() - 365); this.ImageExportReportForm = this.fb.group({ @@ -89,10 +92,23 @@ export class ImageExportReport implements OnInit { //this.GetSubscriptionCancellationReport(); } - GetImageExportReport(this) { + GetImageExportReport(this) { + this._loadingService.ShowLoading("global-loading"); this.NewSubscription = this.ImageExportReportForm.value; var obj = this.NewSubscription; - this.reportservice.GetImageExportReport(obj).subscribe((ImageExportReports: ImageExportReports[]) => { this.lstImageExportReport = ImageExportReports; this.numberOfImageExportReport = this.lstImageExportReport.length; this.limit = this.lstImageExportReport.length; }, error => this.error = error); + this.reportservice.GetImageExportReport(obj).subscribe((ImageExportReports: ImageExportReports[]) => { this.BindFormFields(ImageExportReports); }, error => this.error = error); + } + BindFormFields(data) { + this.lstImageExportReport = data + this.numberOfImageExportReport = this.lstImageExportReport.length; this.limit = this.lstImageExportReport.length; + if (this.lstImageExportReport.length > 0) { + this.NoRecord = ''; + this._loadingService.HideLoading("global-loading"); + } + if (this.lstImageExportReport.length == 0) { + this.NoRecord = this.global.NoRecords; + this._loadingService.HideLoading("global-loading"); + } } } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.html index 3fe091c..6057342 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.html @@ -124,6 +124,10 @@ + + + + {{item.LicenseType}} {{item.AccountType}} diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.ts index 60eda3d..3d3cfb5 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.ts @@ -15,7 +15,7 @@ import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'; import { DatePipe } from '@angular/common'; import { BsDatepickerModule } from 'ngx-bootstrap'; import { Http, Response } from '@angular/http'; - +import { LoadingService } from '../../shared/loading.service'; declare var $: any; @Component({ @@ -41,10 +41,12 @@ export class NetAdSubscriptionReport implements OnInit { modalRef: BsModalRef; date = new Date(); previousdate = new Date(); - - constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, private modalService: BsModalService) { } + NoRecord: string; + constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, + private modalService: BsModalService, private global: GlobalService, private _loadingService: LoadingService) { } ngOnInit(): void { + this.NoRecord = this.global.NoRecords; let NetAdSubscriptionReport = new NetAdSubscriptionReports(); this.previousdate.setDate(this.previousdate.getDate() - 365); this.NetAdSubscriptionReportForm = this.fb.group({ @@ -98,11 +100,22 @@ export class NetAdSubscriptionReport implements OnInit { GetLicenceType() { this.reportservice.GetLicenceType().subscribe(st => { this.lstLicenceType = st; }, error => this.error = error); } - - GetNetAdSummaryReport(this) { + this._loadingService.ShowLoading("global-loading"); this.NewSubscription = this.NetAdSubscriptionReportForm.value; var obj = this.NewSubscription; - this.reportservice.GetNetAdSummaryReport(obj).subscribe((NetAdSubscriptionReports: NetAdSubscriptionReports[]) => { this.lstNetAdSubscriptionReport = NetAdSubscriptionReports; this.numberOfNetAdSubscriptionReport = this.lstNetAdSubscriptionReport.length; this.limit = this.lstSubscriptionReport.length; }, error => this.error = error); + this.reportservice.GetNetAdSummaryReport(obj).subscribe((NetAdSubscriptionReports: NetAdSubscriptionReports[]) => { this.BindFormFields(NetAdSubscriptionReports); }, error => this.error = error); + } + BindFormFields(data) { + this.lstNetAdSubscriptionReport = data + this.numberOfNetAdSubscriptionReport = this.lstNetAdSubscriptionReport.length; this.limit = this.lstNetAdSubscriptionReport.length; + if (this.lstNetAdSubscriptionReport.length > 0) { + this.NoRecord = ''; + this._loadingService.HideLoading("global-loading"); + } + if (this.lstNetAdSubscriptionReport.length == 0) { + this.NoRecord = this.global.NoRecords; + this._loadingService.HideLoading("global-loading"); + } } } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.html index 653293e..e45e84a 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.html @@ -125,6 +125,10 @@ + + + + {{item.AccountNumber}} {{item.EditionTitle}} diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.ts index 1382812..322c51e 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.ts @@ -15,14 +15,14 @@ import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'; import { DatePipe } from '@angular/common'; import { BsDatepickerModule } from 'ngx-bootstrap'; import { Http, Response } from '@angular/http'; - +import { LoadingService } from '../../shared/loading.service'; declare var $: any; @Component({ templateUrl: './sitelicenseusagereport.component.html' }) export class SiteLicenseUsageReport implements OnInit { - public lstSiteLicenseUsageReportReport: any; + public lstSiteLicenseUsageReport: any; public lstEdition: any; SiteLicenseUsageReportForm: FormGroup; SiteLicenseUsageReports: SiteLicenseUsageReports[]; @@ -41,10 +41,12 @@ export class SiteLicenseUsageReport implements OnInit { modalRef: BsModalRef; date = new Date(); previousdate = new Date(); - - constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, private modalService: BsModalService) { } + NoRecord: string; + constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, + private modalService: BsModalService, private global: GlobalService, private _loadingService: LoadingService) { } ngOnInit(): void { + this.NoRecord = this.global.NoRecords; let SiteLicenseUsageReport = new SiteLicenseUsageReports(); this.previousdate.setDate(this.previousdate.getDate() - 365); this.SiteLicenseUsageReportForm = this.fb.group({ @@ -100,8 +102,21 @@ export class SiteLicenseUsageReport implements OnInit { GetSiteLicenseUsageReport(this) { + this._loadingService.ShowLoading("global-loading"); this.NewSubscription = this.SiteLicenseUsageReportForm.value; var obj = this.NewSubscription; - this.reportservice.GetSiteLicenseUsageReport(obj).subscribe((SiteLicenseUsageReports: SiteLicenseUsageReports[]) => { this.lstSiteLicenseUsageReport = SiteLicenseUsageReports; this.numberOfSiteLicenseUsageReport = this.lstSiteLicenseUsageReport.length; this.limit = this.lstSiteLicenseUsageReport.length; }, error => this.error = error); + this.reportservice.GetSiteLicenseUsageReport(obj).subscribe((SiteLicenseUsageReports: SiteLicenseUsageReports[]) => { this.BindFormFields(SiteLicenseUsageReports); }, error => this.error = error); + } + BindFormFields(data) { + this.lstSiteLicenseUsageReport = data + this.numberOfSiteLicenseUsageReport = this.lstSiteLicenseUsageReport.length; this.limit = this.lstSiteLicenseUsageReport.length; + if (this.lstSiteLicenseUsageReport.length > 0) { + this.NoRecord = ''; + this._loadingService.HideLoading("global-loading"); + } + if (this.lstSiteLicenseUsageReport.length == 0) { + this.NoRecord = this.global.NoRecords; + this._loadingService.HideLoading("global-loading"); + } } } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.html index c2a656a..a973f11 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.html @@ -178,6 +178,10 @@ + + + + {{sr.AccountNumber}} {{sr.LicenseeName}} diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.ts index 981ebb5..354e5bb 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.ts @@ -15,7 +15,7 @@ import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'; import { DatePipe } from '@angular/common'; import { BsDatepickerModule } from 'ngx-bootstrap'; import { Http, Response } from '@angular/http'; - +import { LoadingService } from '../../shared/loading.service'; declare var $: any; @Component({ @@ -45,10 +45,13 @@ export class SubscriptionCancellationReport implements OnInit { modalRef: BsModalRef; date = new Date(); previousdate = new Date(); - - constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, private modalService: BsModalService) { } + NoRecord: string; + constructor(private router: Router, private reportservice: ReportService, + private fb: FormBuilder, private modalService: BsModalService, + private global: GlobalService, private _loadingService: LoadingService) { } ngOnInit(): void { + this.NoRecord = this.global.NoRecords; let SubscriptionCancellationReport = new SubscriptionCancellationReports(); this.previousdate.setDate(this.previousdate.getDate() - 365); this.SubscriptionCancellationReportForm = this.fb.group({ @@ -62,10 +65,12 @@ export class SubscriptionCancellationReport implements OnInit { icEndPrice: [0], iCountryId: [0], }); + this._loadingService.ShowLoading("global-loading"); this.GetCountry(); this.GetState(); this.GetAccountType(); this.GetLicenceType(); + this._loadingService.HideLoading("global-loading"); //this.GetSubscriptionReport(); $('#fixed_hdr2').fxdHdrCol({ fixedCols: 0, @@ -101,6 +106,7 @@ export class SubscriptionCancellationReport implements OnInit { testScript.setAttribute("type", "text/javascript"); document.body.appendChild(testScript); this.GetSubscriptionCancellationReport(); + } @@ -119,10 +125,23 @@ export class SubscriptionCancellationReport implements OnInit { this.reportservice.GetAccountType().subscribe(st => { this.lstAccountType = st; }, error => this.error = error); } - GetSubscriptionCancellationReport(this) { + GetSubscriptionCancellationReport(this) { + this._loadingService.ShowLoading("global-loading"); this.NewSubscription = this.SubscriptionCancellationReportForm.value; var obj = this.NewSubscription; - this.reportservice.GetSubscriptionCancellationReport(obj).subscribe((SubscriptionCancellationReports: SubscriptionCancellationReports[]) => { this.lstSubscriptionCancellationReport = SubscriptionCancellationReports; this.numberOfSubscriptionCancellationReport = this.lstSubscriptionCancellationReport.length; this.limit = this.lstSubscriptionReport.length; }, error => this.error = error); + this.reportservice.GetSubscriptionCancellationReport(obj).subscribe((SubscriptionCancellationReports: SubscriptionCancellationReports[]) => { this.BindFormFields(SubscriptionCancellationReports); }, error => this.error = error); } + BindFormFields(data) { + this.lstSubscriptionCancellationReport = data + this.numberOfSubscriptionCancellationReport = this.lstSubscriptionCancellationReport.length; this.limit = this.lstSubscriptionCancellationReport.length; + if (this.lstSubscriptionCancellationReport.length > 0) { + this.NoRecord = ''; + this._loadingService.HideLoading("global-loading"); + } + if (this.lstSubscriptionCancellationReport.length == 0) { + this.NoRecord = this.global.NoRecords; + this._loadingService.HideLoading("global-loading"); + } + } } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.html index c8f5ec6..333014b 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.html @@ -180,6 +180,10 @@ + + + + {{sr.AccountNumber}} {{sr.LicenseeName}} diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.ts index 72608bd..046704d 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.ts @@ -15,7 +15,7 @@ import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'; import { DatePipe } from '@angular/common'; import { BsDatepickerModule } from 'ngx-bootstrap'; import { Http, Response } from '@angular/http'; - +import { LoadingService } from '../../shared/loading.service'; declare var $: any; @@ -46,10 +46,13 @@ export class SubscriptionReport implements OnInit { modalRef: BsModalRef; date = new Date(); previousdate = new Date(); - - constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, private modalService: BsModalService) { } + NoRecord: string; + constructor(private router: Router, private reportservice: ReportService, + private fb: FormBuilder, private modalService: BsModalService, + private global: GlobalService, private _loadingService: LoadingService) { } ngOnInit(): void { + this.NoRecord = this.global.NoRecords; let SubscriptionReport = new SubscriptionReports(); this.previousdate.setDate(this.previousdate.getDate() - 365); this.SubscriptionReportForm = this.fb.group({ @@ -63,10 +66,12 @@ export class SubscriptionReport implements OnInit { icEndPrice: [0], iCountryId: [0], }); + this._loadingService.ShowLoading("global-loading"); this.GetCountry(); this.GetState(); this.GetAccountType(); this.GetLicenceType(); + this._loadingService.HideLoading("global-loading"); //this.GetSubscriptionReport(); $('#fixed_hdr2').fxdHdrCol({ fixedCols: 0, @@ -121,9 +126,22 @@ export class SubscriptionReport implements OnInit { } GetSubscriptionReport(this) { + this._loadingService.ShowLoading("global-loading"); this.NewSubscription = this.SubscriptionReportForm.value; var obj = this.NewSubscription; - this.reportservice.GetSubscriptionReport(obj).subscribe((SubscriptionReports: SubscriptionReports[]) => { this.lstSubscriptionReport = SubscriptionReports; this.numberOfSubscriptionReport = this.lstSubscriptionReport.length; this.limit = this.lstSubscriptionReport.length; }, error => this.error = error); + this.reportservice.GetSubscriptionReport(obj).subscribe((SubscriptionReports: SubscriptionReports[]) => { this.BindFormFields(SubscriptionReports);}, error => this.error = error); } + BindFormFields(data) { + this.lstSubscriptionReport = data + this.numberOfSubscriptionReport = this.lstSubscriptionReport.length; this.limit = this.lstSubscriptionReport.length; + if (this.lstSubscriptionReport.length > 0) { + this.NoRecord = ''; + this._loadingService.HideLoading("global-loading"); + } + if (this.lstSubscriptionReport.length == 0) { + this.NoRecord = this.global.NoRecords; + this._loadingService.HideLoading("global-loading"); + } + } } diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.html b/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.html index 73c3472..9ea878d 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.html +++ b/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.html @@ -146,6 +146,10 @@ + + + + {{usage.LoginId}} {{usage.FirstName}} diff --git a/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.ts b/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.ts index 042ff5a..9507574 100644 --- a/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.ts @@ -15,7 +15,7 @@ import { BsModalRef } from 'ngx-bootstrap/modal/bs-modal-ref.service'; import { DatePipe } from '@angular/common'; import { BsDatepickerModule } from 'ngx-bootstrap'; import { Http, Response } from '@angular/http'; - +import { LoadingService } from '../../shared/loading.service'; declare var $: any; @Component({ @@ -44,11 +44,13 @@ export class UsageReport implements OnInit { modalRef: BsModalRef; date = new Date(); previousdate = new Date(); + NoRecord: string; + constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, + private modalService: BsModalService, private global: GlobalService, private _loadingService: LoadingService) { } - constructor(private router: Router, private reportservice: ReportService, private fb: FormBuilder, private modalService: BsModalService) { } - - + ngOnInit(): void { + this.NoRecord = this.global.NoRecords; let usagereport = new UsageReports(); this.previousdate.setDate(this.previousdate.getDate() - 365); this.UsageReportForm = this.fb.group({ @@ -94,14 +96,17 @@ export class UsageReport implements OnInit { testScript.setAttribute("id", "fixed_table_rc"); testScript.setAttribute("src", "../assets/scripts/fixed_table_rc.js"); testScript.setAttribute("type", "text/javascript"); - document.body.appendChild(testScript); + document.body.appendChild(testScript); + this.GetUsageReport(); + } - GetUsageReport(this) { + GetUsageReport(this) { + this._loadingService.ShowLoading("global-loading"); this.usagereport = this.UsageReportForm.value; var obj = this.usagereport; - this.reportservice.GetUsageReport(obj).subscribe((UsageReports: UsageReports[]) => { this.lstUserUsageReport = UsageReports; this.numberOfUsageReport = this.lstUserUsageReport.length; this.limit = this.lstUserUsageReport.length; }, error => this.error = error); + this.reportservice.GetUsageReport(obj).subscribe((UsageReports: UsageReports[]) => { this.BindFormFields(UsageReports);}, error => this.error = error); } GetCountry() { @@ -111,4 +116,17 @@ export class UsageReport implements OnInit { GetState() { this.reportservice.GetState().subscribe(st => { this.lstState = st; }, error => this.error = error); } + + BindFormFields(data) { + this.lstUserUsageReport = data + this.numberOfUsageReport = this.lstUserUsageReport.length; this.limit = this.lstUserUsageReport.length; + if (this.lstUserUsageReport.length > 0) { + this.NoRecord = ''; + this._loadingService.HideLoading("global-loading"); + } + if (this.lstUserUsageReport.length == 0) { + this.NoRecord = this.global.NoRecords; + this._loadingService.HideLoading("global-loading"); + } + } } diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html index a982352..9077d17 100644 --- a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.html @@ -1,6 +1,6 @@
    -

    List User

    +

    {{modalTitle}}

    @@ -121,7 +121,13 @@ Status + + + + + + {{UserEntity.FirstName}} {{UserEntity.LastName}} @@ -133,12 +139,10 @@ {{UserEntity.ModifiedDate | date: 'MM/dd/yyyy'}} {{UserEntity.AccountNumber}} {{UserEntity.EditionType}} - - {{UserEntity.UserStatus}} + Active + Inactive - - @@ -222,13 +226,13 @@
    - +
    diff --git a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts index 9e17f57..809192e 100644 --- a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts +++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts @@ -16,6 +16,7 @@ import 'rxjs/add/operator/filter'; import { LoadingService } from '../../shared/loading.service'; declare var $: any; import { DatePipe } from '@angular/common'; +import { GlobalService } from '../../Shared/global'; @Component({ templateUrl:'./users.component.html' // '../../../../../wwwroot/html/UpdateProfile/updateuserprofile.component.html' }) @@ -45,16 +46,18 @@ export class UsersList implements OnInit { selectedId: number = 0; divClass: string; isActive: boolean; + NoRecord: string; //@ViewChild("profileModal") //profileModal: ModalComponent; //errorMessage: any; constructor(private _loadingService: LoadingService,private userservice: UserService, private router: Router, private fb: FormBuilder, private http: Http, - private _confirmService: ConfirmService + private _confirmService: ConfirmService,private global:GlobalService ) { } - ngOnInit(): void { + ngOnInit(): void { + this.modalTitle = 'LIST USER'; this.alerts = ''; - + this.NoRecord = this.global.NoRecords; this.Users = this.fb.group({ FirstName:[''], LastName: [''], @@ -83,7 +86,7 @@ export class UsersList implements OnInit { Modifiedby: [''], DeactivationDate: [''], isActive: [false], - UserStatusActive: [''], + UserStatusActive: ['false'], UserStatusInActive:[''] }); this.managerightFrm = this.fb.group({ @@ -104,7 +107,7 @@ export class UsersList implements OnInit { { width: 150, align: 'Center' }, { width: 150, align: 'Center' }, { width: 350, align: 'Center' }, - { width: 500, align: 'Center' }, + { width: 200, align: 'Center' }, { width: 130, align: 'Center' }, { width: 120, align: 'center' }, { width: 280, align: 'Center' }, @@ -147,7 +150,7 @@ export class UsersList implements OnInit { public SetClickedRow(i: number, item: any) { this.selectedRow = i; this.selectedId = item['Id']; - this.UserManageRightsEntity = item; + this.UserEntity = item; } public SetClickedRowManageRight(j: number, item: any) { this.selectedRow = j; @@ -193,12 +196,24 @@ export class UsersList implements OnInit { }) - .subscribe(x => { this.UserList = x; }, error => this.error = error); - this._loadingService.HideLoading("global-loading"); + .subscribe(x => { this.BindFormFields(x) }, error => this.error = error); + + } + BindFormFields(data) { + this.UserList = data; + if (this.UserList.length > 0) { + this.NoRecord = ''; + this._loadingService.HideLoading("global-loading"); + } + if (this.UserList.length == 0) { + this.NoRecord = this.global.NoRecords; + this._loadingService.HideLoading("global-loading"); + } } - EditUser() { + debugger; this.Mode = 'Edit'; + this.modalTitle = 'Edit USER'; this.topPos = '100px'; this.divClass = 'col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3'; this.alerts = ''; @@ -217,14 +232,21 @@ export class UsersList implements OnInit { this.adduserFrm.controls['Createdby'].setValue(this.UserEntity.Createdby) this.adduserFrm.controls['Modifiedby'].setValue(this.UserEntity.Modifiedby) this.adduserFrm.controls['DeactivationDate'].setValue(this.datePipe.transform(this.UserEntity.DeactivationDate, 'MM/dd/yyyy')) - this.adduserFrm.controls['UserStatusActive'].setValue(true) - this.adduserFrm.controls['UserStatusInActive'].setValue(false) + if (this.UserEntity.UserStatus == 'Active') { + this.adduserFrm.controls['UserStatusActive'].setValue('true') + } + else { + this.adduserFrm.controls['UserStatusActive'].setValue('false') + } + //this.adduserFrm.controls['UserStatusActive'].setValue(true) + //this.adduserFrm.controls['UserStatusInActive'].setValue(false) this.isActive = (this.UserEntity.UserStatus=='Active'?true :false) } EditManageUserRights() { this.Mode = 'ManageRight'; + this.modalTitle = 'MANAGE USER Right'; this.topPos = '100px'; this.divClass = 'col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3'; this.alerts = ''; @@ -258,7 +280,7 @@ export class UsersList implements OnInit { } if (this.adduserFrm.valid && this.alerts == '') { - this.adduserFrm.controls['isActive'].setValue(this.isActive) + this.adduserFrm.controls['isActive'].setValue(this.adduserFrm.value.UserStatusActive) var UserEntity = this.adduserFrm.value; @@ -273,6 +295,10 @@ export class UsersList implements OnInit { } + //public DeleteUnblockedUser(this) { + // this.alerts = ''; + //} + AfterInsertData(data) { if (data == "User updated successfully") { diff --git a/400-SOURCECODE/Admin/src/app/shared/global.ts b/400-SOURCECODE/Admin/src/app/shared/global.ts index 552bda4..e77b68c 100644 --- a/400-SOURCECODE/Admin/src/app/shared/global.ts +++ b/400-SOURCECODE/Admin/src/app/shared/global.ts @@ -7,19 +7,20 @@ export class GlobalService { UserType: number =1; AccountType: number = 0; loggedInUser: any; + NoRecords: string; constructor() { this.hostURL = "http://192.168.84.242:97/"; this.LiveURL = "http://qa.beta.interactiveanatomy.com/API/Adminapi/"; - //this.resourceBaseUrl = this.hostURL; - this.resourceBaseUrl = this.LiveURL; - //localStorage.setItem('loggedInUserDetails', JSON.stringify( - // { - // "Id": 1, "FirstName": "Maribel", "LastName": "sfsfsfsfsfsfs", "EmailId": "ravi.vishwakarma@ebix.com", "LoginId": "superadmin", "Password": "ebix@2016", "SecurityQuestionId": 1, "SecurityAnswer": "boxer", "CreatorId": 1, "CreationDate": "2009-03-02T00:00:00", "DeactivationDate": null, "ModifierId": 1, "ModifiedDate": "2017-01-24T02:03:19", "UserType": "Super Admin", "UserTypeId": 1, "IsActive": true, "IsCorrectPassword": false, "IncorrectLoginAttemptCount": 0, "IsBlocked": false, "LicenseId": 0, "EditionId": 0, "LoginFailureCauseId": 0, "Modules": [{ "slug": "da-view-list", "name": "Dissectible Anatomy", "id": 1 }, { "slug": "tile-view-list", "name": "Atlas Anatomy", "id": 2 }, { "slug": "3d-anatomy-list", "name": "3D Anatomy", "id": 3 }, { "slug": "clinical-illustrations", "name": "Clinical Illustrations", "id": 4 }, { "slug": "clinical-animations", "name": "Clinical Animations", "id": 5 }, { "slug": "Link/encyclopedia", "name": "Encyclopedia", "id": 6 }, { "slug": "curriculum-builder", "name": "Curriculum Builder", "id": 7 }, { "slug": "anatomy-test", "name": "Anatomy Test", "id": 8 }, { "slug": "Link/IP-10", "name": "IP 10", "id": 9 }, { "slug": "lab-exercises", "name": "Lab Exercises", "id": 10 }, { "slug": "Link/indepth-reports", "name": "In-Depth Reports", "id": 11 }, { "slug": "Link/complementary-and-alternate-medicine", "name": "CAM", "id": 12 }, { "slug": "ADAM-images", "name": "A.D.A.M. Images", "id": 13 }, { "slug": "Link/bodyguide", "name": "Body Guide", "id": 14 }, { "slug": "Link/health-navigator", "name": "Symptom Navigator", "id": 15 }, { "slug": "Link/wellness-tools", "name": "The Wellness Tools", "id": 16 }, { "slug": "Link/aod", "name": "A.D.A.M. OnDemand", "id": 1017 }], "LicenseInfo": null, "LicenseSubscriptions": null, "IsSubscriptionExpired": false, "SubscriptionExpirationDate": null, "TermsAndConditionsTitle": null, "TermsAndConditionsText": null - // })); + this.resourceBaseUrl = this.hostURL; + //this.resourceBaseUrl = this.LiveURL; + localStorage.setItem('loggedInUserDetails', JSON.stringify( + { + "Id": 1, "FirstName": "Maribel", "LastName": "sfsfsfsfsfsfs", "EmailId": "ravi.vishwakarma@ebix.com", "LoginId": "superadmin", "Password": "ebix@2016", "SecurityQuestionId": 1, "SecurityAnswer": "boxer", "CreatorId": 1, "CreationDate": "2009-03-02T00:00:00", "DeactivationDate": null, "ModifierId": 1, "ModifiedDate": "2017-01-24T02:03:19", "UserType": "Super Admin", "UserTypeId": 1, "IsActive": true, "IsCorrectPassword": false, "IncorrectLoginAttemptCount": 0, "IsBlocked": false, "LicenseId": 0, "EditionId": 0, "LoginFailureCauseId": 0, "Modules": [{ "slug": "da-view-list", "name": "Dissectible Anatomy", "id": 1 }, { "slug": "tile-view-list", "name": "Atlas Anatomy", "id": 2 }, { "slug": "3d-anatomy-list", "name": "3D Anatomy", "id": 3 }, { "slug": "clinical-illustrations", "name": "Clinical Illustrations", "id": 4 }, { "slug": "clinical-animations", "name": "Clinical Animations", "id": 5 }, { "slug": "Link/encyclopedia", "name": "Encyclopedia", "id": 6 }, { "slug": "curriculum-builder", "name": "Curriculum Builder", "id": 7 }, { "slug": "anatomy-test", "name": "Anatomy Test", "id": 8 }, { "slug": "Link/IP-10", "name": "IP 10", "id": 9 }, { "slug": "lab-exercises", "name": "Lab Exercises", "id": 10 }, { "slug": "Link/indepth-reports", "name": "In-Depth Reports", "id": 11 }, { "slug": "Link/complementary-and-alternate-medicine", "name": "CAM", "id": 12 }, { "slug": "ADAM-images", "name": "A.D.A.M. Images", "id": 13 }, { "slug": "Link/bodyguide", "name": "Body Guide", "id": 14 }, { "slug": "Link/health-navigator", "name": "Symptom Navigator", "id": 15 }, { "slug": "Link/wellness-tools", "name": "The Wellness Tools", "id": 16 }, { "slug": "Link/aod", "name": "A.D.A.M. OnDemand", "id": 1017 }], "LicenseInfo": null, "LicenseSubscriptions": null, "IsSubscriptionExpired": false, "SubscriptionExpirationDate": null, "TermsAndConditionsTitle": null, "TermsAndConditionsText": null + })); this.loggedInUser = JSON.parse(localStorage.getItem("loggedInUserDetails")); this.UserId = this.loggedInUser.Id; this.UserType = this.loggedInUser.UserTypeId; - + this.NoRecords = 'No records founds.'; } } diff --git a/400-SOURCECODE/Admin/src/assets/styles/admin-custom.css b/400-SOURCECODE/Admin/src/assets/styles/admin-custom.css index a4a3fdb..75bc717 100644 --- a/400-SOURCECODE/Admin/src/assets/styles/admin-custom.css +++ b/400-SOURCECODE/Admin/src/assets/styles/admin-custom.css @@ -164,4 +164,11 @@ .table-fixed thead { width: calc( 100% - 0em ) } +#fixed_hdr2 > tbody > tr.active > td { + background: #726D6D; + color: #FDFBFB; +} + + + /*30-1-2017*/ -- libgit2 0.21.4