diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj b/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj index f552370..efed60b 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/AIAHTML5.ADMIN.API.csproj @@ -511,9 +511,15 @@ AIADBEntity.tt + + AIADBEntity.tt + AIADBEntity.tt + + AIADBEntity.tt + AIADBEntity.tt diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs index 6692568..0f61d9b 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Controllers/LicenseController.cs @@ -252,6 +252,23 @@ namespace AIAHTML5.ADMIN.API.Controllers } } + [Route("LicenseSiteAdmin")] + [HttpGet] + public HttpResponseMessage GetLicenseSiteAdmin(string AccountNo) + { + List> LicenseSiteAdminList = new List>(); + try + { + LicenseSiteAdminList = LicenseModel.GetLicenseSiteAdmin(dbContext, AccountNo); + return Request.CreateResponse(HttpStatusCode.OK, new { LicenseSiteAdminList = LicenseSiteAdminList }); + } + 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) diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs index eb7ff36..d176f72 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.Context.cs @@ -3802,5 +3802,31 @@ namespace AIAHTML5.ADMIN.API.Entity return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_CheckDuplicateLicenseUserGroup", licenseIdParameter, titleParameter, status); } + + public virtual ObjectResult usp_GetSiteAccountAdmin(string accountNumber) + { + var accountNumberParameter = accountNumber != null ? + new ObjectParameter("AccountNumber", accountNumber) : + new ObjectParameter("AccountNumber", typeof(string)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteAccountAdmin", accountNumberParameter); + } + + public virtual ObjectResult usp_GetSiteAccountSites(string strAccountNumber, Nullable pageNo, Nullable pageLength, ObjectParameter recordCount) + { + var strAccountNumberParameter = strAccountNumber != null ? + new ObjectParameter("strAccountNumber", strAccountNumber) : + new ObjectParameter("strAccountNumber", typeof(string)); + + var pageNoParameter = pageNo.HasValue ? + new ObjectParameter("pageNo", pageNo) : + new ObjectParameter("pageNo", typeof(int)); + + var pageLengthParameter = pageLength.HasValue ? + new ObjectParameter("pageLength", pageLength) : + new ObjectParameter("pageLength", typeof(int)); + + return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction("usp_GetSiteAccountSites", strAccountNumberParameter, pageNoParameter, pageLengthParameter, recordCount); + } } } diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx index 944cc33..92cfd92 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/AIADBEntity.edmx @@ -1014,10 +1014,19 @@ + + + + + + + + + @@ -2314,6 +2323,15 @@ + + + + + + + + + @@ -3358,6 +3376,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4939,6 +4988,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountAdmin_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountAdmin_Result.cs new file mode 100644 index 0000000..b0e3b69 --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountAdmin_Result.cs @@ -0,0 +1,32 @@ +//------------------------------------------------------------------------------ +// +// 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_GetSiteAccountAdmin_Result + { + public int Id { get; set; } + public string Password { get; set; } + public string LoginId { get; set; } + public string FirstName { get; set; } + public byte UserTypeId { get; set; } + public string LastName { get; set; } + public string EmailId { get; set; } + public Nullable IsActive { get; set; } + public Nullable SecurityQuestionId { get; set; } + public string SecurityAnswer { get; set; } + public Nullable CreatorId { get; set; } + public System.DateTime CreationDate { get; set; } + public Nullable ModifierId { get; set; } + public Nullable ModifiedDate { get; set; } + public Nullable DeactivationDate { get; set; } + } +} diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountSites_Result.cs b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountSites_Result.cs new file mode 100644 index 0000000..8510c4b --- /dev/null +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Entity/usp_GetSiteAccountSites_Result.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------------------------ +// +// 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_GetSiteAccountSites_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 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 d4f361d..f756162 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs +++ b/400-SOURCECODE/AIAHTML5.ADMIN.API/Models/LicenseModel.cs @@ -181,7 +181,7 @@ namespace AIAHTML5.ADMIN.API.Models recordCount = 0; try { - var result = dbContext.GetSiteAccoutDetail(AccountNo, pageNo, pageLength, spRecordCount).ToList(); + var result = dbContext.usp_GetSiteAccountSites(AccountNo, pageNo, pageLength, spRecordCount).ToList(); if (result.Count > 0) { foreach (var item in result) @@ -198,7 +198,10 @@ namespace AIAHTML5.ADMIN.API.Models 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); + if (!string.IsNullOrEmpty(item.ModifiedDate)) + { + SiteModelObj.ModifiedDate = DateTime.ParseExact(item.ModifiedDate, "MM/dd/yyyy", System.Globalization.CultureInfo.CurrentCulture); + } LicenseSiteList.Add(SiteModelObj); } } @@ -208,6 +211,26 @@ namespace AIAHTML5.ADMIN.API.Models return LicenseSiteList; } + public static List> GetLicenseSiteAdmin(AIADatabaseV5Entities dbContext, string AccountNo) + { + List> LicenseSiteAdminList = new List>(); + Tuple SiteAdmin; + try + { + var result = dbContext.usp_GetSiteAccountAdmin(AccountNo).ToList(); + if (result.Count > 0) + { + foreach (var item in result) + { + SiteAdmin = new Tuple(item.Id, item.FirstName + " " + item.LastName, item.EmailId); + LicenseSiteAdminList.Add(SiteAdmin); + } + } + } + catch (Exception ex) { } + return LicenseSiteAdminList; + } + public static List> GetLicenseModestySettings(AIADatabaseV5Entities dbContext, int LicenseId, int BuildingLevelId) { List> LicenseModestyList = new List>(); diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.component.ts b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.component.ts index 6462602..091516d 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.component.ts +++ b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, Compiler } from '@angular/core'; import { UserService } from './components/UserEntity/user.service'; import { ManageDiscountCodeService } from './components/ManageDiscountCode/managediscountcode.service'; import { SubscriptionPriceService } from './components/SubscriptionPrice/subscriptionprice.service'; @@ -6,7 +6,10 @@ import { LicenseService } from './components/LicenseEntity/license.service'; import { ReportService } from './components/Reports/report.service'; //import { MyAuthService } from './shared/my-auth.service'; import { GlobalService } from './Shared/global'; -import { Router } from '@angular/router'; +import { Router, NavigationEnd } from '@angular/router'; +//import { HttpClient } from '@angular/common/http'; +//import { HttpErrorResponse } from '@angular/common/http'; +//import { Observable } from 'rxjs/Observable'; @Component({ selector: 'app-component', templateUrl: '../app/app.component.html', @@ -14,12 +17,26 @@ import { Router } from '@angular/router'; }) export class AppComponent implements OnInit { - DisplayName: string = ""; - constructor(private userservice: UserService, private global: GlobalService, private router: Router) { } + public obj: any; + public objMenu: any; + public menustaus: string; + public submenustaus: string; + + constructor(private userservice: UserService, public global: GlobalService, private router: Router, + private _compiler: Compiler) { } ngOnInit(): void { - - this.DisplayName = this.global.DisplayName; + this._compiler.clearCache(); + this.menustaus = "True"; + this.global.getJSON().subscribe(data => { + this.obj = data["AdminSections"] + for (let i = 0; i < 7; i++) { + + if (this.obj[i].Id == this.global.UserType) { + this.objMenu = this.obj[i].HeaderMenu; + } + } + }, error => console.log(error)); this.router.navigate(['/updateuserprofile']); } logout() { diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.module.ts b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.module.ts index b610cc8..db4002d 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.module.ts +++ b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/app.module.ts @@ -44,11 +44,12 @@ import { ConfirmService } from './Shared/Confirm/confirm.service'; import { ConfirmComponent } from "./Shared/Confirm/confirm.component" import { BsDatepickerModule, ModalModule } from 'ngx-bootstrap'; import { BsModalService } from 'ngx-bootstrap/modal'; -import { ScrollEventModule } from 'ngx-scroll-event'; import { ContenteditableModelDirective } from './shared/contenteditabledirective'; import { LoadingService } from './shared/loading.service'; import { PagerComponent } from './shared/Pager/pager.component'; import { NumberOnlyDirective } from './shared/numberonlydirective'; +import { MyFilterPipe } from './shared/my-filter.pipe'; +import { BsDropdownModule } from 'ngx-bootstrap'; //import { MyAuthService } from './shared/my-auth.service'; //import { AngularFireAuth } from 'angularfire2/auth'; //import { FirebaseApp, AngularFireModule } from 'angularfire2'; @@ -73,11 +74,13 @@ import { NumberOnlyDirective } from './shared/numberonlydirective'; SubscriptionCancellationReport, NetAdSubscriptionReport, SiteLicenseUsageReport, DiscountCodeReport, ImageExportReport, EditLicenseBasicSettings, LicenseModestySettings, - LicenseModuleSettings, SiteLicenseAccount, UserGroup, PagerComponent, NumberOnlyDirective + LicenseModuleSettings, SiteLicenseAccount, UserGroup, PagerComponent, NumberOnlyDirective, + //filter + MyFilterPipe ], imports: [ BrowserModule, AppRoutingModule, HttpClientModule, FormsModule, ReactiveFormsModule, HttpModule, Ng2Bs3ModalModule, - BsDatepickerModule.forRoot(), ModalModule.forRoot(), ScrollEventModule//ModalModule.forRoot() + BsDatepickerModule.forRoot(), ModalModule.forRoot(), BsDropdownModule.forRoot() //ModalModule.forRoot() // , AngularFireModule.initializeApp(firebaseConfig), ], providers: [GlobalService, ConfirmService, BsModalService, LoadingService, CsvService, diff --git a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.ts b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.ts index f67e2a8..740f2b1 100644 --- a/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.ts +++ b/400-SOURCECODE/AIAHTML5.ADMIN.Web/src/app/components/SubscriptionPrice/subscriptionprice.component.ts @@ -144,21 +144,27 @@ RecordDeleted: number[]; AfterInsertData(data, template) { if (data.Status == "false") { // this.alerts = "Subscription price save unsuccessfull"; - this._confirmService.activate("Subscription prices insert unsuccessfull", "alertMsg"); + this.modalAlerts = "

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