Subscription insert unsuccessfull
"; + this.modalRef = this.modalService.show(template); + // this._confirmService.activate("Subscription insert unsuccessfull", "alertMsg"); } else { - this.modalAlerts = "Subscriptions saved successfully
"; + this._confirmService.activate("Subscription saved successfull", "alertMsg"); + //this.modalAlerts = "Subscriptions saved successfully
"; this.CancelAdd(); - this.modalRef = this.modalService.show(template); + //this.modalRef = this.modalService.show(template); } } AfterUpdateData(data, template) { - if (data.Status == "false") { + if (data.Status == "false") { + this.modalAlerts = "Subscription prices update unsuccessfull
"; + this.modalRef = this.modalService.show(template); //this.alerts = "Subscription prices update unsuccessfull\n"; - this._confirmService.activate("Subscription prices update unsuccessfull", "alertMsg"); + //this._confirmService.activate("Subscription prices update unsuccessfull", "alertMsg"); } else { - this.modalAlerts = "Subscriptions updated successfully
"; - this.modalRef = this.modalService.show(template); + this._confirmService.activate("Subscriptions updated successfully", "alertMsg"); + //this.modalAlerts = "Subscriptions updated successfully
"; + //this.modalRef = this.modalService.show(template); } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.service.ts b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.service.ts index 9f8f0ee..e455440 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.service.ts +++ b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.service.ts @@ -1,6 +1,6 @@ import { Injectable, Inject } from '@angular/core'; //import { HttpClient, HttpParams, HttpRequest} from "@angular/common/http"; -import { Http, Response, Headers, RequestOptions, RequestOptionsArgs, RequestMethod, HttpModule } from '@angular/http'; +import { Http, Response, Headers, RequestOptions, HttpModule } from '@angular/http'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/catch'; import 'rxjs/add/observable/throw'; @@ -47,19 +47,18 @@ export class SubscriptionPriceService { .catch((res: Response) => this.handleError(res)); } - DeleteSubscriptionPrice(obj: any) { + DeleteSubscriptionPrice(obj: any) { //let options = new RequestOptions({ headers: this.headers }); console.log(obj); let subscriptionPriceId = obj; let headers = new Headers({ 'Content-Type': 'application/json' }); - return this.http.get(this.commonService.resourceBaseUrl + "SubscriptionPrice/DeleteSubscriptionPrice?subscriptionPriceId=" + subscriptionPriceId) + return this.http.get(this.commonService.resourceBaseUrl + "SubscriptionPrice/DeleteSubscriptionPrice?subscriptionPriceId=" + subscriptionPriceId) .map(this.extractData) .catch((res: Response) => this.handleError(res)); } - - CheckSubscriptionPlanForLicense(obj: any) { + CheckSubscriptionPlanForLicense(obj: any) { //let options = new RequestOptions({ headers: this.headers }); console.log(obj); return this.http.get(this.commonService.resourceBaseUrl + "SubscriptionPrice/CheckSubscriptionPlanForLicense?subscriptionPriceId=" + obj) diff --git a/500-DBDump/AIA-StoredProcedures/usp_GetSiteAccountAdmin.sql b/500-DBDump/AIA-StoredProcedures/usp_GetSiteAccountAdmin.sql new file mode 100644 index 0000000..e83c2b0 --- /dev/null +++ b/500-DBDump/AIA-StoredProcedures/usp_GetSiteAccountAdmin.sql @@ -0,0 +1,41 @@ +USE [AIADatabaseV5] +GO +/****** Object: StoredProcedure [dbo].[usp_GetSiteAccountAdmin] Script Date: 2/1/2018 12:15:55 PM ******/ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +-- ============================================= +-- Author: magic +-- Create date: 5/6/2018 +-- Description: Fetch building level accounts client admins for corresponding given Account Number. +-- ============================================= + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetSiteAccountAdmin]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[usp_GetSiteAccountAdmin] +GO + +CREATE PROCEDURE [dbo].[usp_GetSiteAccountAdmin] + -- Add the parameters for the stored procedure here + @AccountNumber varchar(50)='' + +AS +BEGIN + -- SET NOCOUNT ON added to prevent extra result sets from + -- interfering with SELECT statements. + SET NOCOUNT ON; + + SELECT AIAUser.Id, AIAUser.Password, AIAUser.LoginId, AIAUser.FirstName, AIAUser.UserTypeId, AIAUser.LastName, AIAUser.EmailId, AIAUser.IsActive, + AIAUser.SecurityQuestionId, AIAUser.SecurityAnswer, AIAUser.CreatorId, AIAUser.CreationDate, AIAUser.ModifierId, AIAUser.ModifiedDate, + AIAUser.DeactivationDate + FROM AIAUser + INNER JOIN AIAUserToLicenseEdition ON AIAUser.Id = AIAUserToLicenseEdition.UserId + INNER JOIN LicenseToEdition ON AIAUserToLicenseEdition.LicenseEditionId = LicenseToEdition.Id + INNER JOIN License ON LicenseToEdition.LicenseId = License.Id + WHERE (AIAUser.IsActive = 1) AND (License.AccountNumber = @AccountNumber) AND (AIAUser.UserTypeId = 4); + +END + + + +GO diff --git a/500-DBDump/AIA-StoredProcedures/usp_GetSiteAccountSites.sql b/500-DBDump/AIA-StoredProcedures/usp_GetSiteAccountSites.sql new file mode 100644 index 0000000..44a20c5 --- /dev/null +++ b/500-DBDump/AIA-StoredProcedures/usp_GetSiteAccountSites.sql @@ -0,0 +1,67 @@ +USE [AIADatabaseV5] +GO +/****** Object: StoredProcedure [dbo].[usp_GetSiteAccountSites] Script Date: 2/1/2018 12:15:55 PM ******/ +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO +-- ============================================= +-- Author: magic +-- Create date: 5/6/2018 +-- Description: Fetch building level accounts details for corresponding given Account Number. +-- ============================================= + +if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetSiteAccountSites]') and OBJECTPROPERTY(id, N'IsProcedure') = 1) +drop procedure [dbo].[usp_GetSiteAccountSites] +GO + +CREATE PROCEDURE [dbo].[usp_GetSiteAccountSites] + -- Add the parameters for the stored procedure here + @strAccountNumber varchar(50)='', @pageNo int, @pageLength int, @recordCount int out + +AS +BEGIN + -- SET NOCOUNT ON added to prevent extra result sets from + -- interfering with SELECT statements. + SET NOCOUNT ON; + + --Get the records on the basis of parameters page length and page number rows + select LD.Id, LD.SiteIp, LD.Title, LD.SiteIPTo, LD.SiteMasterIPTo, LD.CreationDate, LD.ModifiedDate, LD.InstituteName, + LD.Department, LD.UserId, LD.FirstName, LD.EmailId + from + (Select ROW_NUMBER() OVER (ORDER BY Site.Id) AS RowNo, + Site.Id,Site.SiteIp,Site.Title,ISNULL(Site.SiteIPTo,'') as SiteIPTo,ISNULL(Site.SiteMasterIPTo,'') as SiteMasterIPTo, + CONVERT(VARCHAR,Site.CreationDate,101) as CreationDate, + CONVERT(VARCHAR,Site.ModifiedDate,101) as ModifiedDate, + Site.InstituteName, Site.Department, AIAUser.Id as UserId,AIAUser.FirstName,AIAUser.EmailId + from License join LicenseToEdition on License.Id = LicenseToEdition.LicenseId + join SiteToLicenseEdition on LicenseToEdition.Id = SiteToLicenseEdition.LicenseEditionId + join AIAUserToLicenseEdition on SiteToLicenseEdition.LicenseEditionId = AIAUserToLicenseEdition.LicenseEditionId + join AIAUserToSite on SiteToLicenseEdition.SiteId = AIAUserToSite.SiteId + join Site on SiteToLicenseEdition.SiteId = Site.Id + join AIAUser on AIAUserToLicenseEdition.UserId = AIAUser.Id + where Site.IsActive=1 and License.AccountNumber=@strAccountNumber) + as LD + where + RowNo > @pageLength * (@pageNo - 1) AND + RowNo <= @pageLength * @pageNo + + --Calculate total number of records + select @recordCount = count(ResultTable.Id) from + (Select Site.Id,Site.SiteIp,Site.Title,ISNULL(Site.SiteIPTo,'') as SiteIPTo,ISNULL(Site.SiteMasterIPTo,'') as SiteMasterIPTo, + CONVERT(VARCHAR,Site.CreationDate,101) as CreationDate, + CONVERT(VARCHAR,Site.ModifiedDate,101) as ModifiedDate, + Site.InstituteName, Site.Department, AIAUser.Id as UserId,AIAUser.FirstName,AIAUser.EmailId + from License join LicenseToEdition on License.Id = LicenseToEdition.LicenseId + join SiteToLicenseEdition on LicenseToEdition.Id = SiteToLicenseEdition.LicenseEditionId + join AIAUserToLicenseEdition on SiteToLicenseEdition.LicenseEditionId = AIAUserToLicenseEdition.LicenseEditionId + join AIAUserToSite on SiteToLicenseEdition.SiteId = AIAUserToSite.SiteId + join Site on SiteToLicenseEdition.SiteId = Site.Id + join AIAUser on AIAUserToLicenseEdition.UserId = AIAUser.Id + where Site.IsActive=1 and License.AccountNumber=@strAccountNumber) as ResultTable; + +END + + + +GO