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 2d0d156..753b6d2 100644
--- a/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.ts
+++ b/400-SOURCECODE/Admin/src/app/components/Reports/customersummaryreport.component.ts
@@ -178,10 +178,15 @@ export class CustomerSummaryReport implements OnInit, AfterViewChecked {
if (this.buttonStatus) {
this.ExportingStart = true;
this.GetCustomerSummeryReport('1, ' + this.recordCount);
+ this.ExportingStart = false;
}
}
ExportService(data: any) {
- debugger;
+ for (let c = 0; c < this.global.RemoveColumns.length; c++) {
+ for (let i = 0; i < data.CustomerSummery.length; i++) {
+ delete data.CustomerSummery[i][this.global.RemoveColumns[c].toString()];
+ }
+ }
this._loadingService.HideLoading("global-loading");
this.global.ExportToCSV(data.CustomerSummery, "CustomerSummeryReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds())
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 c9cd538..fc70cb3 100644
--- a/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts
+++ b/400-SOURCECODE/Admin/src/app/components/Reports/discountcodereport.component.ts
@@ -173,10 +173,16 @@ export class DiscountCodeReport implements OnInit {
if (this.buttonStatus) {
this.ExportingStart = true;
this.GetDiscountReport('1, ' + this.recordCount);
+ this.ExportingStart = false;
}
}
ExportService(data: any) {
+ for (let c = 0; c < this.global.RemoveColumns.length; c++) {
+ for (let i = 0; i < data.DiscountReportList.length; i++) {
+ delete data.DiscountReportList[i][this.global.RemoveColumns[c].toString()];
+ }
+ }
this._loadingService.HideLoading("global-loading");
this.global.ExportToCSV(data.DiscountReportList, "DiscountReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds())
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 ce2cfea..c818966 100644
--- a/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.ts
+++ b/400-SOURCECODE/Admin/src/app/components/Reports/expiringsubscriptionreport.component.ts
@@ -264,9 +264,15 @@ export class ExpiringSubscriptionReport implements OnInit, AfterViewChecked {
if (this.buttonStatus) {
this.ExportingStart = true;
this.GetExpiringSubscriptionReport('1, ' + this.recordCount);
+ this.ExportingStart = false;
}
}
ExportService(data: any) {
+ for (let c = 0; c < this.global.RemoveColumns.length; c++) {
+ for (let i = 0; i < data.ExpiringSubscription.length; i++) {
+ delete data.ExpiringSubscription[i][this.global.RemoveColumns[c].toString()];
+ }
+ }
this._loadingService.HideLoading("global-loading");
this.global.ExportToCSV(data.ExpiringSubscription, "ExpiringSubscriptionReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds())
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 b9a09f8..09f8d73 100644
--- a/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.html
+++ b/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.html
@@ -137,7 +137,7 @@
{{item.ImageName}} |
{{item.OriginalFileName}} |
{{item.ModuleName}} |
-
{{item.ExportedDate}} |
+
{{item.ExportedDate| date: 'MM/dd/yyyy'}} |
{{item.AccountNumber}} |
{{item.UserName}} |
{{item.ExportLimit}} |
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 e668921..fb232c1 100644
--- a/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts
+++ b/400-SOURCECODE/Admin/src/app/components/Reports/imageexportreport.component.ts
@@ -137,8 +137,8 @@ export class ImageExportReport implements OnInit {
BindFormFields(data) {
this.recordCount = data.RecordCount;
this.lstImageExportReport = data.ImageExportList;
- this.numberOfImageExportReport = this.lstImageExportReport.length;
- this.limit = this.lstImageExportReport.length;
+ //this.numberOfImageExportReport = this.lstImageExportReport.length;
+ //this.limit = this.lstImageExportReport.length;
if (this.lstImageExportReport.length > 0) {
this.NoRecord = '';
this.buttonStatus = true;
@@ -155,10 +155,16 @@ export class ImageExportReport implements OnInit {
if (this.buttonStatus) {
this.ExportingStart = true;
this.GetImageExportReport('1, ' + this.recordCount);
+ this.ExportingStart = false;
}
}
ExportService(data: any) {
+ for (let c = 0; c < this.global.RemoveColumns.length; c++) {
+ for (let i = 0; i < data.ImageExportList.length; i++) {
+ delete data.ImageExportList[i][this.global.RemoveColumns[c].toString()];
+ }
+ }
this._loadingService.HideLoading("global-loading");
this.global.ExportToCSV(data.ImageExportList, "ImageExportReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds())
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 b20b978..1e8cc19 100644
--- a/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.ts
+++ b/400-SOURCECODE/Admin/src/app/components/Reports/netadsubscriptionreport.component.ts
@@ -127,7 +127,8 @@ export class NetAdSubscriptionReport implements OnInit {
this.NetAdSubscriptionReport = this.NetAdSubscriptionReportForm.value;
var obj = this.NetAdSubscriptionReport;
if (this.ExportingStart) {
- this.reportservice.GetNetAdSummaryReport(obj, this.pageNo, this.pageLength).subscribe((NetAdSubscriptionReports: NetAdSubscriptionReports[]) => { this.ExportService(NetAdSubscriptionReports); }, error => this.error =
error);
+ this.reportservice.GetNetAdSummaryReport(obj, this.pageNo, this.pageLength).subscribe((NetAdSubscriptionReports: NetAdSubscriptionReports[]) => {
+ this.ExportService(NetAdSubscriptionReports); }, error => this.error = error);
}
else {
this.reportservice.GetNetAdSummaryReport(obj, this.pageNo, this.pageLength).subscribe((NetAdSubscriptionReports: NetAdSubscriptionReports[]) => { this.BindFormFields(NetAdSubscriptionReports); }, error => this.error = error);
@@ -158,10 +159,18 @@ export class NetAdSubscriptionReport implements OnInit {
if (this.buttonStatus) {
this.ExportingStart = true;
this.GetNetAdSummaryReport('1, ' + this.recordCount);
+ this.ExportingStart = false;
}
}
ExportService(data: any) {
+
+ for (let c = 0; c < this.global.RemoveColumns.length; c++) {
+ for (let i = 0; i < data.NetAdSubscriptionList.length; i++) {
+ delete data.NetAdSubscriptionList[i][this.global.RemoveColumns[c].toString()];
+ }
+ }
+
this._loadingService.HideLoading("global-loading");
this.global.ExportToCSV(data.NetAdSubscriptionList, "NetAdSummaryReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds())
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 21938b8..9b701eb 100644
--- a/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.ts
+++ b/400-SOURCECODE/Admin/src/app/components/Reports/sitelicenseusagereport.component.ts
@@ -158,9 +158,15 @@ export class SiteLicenseUsageReport implements OnInit {
if (this.buttonStatus) {
this.ExportingStart = true;
this.GetSiteLicenseUsageReport('1, ' + this.pageLength);
+ this.ExportingStart = false;
}
}
ExportService(data: any) {
+ for (let c = 0; c < this.global.RemoveColumns.length; c++) {
+ for (let i = 0; i < data.SiteLicenseUsageList.length; i++) {
+ delete data.SiteLicenseUsageList[i][this.global.RemoveColumns[c].toString()];
+ }
+ }
this._loadingService.HideLoading("global-loading");
this.global.ExportToCSV(data.SiteLicenseUsageList, "SiteLicenseUsageReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds())
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 e43f9ea..f43f884 100644
--- a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.ts
+++ b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptioncancellationreport.component.ts
@@ -180,11 +180,17 @@ export class SubscriptionCancellationReport implements OnInit {
if (this.buttonStatus) {
this.ExportingStart = true;
this.GetSubscriptionCancellationReport('1, ' + this.recordCount);
+ this.ExportingStart = false;
}
}
ExportService(data: any) {
+ for (let c = 0; c < this.global.RemoveColumns.length; c++) {
+ for (let i = 0; i < data.SubscriptionCancel.length; i++) {
+ delete data.SubscriptionCancel[i][this.global.RemoveColumns[c].toString()];
+ }
+ }
this._loadingService.HideLoading("global-loading");
- this.global.ExportToCSV(data, "SubscriptionCancellationReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds())
+ this.global.ExportToCSV(data.SubscriptionCancel, "SubscriptionCancellationReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds())
}
}
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 9c02048..f2a7d21 100644
--- a/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.ts
+++ b/400-SOURCECODE/Admin/src/app/components/Reports/subscriptionreport.component.ts
@@ -178,10 +178,16 @@ export class SubscriptionReport implements OnInit {
if (this.buttonStatus) {
this.ExportingStart = true;
this.GetSubscriptionReport('1, ' + this.recordCount);
+ this.ExportingStart = false;
}
}
ExportService(data: any) {
+ for (let c = 0; c < this.global.RemoveColumns.length; c++) {
+ for (let i = 0; i < data.Subscription.length; i++) {
+ delete data.Subscription[i][this.global.RemoveColumns[c].toString()];
+ }
+ }
this._loadingService.HideLoading("global-loading");
- this.global.ExportToCSV(data, "SubscriptionReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds())
+ this.global.ExportToCSV(data.Subscription, "SubscriptionReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds())
}
}
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 6739120..5150d94 100644
--- a/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.ts
+++ b/400-SOURCECODE/Admin/src/app/components/Reports/usagereport.component.ts
@@ -258,13 +258,19 @@ export class UsageReport implements OnInit, AfterViewChecked {
}
}
ExportEvent() {
- debugger;
+
if (this.buttonStatus) {
this.ExportingStart = true;
this.GetUsageReport('1,' + this.recordCount);
+ this.ExportingStart = false;
}
}
ExportService(data: any) {
+ for (let c = 0; c < this.global.RemoveColumns.length; c++) {
+ for (let i = 0; i < data.UserUsage.length; i++) {
+ delete data.UserUsage[i][this.global.RemoveColumns[c].toString()];
+ }
+ }
this._loadingService.HideLoading("global-loading");
this.global.ExportToCSV(data.UserUsage, "UsageReport-" + this.date.getDay() + "-" + this.date.getMonth() + "-" + this.date.getSeconds())
}
diff --git a/400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.component.html b/400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.component.html
index 3090495..5e5baba 100644
--- a/400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.component.html
+++ b/400-SOURCECODE/Admin/src/app/components/SubscriptionPrice/subscriptionprice.component.html
@@ -43,7 +43,7 @@
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 378a7d1..c36ece9 100644
--- a/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts
+++ b/400-SOURCECODE/Admin/src/app/components/UserEntity/users.component.ts
@@ -63,6 +63,7 @@ export class UsersList implements OnInit, AfterViewChecked {
recordCount: number;
pageNo: number;
pageLength: number;
+ DisableAccountNumberControl: boolean;
constructor(private _loadingService: LoadingService,private userservice: UserService, private router: Router, private fb: FormBuilder, private http: Http,
private _confirmService: ConfirmService,private global:GlobalService
) { }
@@ -110,6 +111,9 @@ export class UsersList implements OnInit, AfterViewChecked {
UncheckedRecords: this.fb.array([])
});
+ if (this.global.UserTypeName == "Client Admin" || this.global.UserTypeName == "District Admin") {
+ this.DisableAccountNumberControl = true;
+ }
this._loadingService.ShowLoading("global-loading");
this.GetUserType();
this.GetAccountType();
@@ -177,9 +181,19 @@ export class UsersList implements OnInit, AfterViewChecked {
this.selectedRow = i;
this.selectedId = item['Id'];
this.UserEntity = item;
+
if (item['UserTypeTitle'] == 'General Admin') {
- this.buttonStatus = true;
- }
+ if (this.global.UserTypeName == 'District Admin') {
+ this.buttonStatus = null;
+ }
+ else if (this.global.UserTypeName == 'Client Admin') {
+ this.buttonStatus = null;
+ }
+ else if (this.global.UserTypeName == 'Reseller') {
+ this.buttonStatus = null;
+ }
+ else { this.buttonStatus = true;}
+ }
else {
this.buttonStatus = null;
}
@@ -227,6 +241,7 @@ export class UsersList implements OnInit, AfterViewChecked {
this.pageLength = parseInt(tempArr[1]);
this._loadingService.ShowLoading("global-loading");
var UserFilterControl = this.Users.value;
+
this.userservice.GetUserList(
{
FirstName: this.Users.controls['FirstName'].value,
@@ -241,6 +256,8 @@ export class UsersList implements OnInit, AfterViewChecked {
}
SearchRecords() {
+ this.buttonStatus = null;
+ this.selectedRow = -1;
this.SearchUserList('1, ' + this.pageLength);
}
BindFormFields(data) {
@@ -343,7 +360,7 @@ export class UsersList implements OnInit, AfterViewChecked {
this.adduserFrm.controls['isActive'].setValue(this.adduserFrm.value.UserStatusActive)
var UserEntity = this.adduserFrm.value;
-
+
return this.userservice.UpdateUserEntity(UserEntity)
.subscribe(
n => (this.AfterInsertData(n)),
@@ -396,6 +413,7 @@ export class UsersList implements OnInit, AfterViewChecked {
if (data == "User updated successfully") {
this.alerts = '';
+ this.UserEntity = this.adduserFrm.value;
this._confirmService.activate("User updated successfully.", "alertMsg");
}
else {
diff --git a/400-SOURCECODE/Admin/src/app/shared/global.ts b/400-SOURCECODE/Admin/src/app/shared/global.ts
index ba42cb6..ef610c5 100644
--- a/400-SOURCECODE/Admin/src/app/shared/global.ts
+++ b/400-SOURCECODE/Admin/src/app/shared/global.ts
@@ -13,22 +13,26 @@ export class GlobalService {
LiveAPIURL: string = "";
QAAPIURL: string = "";
UserId: number = 0;
- UserType: number =0;
+ UserType: number = 0;
+ UserTypeName: string ="";
AccountType: number = 0;
loggedInUser: any;
DisplayName: string = "";
NoRecords: string;
ValidationMsg: string;
+ RemoveColumns: Array = ["Serial_No", "LicenseId","RowNum"]
error;
constructor(private csvService: CsvService, private http: Http) {
this.hostURL = "http://192.168.84.242:97/";
+ // this.hostURL = "http://192.168.90.20:82/API/Adminapi/"; //Amrita Machine IP
this.LiveAPIURL = "http://beta.interactiveanatomy.com/API/Adminapi/";
this.QAAPIURL = "http://qa.beta.interactiveanatomy.com/API/Adminapi/";
this.LocalURL = "http://localhost:4200";
- this.resourceBaseUrl = this.hostURL;
+ //this.resourceBaseUrl = this.hostURL;
//this.resourceBaseUrl = this.LiveAPIURL;
- // this.resourceBaseUrl = this.QAAPIURL;
+ this.resourceBaseUrl = this.QAAPIURL;
if (this.resourceBaseUrl == "http://192.168.84.242:97/") {
+ //if (this.resourceBaseUrl == "http://192.168.90.20:82/API/Adminapi/") {
localStorage.setItem('loggedInUserDetails', JSON.stringify(
{
@@ -46,8 +50,9 @@ export class GlobalService {
this.loggedInUser = JSON.parse(localStorage.getItem("loggedInUserDetails"));
this.UserId = this.loggedInUser.Id;
this.UserType = this.loggedInUser.UserTypeId;
+ this.UserTypeName = this.loggedInUser.UserType;
this.DisplayName = this.loggedInUser.FirstName + " " + this.loggedInUser.LastName;
- this.NoRecords = 'No records founds.';
+ this.NoRecords = 'No Record Found.';
}
compareTwoDates(todate: string, fromdate: string) {
debugger;
diff --git a/400-SOURCECODE/Admin/src/assets/data/Menu.json b/400-SOURCECODE/Admin/src/assets/data/Menu.json
index c1d872d..816aa74 100644
--- a/400-SOURCECODE/Admin/src/assets/data/Menu.json
+++ b/400-SOURCECODE/Admin/src/assets/data/Menu.json
@@ -492,7 +492,7 @@
"SubMenuId": "207",
"SubMenuName": "List User",
"SubMenuUrl": "users",
- "SubMenuStatus": "False"
+ "SubMenuStatus": "True"
},
{
"SubMenuId": "208",
@@ -1339,7 +1339,7 @@
"SubMenuId": "210",
"SubMenuName": "User Group",
"SubMenuUrl": "usergroup",
- "SubMenuStatus": "True"
+ "SubMenuStatus": "False"
}
]
diff --git a/400-SOURCECODE/Admin/src/assets/styles/bootstrap.css b/400-SOURCECODE/Admin/src/assets/styles/bootstrap.css
index 7b06313..1675211 100644
--- a/400-SOURCECODE/Admin/src/assets/styles/bootstrap.css
+++ b/400-SOURCECODE/Admin/src/assets/styles/bootstrap.css
@@ -2217,7 +2217,7 @@ select[multiple].input-lg {
text-align: center;
vertical-align: middle;
-ms-touch-action: manipulation;
- touch-action: manipulation;
+ touch-action: manipulation;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
@@ -2651,7 +2651,7 @@ fieldset[disabled] .btn-link:focus {
}
.btn-sm,
.btn-group-sm > .btn {
- padding: 5px 10px;
+ /* padding: 5px 10px; */
font-size: 12px;
line-height: 1.5;
border-radius: 2px;
diff --git a/400-SOURCECODE/Admin/src/index.html b/400-SOURCECODE/Admin/src/index.html
index 154ec79..31ca5df 100644
--- a/400-SOURCECODE/Admin/src/index.html
+++ b/400-SOURCECODE/Admin/src/index.html
@@ -2,6 +2,7 @@
+
diff --git a/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.Query.sql b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.Query.sql
new file mode 100644
index 0000000..60d2aeb
--- /dev/null
+++ b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.Query.sql
@@ -0,0 +1,5 @@
+Update ResourceModule Set Status=0 where Id in(7,8,13)
+
+
+ Update Activity set Title='Setting' Where id=7
+ Update Activity set Title='Profile' Where id=1
\ No newline at end of file
diff --git a/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetDiscountCodes.sql b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetDiscountCodes.sql
new file mode 100644
index 0000000..5a3131a
--- /dev/null
+++ b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetDiscountCodes.sql
@@ -0,0 +1,41 @@
+if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetDiscountCodes]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+drop procedure [dbo].[usp_GetDiscountCodes]
+GO
+CREATE PROCEDURE [dbo].[usp_GetDiscountCodes]
+ -- Add the parameters for the stored procedure here
+ @sDiscountCode VARCHAR(255) = '', @sStartDate VARCHAR(20) = '', @sEndDate VARCHAR(20) = '', @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;
+ DECLARE @dtStartDate DATETIME, @dtEndDate DATETIME
+
+ -- convert the datatype of startdate & enddate parameter to datetime
+ SELECT @dtStartDate = CONVERT(DATETIME,@sStartDate)
+ SELECT @dtEndDate = CONVERT(DATETIME,@sEndDate)
+ set @pageLength=(Select Count(*) from Discount)
+ --Get the records on the basis of parameters page length and page number rows
+ select LD.Id, LD.DiscountCode, LD.Percentage, LD.StartDate, LD.EndDate, LD.Status
+ from
+ (Select ROW_NUMBER() OVER (ORDER BY Id) AS RowNo, Id, DiscountCode, Percentage, CONVERT(VARCHAR(10),StartDate,101) as StartDate,
+ CONVERT(VARCHAR(10),EndDate,101) as EndDate, (CASE IsActive WHEN 1 THEN 'Active' ELSE 'Inactive' END) AS Status
+ FROM Discount WHERE StartDate >= (CASE WHEN LEN(@sStartDate) > 0 THEN @dtStartDate ELSE StartDate END)
+ AND EndDate <= (CASE WHEN LEN(@sEndDate) > 0 THEN @dtEndDate ELSE EndDate END)
+ AND DiscountCode like (CASE WHEN LEN(@sDiscountCode) > 0 THEN '%' + @sDiscountCode + '%' ELSE DiscountCode END))
+ as LD
+ where
+ RowNo > @pageLength * (@pageNo - 1) AND
+ RowNo <= @pageLength * @pageNo
+
+--Calculate total number of records
+select @recordCount = count(ResultTable.Id) from
+(Select Id, DiscountCode, Percentage, CONVERT(VARCHAR(10),StartDate,101) as StartDate,
+CONVERT(VARCHAR(10),EndDate,101) as EndDate, (CASE IsActive WHEN 1 THEN 'Active' ELSE 'Inactive' END) AS Status
+FROM Discount WHERE StartDate >= (CASE WHEN LEN(@sStartDate) > 0 THEN @dtStartDate ELSE StartDate END)
+AND EndDate <= (CASE WHEN LEN(@sEndDate) > 0 THEN @dtEndDate ELSE EndDate END)
+AND DiscountCode like (CASE WHEN LEN(@sDiscountCode) > 0 THEN '%' + @sDiscountCode + '%' ELSE DiscountCode END)) as ResultTable;
+
+END
+
+
diff --git a/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetExportedImageDetails.sql b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetExportedImageDetails.sql
new file mode 100644
index 0000000..37f12d4
--- /dev/null
+++ b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetExportedImageDetails.sql
@@ -0,0 +1,59 @@
+if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetExportedImageDetails]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+drop procedure [dbo].[usp_GetExportedImageDetails]
+GO
+
+CREATE PROCEDURE [dbo].[usp_GetExportedImageDetails]--'2011-01-01','2018-01-01','',1,10,100
+ @sStartDate varchar(20) = '', @sEndDate varchar(20) = '', @sAccoutNumber 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;
+
+ Select RowNum, LicenseId, ExportedDate, ImageName, AccountNumber, OriginalFileName, Title, ModuleName, ExportLimit, UserName, imageCount
+ from (
+ SELECT ROW_NUMBER() OVER (ORDER BY LID.LicenseId) AS RowNum , LID.LicenseId,
+ convert(varchar,LID.ExportedDate, 101) as ExportedDate,
+
+ LID.ImageName,
+ isnull(L.AccountNumber,'') as AccountNumber,
+ LID.OriginalFileName,
+ LID.Title,
+ LID.ModuleName,
+ isnull((SELECT TOP(1) LSD.NoofImages FROM LicenseSubscriptionDetail LSD WHERE LSD.LicenseId = LID.LicenseId order by LSD.SubscriptionValidFrom desc),'') as ExportLimit,
+ USR.FirstName + ' '+ USR.LastName as UserName,
+ (SELECT COUNT(LID1.Id) FROM LicenseImageExportDetail LID1 WHERE LID1.LicenseId = LID.LicenseId group by LID1.LicenseId) as imageCount
+ FROM
+ LicenseImageExportDetail LID
+ LEFT JOIN License L ON LID.LicenseId =L.Id
+ INNER JOIN AIAUser USR ON LID.UserId = USR.Id
+ WHERE
+ ((LEN(@sStartDate)=0) OR (LID.ExportedDate >= (CONVERT(DATETIME,@sStartDate)))) AND
+ ((LEN(@sEndDate)=0) OR (LID.ExportedDate <= (DATEADD(ms,-3,DATEADD(DAY,1,CONVERT(DATETIME,@sEndDate)))))) AND
+ ((LEN(@sAccoutNumber)=0) OR (AccountNumber LIKE '%'+@sAccoutNumber+'%'))) as usr
+ WHERE RowNum > @pageLength * (@pageNo - 1) AND RowNum <= @pageLength * @pageNo order by LicenseId
+
+ --Calculate total number of records
+ select @recordCount = count(ResultTable.LicenseId) from (
+ SELECT LID.LicenseId,
+ LID.ExportedDate,
+ LID.ImageName,
+ L.AccountNumber,
+ LID.OriginalFileName,
+ LID.Title,
+ LID.ModuleName,
+ (SELECT TOP(1) LSD.NoofImages FROM LicenseSubscriptionDetail LSD WHERE LSD.LicenseId = LID.LicenseId order by LSD.SubscriptionValidFrom desc) as ExportLimit,
+ USR.FirstName + ' '+ USR.LastName as UserName,
+ (SELECT COUNT(LID1.Id) FROM LicenseImageExportDetail LID1 WHERE LID1.LicenseId = LID.LicenseId group by LID1.LicenseId) as imageCount
+ FROM
+ LicenseImageExportDetail LID
+ LEFT JOIN License L ON LID.LicenseId =L.Id
+ INNER JOIN AIAUser USR ON LID.UserId = USR.Id
+ WHERE
+ ((LEN(@sStartDate)=0) OR (LID.ExportedDate >= (CONVERT(DATETIME,@sStartDate)))) AND
+ ((LEN(@sEndDate)=0) OR (LID.ExportedDate <= (DATEADD(ms,-3,DATEADD(DAY,1,CONVERT(DATETIME,@sEndDate)))))) AND
+ ((LEN(@sAccoutNumber)=0) OR (AccountNumber LIKE '%'+@sAccoutNumber+'%'))) as ResultTable;
+
+END
+
+
diff --git a/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetManageRights.sql b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetManageRights.sql
new file mode 100644
index 0000000..0401fa6
--- /dev/null
+++ b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetManageRights.sql
diff --git a/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetModuleStatusByLicenseId.sql b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetModuleStatusByLicenseId.sql
new file mode 100644
index 0000000..2ffb149
--- /dev/null
+++ b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetModuleStatusByLicenseId.sql
@@ -0,0 +1,23 @@
+if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetModuleStatusByLicenseId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+drop procedure [dbo].[usp_GetModuleStatusByLicenseId]
+GO
+
+CREATE PROCEDURE [dbo].[usp_GetModuleStatusByLicenseId]
+ -- Add the parameters for the stored procedure here
+ @iLicenseId int
+AS
+BEGIN
+ IF 1=0 BEGIN
+ SET FMTONLY OFF
+ END
+ -- SET NOCOUNT ON added to prevent extra result sets from
+ -- interfering with SELECT statements.
+ SET NOCOUNT ON;
+
+ -- Insert statements for procedure here
+ SELECT ResourceModule.Id,ResourceModule.Title,ModuleToLicense.Status
+ FROM ResourceModule
+ INNER JOIN ModuleToLicense ON ResourceModule.Id = ModuleToLicense.ModuleId
+ WHERE ModuleToLicense.LicenseId = @iLicenseId and ResourceModule.Status=1
+END
+
diff --git a/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetNetAdSummaryReport.sql b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetNetAdSummaryReport.sql
index f30e5c9..397be2c 100644
--- a/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetNetAdSummaryReport.sql
+++ b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetNetAdSummaryReport.sql
@@ -152,6 +152,7 @@ BEGIN
WHERE LicenseType = N1.LicenseType AND AccountType = N1.AccountType AND IsRenew = 1) as RenewSubscription,
(SELECT COUNT(1) FROM #NetAdSummaryReport
WHERE LicenseType = N1.LicenseType AND AccountType = N1.AccountType AND IsActive = 0 AND IsRenew = 0) as InActiveSubscription,
+
((SELECT COUNT(1) FROM #NetAdSummaryReport
WHERE LicenseType = N1.LicenseType AND AccountType = N1.AccountType AND IsActive = 1 AND IsRenew = 0) + (SELECT COUNT(1) FROM #NetAdSummaryReport
WHERE LicenseType = N1.LicenseType AND AccountType = N1.AccountType AND IsRenew = 1) - (SELECT COUNT(1) FROM #NetAdSummaryReport
diff --git a/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetSiteLicenseUsageReport.sql b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetSiteLicenseUsageReport - Copy.sql
index 2a9420f..2a9420f 100644
--- a/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetSiteLicenseUsageReport.sql
+++ b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetSiteLicenseUsageReport - Copy.sql
diff --git a/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetUserType.sql b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetUserType.sql
new file mode 100644
index 0000000..2f893b3
--- /dev/null
+++ b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/dbo.usp_GetUserType.sql
@@ -0,0 +1,41 @@
+if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetUserType]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+drop procedure [dbo].[usp_GetUserType]
+GO
+CREATE PROCEDURE [dbo].[usp_GetUserType]
+ -- Add the parameters for the stored procedure here
+ @id int
+AS
+BEGIN
+Declare @UserType varchar(50)
+ -- SET NOCOUNT ON added to prevent extra result sets from
+ -- interfering with SELECT statements.
+ SET NOCOUNT ON;
+ if(@id>0)
+ begin
+ set @UserType=(select Title from UserType Where Id=@id)
+ if(@UserType='District Admin')
+ begin
+ select Id,Title from UserType where IsActive=1 and Title IN ('Client Admin', 'District Admin')
+ end
+ else if(@UserType='Client Admin')
+ begin
+ select Id,Title from UserType where IsActive=1 and Title IN ('Client Admin', 'Concurrent User')
+ end
+ else
+ begin
+ -- Insert statements for procedure here
+ select Id,Title from UserType where IsActive=1 and Title Not in('Super Admin')--and Id=@id
+ end
+ end
+ else
+ begin
+
+ select Id,Title
+ from UserType where IsActive=1 and Id > 1
+ORDER BY Priority
+ end
+
+END
+
+
+
diff --git a/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/usp_GetSearchUsers.sql b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/usp_GetSearchUsers.sql
new file mode 100644
index 0000000..595e565
--- /dev/null
+++ b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/usp_GetSearchUsers.sql
@@ -0,0 +1,213 @@
+if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetUsersList]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+drop procedure [dbo].[usp_GetUsersList]
+GO
+
+Create PROCEDURE [dbo].[usp_GetUsersList]--'','','','',0,0,3,1,10,0
+ -- Add the parameters for the stored procedure here
+ @sFirstName varchar(100) = '', @sLastName varchar(100) = '', @sEmailId varchar(100) = '',
+ @sAccoutNumber varchar(100) ='', @iUserTypeId int, @iAccountTypeId int, @iLoginUserType int,
+ @pageNo int, @pageLength int, @recordCount int out
+AS
+BEGIN
+ IF 1=0 BEGIN
+ SET FMTONLY OFF
+ END
+
+ DECLARE @SQL NVARCHAR(MAX)
+ Declare @LoginUserType varchar(50)
+ -- create a temporary table to store the desired results of user on the basis of parameter
+ CREATE TABLE #UserResult
+ (
+ RowNums int IDENTITY PRIMARY KEY,
+ Id INT,
+ FirstName VARCHAR(100),
+ LastName VARCHAR(100),
+ LoginId VARCHAR(50),
+ EmailId VARCHAR(50),
+ UserTypeTitle VARCHAR(50),
+ Password VARCHAR(50),
+ CreationDate DATETIME,
+ ModifiedDate DATETIME,
+ AccountNumber VARCHAR(50) DEFAULT '',
+ AccountTypeTitle VARCHAR(50) DEFAULT '',
+ EditionType VARCHAR(50) DEFAULT '',
+ UserStatus VARCHAR(8),
+ UserTypeId INT,
+ EditionTypeId INT DEFAULT ''
+ )
+ /*SET @sFirstName = REPLACE(@sFirstName,' ',' OR ')
+ SET @sLastName = REPLACE(@sLastName,' ',' OR ')*/
+ if((Select Title From UserType Where Id=@iLoginUserType)='District Admin')
+ begin
+ set @LoginUserType='3'+','+'4'
+ end
+ else if((Select Title From UserType Where Id=@iLoginUserType)='Client Admin')
+ begin
+ set @LoginUserType='4'+','+'6'
+ end
+ -- Select @LoginUserType
+ SET @SQL = ''
+ IF LEN(@sAccoutNumber) > 0 OR @iAccountTypeId > 0
+ BEGIN
+ -- fetch account number, state, zip, country of the license to which the user is belonged
+
+ SET @SQL = 'INSERT INTO #UserResult (Id, FirstName, LastName, LoginId, EmailId, UserTypeTitle, Password, CreationDate,
+ ModifiedDate, AccountNumber, AccountTypeTitle, EditionType, UserStatus, UserTypeId, EditionTypeId)
+ SELECT AIAUser.Id, ISNULL(AIAUser.FirstName,''''), ISNULL(AIAUser.LastName,''''), AIAUser.LoginId, ISNULL(AIAUser.EmailId,'''') as EmailId,
+ UserType.Title as UserTypeTitle, AIAUser.Password, AIAUser.CreationDate, ISNULL(AIAUser.ModifiedDate,'''') as ModifiedDate,
+ ISNULL(License.AccountNumber,'''') as AccountNumber, ISNULL(AccountType.Title,'''') as AccountTypeTitle,
+ ISNULL(Edition.Title,'''') as EditionType,
+ (CASE AIAUser.IsActive WHEN 1 THEN ''Active'' ELSE ''Inactive'' END) as UserStatus,
+ UserType.Id as UserTypeId, ISNULL(Edition.Id,'''') as EditionTypeId
+ FROM AIAUser
+ INNER JOIN UserType ON UserType.Id = AIAUser.UserTypeId
+ INNER JOIN AIAUserToLicenseEdition ON AIAUser.Id = AIAUserToLicenseEdition.UserId
+ INNER JOIN LicenseToEdition ON AIAUserToLicenseEdition.LicenseEditionId = LicenseToEdition.Id
+ INNER JOIN License ON LicenseToEdition.LicenseId = License.Id
+ INNER JOIN AccountType ON AccountType.Id = License.AccountTypeId
+ INNER JOIN Edition ON Edition.Id = LicenseToEdition.EditionId
+ WHERE
+ License.IsActive = 1'
+ -- AND UserType.Priority >' +CONVERT(VARCHAR(20),@iLoginUserType)
+
+ IF LEN(@sAccoutNumber)>0
+ BEGIN
+ SET @SQL = @SQL + ' AND License.AccountNumber = '''+@sAccoutNumber+''''
+ END
+ IF @iAccountTypeId > 0
+ BEGIN
+ SET @SQL = @SQL + ' AND License.AccountTypeId = '''+CONVERT(VARCHAR(20),@iAccountTypeId)+''''
+ END
+ IF LEN(@sFirstName)>0
+ BEGIN
+ SET @SQL = @SQL + ' AND (AIAUser.FirstName LIKE ''%'+@sFirstName+'%'')' --CONTAINS(AIAUser.FirstName, '''+@sFirstName+''')'
+ END
+ IF LEN(@sLastName)>0
+ BEGIN
+ SET @SQL = @SQL + ' AND (AIAUser.LastName LIKE ''%'+@sLastName+'%'')'--CONTAINS(AIAUser.LastName, '''+@sLastName+''')'
+ END
+ IF LEN(@sEmailId)>0
+ BEGIN
+ SET @SQL = @SQL + ' AND AIAUser.EmailId = '''+@sEmailId+''''
+ END
+ IF @iUserTypeId>0
+ BEGIN
+ SET @SQL = @SQL + ' AND AIAUser.UserTypeId = '''+CONVERT(VARCHAR(20),@iUserTypeId)+''''
+ END
+ IF LEN(@LoginUserType)>0
+ begin
+ SET @SQL = @SQL + ' AND UserType.Id in ('+CONVERT(VARCHAR(50),@LoginUserType)+')'
+ end
+ -- select @SQL
+ EXEC SP_EXECUTESQL @SQL
+
+ END
+ ELSE
+ BEGIN
+
+ SET @SQL = 'INSERT INTO #UserResult (Id, FirstName, LastName, LoginId, EmailId, UserTypeTitle, Password, CreationDate,
+ ModifiedDate, UserStatus, UserTypeId)
+ SELECT AIAUser.Id, ISNULL(AIAUser.FirstName,''''), ISNULL(AIAUser.LastName,''''),
+ AIAUser.LoginId, ISNULL(AIAUser.EmailId,''''), UserType.Title, AIAUser.Password, AIAUser.CreationDate,
+ ISNULL(AIAUser.ModifiedDate,''''), (CASE AIAUser.IsActive WHEN 1 THEN ''Active'' ELSE ''Inactive'' END),
+ UserType.Id
+ FROM AIAUser
+ INNER JOIN UserType ON UserType.Id = AIAUser.UserTypeId
+ WHERE UserType.Title in (''General Admin'')'
+
+ IF LEN(@sFirstName)>0
+ BEGIN
+ SET @SQL = @SQL + ' AND (AIAUser.FirstName LIKE ''%'+@sFirstName+'%'')'--CONTAINS(AIAUser.FirstName, '''+@sFirstName+''')'
+ END
+ IF LEN(@sLastName)>0
+ BEGIN
+ SET @SQL = @SQL + ' AND (AIAUser.LastName LIKE ''%'+@sLastName+'%'')'--CONTAINS(AIAUser.LastName, '''+@sLastName+''')'
+ END
+ IF LEN(@sEmailId)>0
+ BEGIN
+ SET @SQL = @SQL + ' AND AIAUser.EmailId = '''+@sEmailId+''''
+ END
+ IF @iUserTypeId>0
+ BEGIN
+ SET @SQL = @SQL + ' AND AIAUser.UserTypeId = '''+CONVERT(VARCHAR(20),@iUserTypeId)+''''
+ END
+ IF LEN(@LoginUserType)>0
+ begin
+ SET @SQL = @SQL + ' AND UserType.Id in ('+CONVERT(VARCHAR(50),@LoginUserType)+')'
+ end
+ -- select @SQL
+ EXEC SP_EXECUTESQL @SQL
+
+ -- fetch account number, state, zip, country of the license to which the user is belonged
+ SET @SQL = 'INSERT INTO #UserResult (Id, FirstName, LastName, LoginId, EmailId, UserTypeTitle, Password, CreationDate,
+ ModifiedDate, AccountNumber, AccountTypeTitle, EditionType, UserStatus, UserTypeId, EditionTypeId)
+ SELECT AIAUser.Id, ISNULL(AIAUser.FirstName,''''), ISNULL(AIAUser.LastName,''''), AIAUser.LoginId, ISNULL(AIAUser.EmailId,''''),
+ UserType.Title, AIAUser.Password, AIAUser.CreationDate, ISNULL(AIAUser.ModifiedDate,''''),
+ License.AccountNumber, AccountType.Title, Edition.Title,
+ (CASE AIAUser.IsActive WHEN 1 THEN ''Active'' ELSE ''Inactive'' END), UserType.Id, Edition.Id
+ FROM AIAUser
+ INNER JOIN UserType ON UserType.Id = AIAUser.UserTypeId
+ INNER JOIN AIAUserToLicenseEdition ON AIAUser.Id = AIAUserToLicenseEdition.UserId
+ INNER JOIN LicenseToEdition ON AIAUserToLicenseEdition.LicenseEditionId = LicenseToEdition.Id
+ INNER JOIN License ON LicenseToEdition.LicenseId = License.Id
+ INNER JOIN AccountType ON AccountType.Id = License.AccountTypeId
+ INNER JOIN Edition ON Edition.Id = LicenseToEdition.EditionId
+ WHERE
+ UserType.Title NOT IN (''Super Admin'',''General Admin'')
+ AND License.IsActive = 1'
+
+ IF LEN(@sAccoutNumber)>0
+ BEGIN
+ SET @SQL = @SQL + ' AND License.AccountNumber = '''+@sAccoutNumber+''''
+ END
+ IF @iAccountTypeId > 0
+ BEGIN
+ SET @SQL = @SQL + ' AND License.AccountTypeId = '''+CONVERT(VARCHAR(20),@iAccountTypeId)+''''
+ END
+ IF LEN(@sFirstName)>0
+ BEGIN
+ SET @SQL = @SQL + ' AND (AIAUser.FirstName LIKE ''%'+@sFirstName+'%'')'--CONTAINS(AIAUser.FirstName, '''+@sFirstName+''')'
+ END
+ IF LEN(@sLastName)>0
+ BEGIN
+ SET @SQL = @SQL + ' AND (AIAUser.LastName LIKE ''%'+@sLastName+'%'')'--CONTAINS(AIAUser.LastName, '''+@sLastName+''')'
+ END
+ IF LEN(@sEmailId)>0
+ BEGIN
+ SET @SQL = @SQL + ' AND AIAUser.EmailId = '''+@sEmailId+''''
+ END
+ IF @iUserTypeId>0
+ BEGIN
+ SET @SQL = @SQL + ' AND AIAUser.UserTypeId = '''+CONVERT(VARCHAR(20),@iUserTypeId)+''''
+ END
+ IF LEN(@LoginUserType)>0
+ begin
+ SET @SQL = @SQL + ' AND UserType.Id in ('+CONVERT(VARCHAR(50),@LoginUserType)+')'
+ end
+ --select @SQL
+ EXEC SP_EXECUTESQL @SQL
+
+ END
+ -- Selecting the desired result from temporary table
+ Select RowNum,Id, FirstName, LastName,LoginId, EmailId,UserTypeTitle, Password, CreationDate,
+ ModifiedDate, AccountNumber, AccountTypeTitle, EditionType, UserStatus, UserTypeId,EditionTypeId
+ from (
+ SELECT ROW_NUMBER() OVER (ORDER BY Id) AS RowNum ,Id, FirstName, LastName, LoginId, EmailId, UserTypeTitle, Password, CreationDate,
+ ModifiedDate, AccountNumber, AccountTypeTitle, EditionType, UserStatus, UserTypeId, EditionTypeId FROM #UserResult) as usr
+ WHERE RowNum > @pageLength * (@pageNo - 1) AND RowNum <= @pageLength * @pageNo order by Id --RowNum BETWEEN @pageNo AND (@pageNo - 1) * @pageLength
+--SELECT RowNum, Id, FirstName, LastName, LoginId, EmailId, UserTypeTitle, Password, CreationDate,
+-- ModifiedDate, AccountNumber, AccountTypeTitle, EditionType, UserStatus, UserTypeId, EditionTypeId FROM #UserResult
+-- where RowNum > (@pageLength * (@pageNo - 1)) AND (RowNo <= (@pageLength * @pageNo)) order by RowNum
+ -- order by Id
+ -- order by Id OFFSET ((@pageNo - 1) * @pageLength) ROWS FETCH NEXT @pageLength ROWS ONLY;
+
+
+
+ --Calculate total number of records
+ select @recordCount = count(ResultTable.Id) from (SELECT Id, FirstName, LastName, LoginId, EmailId, UserTypeTitle, Password, CreationDate,
+ ModifiedDate, AccountNumber, AccountTypeTitle, EditionType, UserStatus, UserTypeId, EditionTypeId FROM #UserResult) as ResultTable;
+
+ -- Dropping the temporary table
+ DROP TABLE #UserResult
+END
+
diff --git a/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/usp_InsertUpdateSiteAccount.sql b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/usp_InsertUpdateSiteAccount.sql
new file mode 100644
index 0000000..1e7e99d
--- /dev/null
+++ b/500-DBDump/AIA-StoredProcedures/ADMIN-ANGULAR-VERSION-PROCS/usp_InsertUpdateSiteAccount.sql
@@ -0,0 +1,107 @@
+SET QUOTED_IDENTIFIER ON
+GO
+SET ANSI_NULLS ON
+GO
+
+if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_InsertUpdateSiteAccount]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+drop procedure [dbo].[usp_InsertUpdateSiteAccount]
+GO
+
+-- ====================================================
+-- Author: Magic Software
+-- Create date: 08-Feb-2018
+-- Description: To insert or update a site account for a license account and site
+-- ====================================================
+create PROCEDURE [dbo].[usp_InsertUpdateSiteAccount]
+ -- Add the parameters for the stored procedure here
+ @iSiteId int, @sSiteIP varchar(2000), @sTitle varchar(100), @sInstituteName varchar(100), @sDepartment varchar(50),
+ @sAddress1 varchar(100), @sAddress2 varchar(100), @sCity varchar(50), @Zip varchar(20), @Phone varchar(30),
+ @StateId int, @CountryId int, @IsMaster bit, @CreationDate datetime, @ModifiedDate datetime,
+ @IsActive bit, @UserId int, @sSiteIPTo varchar(100), @LicenseId int, @SiteEditionIds varchar(1000),
+ @Status int out
+AS
+BEGIN
+ -- SET NOCOUNT ON added to prevent extra result sets from
+ -- interfering with SELECT statements.
+SET NOCOUNT ON;
+
+DECLARE @list varchar(1000)
+DECLARE @pos INT, @tempEditionId int, @tempLicenseEditionId int;
+DECLARE @len INT, @tempModesty bit;
+DECLARE @value varchar(1000)
+
+CREATE TABLE #LocalTempTable(
+SiteId int,
+LicenseEditionId int,
+IsModesty bit);
+
+if(@SiteEditionIds != '')
+begin
+ set @SiteEditionIds = @SiteEditionIds + ',';
+end
+SET @list = @SiteEditionIds
+
+ set @Status = 0;
+ BEGIN TRY
+ BEGIN TRANSACTION
+
+ IF @iSiteId = 0
+ BEGIN
+ INSERT INTO [dbo].[Site]([SiteIP],[Title],[InstituteName],[Department],[Address1],[Address2],
+ [City],[Zip],[Phone],[StateId],[CountryId],[IsMaster],[CreationDate],[ModifiedDate],[IsActive],[SiteIPTo])
+ VALUES(@sSiteIP, @sTitle, @sInstituteName, @sDepartment, @sAddress1, @sAddress2, @sCity, @Zip, @Phone,
+ @StateId, @CountryId, @IsMaster, @CreationDate, @ModifiedDate, @IsActive, @sSiteIPTo);
+ -- to get the last inserted identity value in the current session
+ SET @iSiteId=SCOPE_IDENTITY();
+ insert into AIAUserToSite values(@UserId, @iSiteId);
+ END
+ ELSE
+ BEGIN
+ UPDATE [dbo].[Site] SET [SiteIP]=@sSiteIP, [Title]=@sTitle,[InstituteName]=@sInstituteName,
+ [Department]=@sDepartment, [Address1]=@sAddress1, [Address2]=@sAddress2,[City]=@sCity,
+ [Zip]=@Zip, [Phone]=@Phone, [StateId]=@StateId, [CountryId]=@CountryId,
+ [ModifiedDate]=@ModifiedDate, [IsActive]=@IsActive, [SiteIPTo]=@sSiteIPTo
+ WHERE [Id]=@iSiteId
+ END
+
+ insert into #LocalTempTable
+ select SLE.* from SiteToLicenseEdition SLE inner join LicenseToEdition LE on SLE.LicenseEditionId = LE.Id where
+ SLE.SiteId = @iSiteId and LicenseId = @LicenseId;
+
+ delete SLE from SiteToLicenseEdition SLE inner join LicenseToEdition LE on SLE.LicenseEditionId = LE.Id where
+ SLE.SiteId = @iSiteId and LicenseId = @LicenseId;
+
+ set @pos = 0
+ set @len = 0
+
+ WHILE CHARINDEX(',', @list, @pos+1)>0
+ BEGIN
+ set @len = CHARINDEX(',', @list, @pos+1) - @pos;
+ set @value = SUBSTRING(@list, @pos, @len);
+ set @tempEditionId = convert(int, @value);
+ select @tempLicenseEditionId = Id from LicenseToEdition where LicenseId = @LicenseId and EditionId = @tempEditionId;
+ set @tempModesty = 0;
+ if(exists(select * from #LocalTempTable where LicenseEditionId = @tempLicenseEditionId and SiteId = @iSiteId))
+ begin
+ select @tempModesty = IsModesty from #LocalTempTable where LicenseEditionId = @tempLicenseEditionId and SiteId = @iSiteId;
+ end
+ insert into SiteToLicenseEdition(SiteId, LicenseEditionId, IsModesty) values(@iSiteId, @tempLicenseEditionId, @tempModesty);
+ set @pos = CHARINDEX(',', @list, @pos+@len) + 1;
+ END
+
+ COMMIT TRANSACTION
+ set @Status =@iSiteId;
+ END TRY
+ BEGIN CATCH
+ IF @@TRANCOUNT > 0
+ ROLLBACK TRANSACTION
+ END CATCH
+
+END
+
+GO
+SET QUOTED_IDENTIFIER OFF
+GO
+SET ANSI_NULLS ON
+GO
+
diff --git a/500-DBDump/AIA-StoredProcedures/dbo.usp_GetExportedImageDetails.sql b/500-DBDump/AIA-StoredProcedures/dbo.usp_GetExportedImageDetails.sql
index 2f0badb..a94354a 100644
--- a/500-DBDump/AIA-StoredProcedures/dbo.usp_GetExportedImageDetails.sql
+++ b/500-DBDump/AIA-StoredProcedures/dbo.usp_GetExportedImageDetails.sql
@@ -2,7 +2,7 @@ if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetExp
drop procedure [dbo].[usp_GetExportedImageDetails]
GO
-CREATE PROCEDURE [dbo].[usp_GetExportedImageDetails]
+CREATE PROCEDURE [dbo].[usp_GetExportedImageDetails]--'2011-01-01','2018-01-01','',1,10,100
@sStartDate varchar(20) = '', @sEndDate varchar(20) = '', @sAccoutNumber varchar(50)='', @pageNo int, @pageLength int, @recordCount int out
AS
BEGIN
@@ -13,7 +13,8 @@ BEGIN
Select RowNum, LicenseId, ExportedDate, ImageName, AccountNumber, OriginalFileName, Title, ModuleName, ExportLimit, UserName, imageCount
from (
SELECT ROW_NUMBER() OVER (ORDER BY LID.LicenseId) AS RowNum , LID.LicenseId,
- LID.ExportedDate,
+ convert(varchar,LID.ExportedDate, 101) as ExportedDate,
+
LID.ImageName,
L.AccountNumber,
LID.OriginalFileName,
diff --git a/500-DBDump/AIA-StoredProcedures/dbo.usp_GetManageRights.sql b/500-DBDump/AIA-StoredProcedures/dbo.usp_GetManageRights.sql
index 80474e5..0401fa6 100644
--- a/500-DBDump/AIA-StoredProcedures/dbo.usp_GetManageRights.sql
+++ b/500-DBDump/AIA-StoredProcedures/dbo.usp_GetManageRights.sql
diff --git a/500-DBDump/AIA-StoredProcedures/dbo.usp_GetSearchUsers.sql b/500-DBDump/AIA-StoredProcedures/dbo.usp_GetSearchUsers.sql
index cd08938..560d52c 100644
--- a/500-DBDump/AIA-StoredProcedures/dbo.usp_GetSearchUsers.sql
+++ b/500-DBDump/AIA-StoredProcedures/dbo.usp_GetSearchUsers.sql
@@ -1,8 +1,8 @@
-if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetSearchUsers]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
-drop procedure [dbo].[usp_GetSearchUsers]
+if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[usp_GetUsersList]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+drop procedure [dbo].[usp_GetUsersList]
GO
-Create PROCEDURE [dbo].[usp_GetSearchUsers]--'','','','',0,0,0,1,10,0
+Create PROCEDURE [dbo].[usp_GetUsersList]--'','','','',0,0,7,1,10,0
-- Add the parameters for the stored procedure here
@sFirstName varchar(100) = '', @sLastName varchar(100) = '', @sEmailId varchar(100) = '',
@sAccoutNumber varchar(100) ='', @iUserTypeId int, @iAccountTypeId int, @iLoginUserType int,
@@ -13,7 +13,8 @@ BEGIN
SET FMTONLY OFF
END
- DECLARE @SQL NVARCHAR(MAX)
+ DECLARE @SQL NVARCHAR(MAX)
+ Declare @LoginUserType varchar(50)
-- create a temporary table to store the desired results of user on the basis of parameter
CREATE TABLE #UserResult
(
@@ -36,6 +37,15 @@ BEGIN
)
/*SET @sFirstName = REPLACE(@sFirstName,' ',' OR ')
SET @sLastName = REPLACE(@sLastName,' ',' OR ')*/
+ if((Select Title From UserType Where Id=@iLoginUserType)='District Admin')
+ begin
+ set @LoginUserType='''District Admin'''+','+'''Client Admin'''
+ end
+ else if((Select Title From UserType Where Id=@iLoginUserType)='Client Admin')
+ begin
+ set @LoginUserType='''Client Admin'''+','+'''Concurrent User'''
+ end
+ -- Select @LoginUserType
SET @SQL = ''
IF LEN(@sAccoutNumber) > 0 OR @iAccountTypeId > 0
BEGIN
@@ -57,8 +67,8 @@ BEGIN
INNER JOIN AccountType ON AccountType.Id = License.AccountTypeId
INNER JOIN Edition ON Edition.Id = LicenseToEdition.EditionId
WHERE
- License.IsActive = 1
- AND UserType.Priority >' +CONVERT(VARCHAR(20),@iLoginUserType)
+ License.IsActive = 1'
+ -- AND UserType.Priority >' +CONVERT(VARCHAR(20),@iLoginUserType)
IF LEN(@sAccoutNumber)>0
BEGIN
@@ -84,6 +94,10 @@ BEGIN
BEGIN
SET @SQL = @SQL + ' AND AIAUser.UserTypeId = '''+CONVERT(VARCHAR(20),@iUserTypeId)+''''
END
+ IF LEN(@LoginUserType)>0
+ begin
+ SET @SQL = @SQL + ' AND UserType.Title in ('+CONVERT(VARCHAR(50),@LoginUserType)+')'
+ end
-- select @SQL
EXEC SP_EXECUTESQL @SQL
@@ -117,8 +131,12 @@ BEGIN
BEGIN
SET @SQL = @SQL + ' AND AIAUser.UserTypeId = '''+CONVERT(VARCHAR(20),@iUserTypeId)+''''
END
+ IF LEN(@LoginUserType)>0
+ begin
+ SET @SQL = @SQL + ' AND UserType.Title in ('+CONVERT(VARCHAR(50),@LoginUserType)+')'
+ end
-- select @SQL
- EXEC SP_EXECUTESQL @SQL
+ EXEC SP_EXECUTESQL @SQL
-- fetch account number, state, zip, country of the license to which the user is belonged
SET @SQL = 'INSERT INTO #UserResult (Id, FirstName, LastName, LoginId, EmailId, UserTypeTitle, Password, CreationDate,
@@ -162,7 +180,11 @@ BEGIN
BEGIN
SET @SQL = @SQL + ' AND AIAUser.UserTypeId = '''+CONVERT(VARCHAR(20),@iUserTypeId)+''''
END
- --select @SQL
+ IF LEN(@LoginUserType)>0
+ begin
+ SET @SQL = @SQL + ' AND UserType.Title in ('+CONVERT(VARCHAR(50),@LoginUserType)+')'
+ end
+ -- select @SQL
EXEC SP_EXECUTESQL @SQL
END
diff --git a/500-DBDump/AIA-StoredProcedures/usp_InsertUpdateSiteAccount.sql b/500-DBDump/AIA-StoredProcedures/usp_InsertUpdateSiteAccount.sql
index bf65716..1e7e99d 100644
--- a/500-DBDump/AIA-StoredProcedures/usp_InsertUpdateSiteAccount.sql
+++ b/500-DBDump/AIA-StoredProcedures/usp_InsertUpdateSiteAccount.sql
@@ -18,7 +18,7 @@ create PROCEDURE [dbo].[usp_InsertUpdateSiteAccount]
@sAddress1 varchar(100), @sAddress2 varchar(100), @sCity varchar(50), @Zip varchar(20), @Phone varchar(30),
@StateId int, @CountryId int, @IsMaster bit, @CreationDate datetime, @ModifiedDate datetime,
@IsActive bit, @UserId int, @sSiteIPTo varchar(100), @LicenseId int, @SiteEditionIds varchar(1000),
- @Status bit out
+ @Status int out
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
@@ -90,7 +90,7 @@ SET @list = @SiteEditionIds
END
COMMIT TRANSACTION
- set @Status = 1;
+ set @Status =@iSiteId;
END TRY
BEGIN CATCH
IF @@TRANCOUNT > 0