master issues fixes : ps

This commit is contained in:
venbatechnologies@gmail.com 2018-10-16 20:20:25 +05:30
parent 37ab34c0ef
commit 8c17c9504a
49 changed files with 968 additions and 1269 deletions

View File

@ -4273,7 +4273,8 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -4688,7 +4689,8 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.1", "version": "5.1.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -4744,6 +4746,7 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -4787,12 +4790,14 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.2", "version": "3.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
} }
} }
}, },
@ -7182,6 +7187,24 @@
"integrity": "sha512-vdqTKI9GBIYcAEbFAcpKPErKINfPF5zIuz3/niBfq8WUZjpT2tytLlFVrBgWdOtqI4uaA/Rb6No0hux39XXDuw==", "integrity": "sha512-vdqTKI9GBIYcAEbFAcpKPErKINfPF5zIuz3/niBfq8WUZjpT2tytLlFVrBgWdOtqI4uaA/Rb6No0hux39XXDuw==",
"dev": true "dev": true
}, },
"ng-pick-datetime": {
"version": "5.2.6",
"resolved": "https://registry.npmjs.org/ng-pick-datetime/-/ng-pick-datetime-5.2.6.tgz",
"integrity": "sha512-5vXK+qCKn2Jn1GvcZTd7bYkkiNIrpEk147l/wSRlgitZHIiswsNCNfceNCSvZvgrQL2WncNvGKzDX8zM4sXu3Q==",
"requires": {
"@angular/cdk": "^5.2.0"
},
"dependencies": {
"@angular/cdk": {
"version": "5.2.5",
"resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-5.2.5.tgz",
"integrity": "sha512-GN8m1d+VcCE9+Bgwv06Y8YJKyZ0i9ZIq2ZPBcJYt+KVgnVVRg4JkyUNxud07LNsvzOX22DquHqmIZiC4hAG7Ag==",
"requires": {
"tslib": "^1.7.1"
}
}
}
},
"ng2-charts": { "ng2-charts": {
"version": "1.6.0", "version": "1.6.0",
"resolved": "https://registry.npmjs.org/ng2-charts/-/ng2-charts-1.6.0.tgz", "resolved": "https://registry.npmjs.org/ng2-charts/-/ng2-charts-1.6.0.tgz",

View File

@ -308,7 +308,7 @@ export class AwsService {
)[0]; )[0];
// (userGroup); // (userGroup);
if (userGroup == "ADMIN") { if (userGroup == "ADMIN") {
if (userData.type.fk_entity_type_id == 1) { if (userData.type.entity_type_id == 1) {
params = { params = {
UserPoolId: sineedgedev_poolData.UserPoolId /* required */, UserPoolId: sineedgedev_poolData.UserPoolId /* required */,
Username: userData.email /* required */, Username: userData.email /* required */,
@ -331,7 +331,7 @@ export class AwsService {
/* more items */ /* more items */
] ]
}; };
} else if (userData.type.fk_entity_type_id == 2) { } else if (userData.type.entity_type_id == 2) {
console.log(2); console.log(2);
params = { params = {
UserPoolId: lender_poolData.UserPoolId /* required */, UserPoolId: lender_poolData.UserPoolId /* required */,
@ -355,7 +355,7 @@ export class AwsService {
/* more items */ /* more items */
] ]
}; };
}else if(userData.type.fk_entity_type_id == 3){ }else if(userData.type.entity_type_id == 3){
params = { params = {
UserPoolId: vendor_poolData.UserPoolId /* required */, UserPoolId: vendor_poolData.UserPoolId /* required */,
Username: userData.email /* required */, Username: userData.email /* required */,
@ -411,7 +411,7 @@ export class AwsService {
console.log(userData); console.log(userData);
this.getconfig(); this.getconfig();
//console.log(userData);
//let cognitodata = "539bfefa-ae42-4bee-bf79-4b15d1a2af7f"; //let cognitodata = "539bfefa-ae42-4bee-bf79-4b15d1a2af7f";
@ -433,7 +433,7 @@ export class AwsService {
}; };
} }
//(params); //console.log(params);
return Observable.create(observe=>{ return Observable.create(observe=>{
let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider(); let cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
@ -473,7 +473,7 @@ export class AwsService {
//cognitosdata = 7; //cognitosdata = 7;
let params:any; let params:any;
if (userGroup == 'ADMIN') { if (userGroup == 'ADMIN') {
if(user.type.fk_entity_type_id ==1){ if(user.type.entity_type_id ==1){
params = { params = {
UserAttributes: [ /* required */ UserAttributes: [ /* required */
{ {
@ -491,7 +491,7 @@ export class AwsService {
UserPoolId: sineedgedev_poolData.UserPoolId, /* required */ UserPoolId: sineedgedev_poolData.UserPoolId, /* required */
Username: user.email /* required */ Username: user.email /* required */
}; };
}else if(user.type.fk_entity_type_id ==2){ }else if(user.type.entity_type_id ==2){
params = { params = {
UserAttributes: [ /* required */ UserAttributes: [ /* required */
{ {
@ -509,6 +509,24 @@ export class AwsService {
UserPoolId: lender_poolData.UserPoolId, /* required */ UserPoolId: lender_poolData.UserPoolId, /* required */
Username: user.email /* required */ Username: user.email /* required */
}; };
}else if(user.type.entity_type_id ==3){
params = {
UserAttributes: [ /* required */
{
Name: 'locale', /* required */
Value: cognitosdata.toString()
},{
Name:"email_verified",
Value:"true"
},{
Name:"phone_number_verified",
Value:"true"
}
/* more items */
],
UserPoolId: vendor_poolData.UserPoolId, /* required */
Username: user.email /* required */
};
} }
//console.log(params); //console.log(params);
return Observable.create(observe => { return Observable.create(observe => {

View File

@ -46,22 +46,13 @@
<ng-container matColumnDef="isactive"> <ng-container matColumnDef="isactive">
<mat-header-cell *matHeaderCellDef mat-sort-header>Active </mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header>Active </mat-header-cell>
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;" <mat-slide-toggle
class="example-margin" class="example-margin" [color]="color"
matTooltip="Active" matTooltipPosition="above" [checked] ="row.isactive==1?true:false"
checked="true" [color]="color" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(change)="isactiveBranch(row.branch_id,row.isactive)" matTooltipPosition="above"
(click)="deactive()"> (click)="isactiveBranch(row.branch_id,row.isactive)">
</mat-slide-toggle> </mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin"
matTooltip="Inactive" matTooltipPosition="above"
checked="false" [color]="color"
(change)="isactiveBranch(row.branch_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -48,6 +48,9 @@ export class BranchListComponent implements OnInit {
@ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort; @ViewChild(MatSort) sort: MatSort;
SwalButtonText: string;
SwalMessage: string;
constructor(private dialog: MatDialog, constructor(private dialog: MatDialog,
private _mastersService: MastersService) { private _mastersService: MastersService) {
@ -126,61 +129,50 @@ export class BranchListComponent implements OnInit {
}); });
} }
/** For Changing active States which means both Changing Active And Inactive alternatively */ /** For Changing active States which means both Changing Active And Inactive alternatively
isactiveBranch(id: number,isactive : number) { * Sweetalert2 for active and deactive */
isactiveBranch(id: number,isactive : number){
let ActiveDatas = isactive == 0
let ActiveDatas = isactive == 0
? { 'branch_id':id,'isactive': '1'} ? { 'branch_id':id,'isactive': '1'}
: { 'branch_id':id,'isactive': '0'} : { 'branch_id':id,'isactive': '0'}
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH') //if is active '1' have TO deactive So deactive messages
this._mastersService.editMasterDetails(ActiveDatas,'BRANCH') if(isactive == 1){
.subscribe(dataresult=>{ this.SwalButtonText = 'Yes, deactivate it!';
if (dataresult.dataStatus == true){ this.SwalMessage = 'Deactivated!';
//alert("my check"); }
this.getBranch(); else{
} this.SwalButtonText = 'Yes, activate it!';
else{ this.SwalMessage = 'Activated!';
Swal("SomeThing Wents Wrong Try Again !"); }
}
}); Swal({
}
//Sweetalert2 for active and deactive
active(){
Swal({
title: 'Are you sure?', title: 'Are you sure?',
type: 'warning', type: 'warning',
showCancelButton: true, showCancelButton: true,
confirmButtonColor: '#3085d6', confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33', cancelButtonColor: '#d33',
confirmButtonText: 'Yes, activate it!' confirmButtonText: this.SwalButtonText
}).then((result) => { }).then((result) => {
if (result.value) { if (result.value) {
Swal( this._mastersService.editMasterDetails(ActiveDatas,'BRANCH')
'Activated!', .subscribe(dataresult=>{
'success' if (dataresult.dataStatus == true){
) Swal(this.SwalMessage,'success');
this.getBranch();
}
else{
Swal("Sorry Try Again !");
}
});
}
else{
this.getBranch();
} }
}) })
} }
deactive()
{
Swal({
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;

View File

@ -136,21 +136,13 @@
<ng-container matColumnDef="isactive"> <ng-container matColumnDef="isactive">
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;" <mat-slide-toggle
class="example-margin" [color]="color" class="example-margin" [color]="color"
matTooltip="Active" matTooltipPosition="above" [checked] ="row.isactive==1?true:false"
checked="true" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(change)="isactiveCity(row.city_id,row.isactive)" matTooltipPosition="above"
(click)="deactive()"> (click)="isactiveCity(row.city_id,row.isactive)">
</mat-slide-toggle> </mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin" [color]="color"
matTooltip="Inactive" matTooltipPosition="above"
checked="false"
(change)="isactiveCity(row.city_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
<!-- <button mat-icon-button class="active" matTooltip="Active" matTooltipPosition="above" (click)="isactiveCity(row.city_id,row.isactive)" *ngIf="row.isactive == 1;else notactive;"><mat-icon>done</mat-icon></button> <!-- <button mat-icon-button class="active" matTooltip="Active" matTooltipPosition="above" (click)="isactiveCity(row.city_id,row.isactive)" *ngIf="row.isactive == 1;else notactive;"><mat-icon>done</mat-icon></button>
<ng-template #notactive><button mat-icon-button class="deactive" matTooltip="Inactive" matTooltipPosition="above" (click)="isactiveCity(row.city_id,row.isactive)"><mat-icon>clear</mat-icon></button></ng-template> --> <ng-template #notactive><button mat-icon-button class="deactive" matTooltip="Inactive" matTooltipPosition="above" (click)="isactiveCity(row.city_id,row.isactive)"><mat-icon>clear</mat-icon></button></ng-template> -->
</mat-cell> </mat-cell>

View File

@ -44,6 +44,8 @@ pageSize = 10;
@ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort; @ViewChild(MatSort) sort: MatSort;
SwalButtonText: string;
SwalMessage: string;
constructor(private dialog: MatDialog, constructor(private dialog: MatDialog,
private _mastersService: MastersService) { private _mastersService: MastersService) {
@ -122,58 +124,43 @@ pageSize = 10;
let ActiveDatas = isactive == 0 let ActiveDatas = isactive == 0
? { 'city_id':id,'isactive': '1'} ? { 'city_id':id,'isactive': '1'}
: { 'city_id':id,'isactive': '0'}; : { 'city_id':id,'isactive': '0'};
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'CITY')
this._mastersService.editMasterDetails(ActiveDatas,'CITY')
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
this.getCity();
}
else{
Swal("SomeThing Wents Wrong Try Again !");
}
});
}
if(isactive == 1){
//Sweetalert2 for active and deactive this.SwalButtonText = 'Yes, deactivate it!';
active(){ this.SwalMessage = 'Deactivated!';
Swal({
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, activate it!'
}).then((result) => {
if (result.value) {
Swal(
'Activated!',
'success'
)
} }
}) else{
} this.SwalButtonText = 'Yes, activate it!';
deactive() this.SwalMessage = 'Activated!';
{
Swal({
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
} }
})
}
Swal({
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: this.SwalButtonText
}).then((result) => {
if (result.value) {
this._mastersService.editMasterDetails(ActiveDatas,'CITY')
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
Swal(this.SwalMessage,'success');
this.getCity();
}
else{
Swal("Sorry Try Again !");
}
});
}
else{
this.getCity();
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;

View File

@ -117,21 +117,13 @@
<ng-container matColumnDef="isactive"> <ng-container matColumnDef="isactive">
<mat-header-cell *matHeaderCellDef mat-sort-header> Active </mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header> Active </mat-header-cell>
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;" <mat-slide-toggle
class="example-margin" class="example-margin" [color]="color"
matTooltip="Active" matTooltipPosition="above" [checked] ="row.isactive==1?true:false"
checked="true" [color]="color" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(change)="isactiveCommentsOnLocality(row.comments_on_locality_id,row.isactive)" matTooltipPosition="above"
(click)="deactive()"> (click)="isactiveCommentsOnLocality(row.comments_on_locality_id,row.isactive)">
</mat-slide-toggle> </mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin"
matTooltip="Inactive" matTooltipPosition="above"
checked="false" [color]="color"
(change)="isactiveCommentsOnLocality(row.comments_on_locality_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -31,10 +31,14 @@ export class CommentsOnLocalityListComponent implements OnInit {
CommentsOnLocalityList: any = []; CommentsOnLocalityList: any = [];
userData = null; userData = null;
SwalButtonText: string;
SwalMessage: string;
color = 'primary'; color = 'primary';
// pagination variable details // pagination variable details
pageSize = 10; pageSize = 10;
public dataLength: number; public dataLength: number;
public dataSource = new MatTableDataSource(); public dataSource = new MatTableDataSource();
//displayedColumns = ['SerialNo','CommentsOnLocalityName', 'IsActive','Actions']; //displayedColumns = ['SerialNo','CommentsOnLocalityName', 'IsActive','Actions'];
@ -119,58 +123,42 @@ export class CommentsOnLocalityListComponent implements OnInit {
let ActiveDatas = isactive == 0 let ActiveDatas = isactive == 0
? { 'comments_on_locality_id':id,'isactive': '1'} ? { 'comments_on_locality_id':id,'isactive': '1'}
: { 'comments_on_locality_id':id,'isactive': '0'}; : { 'comments_on_locality_id':id,'isactive': '0'};
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'CITY')
this._mastersService.editMasterDetails(ActiveDatas,'COMMENTSONLOCALITY')
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
this.getCommentsOnLocality();
}
else{
Swal("SomeThing Wents Wrong Try Again !");
}
});
}
if(isactive == 1){
//Sweetalert2 for active and deactive this.SwalButtonText = 'Yes, deactivate it!';
active(){ this.SwalMessage = 'Deactivated!';
Swal({ }
title: 'Are you sure?', else{
type: 'warning', this.SwalButtonText = 'Yes, activate it!';
showCancelButton: true, this.SwalMessage = 'Activated!';
confirmButtonColor: '#3085d6', }
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, activate it!' Swal({
}).then((result) => { title: 'Are you sure?',
if (result.value) { type: 'warning',
Swal( showCancelButton: true,
'Activated!', confirmButtonColor: '#3085d6',
'success' cancelButtonColor: '#d33',
) confirmButtonText: this.SwalButtonText
} }).then((result) => {
}) if (result.value) {
} this._mastersService.editMasterDetails(ActiveDatas,'COMMENTSONLOCALITY')
deactive() .subscribe(dataresult=>{
{ if (dataresult.dataStatus == true){
Swal({ Swal(this.SwalMessage,'success');
title: 'Are you sure?', this.getCommentsOnLocality();
type: 'warning', }
showCancelButton: true, else{
confirmButtonColor: '#3085d6', Swal("Sorry Try Again !");
cancelButtonColor: '#d33', }
confirmButtonText: 'Yes, deactivate it!' });
}).then((result) => { }
if (result.value) { else{
Swal( this.getCommentsOnLocality();
'Deactivated!', }
'success' })
) }
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;

View File

@ -117,21 +117,13 @@
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<!-- <button mat-icon-button class="active" matTooltip="Active" matTooltipPosition="above" (click)="isactiveCustomerBehaviour(row.customer_behaviour_id,row.isactive)" *ngIf="row.isactive == 1;else notactive;"><mat-icon>done</mat-icon></button> <!-- <button mat-icon-button class="active" matTooltip="Active" matTooltipPosition="above" (click)="isactiveCustomerBehaviour(row.customer_behaviour_id,row.isactive)" *ngIf="row.isactive == 1;else notactive;"><mat-icon>done</mat-icon></button>
<ng-template #notactive><button mat-icon-button class="deactive" matTooltip="Inactive" matTooltipPosition="above" (click)="isactiveCustomerBehaviour(row.customer_behaviour_id,row.isactive)"><mat-icon>clear</mat-icon></button></ng-template> --> <ng-template #notactive><button mat-icon-button class="deactive" matTooltip="Inactive" matTooltipPosition="above" (click)="isactiveCustomerBehaviour(row.customer_behaviour_id,row.isactive)"><mat-icon>clear</mat-icon></button></ng-template> -->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;" <mat-slide-toggle
class="example-margin" class="example-margin" [color]="color"
matTooltip="Active" matTooltipPosition="above" [checked] ="row.isactive==1?true:false"
checked="true" [color]="color" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(change)="isactiveCustomerBehaviour(row.customer_behaviour_id,row.isactive)" matTooltipPosition="above"
(click)="deactive()"> (click)="isactiveCustomerBehaviour(row.customer_behaviour_id,row.isactive)">
</mat-slide-toggle> </mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin" [color]="color"
matTooltip="Inactive" matTooltipPosition="above"
checked="false"
(change)="isactiveCustomerBehaviour(row.customer_behaviour_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -30,6 +30,9 @@ export class CustomerBehaviourListComponent implements OnInit {
CustomerBehaviourList: any = []; CustomerBehaviourList: any = [];
noRecordFound: boolean = false; noRecordFound: boolean = false;
userData = null; userData = null;
SwalButtonText: string;
SwalMessage: string;
color = 'primary'; color = 'primary';
// pagination variable details // pagination variable details
pageSize = 10; pageSize = 10;
@ -119,59 +122,41 @@ pageSize = 10;
let ActiveDatas = isactive == 0 let ActiveDatas = isactive == 0
? { 'customer_behaviour_id':id,'isactive': '1'} ? { 'customer_behaviour_id':id,'isactive': '1'}
: { 'customer_behaviour_id':id,'isactive': '0'} : { 'customer_behaviour_id':id,'isactive': '0'}
if(isactive == 1){
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH') this.SwalButtonText = 'Yes, deactivate it!';
this._MastersService.editMasterDetails(ActiveDatas,'CUSTOMERBEHAVIOUR') this.SwalMessage = 'Deactivated!';
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
//alert("my check");
this.getCustomerBehaviour();
} }
else{ else{
Swal("SomeThing Wents Wrong Try Again !"); this.SwalButtonText = 'Yes, activate it!';
this.SwalMessage = 'Activated!';
} }
});
} Swal({
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
//Sweetalert2 for active and deactive confirmButtonColor: '#3085d6',
active(){ cancelButtonColor: '#d33',
Swal({ confirmButtonText: this.SwalButtonText
title: 'Are you sure?', }).then((result) => {
type: 'warning', if (result.value) {
showCancelButton: true, this._MastersService.editMasterDetails(ActiveDatas,'CUSTOMERBEHAVIOUR')
confirmButtonColor: '#3085d6', .subscribe(dataresult=>{
cancelButtonColor: '#d33', if (dataresult.dataStatus == true){
confirmButtonText: 'Yes, activate it!' Swal(this.SwalMessage,'success');
}).then((result) => { this.getCustomerBehaviour();
if (result.value) { }
Swal( else{
'Activated!', Swal("Sorry Try Again !");
'success' }
) });
} }
}) else{
} this.getCustomerBehaviour();
deactive() }
{ })
Swal({ }
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;

View File

@ -113,21 +113,13 @@
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon> <!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> --> <ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;" <mat-slide-toggle
class="example-margin" class="example-margin" [color]="color"
matTooltip="Active" matTooltipPosition="above" [checked] ="row.isactive==1?true:false"
checked="true" [color]="color" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(change)="isactiveCustomerSegment(row.customer_segment_id,row.isactive)" matTooltipPosition="above"
(click)="deactive()"> (click)="isactiveCustomerSegment(row.customer_segment_id,row.isactive)">
</mat-slide-toggle> </mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin"
matTooltip="Inactive" matTooltipPosition="above"
checked="false" [color]="color"
(change)="isactiveCustomerSegment(row.customer_segment_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -28,6 +28,9 @@ export class CustomerSegmentListComponent implements OnInit {
loader: boolean = false; loader: boolean = false;
CustomerSegmentList: any = []; CustomerSegmentList: any = [];
noRecordFound: boolean = false; noRecordFound: boolean = false;
SwalButtonText: string;
SwalMessage: string;
color = 'primary'; color = 'primary';
// pagination variable details // pagination variable details
pageSize = 10; pageSize = 10;
@ -121,58 +124,42 @@ displayedColumns = ['serialno','name','actions','isactive'];
let ActiveDatas = isactive == 0 let ActiveDatas = isactive == 0
? { 'customer_segment_id':id,'isactive': '1'} ? { 'customer_segment_id':id,'isactive': '1'}
: { 'customer_segment_id':id,'isactive': '0'} : { 'customer_segment_id':id,'isactive': '0'}
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH') if(isactive == 1){
this._MastersService.editMasterDetails(ActiveDatas,'CUSTOMERSEGMENT') this.SwalButtonText = 'Yes, deactivate it!';
.subscribe(dataresult=>{ this.SwalMessage = 'Deactivated!';
if (dataresult.dataStatus == true){
//alert("my check");
this.getCustomerSegment();
} }
else{ else{
Swal("SomeThing Wents Wrong Try Again !"); this.SwalButtonText = 'Yes, activate it!';
this.SwalMessage = 'Activated!';
} }
});
} Swal({
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
//Sweetalert2 for active and deactive confirmButtonColor: '#3085d6',
active(){ cancelButtonColor: '#d33',
Swal({ confirmButtonText: this.SwalButtonText
title: 'Are you sure?', }).then((result) => {
type: 'warning', if (result.value) {
showCancelButton: true, this._MastersService.editMasterDetails(ActiveDatas,'CUSTOMERSEGMENT')
confirmButtonColor: '#3085d6', .subscribe(dataresult=>{
cancelButtonColor: '#d33', if (dataresult.dataStatus == true){
confirmButtonText: 'Yes, activate it!' Swal(this.SwalMessage,'success');
}).then((result) => { this.getCustomerSegment();
if (result.value) { }
Swal( else{
'Activated!', Swal("Sorry Try Again !");
'success' }
) });
} }
}) else{
} this.getCustomerSegment();
deactive() }
{ })
Swal({ }
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {

View File

@ -112,21 +112,13 @@
<ng-container matColumnDef="isactive"> <ng-container matColumnDef="isactive">
<mat-header-cell *matHeaderCellDef mat-sort-header>Active </mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header>Active </mat-header-cell>
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;" <mat-slide-toggle
class="example-margin" class="example-margin" [color]="color"
matTooltip="Active" matTooltipPosition="above" [checked] ="row.isactive==1?true:false"
checked="true" [color]="color" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(change)="isactiveFrequency(row.frequency_id,row.isactive)" matTooltipPosition="above"
(click)="deactive()"> (click)="isactiveFrequency(row.frequency_id,row.isactive)">
</mat-slide-toggle> </mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin" [color]="color"
matTooltip="Inactive" matTooltipPosition="above"
checked="false"
(change)="isactiveFrequency(row.frequency_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -31,6 +31,9 @@ export class FrequencyListComponent implements OnInit {
loader: boolean = false; loader: boolean = false;
FrequencyList: any = []; FrequencyList: any = [];
noRecordFound: boolean = false; noRecordFound: boolean = false;
SwalButtonText: string;
SwalMessage: string;
color = 'primary'; color = 'primary';
// pagination variable details // pagination variable details
pageSize = 10; pageSize = 10;
@ -127,58 +130,41 @@ export class FrequencyListComponent implements OnInit {
let ActiveDatas = isactive == 0 let ActiveDatas = isactive == 0
? { 'frequency_id':id,'isactive': '1'} ? { 'frequency_id':id,'isactive': '1'}
: { 'frequency_id':id,'isactive': '0'} : { 'frequency_id':id,'isactive': '0'}
if(isactive == 1){
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH') this.SwalButtonText = 'Yes, deactivate it!';
this._MastersService.editMasterDetails(ActiveDatas,'FREQUENCY') this.SwalMessage = 'Deactivated!';
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
//alert("my check");
this.getFrequency();
} }
else{ else{
Swal("SomeThing Wents Wrong Try Again !"); this.SwalButtonText = 'Yes, activate it!';
this.SwalMessage = 'Activated!';
} }
});
} Swal({
title: 'Are you sure?',
type: 'warning',
//Sweetalert2 for active and deactive showCancelButton: true,
active(){ confirmButtonColor: '#3085d6',
Swal({ cancelButtonColor: '#d33',
title: 'Are you sure?', confirmButtonText: this.SwalButtonText
type: 'warning', }).then((result) => {
showCancelButton: true, if (result.value) {
confirmButtonColor: '#3085d6', this._MastersService.editMasterDetails(ActiveDatas,'FREQUENCY')
cancelButtonColor: '#d33', .subscribe(dataresult=>{
confirmButtonText: 'Yes, activate it!' if (dataresult.dataStatus == true){
}).then((result) => { Swal(this.SwalMessage,'success');
if (result.value) { this.getFrequency();
Swal( }
'Activated!', else{
'success' Swal("Sorry Try Again !");
) }
} });
}) }
} else{
deactive() this.getFrequency();
{ }
Swal({ })
title: 'Are you sure?', }
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;

View File

@ -43,20 +43,13 @@
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon> <!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> --> <ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;" <mat-slide-toggle
class="example-margin" class="example-margin" [color]="color"
matTooltip="Active" matTooltipPosition="above" [checked] ="row.isactive==1?true:false"
checked="true" [color]="color" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(change)="isactiveIndustryClassification(row.industry_classification_id,row.isactive)" matTooltipPosition="above"
(click)="deactive()"></mat-slide-toggle> (click)="isactiveIndustryClassification(row.industry_classification_id,row.isactive)">
<ng-template #notactive > </mat-slide-toggle>
<mat-slide-toggle
class="example-margin"
matTooltip="Inactive" matTooltipPosition="above"
checked="false" [color]="color"
(change)="isactiveIndustryClassification(row.industry_classification_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
<!-- <mat-slide-toggle <!-- <mat-slide-toggle
class="example-margin" class="example-margin"
[matTooltip] = "row.isactive == 1 ? Inactive : Active" [matTooltip] = "row.isactive == 1 ? Inactive : Active"

View File

@ -38,7 +38,9 @@ export class IndustryClassificationListComponent implements OnInit {
IndustryClassificationList: any = []; IndustryClassificationList: any = [];
noRecordFound: boolean = false; noRecordFound: boolean = false;
SwalButtonText: string;
SwalMessage: string;
userData = null; userData = null;
color = 'primary'; color = 'primary';
// pagination variable details // pagination variable details
@ -136,57 +138,41 @@ pageSize = 10;
let ActiveDatas = isactive == 0 let ActiveDatas = isactive == 0
? { 'industry_classification_id':id,'isactive': '1'} ? { 'industry_classification_id':id,'isactive': '1'}
: { 'industry_classification_id':id,'isactive': '0'} : { 'industry_classification_id':id,'isactive': '0'}
if(isactive == 1){
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH') this.SwalButtonText = 'Yes, deactivate it!';
this._IMService.editMasterDetails(ActiveDatas,'INDUSTRYCLASSIFICATION') this.SwalMessage = 'Deactivated!';
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
//alert("my check");
this.getIndustryClassification();
} }
else{ else{
Swal("SomeThing Wents Wrong Try Again !"); this.SwalButtonText = 'Yes, activate it!';
this.SwalMessage = 'Activated!';
} }
});
} Swal({
title: 'Are you sure?',
//Sweetalert2 for active and deactive type: 'warning',
active(){ showCancelButton: true,
Swal({ confirmButtonColor: '#3085d6',
title: 'Are you sure?', cancelButtonColor: '#d33',
type: 'warning', confirmButtonText: this.SwalButtonText
showCancelButton: true, }).then((result) => {
confirmButtonColor: '#3085d6', if (result.value) {
cancelButtonColor: '#d33', this._IMService.editMasterDetails(ActiveDatas,'INDUSTRYCLASSIFICATION')
confirmButtonText: 'Yes, activate it!' .subscribe(dataresult=>{
}).then((result) => { if (dataresult.dataStatus == true){
if (result.value) { Swal(this.SwalMessage,'success');
Swal( this.getIndustryClassification();
'Activated!', }
'success' else{
) Swal("Sorry Try Again !");
} }
}) });
} }
deactive() else{
{ this.getIndustryClassification();
Swal({ }
title: 'Are you sure?', })
type: 'warning', }
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;

View File

@ -118,21 +118,14 @@
<ng-container matColumnDef="isactive"> <ng-container matColumnDef="isactive">
<mat-header-cell *matHeaderCellDef mat-sort-header> Active </mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header> Active </mat-header-cell>
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;" <mat-slide-toggle
class="example-margin" class="example-margin" [color]="color"
matTooltip="Active" matTooltipPosition="above" [checked] ="row.isactive==1?true:false"
checked="true" [color]="color" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(change)="isactiveMemberOccupations(row.occupation_non_earning_member_id,row.isactive)" matTooltipPosition="above"
(click)="deactive()"> (click)="isactiveMemberOccupations(row.occupation_non_earning_member_id,row.isactive)">
</mat-slide-toggle> </mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin"
matTooltip="Inactive" matTooltipPosition="above"
checked="false" [color]="color"
(change)="isactiveMemberOccupations(row.occupation_non_earning_member_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon> <!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> --> <ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
</mat-cell> </mat-cell>

View File

@ -31,6 +31,9 @@ export class MembersOccupationListComponent implements OnInit {
isPopupOpened: boolean = true; isPopupOpened: boolean = true;
loader: boolean = false; loader: boolean = false;
MemberOccupationList: any = []; MemberOccupationList: any = [];
SwalButtonText: string;
SwalMessage: string;
color = 'primary'; color = 'primary';
// pagination variable details // pagination variable details
pageSize = 10; pageSize = 10;
@ -141,56 +144,42 @@ export class MembersOccupationListComponent implements OnInit {
let ActiveDatas = isactive == 0 let ActiveDatas = isactive == 0
? { 'occupation_non_earning_member_id':id,'isactive': '1'} ? { 'occupation_non_earning_member_id':id,'isactive': '1'}
: { 'occupation_non_earning_member_id':id,'isactive': '0'} : { 'occupation_non_earning_member_id':id,'isactive': '0'}
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH') if(isactive == 1){
this._memberService.editMasterDetails(ActiveDatas,'OCCUPATIONMEMBERS') this.SwalButtonText = 'Yes, deactivate it!';
.subscribe(dataresult=>{ this.SwalMessage = 'Deactivated!';
if (dataresult.dataStatus == true){
//alert("my check");
this.getMemberOccupation();
} }
else{ else{
Swal("SomeThing Wents Wrong Try Again !"); this.SwalButtonText = 'Yes, activate it!';
this.SwalMessage = 'Activated!';
} }
});
} Swal({
//Sweetalert2 for active and deactive title: 'Are you sure?',
active(){ type: 'warning',
Swal({ showCancelButton: true,
title: 'Are you sure?', confirmButtonColor: '#3085d6',
type: 'warning', cancelButtonColor: '#d33',
showCancelButton: true, confirmButtonText: this.SwalButtonText
confirmButtonColor: '#3085d6', }).then((result) => {
cancelButtonColor: '#d33', if (result.value) {
confirmButtonText: 'Yes, activate it!' this._memberService.editMasterDetails(ActiveDatas,'OCCUPATIONMEMBERS')
}).then((result) => { .subscribe(dataresult=>{
if (result.value) { if (dataresult.dataStatus == true){
Swal( Swal(this.SwalMessage,'success');
'Activated!', this.getMemberOccupation();
'success' }
) else{
} Swal("Sorry Try Again !");
}) }
} });
deactive() }
{ else{
Swal({ this.getMemberOccupation();
title: 'Are you sure?', }
type: 'warning', })
showCancelButton: true, }
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;

View File

@ -97,21 +97,14 @@
<ng-container matColumnDef="isactive"> <ng-container matColumnDef="isactive">
<mat-header-cell *matHeaderCellDef mat-sort-header>Active </mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header>Active </mat-header-cell>
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;" <mat-slide-toggle
class="example-margin" class="example-margin" [color]="color"
matTooltip="Active" matTooltipPosition="above" [checked] ="row.isactive==1?true:false"
checked="true" [color]="color" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(change)="isactivePdLocationApproach(row.pd_location_approach_id,row.isactive)" matTooltipPosition="above"
(click)="deactive()"> (click)="isactivePdLocationApproach(row.pd_location_approach_id,row.isactive)">
</mat-slide-toggle> </mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin"
matTooltip="Inactive" matTooltipPosition="above"
checked="false" [color]="color"
(change)="isactivePdLocationApproach(row.pd_location_approach_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon> <!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> --> <ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
</mat-cell> </mat-cell>

View File

@ -43,6 +43,9 @@ export class PdLocationApproachListComponent implements OnInit {
userData = null; userData = null;
noRecordFound: boolean = false; noRecordFound: boolean = false;
SwalButtonText: string;
SwalMessage: string;
public dataLength: number; public dataLength: number;
public dataSource = new MatTableDataSource(); public dataSource = new MatTableDataSource();
displayedColumns = ['serialno','description','actions', 'isactive']; displayedColumns = ['serialno','description','actions', 'isactive'];
@ -129,56 +132,42 @@ export class PdLocationApproachListComponent implements OnInit {
? { 'pd_location_approach_id':id,'isactive': '1'} ? { 'pd_location_approach_id':id,'isactive': '1'}
: { 'pd_location_approach_id':id,'isactive': '0'} : { 'pd_location_approach_id':id,'isactive': '0'}
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH') if(isactive == 1){
//this._MastersService.editMasterDetails(ActiveDatas,'PDLOCATIONAPPROACH') this.SwalButtonText = 'Yes, deactivate it!';
this._MastersService.editMasterDetails(pdLocationApproachFormValue,'PDLOCATIONAPPROACH') this.SwalMessage = 'Deactivated!';
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
//alert("my check");
this.getPdLocationApproach();
} }
else{ else{
Swal("SomeThing Wents Wrong Try Again !"); this.SwalButtonText = 'Yes, activate it!';
this.SwalMessage = 'Activated!';
} }
});
} Swal({
//Sweetalert2 for active and deactive title: 'Are you sure?',
active(){ type: 'warning',
Swal({ showCancelButton: true,
title: 'Are you sure?', confirmButtonColor: '#3085d6',
type: 'warning', cancelButtonColor: '#d33',
showCancelButton: true, confirmButtonText: this.SwalButtonText
confirmButtonColor: '#3085d6', }).then((result) => {
cancelButtonColor: '#d33', if (result.value) {
confirmButtonText: 'Yes, activate it!' this._MastersService.editMasterDetails(pdLocationApproachFormValue,'PDLOCATIONAPPROACH')
}).then((result) => { .subscribe(dataresult=>{
if (result.value) { if (dataresult.dataStatus == true){
Swal( Swal(this.SwalMessage,'success');
'Activated!', this.getPdLocationApproach();
'success' }
) else{
} Swal("Sorry Try Again !");
}) }
} });
deactive() }
{ else{
Swal({ this.getPdLocationApproach();
title: 'Are you sure?', }
type: 'warning', })
showCancelButton: true, }
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;

View File

@ -50,7 +50,7 @@
</div> --> </div> -->
<mat-header-cell *matHeaderCellDef mat-sort-header> Lender-SMS </mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header> Lender-SMS </mat-header-cell>
<mat-cell *matCellDef="let row;let i=index;"> <mat-cell *matCellDef="let row;let i=index;">
<mat-checkbox color="primary" class="example-margin" (change)="modelChanged(row,$event)" [(ngModel)]="row.sms_lender" [checked]="row.sms_lender==1 ? true:false"></mat-checkbox> <mat-checkbox color="primary" class="example-margin" [(ngModel)]="row.sms_lender" [checked]="row.sms_lender==1 ? true:false"></mat-checkbox>
</mat-cell> </mat-cell>
</ng-container> </ng-container>
@ -58,7 +58,7 @@
<mat-header-cell *matHeaderCellDef mat-sort-header> PD Officer-SMS</mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header> PD Officer-SMS</mat-header-cell>
<mat-cell *matCellDef="let row"> <mat-cell *matCellDef="let row">
<!-- {{row.sms_pdofficer}} --> <!-- {{row.sms_pdofficer}} -->
<mat-checkbox color="primary" class="example-margin" (change)="modelChanged(row,$event)" [(ngModel)]="row.sms_pdofficer" [checked]="row.sms_pdofficer==1 ? true:false"></mat-checkbox> <mat-checkbox color="primary" class="example-margin" [(ngModel)]="row.sms_pdofficer" [checked]="row.sms_pdofficer==1 ? true:false"></mat-checkbox>
<!-- <mat-checkbox class="example-margin" [(ngModel)]="row.sms_pdofficer == 1 ? smsPdofficerCheck : smsPdofficerUncheck"></mat-checkbox> --> <!-- <mat-checkbox class="example-margin" [(ngModel)]="row.sms_pdofficer == 1 ? smsPdofficerCheck : smsPdofficerUncheck"></mat-checkbox> -->
</mat-cell> </mat-cell>
</ng-container> </ng-container>
@ -67,7 +67,7 @@
<mat-header-cell *matHeaderCellDef mat-sort-header> PD Incharge -SMS</mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header> PD Incharge -SMS</mat-header-cell>
<mat-cell *matCellDef="let row"> <mat-cell *matCellDef="let row">
<!-- {{row.sms_pdincharge}} --> <!-- {{row.sms_pdincharge}} -->
<mat-checkbox color="primary" class="example-margin" (change)="modelChanged(row,$event)" [(ngModel)]="row.sms_pdincharge" [checked]="row.sms_pdincharge==1 ? true:false"></mat-checkbox> <mat-checkbox color="primary" class="example-margin" [(ngModel)]="row.sms_pdincharge" [checked]="row.sms_pdincharge==1 ? true:false"></mat-checkbox>
<!-- <mat-checkbox class="example-margin" [(ngModel)]="row.sms_pdincharge == 1 ? Check : Uncheck"></mat-checkbox> --> <!-- <mat-checkbox class="example-margin" [(ngModel)]="row.sms_pdincharge == 1 ? Check : Uncheck"></mat-checkbox> -->
</mat-cell> </mat-cell>
</ng-container> </ng-container>
@ -78,7 +78,7 @@
<mat-header-cell *matHeaderCellDef mat-sort-header> Lender -MAIL</mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header> Lender -MAIL</mat-header-cell>
<mat-cell *matCellDef="let row"> <mat-cell *matCellDef="let row">
<!-- {{row.mail_lender}} --> <!-- {{row.mail_lender}} -->
<mat-checkbox color="primary" class="example-margin" (change)="modelChanged(row,$event)" [(ngModel)]="row.mail_lender" [checked]="row.mail_lender==1 ? true:false"></mat-checkbox> <mat-checkbox color="primary" class="example-margin" [(ngModel)]="row.mail_lender" [checked]="row.mail_lender==1 ? true:false"></mat-checkbox>
<!-- <mat-checkbox class="example-margin" [(ngModel)]="row.mail_lender == 1 ? Check : Uncheck"></mat-checkbox> --> <!-- <mat-checkbox class="example-margin" [(ngModel)]="row.mail_lender == 1 ? Check : Uncheck"></mat-checkbox> -->
</mat-cell> </mat-cell>
</ng-container> </ng-container>
@ -86,7 +86,7 @@
<ng-container matColumnDef="mail_pdincharge"> <ng-container matColumnDef="mail_pdincharge">
<mat-header-cell *matHeaderCellDef mat-sort-header> PD Incharge -MAIL </mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header> PD Incharge -MAIL </mat-header-cell>
<mat-cell *matCellDef="let row"> <mat-cell *matCellDef="let row">
<mat-checkbox color="primary" class="example-margin" (change)="modelChanged(row,$event)" [(ngModel)]="row.mail_pdincharge" [checked]="row.mail_pdincharge==1 ? true:false"></mat-checkbox> <mat-checkbox color="primary" class="example-margin" [(ngModel)]="row.mail_pdincharge" [checked]="row.mail_pdincharge==1 ? true:false"></mat-checkbox>
<!-- <mat-checkbox class="example-margin" [(ngModel)]="row.mail_pdincharge == 1 ? Check : Uncheck"></mat-checkbox> --> <!-- <mat-checkbox class="example-margin" [(ngModel)]="row.mail_pdincharge == 1 ? Check : Uncheck"></mat-checkbox> -->
</mat-cell> </mat-cell>
</ng-container> </ng-container>
@ -95,7 +95,7 @@
<mat-header-cell *matHeaderCellDef mat-sort-header> PD Officer -MAIL</mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header> PD Officer -MAIL</mat-header-cell>
<mat-cell *matCellDef="let row"> <mat-cell *matCellDef="let row">
<!-- {{row.mail_pdofficer}} --> <!-- {{row.mail_pdofficer}} -->
<mat-checkbox color="primary" class="example-margin" (change)="modelChanged(row,$event)" [(ngModel)]="row.mail_pdofficer" [checked]="row.mail_pdofficer==1 ? true:false"></mat-checkbox> <mat-checkbox color="primary" class="example-margin" [(ngModel)]="row.mail_pdofficer" [checked]="row.mail_pdofficer==1 ? true:false"></mat-checkbox>
<!-- <mat-checkbox class="example-margin" [(ngModel)]="row.mail_pdofficer == 1 ? Check : Uncheck"></mat-checkbox> --> <!-- <mat-checkbox class="example-margin" [(ngModel)]="row.mail_pdofficer == 1 ? Check : Uncheck"></mat-checkbox> -->
</mat-cell> </mat-cell>
</ng-container> </ng-container>
@ -128,7 +128,7 @@
<mat-toolbar-row fxLayout > <mat-toolbar-row fxLayout >
<button class="mr-1 mb-1 save-button" fxFlex="10%" fxLayoutAlign="center" mat-raised-button color="primary" class="hover-icon" matTooltip="Save Data" matTooltipPosition="above" (click)="SaveData(dataSource)">Save</button> <button class="mr-1 mb-1 save-button" fxFlex="10%" fxLayoutAlign="center" mat-raised-button color="primary" class="hover-icon" matTooltip="Save Data" matTooltipPosition="above" (click)="SaveData(dataSource)">Save</button>
<!-- <span class="empty-spacer"></span> --> <!-- <span class="empty-spacer"></span> -->
<mat-paginator fxFlex="90%" [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator> <mat-paginator fxFlex="90%" [pageSize]="pageSize" [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
</mat-toolbar-row> </mat-toolbar-row>
</mat-toolbar> </mat-toolbar>

View File

@ -30,6 +30,7 @@ export class PdNotificationListComponent implements OnInit {
}; };
notificationData = null; notificationData = null;
noRecordFound: boolean = false; noRecordFound: boolean = false;
pageSize = 10;
private notifier: NotifierService; private notifier: NotifierService;
public dataLength: number; public dataLength: number;
public dataSource = new MatTableDataSource(); public dataSource = new MatTableDataSource();
@ -193,7 +194,8 @@ SaveData(dataSource){
dataresult => { dataresult => {
if(dataresult.dataStatus == true){ if(dataresult.dataStatus == true){
//alert('Updated Successfully !'); //alert('Updated Successfully !');
//this.getPdNotification();
this.getPdNotification();
this.notifier.notify('success', 'Record Updated Successfully.!'); this.notifier.notify('success', 'Record Updated Successfully.!');
}else{ }else{

View File

@ -99,21 +99,13 @@
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon> <!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> --> <ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;" <mat-slide-toggle
class="example-margin" class="example-margin" [color]="color"
matTooltip="Active" matTooltipPosition="above" [checked] ="row.isactive==1?true:false"
checked="true" [color]="color" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(change)="isactivePDType(row.pd_type_id,row.isactive)" matTooltipPosition="above"
(click)="deactive()"> (click)="isactivePDType(row.pd_type_id,row.isactive)">
</mat-slide-toggle> </mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin"
matTooltip="Inactive" matTooltipPosition="above"
checked="false" [color]="color"
(change)="isactivePDType(row.pd_type_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -30,6 +30,9 @@ export class PdTypeListComponent implements OnInit {
loader: boolean = false; loader: boolean = false;
PDTypeList: any = []; PDTypeList: any = [];
noRecordFound: boolean = false; noRecordFound: boolean = false;
SwalButtonText: string;
SwalMessage: string;
color = 'primary'; color = 'primary';
// pagination variable details // pagination variable details
pageSize = 10; pageSize = 10;
@ -122,55 +125,41 @@ isactivePDType(id: number,isactive : number) {
? { 'pd_type_id':id,'isactive': '1'} ? { 'pd_type_id':id,'isactive': '1'}
: { 'pd_type_id':id,'isactive': '0'} : { 'pd_type_id':id,'isactive': '0'}
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH') if(isactive == 1){
this._PDTypeService.editMasterDetails(ActiveDatas,'PDTYPE') this.SwalButtonText = 'Yes, deactivate it!';
.subscribe(dataresult=>{ this.SwalMessage = 'Deactivated!';
if (dataresult.dataStatus == true){
//alert("my check");
this.getPDType();
} }
else{ else{
Swal("SomeThing Wents Wrong Try Again !"); this.SwalButtonText = 'Yes, activate it!';
this.SwalMessage = 'Activated!';
} }
});
} Swal({
//Sweetalert2 for active and deactive title: 'Are you sure?',
active(){ type: 'warning',
Swal({ showCancelButton: true,
title: 'Are you sure?', confirmButtonColor: '#3085d6',
type: 'warning', cancelButtonColor: '#d33',
showCancelButton: true, confirmButtonText: this.SwalButtonText
confirmButtonColor: '#3085d6', }).then((result) => {
cancelButtonColor: '#d33', if (result.value) {
confirmButtonText: 'Yes, activate it!' this._PDTypeService.editMasterDetails(ActiveDatas,'PDTYPE')
}).then((result) => { .subscribe(dataresult=>{
if (result.value) { if (dataresult.dataStatus == true){
Swal( Swal(this.SwalMessage,'success');
'Activated!', this.getPDType();
'success' }
) else{
} Swal("Sorry Try Again !");
}) }
} });
deactive() }
{ else{
Swal({ this.getPDType();
title: 'Are you sure?', }
type: 'warning', })
showCancelButton: true, }
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;

View File

@ -50,21 +50,14 @@
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon> --> <!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon> -->
<!-- <ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> --> <!-- <ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
class="example-margin" <mat-slide-toggle
matTooltip="Active" matTooltipPosition="above" class="example-margin" [color]="color"
checked="true" [color]="color" [checked] ="row.isactive==1?true:false"
(change)="isactiveProductMaster(row.product_id,row.isactive)" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(click)="deactive()"> matTooltipPosition="above"
</mat-slide-toggle> (click)="isactiveProductMaster(row.product_id,row.isactive)">
<ng-template #notactive > </mat-slide-toggle>
<mat-slide-toggle
class="example-margin"
matTooltip="Inactive" matTooltipPosition="above"
checked="false" [color]="color"
(change)="isactiveProductMaster(row.product_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -31,6 +31,9 @@ export class ProductListComponent implements OnInit {
ProductMasterList: any = []; ProductMasterList: any = [];
noRecordFound: boolean = false; noRecordFound: boolean = false;
userData = null; userData = null;
SwalButtonText: string;
SwalMessage: string;
color = 'primary'; color = 'primary';
// pagination variable details // pagination variable details
pageSize = 10; pageSize = 10;
@ -129,55 +132,42 @@ export class ProductListComponent implements OnInit {
let ActiveDatas = isactive == 0 let ActiveDatas = isactive == 0
? { 'product_id':id,'isactive': '1'} ? { 'product_id':id,'isactive': '1'}
: { 'product_id':id,'isactive': '0'} : { 'product_id':id,'isactive': '0'}
if(isactive == 1){
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH') this.SwalButtonText = 'Yes, deactivate it!';
this._ProductService.editMasterDetails(ActiveDatas,'PRODUCTS') this.SwalMessage = 'Deactivated!';
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
//alert("my check");
this.getProductMaster();
} }
else{ else{
Swal("SomeThing Wents Wrong Try Again !"); this.SwalButtonText = 'Yes, activate it!';
this.SwalMessage = 'Activated!';
} }
});
} Swal({
//Sweetalert2 for active and deactive title: 'Are you sure?',
active(){ type: 'warning',
Swal({ showCancelButton: true,
title: 'Are you sure?', confirmButtonColor: '#3085d6',
type: 'warning', cancelButtonColor: '#d33',
showCancelButton: true, confirmButtonText: this.SwalButtonText
confirmButtonColor: '#3085d6', }).then((result) => {
cancelButtonColor: '#d33', if (result.value) {
confirmButtonText: 'Yes, activate it!' this._ProductService.editMasterDetails(ActiveDatas,'PRODUCTS')
}).then((result) => { .subscribe(dataresult=>{
if (result.value) { if (dataresult.dataStatus == true){
Swal( Swal(this.SwalMessage,'success');
'Activated!', this.getProductMaster();
'success' }
) else{
} Swal("Sorry Try Again !");
}) }
} });
deactive() }
{ else{
Swal({ this.getProductMaster();
title: 'Are you sure?', }
type: 'warning', })
showCancelButton: true, }
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;

View File

@ -43,21 +43,14 @@
<ng-container matColumnDef="isactive"> <ng-container matColumnDef="isactive">
<mat-header-cell *matHeaderCellDef mat-sort-header> Active </mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header> Active </mat-header-cell>
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
class="example-margin"
matTooltip="Active" matTooltipPosition="above"
checked="true" [color]="color"
(change)="isactiveQuestionCategory(row.question_category_id,row.isactive)"
(click)="deactive()">
</mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle <mat-slide-toggle
class="example-margin" class="example-margin" [color]="color"
matTooltip="Inactive" matTooltipPosition="above" [checked] ="row.isactive==1?true:false"
checked="false" [color]="color" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(change)="isactiveQuestionCategory(row.question_category_id,row.isactive)" matTooltipPosition="above"
(click)="active()"> (click)="isactiveQuestionCategory(row.question_category_id,row.isactive)">
</mat-slide-toggle></ng-template> </mat-slide-toggle>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -29,6 +29,9 @@ export class QuestionCategoryListComponent implements OnInit {
QuestionCategoryList: any = []; QuestionCategoryList: any = [];
noRecordFound: boolean = false; noRecordFound: boolean = false;
userData = null; userData = null;
SwalButtonText: string;
SwalMessage: string;
color = 'primary'; color = 'primary';
// pagination variable details // pagination variable details
pageSize = 10; pageSize = 10;
@ -115,53 +118,41 @@ export class QuestionCategoryListComponent implements OnInit {
? { 'question_category_id':id,'isactive': '1'} ? { 'question_category_id':id,'isactive': '1'}
: { 'question_category_id':id,'isactive': '0'} : { 'question_category_id':id,'isactive': '0'}
this._MasterService.editMasterDetails(ActiveDatas,'QUESTIONCATEGORY') if(isactive == 1){
.subscribe(dataresult=>{ this.SwalButtonText = 'Yes, deactivate it!';
if (dataresult.dataStatus == true){ this.SwalMessage = 'Deactivated!';
//alert("my check");
this.getQuestionCategory();
} }
else{ else{
Swal("SomeThing Wents Wrong Try Again !"); this.SwalButtonText = 'Yes, activate it!';
this.SwalMessage = 'Activated!';
} }
});
} Swal({
//Sweetalert2 for active and deactive title: 'Are you sure?',
active(){ type: 'warning',
Swal({ showCancelButton: true,
title: 'Are you sure?', confirmButtonColor: '#3085d6',
type: 'warning', cancelButtonColor: '#d33',
showCancelButton: true, confirmButtonText: this.SwalButtonText
confirmButtonColor: '#3085d6', }).then((result) => {
cancelButtonColor: '#d33', if (result.value) {
confirmButtonText: 'Yes, activate it!' this._MasterService.editMasterDetails(ActiveDatas,'QUESTIONCATEGORY')
}).then((result) => { .subscribe(dataresult=>{
if (result.value) { if (dataresult.dataStatus == true){
Swal( Swal(this.SwalMessage,'success');
'Activated!', this.getQuestionCategory();
'success' }
) else{
} Swal("Sorry Try Again !");
}) }
} });
deactive() }
{ else{
Swal({ this.getQuestionCategory();
title: 'Are you sure?', }
type: 'warning', })
showCancelButton: true, }
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {

View File

@ -28,21 +28,14 @@
<ng-container matColumnDef="isactive"> <ng-container matColumnDef="isactive">
<mat-header-cell *matHeaderCellDef mat-sort-header> Active </mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header> Active </mat-header-cell>
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;" <mat-slide-toggle
class="example-margin" class="example-margin" [color]="color"
matTooltip="Active" matTooltipPosition="above" [checked] ="row.isactive==1?true:false"
checked="true" [color]="color" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(change)="isactiveregions(row.region_id,row.isactive)" matTooltipPosition="above"
(click)="deactive()"> (click)="isactiveregions(row.region_id,row.isactive)">
</mat-slide-toggle> </mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin"
matTooltip="Inactive" matTooltipPosition="above"
checked="false" [color]="color"
(change)="isactiveregions(row.region_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -32,6 +32,9 @@ export class RegionsListComponent implements OnInit {
regionsList: any = []; regionsList: any = [];
noRecordFound: boolean = false; noRecordFound: boolean = false;
color = 'primary'; color = 'primary';
SwalButtonText: string;
SwalMessage: string;
userData = null; userData = null;
// pagination variable details // pagination variable details
pageSize = 10; pageSize = 10;
@ -103,64 +106,48 @@ export class RegionsListComponent implements OnInit {
? { 'region_id':id,'isactive': '1'} ? { 'region_id':id,'isactive': '1'}
: { 'region_id':id,'isactive': '0'} : { 'region_id':id,'isactive': '0'}
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH') if(isactive == 1){
this._regionsService.editMasterDetails(ActiveDatas,'REGIONS') this.SwalButtonText = 'Yes, deactivate it!';
.subscribe(dataresult=>{ this.SwalMessage = 'Deactivated!';
if (dataresult.dataStatus == true){
this.getregions();
} }
else{ else{
Swal("SomeThing Wents Wrong Try Again !"); this.SwalButtonText = 'Yes, activate it!';
this.SwalMessage = 'Activated!';
} }
});
} Swal({
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: this.SwalButtonText
}).then((result) => {
if (result.value) {
this._regionsService.editMasterDetails(ActiveDatas,'REGIONS')
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
Swal(this.SwalMessage,'success');
this.getregions();
}
else{
Swal("Sorry Try Again !");
}
});
}
else{
this.getregions();
}
})
}
deleteregions(id: number) { deleteregions(id: number) {
var PrimaryKeyWithValue ={'region_id':id}; var PrimaryKeyWithValue ={'region_id':id};
this._regionsService.deleteMasterDetails(PrimaryKeyWithValue,'REGIONS').subscribe( data => { }); this._regionsService.deleteMasterDetails(PrimaryKeyWithValue,'REGIONS').subscribe( data => { });
this.getregions(); this.getregions();
//this._regionsService.deleteMasterDetails('region_id',id,'REGIONS'); //this._regionsService.deleteMasterDetails('region_id',id,'REGIONS');
} }
//Sweetalert2 for active and deactive
active(){
Swal({
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, activate it!'
}).then((result) => {
if (result.value) {
Swal(
'Activated!',
'success'
)
}
})
}
deactive()
{
Swal({
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {

View File

@ -122,21 +122,13 @@
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon> <!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> --> <ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;" <mat-slide-toggle
class="example-margin" class="example-margin" [color]="color"
matTooltip="Active" matTooltipPosition="above" [checked] ="row.isactive==1?true:false"
checked="true" [color]="color" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(change)="isactiveRelationShip(row.relationship_id,row.isactive)" matTooltipPosition="above"
(click)="deactive()"> (click)="isactiveRelationShip(row.relationship_id,row.isactive)">
</mat-slide-toggle> </mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin"
matTooltip="Inactive" matTooltipPosition="above"
checked="false" [color]="color"
(change)="isactiveRelationShip(row.relationship_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -29,6 +29,9 @@ export class RelationShipListComponent implements OnInit {
loader: boolean = false; loader: boolean = false;
RelationShipList: any = []; RelationShipList: any = [];
noRecordFound: boolean = false; noRecordFound: boolean = false;
SwalButtonText: string;
SwalMessage: string;
color = 'primary'; color = 'primary';
// pagination variable details // pagination variable details
pageSize = 10; pageSize = 10;
@ -100,20 +103,42 @@ export class RelationShipListComponent implements OnInit {
let ActiveDatas = isactive == 0 let ActiveDatas = isactive == 0
? { 'relationship_id':id,'isactive': '1'} ? { 'relationship_id':id,'isactive': '1'}
: { 'relationship_id':id,'isactive': '0'} : { 'relationship_id':id,'isactive': '0'}
if(isactive == 1){
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH') this.SwalButtonText = 'Yes, deactivate it!';
this._MastersService.editMasterDetails(ActiveDatas,'RELATIONSHIPS') this.SwalMessage = 'Deactivated!';
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
//alert("my check");
this.getRelationShip();
} }
else{ else{
Swal("SomeThing Wents Wrong Try Again !"); this.SwalButtonText = 'Yes, activate it!';
this.SwalMessage = 'Activated!';
} }
});
} Swal({
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: this.SwalButtonText
}).then((result) => {
if (result.value) {
this._MastersService.editMasterDetails(ActiveDatas,'RELATIONSHIPS')
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
Swal(this.SwalMessage,'success');
this.getRelationShip();
}
else{
Swal("Sorry Try Again !");
}
});
}
else{
this.getRelationShip();
}
})
}
//To get data for listing //To get data for listing
getRelationShip() { getRelationShip() {
this._MastersService.getAllMasterData('RELATIONSHIPS').subscribe( this._MastersService.getAllMasterData('RELATIONSHIPS').subscribe(
@ -146,42 +171,7 @@ export class RelationShipListComponent implements OnInit {
//this._MastersService.deleteMasterDetails('relationship_id',id,'RELATIONSHIPS'); //this._MastersService.deleteMasterDetails('relationship_id',id,'RELATIONSHIPS');
} }
//Sweetalert2 for active and deactive
active(){
Swal({
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, activate it!'
}).then((result) => {
if (result.value) {
Swal(
'Activated!',
'success'
)
}
})
}
deactive()
{
Swal({
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;

View File

@ -145,21 +145,13 @@
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon> <!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> --> <ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;" <mat-slide-toggle
class="example-margin" class="example-margin" [color]="color"
matTooltip="Active" matTooltipPosition="above" [checked] ="row.isactive==1?true:false"
checked="true" [color]="color" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(change)="isactiveState(row.state_id,row.isactive)" matTooltipPosition="above"
(click)="deactive()"> (click)="isactiveState(row.state_id,row.isactive)">
</mat-slide-toggle> </mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin"
matTooltip="Inactive" matTooltipPosition="above"
checked="false" [color]="color"
(change)="isactiveState(row.state_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -29,6 +29,9 @@ export class StatesListComponent implements OnInit {
isPopupOpened: boolean = true; isPopupOpened: boolean = true;
loader: boolean = false; loader: boolean = false;
StateList: any = []; StateList: any = [];
SwalButtonText: string;
SwalMessage: string;
color = 'primary'; color = 'primary';
// pagination variable details // pagination variable details
pageSize = 10; pageSize = 10;
@ -97,19 +100,42 @@ isactiveState(id: number,isactive : number) {
let ActiveDatas = isactive == 0 let ActiveDatas = isactive == 0
? { 'state_id':id,'isactive': '1'} ? { 'state_id':id,'isactive': '1'}
: { 'state_id':id,'isactive': '0'} : { 'state_id':id,'isactive': '0'}
if(isactive == 1){
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH') this.SwalButtonText = 'Yes, deactivate it!';
this._statesService.editMasterDetails(ActiveDatas,'STATE') this.SwalMessage = 'Deactivated!';
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
//alert("my check");
this.getState();
} }
else{ else{
Swal("SomeThing Wents Wrong Try Again !"); this.SwalButtonText = 'Yes, activate it!';
this.SwalMessage = 'Activated!';
} }
});
} Swal({
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: this.SwalButtonText
}).then((result) => {
if (result.value) {
this._statesService.editMasterDetails(ActiveDatas,'STATE')
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
Swal(this.SwalMessage,'success');
this.getState();
}
else{
Swal("Sorry Try Again !");
}
});
}
else{
this.getState();
}
})
}
//To get data for listing //To get data for listing
getState() { getState() {
this._statesService.getAllState().subscribe( this._statesService.getAllState().subscribe(
@ -138,42 +164,6 @@ isactiveState(id: number,isactive : number) {
this.getState(); this.getState();
//this._statesService.deleteMasterDetails('state_id',id,'STATE'); //this._statesService.deleteMasterDetails('state_id',id,'STATE');
} }
//Sweetalert2 for active and deactive
active(){
Swal({
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, activate it!'
}).then((result) => {
if (result.value) {
Swal(
'Activated!',
'success'
)
}
})
}
deactive()
{
Swal({
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {

View File

@ -134,21 +134,14 @@
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon> <!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> --> <ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;" <mat-slide-toggle
class="example-margin" class="example-margin" [color]="color"
matTooltip="Active" matTooltipPosition="above" [checked] ="row.isactive==1?true:false"
checked="true" [color]="color" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(change)="isactiveSubProductMaster(row.subproduct_id,row.isactive)" matTooltipPosition="above"
(click)="deactive()"> (click)="isactiveSubProductMaster(row.subproduct_id,row.isactive)">
</mat-slide-toggle> </mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin"
matTooltip="Inactive" matTooltipPosition="above"
checked="false" [color]="color"
(change)="isactiveSubProductMaster(row.subproduct_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -34,6 +34,9 @@ export class SubProductListComponent implements OnInit {
userData = null; userData = null;
noRecordFound: boolean = false; noRecordFound: boolean = false;
SwalButtonText: string;
SwalMessage: string;
// pagination variable details // pagination variable details
pageSize = 10; pageSize = 10;
@ -137,56 +140,41 @@ getSubProductMaster() {
let ActiveDatas = isactive == 0 let ActiveDatas = isactive == 0
? { 'subproduct_id':id,'isactive': '1'} ? { 'subproduct_id':id,'isactive': '1'}
: { 'subproduct_id':id,'isactive': '0'} : { 'subproduct_id':id,'isactive': '0'}
if(isactive == 1){
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH') this.SwalButtonText = 'Yes, deactivate it!';
this._MastersService.editMasterDetails(ActiveDatas,'SUBPRODUCTS') this.SwalMessage = 'Deactivated!';
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
//alert("my check");
this.getSubProductMaster();
} }
else{ else{
Swal("SomeThing Wents Wrong Try Again !"); this.SwalButtonText = 'Yes, activate it!';
this.SwalMessage = 'Activated!';
} }
});
} Swal({
//Sweetalert2 for active and deactive title: 'Are you sure?',
active(){ type: 'warning',
Swal({ showCancelButton: true,
title: 'Are you sure?', confirmButtonColor: '#3085d6',
type: 'warning', cancelButtonColor: '#d33',
showCancelButton: true, confirmButtonText: this.SwalButtonText
confirmButtonColor: '#3085d6', }).then((result) => {
cancelButtonColor: '#d33', if (result.value) {
confirmButtonText: 'Yes, activate it!' this._MastersService.editMasterDetails(ActiveDatas,'SUBPRODUCTS')
}).then((result) => { .subscribe(dataresult=>{
if (result.value) { if (dataresult.dataStatus == true){
Swal( Swal(this.SwalMessage,'success');
'Activated!', this.getSubProductMaster();
'success' }
) else{
} Swal("Sorry Try Again !");
}) }
} });
deactive() }
{ else{
Swal({ this.getSubProductMaster();
title: 'Are you sure?', }
type: 'warning', })
showCancelButton: true, }
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;

View File

@ -118,21 +118,14 @@
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon> <!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> --> <ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;" <mat-slide-toggle
class="example-margin" class="example-margin" [color]="color"
matTooltip="Active" matTooltipPosition="above" [checked] ="row.isactive==1?true:false"
checked="true" [color]="color" [matTooltip]="row.isactive==1?'Active':'Inactive'"
(change)="isactiveTitle(row.title_id,row.isactive)" matTooltipPosition="above"
(click)="deactive()"> (click)="isactiveTitle(row.title_id,row.isactive)">
</mat-slide-toggle> </mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin"
matTooltip="Inactive" matTooltipPosition="above"
checked="false" [color]="color"
(change)="isactiveTitle(row.title_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -27,6 +27,9 @@ export class TitleListComponent implements OnInit {
loader: boolean = false; loader: boolean = false;
TitleList: any = []; TitleList: any = [];
noRecordFound: boolean = false; noRecordFound: boolean = false;
SwalButtonText: string;
SwalMessage: string;
color = 'primary'; color = 'primary';
// pagination variable details // pagination variable details
pageSize = 10; pageSize = 10;
@ -124,55 +127,42 @@ export class TitleListComponent implements OnInit {
let ActiveDatas = isactive == 0 let ActiveDatas = isactive == 0
? { 'title_id':id,'isactive': '1'} ? { 'title_id':id,'isactive': '1'}
: { 'title_id':id,'isactive': '0'} : { 'title_id':id,'isactive': '0'}
if(isactive == 1){
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH') this.SwalButtonText = 'Yes, deactivate it!';
this._MastersService.editMasterDetails(ActiveDatas,'TITLES') this.SwalMessage = 'Deactivated!';
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
//alert("my check");
this.getTitle();
} }
else{ else{
Swal("SomeThing Wents Wrong Try Again !"); this.SwalButtonText = 'Yes, activate it!';
this.SwalMessage = 'Activated!';
} }
});
} Swal({
//Sweetalert2 for active and deactive title: 'Are you sure?',
active(){ type: 'warning',
Swal({ showCancelButton: true,
title: 'Are you sure?', confirmButtonColor: '#3085d6',
type: 'warning', cancelButtonColor: '#d33',
showCancelButton: true, confirmButtonText: this.SwalButtonText
confirmButtonColor: '#3085d6', }).then((result) => {
cancelButtonColor: '#d33', if (result.value) {
confirmButtonText: 'Yes, activate it!' this._MastersService.editMasterDetails(ActiveDatas,'TITLES')
}).then((result) => { .subscribe(dataresult=>{
if (result.value) { if (dataresult.dataStatus == true){
Swal( Swal(this.SwalMessage,'success');
'Activated!', this.getTitle();
'success' }
) else{
} Swal("Sorry Try Again !");
}) }
} });
deactive() }
{ else{
Swal({ this.getTitle();
title: 'Are you sure?', }
type: 'warning', })
showCancelButton: true, }
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {

View File

@ -110,23 +110,15 @@
<ng-container matColumnDef="isactive"> <ng-container matColumnDef="isactive">
<mat-header-cell *matHeaderCellDef mat-sort-header> Active </mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header> Active </mat-header-cell>
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<mat-slide-toggle
class="example-margin" [color]="color"
[checked] ="row.isactive==1?true:false"
[matTooltip]="row.isactive==1?'Active':'Inactive'"
matTooltipPosition="above"
(click)="isactiveActivity(row.type_of_activity_id,row.isactive)">
</mat-slide-toggle>
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon> <!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> --> <ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
class="example-margin"
matTooltip="Active" matTooltipPosition="above"
checked="true" [color]="color"
(change)="isactiveActivity(row.type_of_activity_id,row.isactive)"
(click)="deactive()">
</mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin" [color]="color"
matTooltip="Inactive" matTooltipPosition="above"
checked="false"
(change)="isactiveActivity(row.type_of_activity_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -26,7 +26,10 @@ import Swal from 'sweetalert2';
export class ActivityListComponent implements OnInit { export class ActivityListComponent implements OnInit {
isPopupOpened: boolean = true; isPopupOpened: boolean = true;
loader: boolean = false; loader: boolean = false;
SwalButtonText: string;
SwalMessage: string;
ActivityList: any = []; ActivityList: any = [];
// displayedColumns = ['type_of_activity_id', 'name', 'createdon', 'fk_createdby', 'updatedon', 'fk_updatedby', 'isactive','actions']; // displayedColumns = ['type_of_activity_id', 'name', 'createdon', 'fk_createdby', 'updatedon', 'fk_updatedby', 'isactive','actions'];
@ -133,56 +136,42 @@ export class ActivityListComponent implements OnInit {
? { 'type_of_activity_id':id,'isactive': '1'} ? { 'type_of_activity_id':id,'isactive': '1'}
: { 'type_of_activity_id':id,'isactive': '0'} : { 'type_of_activity_id':id,'isactive': '0'}
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH') if(isactive == 1){
this._MastersService.editMasterDetails(ActiveDatas,'TYPEOFACTIVITY') this.SwalButtonText = 'Yes, deactivate it!';
.subscribe(dataresult=>{ this.SwalMessage = 'Deactivated!';
if (dataresult.dataStatus == true){
//alert("my check");
this.getActivity();
} }
else{ else{
Swal("SomeThing Wents Wrong Try Again !"); this.SwalButtonText = 'Yes, activate it!';
this.SwalMessage = 'Activated!';
} }
});
} Swal({
//Sweetalert2 for active and deactive title: 'Are you sure?',
active(){ type: 'warning',
Swal({ showCancelButton: true,
title: 'Are you sure?', confirmButtonColor: '#3085d6',
type: 'warning', cancelButtonColor: '#d33',
showCancelButton: true, confirmButtonText: this.SwalButtonText
confirmButtonColor: '#3085d6', }).then((result) => {
cancelButtonColor: '#d33', if (result.value) {
confirmButtonText: 'Yes, activate it!' this._MastersService.editMasterDetails(ActiveDatas,'TYPEOFACTIVITY')
}).then((result) => { .subscribe(dataresult=>{
if (result.value) { if (dataresult.dataStatus == true){
Swal( Swal(this.SwalMessage,'success');
'Activated!', this.getActivity();
'success' }
) else{
} Swal("Sorry Try Again !");
}) }
} });
deactive() }
{ else{
Swal({ this.getActivity();
title: 'Are you sure?', }
type: 'warning', })
showCancelButton: true, }
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;

View File

@ -37,23 +37,15 @@
<ng-container matColumnDef="isactive"> <ng-container matColumnDef="isactive">
<mat-header-cell *matHeaderCellDef mat-sort-header>Active </mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header>Active </mat-header-cell>
<mat-cell *matCellDef="let row"><!--{{row.isactive}}--> <mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
<mat-slide-toggle
class="example-margin" [color]="color"
[checked] ="row.isactive==1?true:false"
[matTooltip]="row.isactive==1?'Active':'Inactive'"
matTooltipPosition="above"
(click)="isactiveUOM(row.uom_id,row.isactive)">
</mat-slide-toggle>
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon> <!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> --> <ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
class="example-margin"
matTooltip="Active" matTooltipPosition="above"
checked="true" [color]="color"
(change)="isactiveUOM(row.uom_id,row.isactive)"
(click)="deactive()">
</mat-slide-toggle>
<ng-template #notactive >
<mat-slide-toggle
class="example-margin"
matTooltip="Inactive" matTooltipPosition="above"
checked="false" [color]="color"
(change)="isactiveUOM(row.uom_id,row.isactive)"
(click)="active()">
</mat-slide-toggle></ng-template>
</mat-cell> </mat-cell>
</ng-container> </ng-container>

View File

@ -33,6 +33,9 @@ export class UomListComponent implements OnInit {
isPopupOpened: boolean = true; isPopupOpened: boolean = true;
loader: boolean = false; loader: boolean = false;
UOMList: any = []; UOMList: any = [];
SwalButtonText: string;
SwalMessage: string;
color = 'primary'; color = 'primary';
// pagination variable details // pagination variable details
pageSize = 10; pageSize = 10;
@ -147,57 +150,41 @@ export class UomListComponent implements OnInit {
let ActiveDatas = isactive == 0 let ActiveDatas = isactive == 0
? { 'uom_id':id,'isactive': '1'} ? { 'uom_id':id,'isactive': '1'}
: { 'uom_id':id,'isactive': '0'} : { 'uom_id':id,'isactive': '0'}
if(isactive == 1){
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH') this.SwalButtonText = 'Yes, deactivate it!';
this._MastersService.editMasterDetails(ActiveDatas,'UOM') this.SwalMessage = 'Deactivated!';
.subscribe(dataresult=>{
if (dataresult.dataStatus == true){
//alert("my check");
this.getUOM();
} }
else{ else{
Swal("SomeThing Wents Wrong Try Again !"); this.SwalButtonText = 'Yes, activate it!';
this.SwalMessage = 'Activated!';
} }
});
} Swal({
//Sweetalert2 for active and deactive title: 'Are you sure?',
active(){ type: 'warning',
Swal({ showCancelButton: true,
title: 'Are you sure?', confirmButtonColor: '#3085d6',
type: 'warning', cancelButtonColor: '#d33',
showCancelButton: true, confirmButtonText: this.SwalButtonText
confirmButtonColor: '#3085d6', }).then((result) => {
cancelButtonColor: '#d33', if (result.value) {
confirmButtonText: 'Yes, activate it!' this._MastersService.editMasterDetails(ActiveDatas,'UOM')
}).then((result) => { .subscribe(dataresult=>{
if (result.value) { if (dataresult.dataStatus == true){
Swal( Swal(this.SwalMessage,'success');
'Activated!', this.getUOM();
'success' }
) else{
} Swal("Sorry Try Again !");
}) }
} });
deactive() }
{ else{
Swal({ this.getUOM();
title: 'Are you sure?', }
type: 'warning', })
showCancelButton: true, }
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
Swal(
'Deactivated!',
'success'
)
}
})
}
/** For Display Tables Pagination And Sorting */ /** For Display Tables Pagination And Sorting */
ngAfterViewInit() { ngAfterViewInit() {
this.dataSource.paginator = this.paginator; this.dataSource.paginator = this.paginator;

View File

@ -81,16 +81,10 @@
<div *ngIf="masterCtrl.value =='20'"> <div *ngIf="masterCtrl.value =='20'">
<app-frequency-list></app-frequency-list> <app-frequency-list></app-frequency-list>
</div> </div>
<div *ngIf="masterCtrl.value =='21'">
<app-designation-list></app-designation-list>
</div>
<div *ngIf="masterCtrl.value =='22'"> <div *ngIf="masterCtrl.value =='22'">
<!-- <app-company-list></app-company-list> --> <!-- <app-company-list></app-company-list> -->
<app-company></app-company> <app-company></app-company>
</div> </div>
<div *ngIf="masterCtrl.value =='23'">
<app-lender-hierarchy-list></app-lender-hierarchy-list>
</div>
<div *ngIf="masterCtrl.value =='26'"> <div *ngIf="masterCtrl.value =='26'">
<app-pd-notification-list></app-pd-notification-list> <app-pd-notification-list></app-pd-notification-list>
</div> </div>

View File

@ -23,8 +23,8 @@ export interface Master {
export class PdTeamService { export class PdTeamService {
private apiUrl = "http://ssa.sineedge.com/sparqapi/api/"; // private apiUrl = "http://ssa.sineedge.com/sparqapi/api/";
//private apiUrl = "http://localhost/sparqapi/api/"; private apiUrl = "http://192.168.0.21:9999/AWSEC2/sparqapi/api/";
pk: { "primary_key": any; }; pk: { "primary_key": any; };

View File

@ -207,6 +207,7 @@ this.loader = true;
} else { } else {
this.AWS.adminchangeData(this.usersData,userData).subscribe(res=>{ this.AWS.adminchangeData(this.usersData,userData).subscribe(res=>{
if(userData.role.role_id == 10){ if(userData.role.role_id == 10){
userData.aws_name = this.usersData.aws_name;
this.AWS.UserGroup(res,userData).subscribe(res=>{ this.AWS.UserGroup(res,userData).subscribe(res=>{
});} });}
this.users.saveRecords(res,userData).subscribe(res=>{ this.users.saveRecords(res,userData).subscribe(res=>{

View File

@ -48,7 +48,16 @@
<ng-container matColumnDef="IsActive"> <ng-container matColumnDef="IsActive">
<mat-header-cell *matHeaderCellDef mat-sort-header> Active </mat-header-cell> <mat-header-cell *matHeaderCellDef mat-sort-header> Active </mat-header-cell>
<mat-cell *matCellDef="let us"><!--{{row.isactive}}--> <mat-cell *matCellDef="let us"><!--{{row.isactive}}-->
<mat-slide-toggle *ngIf="us.isactive == 1;else notactive;" <mat-slide-toggle
class="example-margin"
[checked]="us.isactive == 1 ? true : false " [color]="color"
[matTooltip]="us.isactive == 1 ? 'Active': 'Deactive'" matTooltipPosition="above"
(click)="isactive(us.userid,us.aws_name)">
</mat-slide-toggle>
<!-- <mat-slide-toggle *ngIf="us.isactive == 1;else notactive;"
class="example-margin" class="example-margin"
matTooltip="Active" matTooltipPosition="above" matTooltip="Active" matTooltipPosition="above"
checked="true" [color]="color" checked="true" [color]="color"
@ -62,7 +71,7 @@
checked="false" [color]="color" checked="false" [color]="color"
(change)="isactive(us.userid,us.aws_name)" (change)="isactive(us.userid,us.aws_name)"
(click)=active()> (click)=active()>
</mat-slide-toggle></ng-template> </mat-slide-toggle></ng-template> -->
<!-- <a (click)="isactive(us.userid,us.aws_name)"><mat-icon *ngIf="us.isactive == 1;else notactive;" class="active" matTooltip="Active" matTooltipPosition="above">done</mat-icon></a> <!-- <a (click)="isactive(us.userid,us.aws_name)"><mat-icon *ngIf="us.isactive == 1;else notactive;" class="active" matTooltip="Active" matTooltipPosition="above">done</mat-icon></a>
<a (click)="isactive(us.userid,us.aws_name)"><ng-template #notactive ><mat-icon class="deactive" matTooltip="Inactive" matTooltipPosition="above">close</mat-icon></ng-template></a> --> <a (click)="isactive(us.userid,us.aws_name)"><ng-template #notactive ><mat-icon class="deactive" matTooltip="Inactive" matTooltipPosition="above">close</mat-icon></ng-template></a> -->
</mat-cell> </mat-cell>

View File

@ -85,47 +85,78 @@ export class UserListComponent implements OnInit {
let data:any; let data:any;
let userstatus = this.userdata.filter((users) => users.userid == id)[0]; let userstatus = this.userdata.filter((users) => users.userid == id)[0];
if (userstatus.isactive == 1) { if (userstatus.isactive == 1) {
this.aws.admindisabelUser(userstatus, awsname).subscribe(res => { Swal({
if (res == 0) { title: 'Are you sure?',
let users = { type: 'warning',
showCancelButton: true,
'userid': userstatus.userid, confirmButtonColor: '#3085d6',
'isactive': '0', cancelButtonColor: '#d33',
} confirmButtonText: 'Yes, deactivate it!'
}).then((result) => {
if (result.value) {
this.users.adminupendis(users).subscribe(res => { this.aws.admindisabelUser(userstatus, awsname).subscribe(res => {
data = res; if (res == 0) {
if (data.status == 200) { let users = { 'userid': userstatus.userid,'isactive': '0'}
this.getusers(); this.users.adminupendis(users).subscribe(res => {
//this.shared.redirectTo(this.route.url); data = res;
} if (data.status == 200) {
}) Swal(
} 'Deactivated!',
'success'
}) )
this.getusers();
//this.shared.redirectTo(this.route.url);
}
else{
Swal("Sorry Try Again !");
}
})
}
})
}
else{
this.getusers();
}
})//swal End Here
} else { } else {
this.aws.adminenableUser(userstatus, awsname).subscribe(res => {
console.log(res);
if (res == 1) {
let users = {
'userid': userstatus.userid,
'isactive': '1',
}
Swal({
this.users.adminupendis(users).subscribe(res => { title: 'Are you sure?',
data = res; type: 'warning',
if (data.status == 200) { showCancelButton: true,
this.getusers(); confirmButtonColor: '#3085d6',
//this.shared.redirectTo(this.route.url); cancelButtonColor: '#d33',
} confirmButtonText: 'Yes, activate it!'
}) }).then((result) => {
} if (result.value) {
}) this.aws.adminenableUser(userstatus, awsname).subscribe(res => {
} //console.log(res);
} if (res == 1) {
let users = { 'userid': userstatus.userid,
'isactive': '1'}
this.users.adminupendis(users).subscribe(res => {
data = res;
if (data.status == 200) {
Swal(
'Activated!',
'success'
)
this.getusers();
//this.shared.redirectTo(this.route.url);
}
else{
Swal("Sorry Try Again !");
}
})
}
})
}
else{
this.getusers();
}
})//swal End Here
}
}
editUserDetails(userId){ editUserDetails(userId){
let userDetails = this.userdata.filter(users=>users.userid == userId)[0]; let userDetails = this.userdata.filter(users=>users.userid == userId)[0];
@ -148,23 +179,6 @@ export class UserListComponent implements OnInit {
}) })
} }
//Sweetalert2 for active and deactive //Sweetalert2 for active and deactive
active(){
Swal({
title: 'Are you sure?',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, activate it!'
}).then((result) => {
if (result.value) {
Swal(
'Activated!',
'success'
)
}
})
}
deactive() deactive()
{ {
Swal({ Swal({

View File

@ -11,6 +11,9 @@ import {
MatListModule, MatMenuModule, MatListModule, MatMenuModule,
} from '@angular/material'; } from '@angular/material';
import {MatSlideToggleModule} from '@angular/material/slide-toggle'; import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import { MatTooltipModule } from '@angular/material/tooltip';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@ -33,7 +36,7 @@ import { NewPasswordDialog, ForgotPass } from '../../session/login/login.compone
MatButtonModule,MatTableModule,MatPaginatorModule, MatButtonModule,MatTableModule,MatPaginatorModule,
MatProgressBarModule,MatDialogModule, MatSortModule, MatProgressBarModule,MatDialogModule, MatSortModule,
MatToolbarModule,MatSelectModule,MatListModule, MatMenuModule, MatToolbarModule,MatSelectModule,MatListModule, MatMenuModule,
MatSlideToggleModule, MatSlideToggleModule,MatTooltipModule,
FormsModule, ReactiveFormsModule, FormsModule, ReactiveFormsModule,
// HttpClientModule, // HttpClientModule,
], ],

View File

@ -38,7 +38,7 @@ export class ListComponent implements OnInit {
questionListData = null; questionListData = null;
public dataLength: number; public dataLength: number;
public dataSource = new MatTableDataSource(); public dataSource = new MatTableDataSource();
displayedColumns = ['categroy_name', 'question', 'actions']; displayedColumns = ['category_name', 'question', 'actions'];
@ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort; @ViewChild(MatSort) sort: MatSort;