masterdetail changes
This commit is contained in:
parent
6f056397fc
commit
554bd2639e
17
sineedge/src/app/error/404/error-404-component.html
Normal file
17
sineedge/src/app/error/404/error-404-component.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<div class="relative">
|
||||||
|
<div class="form-bg">
|
||||||
|
<div class="relative error-wrapper">
|
||||||
|
<h1>
|
||||||
|
Oops!</h1>
|
||||||
|
<span class="error-text">404</span>
|
||||||
|
<h2>
|
||||||
|
Not Found</h2>
|
||||||
|
<div class="error-details">
|
||||||
|
<p> Sorry, an error has occured, Requested page not found!</p>
|
||||||
|
</div>
|
||||||
|
<div class="error-actions">
|
||||||
|
<button class="mat-blue" mat-raised-button>Take me to home</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
0
sineedge/src/app/error/404/error-404-component.scss
Normal file
0
sineedge/src/app/error/404/error-404-component.scss
Normal file
20
sineedge/src/app/error/404/error-404.component.ts
Normal file
20
sineedge/src/app/error/404/error-404.component.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { Component, OnInit,ViewEncapsulation } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ms-error-404',
|
||||||
|
templateUrl:'./error-404-component.html',
|
||||||
|
styleUrls: ['./error-404-component.scss'],
|
||||||
|
encapsulation: ViewEncapsulation.None
|
||||||
|
})
|
||||||
|
export class ErrorOneComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor() {}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
17
sineedge/src/app/error/503/error-503-component.html
Normal file
17
sineedge/src/app/error/503/error-503-component.html
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<div class="relative">
|
||||||
|
<div class="form-bg">
|
||||||
|
<div class="relative error-wrapper">
|
||||||
|
<h1>
|
||||||
|
Error!</h1>
|
||||||
|
<span class="error-text">505</span>
|
||||||
|
<h2>
|
||||||
|
Service is currently unavailbale</h2>
|
||||||
|
<div class="error-details">
|
||||||
|
<p>Sorry, but the page you were trying to view does not exist</p>
|
||||||
|
</div>
|
||||||
|
<div class="error-actions">
|
||||||
|
<button class="mat-blue" mat-raised-button>Take me to home</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
0
sineedge/src/app/error/503/error-503-component.scss
Normal file
0
sineedge/src/app/error/503/error-503-component.scss
Normal file
20
sineedge/src/app/error/503/error-503.component.ts
Normal file
20
sineedge/src/app/error/503/error-503.component.ts
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { Component, OnInit,ViewEncapsulation } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'ms-error-503',
|
||||||
|
templateUrl:'./error-503-component.html',
|
||||||
|
styleUrls: ['./error-503-component.scss'],
|
||||||
|
encapsulation: ViewEncapsulation.None
|
||||||
|
})
|
||||||
|
export class ErrorTwoComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor() {}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
38
sineedge/src/app/error/error.module.ts
Normal file
38
sineedge/src/app/error/error.module.ts
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { MatIconModule} from '@angular/material';
|
||||||
|
import {
|
||||||
|
MatCardModule,
|
||||||
|
MatInputModule,
|
||||||
|
MatRadioModule,
|
||||||
|
MatButtonModule,
|
||||||
|
MatProgressBarModule,
|
||||||
|
MatToolbarModule } from '@angular/material';
|
||||||
|
import { ErrorOneComponent} from './404/error-404.component';
|
||||||
|
import { ErrorTwoComponent} from './503/error-503.component';
|
||||||
|
|
||||||
|
import { ErrorRoutes } from './error.routing';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
MatIconModule,
|
||||||
|
MatCardModule,
|
||||||
|
MatIconModule,
|
||||||
|
MatInputModule,
|
||||||
|
MatRadioModule,
|
||||||
|
MatButtonModule,
|
||||||
|
MatProgressBarModule,
|
||||||
|
MatToolbarModule,
|
||||||
|
RouterModule.forChild(ErrorRoutes)
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
ErrorOneComponent,
|
||||||
|
ErrorTwoComponent,
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
export class ErrorModule {}
|
||||||
19
sineedge/src/app/error/error.routing.ts
Normal file
19
sineedge/src/app/error/error.routing.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { Routes } from '@angular/router';
|
||||||
|
|
||||||
|
import { ErrorOneComponent} from './404/error-404.component';
|
||||||
|
import { ErrorTwoComponent} from './503/error-503.component';
|
||||||
|
|
||||||
|
export const ErrorRoutes: Routes = [{
|
||||||
|
path: '',
|
||||||
|
redirectTo: '404',
|
||||||
|
pathMatch: 'full',
|
||||||
|
},{
|
||||||
|
path: '',
|
||||||
|
children: [{
|
||||||
|
path: '404',
|
||||||
|
component: ErrorOneComponent
|
||||||
|
}, {
|
||||||
|
path: '503',
|
||||||
|
component: ErrorTwoComponent
|
||||||
|
}]
|
||||||
|
}];
|
||||||
@ -34,7 +34,7 @@ export class BranchDialogComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
//console.log(this._branchForm);
|
//console.log(this._branchForm);
|
||||||
|
|
||||||
this._mastersService.getAllCityData()
|
this._mastersService.getAllMasterData('CITY')
|
||||||
.subscribe(
|
.subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,11 @@
|
|||||||
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
|
||||||
|
|
||||||
import { Observable, Subject } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { Http, Response } from '@angular/http';
|
|
||||||
import 'rxjs/add/operator/map';
|
import 'rxjs/add/operator/map';
|
||||||
|
import { map } from 'rxjs/operators';
|
||||||
|
|
||||||
import { DataSource } from '@angular/cdk/collections';
|
import { DataSource } from '@angular/cdk/collections';
|
||||||
import { map } from 'rxjs/operators';
|
|
||||||
import { of as observableOf, merge } from 'rxjs';
|
import { of as observableOf, merge } from 'rxjs';
|
||||||
|
|
||||||
import { MastersService } from '../../../service/master/masters.service';
|
import { MastersService } from '../../../service/master/masters.service';
|
||||||
@ -25,8 +24,6 @@ export class BranchListComponent implements OnInit {
|
|||||||
loader: boolean = false;
|
loader: boolean = false;
|
||||||
BranchList: any = [];
|
BranchList: any = [];
|
||||||
|
|
||||||
isactive:number;
|
|
||||||
|
|
||||||
|
|
||||||
constructor(private dialog: MatDialog,
|
constructor(private dialog: MatDialog,
|
||||||
private _mastersService: MastersService) { }
|
private _mastersService: MastersService) { }
|
||||||
@ -38,7 +35,7 @@ export class BranchListComponent implements OnInit {
|
|||||||
displayedColumns = ['branch_id','name','fk_city_id','cname', 'isactive','actions'];
|
displayedColumns = ['branch_id','name','fk_city_id','cname', 'isactive','actions'];
|
||||||
// dataSource = new UserDataSource(this._mastersService);
|
// dataSource = new UserDataSource(this._mastersService);
|
||||||
|
|
||||||
/** Popup for ADD Branch */
|
/**Popup for ADD Branch */
|
||||||
addBranch() {
|
addBranch() {
|
||||||
this.isPopupOpened = true;
|
this.isPopupOpened = true;
|
||||||
const dialogRef = this.dialog.open(BranchDialogComponent, {
|
const dialogRef = this.dialog.open(BranchDialogComponent, {
|
||||||
@ -63,29 +60,29 @@ export class BranchListComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Popup for EDIT Branch */
|
/** To get Branch Data For Listing */
|
||||||
getBranch() {
|
getBranch() {
|
||||||
this.loader = true;
|
this.loader = true;
|
||||||
this._mastersService.getAllBranch().subscribe(dataresult => {
|
this._mastersService.getAllBranch().subscribe(dataresult => {
|
||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.BranchList = dataresult.records;
|
this.BranchList = dataresult.records;
|
||||||
console.log(this.BranchList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Popup for EDIT Branch */
|
/** To delete Branch Datas */
|
||||||
deleteBranch(id: number) {
|
deleteBranch(id: number) {
|
||||||
var PrimaryKeyWithValue ={'branch_id':id};
|
var PrimaryKeyWithValue ={'branch_id':id};
|
||||||
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'BRANCH').subscribe();
|
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'BRANCH').subscribe();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** To set the All Branch value as Data sources with help of connect() */
|
||||||
export class UserDataSource extends DataSource<any> {
|
export class UserDataSource extends DataSource<any> {
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ export class CityDialogComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
//console.log(this._cityForm);
|
//console.log(this._cityForm);
|
||||||
|
|
||||||
this._MastersService.getAllStateData()
|
this._MastersService.getAllMasterData('STATE')
|
||||||
.subscribe(
|
.subscribe(
|
||||||
data => {
|
data => {
|
||||||
if (data.status == 200) {
|
if (data.status == 200) {
|
||||||
|
|||||||
@ -78,7 +78,7 @@ export class CityListComponent implements OnInit {
|
|||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.CityList = dataresult.records;
|
this.CityList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -77,7 +77,7 @@ export class CommentsOnLocalityListComponent implements OnInit {
|
|||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.CommentsOnLocalityList = dataresult.records;
|
this.CommentsOnLocalityList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -45,22 +45,22 @@ export class CompanyDialogComponent implements OnInit {
|
|||||||
logo : [this.data.logo, Validators.compose([Validators.required])]
|
logo : [this.data.logo, Validators.compose([Validators.required])]
|
||||||
|
|
||||||
});
|
});
|
||||||
this._masterService.getAllStateData()
|
this._masterService.getAllMasterData('STATE')
|
||||||
.subscribe(
|
.subscribe(
|
||||||
data => {
|
data => {
|
||||||
if (data.status == 200) {
|
if (data.status == 200) {
|
||||||
this.stateDatas = data.records;
|
this.stateDatas = data.records;
|
||||||
this.stateDatas = this.stateDatas.filter(city=>city.isactive == 1 );
|
this.stateDatas = this.stateDatas.filter(dataresult=>dataresult.isactive == 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
}, error => this.errorMessage = <any> error);
|
}, error => this.errorMessage = <any> error);
|
||||||
|
|
||||||
this._masterService.getAllCityData()
|
this._masterService.getAllMasterData('CITY')
|
||||||
.subscribe(
|
.subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
|
||||||
this.citydatas = data.records;
|
this.citydatas = data.records;
|
||||||
this.citydatas = this.citydatas.filter(city=>city.isactive == 1 );
|
this.citydatas = this.citydatas.filter(dataresult=>dataresult.isactive == 1 );
|
||||||
|
|
||||||
}, error => this.errorMessage = <any> error);
|
}, error => this.errorMessage = <any> error);
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,7 @@ export class CompanyListComponent implements OnInit {
|
|||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.CompanyList = dataresult.records;
|
this.CompanyList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -78,7 +78,7 @@ export class CustomerBehaviourListComponent implements OnInit {
|
|||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.CustomerBehaviourList = dataresult.records;
|
this.CustomerBehaviourList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -77,7 +77,7 @@ export class CustomerSegmentListComponent implements OnInit {
|
|||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.CustomerSegmentList = dataresult.records;
|
this.CustomerSegmentList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -79,7 +79,7 @@ export class DesignationListComponent implements OnInit {
|
|||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.DesignationList = dataresult.records;
|
this.DesignationList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -78,7 +78,7 @@ export class FrequencyListComponent implements OnInit {
|
|||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.FrequencyList = dataresult.records;
|
this.FrequencyList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -9,9 +9,9 @@
|
|||||||
fxLayoutAlign="center"
|
fxLayoutAlign="center"
|
||||||
fxLayoutGap="35px"
|
fxLayoutGap="35px"
|
||||||
fxLayoutGap.xs="0">
|
fxLayoutGap.xs="0">
|
||||||
<div class="mat-dialog-title" fxFlex="15px">Industry Classification</div>
|
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">Industry Classification</div>
|
||||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||||
<div fxFlex></div>
|
<div fxFlex="15px" fxFlexOrder="2"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,7 @@ export class IndustryClassificationListComponent implements OnInit {
|
|||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.IndustryClassificationList = dataresult.records;
|
this.IndustryClassificationList = dataresult.records;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
@ -9,9 +9,9 @@ fxLayout.xs="column"
|
|||||||
fxLayoutAlign="center"
|
fxLayoutAlign="center"
|
||||||
fxLayoutGap="35px"
|
fxLayoutGap="35px"
|
||||||
fxLayoutGap.xs="0">
|
fxLayoutGap.xs="0">
|
||||||
<div class="mat-dialog-title" fxFlex="15px">Lender Hierarchy </div>
|
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">Lender Hierarchy </div>
|
||||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||||
<div fxFlex></div>
|
<div fxFlex="15px" fxFlexOrder="2"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
<table style="border-collapse: collapse">
|
<table style="border-collapse: collapse">
|
||||||
<thead>
|
<thead>
|
||||||
<th style="text-align: center;">#</th>
|
<th style="text-align: center;">#</th>
|
||||||
<th style="text-align: center;">LenderHierarchy Name</th>
|
<th style="text-align: center;">Lender Hierarchy Name</th>
|
||||||
<th style="text-align: center;">IsActive</th>
|
<th style="text-align: center;">IsActive</th>
|
||||||
<th style="text-align: center;">Action</th>
|
<th style="text-align: center;">Action</th>
|
||||||
</thead>
|
</thead>
|
||||||
@ -18,7 +18,7 @@
|
|||||||
<tr *ngIf="LenderHierarchyList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
|
<tr *ngIf="LenderHierarchyList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
|
||||||
<tr *ngFor="let LHL of LenderHierarchyList; let i=index">
|
<tr *ngFor="let LHL of LenderHierarchyList; let i=index">
|
||||||
<td style="text-align: center;">{{i+1}}</td>
|
<td style="text-align: center;">{{i+1}}</td>
|
||||||
<td style="text-align: center;">{{LHL.lender_hierarchy_id}} {{LHL.lender_hierarchy}} </td>
|
<td style="text-align: center;">{{LHL.lender_hierarchy}} </td>
|
||||||
<td style="text-align: center;">{{LHL.isactive}} </td>
|
<td style="text-align: center;">{{LHL.isactive}} </td>
|
||||||
<td style="text-align: center;">
|
<td style="text-align: center;">
|
||||||
<a (click)="editLenderHierarchy(LHL)"><mat-icon>edit</mat-icon></a>
|
<a (click)="editLenderHierarchy(LHL)"><mat-icon>edit</mat-icon></a>
|
||||||
|
|||||||
@ -78,7 +78,7 @@ export class LenderHierarchyListComponent implements OnInit {
|
|||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.LenderHierarchyList = dataresult.records;
|
this.LenderHierarchyList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -9,9 +9,9 @@
|
|||||||
fxLayoutAlign="center"
|
fxLayoutAlign="center"
|
||||||
fxLayoutGap="35px"
|
fxLayoutGap="35px"
|
||||||
fxLayoutGap.xs="0">
|
fxLayoutGap.xs="0">
|
||||||
<div class="mat-dialog-title" fxFlex="15px">Occupation of Non earning members </div>
|
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">Occupation of Non earning members </div>
|
||||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||||
<div fxFlex></div>
|
<div fxFlex="15px" fxFlexOrder="2" ></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,7 @@ export class MembersOccupationListComponent implements OnInit {
|
|||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.MemberOccupationList = dataresult.records;
|
this.MemberOccupationList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -10,9 +10,9 @@
|
|||||||
fxLayoutAlign="center"
|
fxLayoutAlign="center"
|
||||||
fxLayoutGap="35px"
|
fxLayoutGap="35px"
|
||||||
fxLayoutGap.xs="0">
|
fxLayoutGap.xs="0">
|
||||||
<div class="mat-dialog-title" fxFlex="15px">PD Allocation Type</div>
|
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">PD Allocation Type</div>
|
||||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||||
<div fxFlex></div>
|
<div fxFlex="15px" fxFlexOrder="2"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form [formGroup]="_PDAllocationTypeForm" (submit)="onSubmit()">
|
<form [formGroup]="_PDAllocationTypeForm" (submit)="onSubmit()">
|
||||||
|
|||||||
@ -78,7 +78,7 @@ export class PdAllocationTypeListComponent implements OnInit {
|
|||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.PDAllocationTypeList = dataresult.records;
|
this.PDAllocationTypeList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -9,9 +9,9 @@
|
|||||||
fxLayoutAlign="center"
|
fxLayoutAlign="center"
|
||||||
fxLayoutGap="35px"
|
fxLayoutGap="35px"
|
||||||
fxLayoutGap.xs="0">
|
fxLayoutGap.xs="0">
|
||||||
<div class="mat-dialog-title" fxFlex="15px">PD Location Approach</div>
|
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">PD Location Approach</div>
|
||||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||||
<div fxFlex></div>
|
<div fxFlex="15px" fxFlexOrder="2"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,7 @@ export class PdLocationApproachListComponent implements OnInit {
|
|||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.PdLocationApproachList = dataresult.records;
|
this.PdLocationApproachList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -9,9 +9,9 @@
|
|||||||
fxLayoutAlign="center"
|
fxLayoutAlign="center"
|
||||||
fxLayoutGap="35px"
|
fxLayoutGap="35px"
|
||||||
fxLayoutGap.xs="0">
|
fxLayoutGap.xs="0">
|
||||||
<div class="mat-dialog-title" fxFlex="15px">PD type</div>
|
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">PD type</div>
|
||||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||||
<div fxFlex></div>
|
<div fxFlex="15px" fxFlexOrder="2" ></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,7 @@ export class PdTypeListComponent implements OnInit {
|
|||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.PDTypeList = dataresult.records;
|
this.PDTypeList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -9,9 +9,9 @@
|
|||||||
fxLayoutAlign="center"
|
fxLayoutAlign="center"
|
||||||
fxLayoutGap="35px"
|
fxLayoutGap="35px"
|
||||||
fxLayoutGap.xs="0">
|
fxLayoutGap.xs="0">
|
||||||
<div class="mat-dialog-title" fxFlex="15px">Product Details</div>
|
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">Product Details</div>
|
||||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||||
<div fxFlex></div>
|
<div fxFlex="15px" fxFlexOrder="2"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,7 @@ export class ProductListComponent implements OnInit {
|
|||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.ProductMasterList = dataresult.records;
|
this.ProductMasterList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -9,9 +9,9 @@
|
|||||||
fxLayoutAlign="center"
|
fxLayoutAlign="center"
|
||||||
fxLayoutGap="35px"
|
fxLayoutGap="35px"
|
||||||
fxLayoutGap.xs="0">
|
fxLayoutGap.xs="0">
|
||||||
<div class="mat-dialog-title" fxFlex="15px">Region</div>
|
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">Region</div>
|
||||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||||
<div fxFlex></div>
|
<div fxFlex="15px" fxFlexOrder="2"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -75,11 +75,11 @@ export class RegionsListComponent implements OnInit {
|
|||||||
//To get data for listing
|
//To get data for listing
|
||||||
getregions() {
|
getregions() {
|
||||||
this.loader = true;
|
this.loader = true;
|
||||||
this._regionsService.getAllMasterData('PRODUCTS').subscribe(dataresult => {
|
this._regionsService.getAllMasterData('REGIONS').subscribe(dataresult => {
|
||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.regionsList = dataresult.records;
|
this.regionsList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -9,9 +9,9 @@
|
|||||||
fxLayoutAlign="center"
|
fxLayoutAlign="center"
|
||||||
fxLayoutGap="35px"
|
fxLayoutGap="35px"
|
||||||
fxLayoutGap.xs="0">
|
fxLayoutGap.xs="0">
|
||||||
<div class="mat-dialog-title" fxFlex="15px">Relation Ship</div>
|
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">Relation Ship</div>
|
||||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||||
<div fxFlex></div>
|
<div fxFlex="15px" fxFlexOrder="2"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -79,11 +79,11 @@ export class RelationShipListComponent implements OnInit {
|
|||||||
//To get data for listing
|
//To get data for listing
|
||||||
getRelationShip() {
|
getRelationShip() {
|
||||||
this.loader = true;
|
this.loader = true;
|
||||||
this._MastersService.getAllMasterData('PRODUCTS').subscribe(dataresult => {
|
this._MastersService.getAllMasterData('RELATIONSHIPS').subscribe(dataresult => {
|
||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.RelationShipList = dataresult.records;
|
this.RelationShipList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -9,9 +9,9 @@
|
|||||||
fxLayoutAlign="center"
|
fxLayoutAlign="center"
|
||||||
fxLayoutGap="35px"
|
fxLayoutGap="35px"
|
||||||
fxLayoutGap.xs="0">
|
fxLayoutGap.xs="0">
|
||||||
<div class="mat-dialog-title" fxFlex="15px">State</div>
|
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">State</div>
|
||||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||||
<div fxFlex></div>
|
<div fxFlex="15px" fxFlexOrder="2"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -56,7 +56,7 @@ export class StatesDialogComponent implements OnInit {
|
|||||||
code: [this.data.code, Validators.compose([Validators.required])],
|
code: [this.data.code, Validators.compose([Validators.required])],
|
||||||
fk_region_id : [this.data.fk_region_id, Validators.compose([Validators.required])]
|
fk_region_id : [this.data.fk_region_id, Validators.compose([Validators.required])]
|
||||||
});
|
});
|
||||||
this._MastersService.getAllRegionData()
|
this._MastersService.getAllMasterData('REGIONS')
|
||||||
.subscribe(
|
.subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
|
||||||
|
|||||||
@ -78,7 +78,7 @@ export class StatesListComponent implements OnInit {
|
|||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.StateList = dataresult.records;
|
this.StateList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -10,9 +10,9 @@
|
|||||||
fxLayoutAlign="center"
|
fxLayoutAlign="center"
|
||||||
fxLayoutGap="35px"
|
fxLayoutGap="35px"
|
||||||
fxLayoutGap.xs="0">
|
fxLayoutGap.xs="0">
|
||||||
<div class="mat-dialog-title" fxFlex="15px">Sub Product Details</div>
|
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">Sub Product Details</div>
|
||||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||||
<div fxFlex></div>
|
<div fxFlex="15px" fxFlexOrder="2"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ export class SubProductDialogComponent implements OnInit {
|
|||||||
abbr: [this.data.abbr, Validators.compose([Validators.required])]
|
abbr: [this.data.abbr, Validators.compose([Validators.required])]
|
||||||
});
|
});
|
||||||
|
|
||||||
this._MastersService.getAllProductData()
|
this._MastersService.getAllMasterData('PRODUCTS')
|
||||||
.subscribe(
|
.subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
|
||||||
|
|||||||
@ -77,11 +77,11 @@ export class SubProductListComponent implements OnInit {
|
|||||||
//To get data for listing
|
//To get data for listing
|
||||||
getSubProductMaster() {
|
getSubProductMaster() {
|
||||||
this.loader = true;
|
this.loader = true;
|
||||||
this._MastersService.getAllMasterData('PRODUCTS').subscribe(dataresult => {
|
this._MastersService.getAllMasterData('SUBPRODUCTS').subscribe(dataresult => {
|
||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.SubProductMasterList = dataresult.records;
|
this.SubProductMasterList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -9,9 +9,9 @@
|
|||||||
fxLayoutAlign="center"
|
fxLayoutAlign="center"
|
||||||
fxLayoutGap="35px"
|
fxLayoutGap="35px"
|
||||||
fxLayoutGap.xs="0">
|
fxLayoutGap.xs="0">
|
||||||
<div class="mat-dialog-title" fxFlex="15px">Title</div>
|
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">Title</div>
|
||||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||||
<div fxFlex></div>
|
<div fxFlex="15px" fxFlexOrder="2"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -23,8 +23,8 @@
|
|||||||
<td style="text-align: center;">{{TL.abbr}}</td>
|
<td style="text-align: center;">{{TL.abbr}}</td>
|
||||||
<td style="text-align: center;">{{TL.isactive}} </td>
|
<td style="text-align: center;">{{TL.isactive}} </td>
|
||||||
<td style="text-align: center;">
|
<td style="text-align: center;">
|
||||||
<a (click)="editTitle(user)"><mat-icon>edit</mat-icon></a>
|
<a (click)="editTitle(TL)"><mat-icon>edit</mat-icon></a>
|
||||||
<a (click)="deleteTitle(user.title_id)"><mat-icon>delete_outline</mat-icon></a>
|
<a (click)="deleteTitle(TL.title_id)"><mat-icon>delete_outline</mat-icon></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@ -80,11 +80,11 @@ export class TitleListComponent implements OnInit {
|
|||||||
//To get data for listing
|
//To get data for listing
|
||||||
getTitle() {
|
getTitle() {
|
||||||
this.loader = true;
|
this.loader = true;
|
||||||
this._MastersService.getAllMasterData('PRODUCTS').subscribe(dataresult => {
|
this._MastersService.getAllMasterData('TITLES').subscribe(dataresult => {
|
||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.TitleList = dataresult.records;
|
this.TitleList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -10,9 +10,9 @@
|
|||||||
fxLayoutAlign="center"
|
fxLayoutAlign="center"
|
||||||
fxLayoutGap="35px"
|
fxLayoutGap="35px"
|
||||||
fxLayoutGap.xs="0">
|
fxLayoutGap.xs="0">
|
||||||
<div class="mat-dialog-title" fxFlex="15px">Type of activity</div>
|
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">Type of activity</div>
|
||||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||||
<div fxFlex></div>
|
<div fxFlex="15px" fxFlexOrder="2"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -68,11 +68,11 @@ export class ActivityListComponent implements OnInit {
|
|||||||
//To get data for listing
|
//To get data for listing
|
||||||
getActivity() {
|
getActivity() {
|
||||||
this.loader = true;
|
this.loader = true;
|
||||||
this._MastersService.getAllMasterData('PRODUCTS').subscribe(dataresult => {
|
this._MastersService.getAllMasterData('TYPEOFACTIVITY').subscribe(dataresult => {
|
||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.ActivityList = dataresult.records;
|
this.ActivityList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -9,9 +9,9 @@ fxLayout.xs="column"
|
|||||||
fxLayoutAlign="center"
|
fxLayoutAlign="center"
|
||||||
fxLayoutGap="35px"
|
fxLayoutGap="35px"
|
||||||
fxLayoutGap.xs="0">
|
fxLayoutGap.xs="0">
|
||||||
<div class="mat-dialog-title" fxFlex="15px">Unit of Measurement</div>
|
<div class="mat-dialog-title" fxFlex fxFlexOrder="1">Unit of Measurement</div>
|
||||||
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
<div fxFlex="20px" fxFlexOrder="3" style="text-align:right;"><button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button></div>
|
||||||
<div fxFlex></div>
|
<div fxFlex="15px" fxFlexOrder="2"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -78,11 +78,11 @@ export class UomListComponent implements OnInit {
|
|||||||
//To get data for listing
|
//To get data for listing
|
||||||
getUOM() {
|
getUOM() {
|
||||||
this.loader = true;
|
this.loader = true;
|
||||||
this._MastersService.getAllMasterData('PRODUCTS').subscribe(dataresult => {
|
this._MastersService.getAllMasterData('UOM').subscribe(dataresult => {
|
||||||
|
|
||||||
this.loader = false;
|
this.loader = false;
|
||||||
|
|
||||||
if (dataresult.status == 200) {
|
if (dataresult.dataStatus === true) {
|
||||||
this.UOMList = dataresult.records;
|
this.UOMList = dataresult.records;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,208 +1,115 @@
|
|||||||
|
/** Common Import Section */
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';//for Datatables
|
import { Observable } from 'rxjs';//for Datatables
|
||||||
// import { Http, Response } from '@angular/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
import { catchError } from 'rxjs/operators';
|
||||||
|
import { of } from 'rxjs';
|
||||||
|
|
||||||
import { catchError, map, tap } from 'rxjs/operators';
|
/** Imported Service Files Are., */
|
||||||
// import 'rxjs/add/operator/map';//for Datatables
|
|
||||||
// import 'rxjs/add/operator/catch';
|
|
||||||
// import 'rxjs/add/operator/toPromise';
|
|
||||||
|
|
||||||
/** Service */
|
|
||||||
import { SharedService } from '../../../shared.service';
|
import { SharedService } from '../../../shared.service';
|
||||||
import { AwsService } from '../../../aws.service';
|
import { AwsService } from '../../../aws.service';
|
||||||
|
|
||||||
/** Model */
|
/** Consant Value For Created Date And Updated Date */
|
||||||
import { PdAllocationType, PdLocationApproach ,PdStatus ,PdType } from '../../model/pd';
|
|
||||||
import { Branch } from '../../model/branch';
|
|
||||||
import { States } from '../../model/states';
|
|
||||||
import { City } from '../../model/city';
|
|
||||||
import { Uom } from '../../model/uom';
|
|
||||||
import { Company } from '../../model/company';
|
|
||||||
import { Activity } from '../../model/activity';
|
|
||||||
import { Title } from '../../model/title';
|
|
||||||
import { ProductMaster } from '../../model/product-master';
|
|
||||||
import { SubProductMaster } from '../../model/sub-product-master';
|
|
||||||
import { IndustryClassification } from '../../model/industry_classification';
|
|
||||||
import { Regions } from '../../model/regions';
|
|
||||||
import { Designation } from '../../model/designation';
|
|
||||||
import { RelationShip } from '../../model/relation-ship';
|
|
||||||
import { CustomerBehaviour } from '../../model/customer-behaviour';
|
|
||||||
import { CommentsOnLocality } from '../../model/comments-on-locality';
|
|
||||||
import { CustomerSegment } from '../../model/customer-segment';
|
|
||||||
import { Frequency } from '../../model/frequency';
|
|
||||||
import { LenderHierarchy } from '../../model/lender-hierarchy';
|
|
||||||
import { MembersOccupation } from '../../model/members-occupation';
|
|
||||||
import { EntityType } from '../../model/entity-type';
|
|
||||||
import { State } from 'aws-sdk/clients/route53domains';
|
|
||||||
import { parse } from 'querystring';
|
|
||||||
import { of } from 'rxjs';
|
|
||||||
//import {} from '../model/states';
|
|
||||||
|
|
||||||
const currentdate = new Date().toJSON().slice(0,19).replace('T',' ');
|
const currentdate = new Date().toJSON().slice(0,19).replace('T',' ');
|
||||||
|
|
||||||
|
/** Master Interface */
|
||||||
export interface Master {
|
export interface Master {
|
||||||
master_id:number;
|
master_id:number;
|
||||||
master_name:string;
|
master_name:string;
|
||||||
constant_name:string;
|
constant_name:string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// const httpOptions = {
|
|
||||||
// headers: new HttpHeaders({
|
|
||||||
// 'Content-Type': 'application/json',
|
|
||||||
// 'Authorization': 'sparqvenba2018'
|
|
||||||
// })
|
|
||||||
// };
|
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
|
||||||
export class MastersService {
|
export class MastersService {
|
||||||
|
|
||||||
// private storeUrl = 'http://localhost/SineEdge/sparqapi/api/saveMaster';
|
|
||||||
// private branchUrl = 'http://localhost/SineEdge/sparqapi/api/getListOfBranches';
|
|
||||||
// private serviceUrl = 'http://localhost/SineEdge/sparqapi/api/getListOfMaster';
|
|
||||||
private apiUrl = 'http://localhost/sparqapi/api/';
|
private apiUrl = 'http://localhost/sparqapi/api/';
|
||||||
|
|
||||||
|
|
||||||
//constructor(private http: HttpClient) { }
|
|
||||||
constructor(private _http: HttpClient,
|
constructor(private _http: HttpClient,
|
||||||
public _shared:SharedService,
|
public _shared:SharedService,
|
||||||
private _aws:AwsService) { }
|
private _aws:AwsService) { }
|
||||||
|
|
||||||
headers:any = this._shared.headercofig('');
|
//headers:any = this._shared.headercofig('');
|
||||||
|
|
||||||
/** TO Add Data using API Call */
|
/**
|
||||||
|
* TO Add Master Datas using API Call
|
||||||
|
* 1st argument is "Records": any - Set of Data To Adding to database
|
||||||
|
* 2nd argument is "MasterName" :string - Table Name To Store the Records
|
||||||
|
*/
|
||||||
addMasterDetails(Records: any,MasterName:string): Observable<any> {
|
addMasterDetails(Records: any,MasterName:string): Observable<any> {
|
||||||
Records.fk_createdby = this._aws.getlocale();
|
|
||||||
Records.createdon = currentdate;
|
Records.fk_createdby = this._aws.getlocale();//to get user id for who is created the Record
|
||||||
|
Records.createdon = currentdate;//to get Current date and Time for when the Record is created
|
||||||
|
|
||||||
var ArrayData = { "master_name":MasterName,
|
var ArrayData = { "master_name":MasterName,
|
||||||
"records": Records
|
"records": Records }
|
||||||
}
|
|
||||||
|
|
||||||
//var data = this._http.post<any>(this.storeUrl,ArrayData,httpOptions);
|
|
||||||
var data = this._http.post(this.apiUrl+'saveMaster',ArrayData);
|
var data = this._http.post(this.apiUrl+'saveMaster',ArrayData);
|
||||||
console.log(data);
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** TO Edit Data using API Call */
|
/**
|
||||||
|
* TO Edit Master Datas using API Call
|
||||||
|
* 1st argument is "Records": any - Set of Updated Data
|
||||||
|
* 2nd argument is "MasterName" :string - Table Name
|
||||||
|
*/
|
||||||
editMasterDetails(Records: any,MasterName:string): Observable<any> {
|
editMasterDetails(Records: any,MasterName:string): Observable<any> {
|
||||||
console.log('b4 Records',Records);
|
|
||||||
Records.fk_updatedby = this._aws.getlocale();
|
Records.fk_updatedby = this._aws.getlocale();//to get user id for who is update the record
|
||||||
Records.updatedon = currentdate;
|
Records.updatedon = currentdate;//to get Current date and Time for when the Record is updated
|
||||||
console.log('after Records',Records);
|
|
||||||
var ArrayData = { "master_name":MasterName,
|
var ArrayData = { "master_name":MasterName,
|
||||||
"records": Records
|
"records": Records }
|
||||||
}
|
|
||||||
console.log('Edited Data IN Service Array ONLY',ArrayData);
|
|
||||||
//var data = this._http.post<any>(this.storeUrl,ArrayData,httpOptions);
|
|
||||||
var data = this._http.post(this.apiUrl+'saveMaster',ArrayData);
|
var data = this._http.post(this.apiUrl+'saveMaster',ArrayData);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**To Inactive Array Data using API Call */
|
|
||||||
//deleteMasterDetails(IDName:any,id: number,MasterName:string): Observable<any> {
|
|
||||||
//console.log(' DeletedID IN Service Argument ONLY',id);
|
|
||||||
//var ID = MasterName+'ID';
|
|
||||||
//console.log(' DeletedID IN Service Argument ONLY',ID);
|
|
||||||
//let ids = {IDName:id};
|
|
||||||
//console.log(IDName);
|
|
||||||
//alert(JSON.stringify(IDName));
|
|
||||||
//let ids = parseInt(IDName);
|
|
||||||
//var ArrayData = {
|
|
||||||
//"master_name":MasterName,
|
|
||||||
//"records": {branch_id:id,
|
|
||||||
// isactive:0,
|
|
||||||
// fk_updatedby:this._aws.getlocale(),
|
|
||||||
// updatedon:currentdate}
|
|
||||||
//}
|
|
||||||
//console.log('DeletedID IN Service Array',ArrayData);
|
|
||||||
//var data = this._http.post(this.apiUrl+'saveMaster',ArrayData,{headers:this.headers});
|
|
||||||
//var data = this._http.post<any>(this.storeUrl,ArrayData,httpOptions);
|
|
||||||
//return data;
|
|
||||||
//}
|
|
||||||
|
|
||||||
/**To Inactive Array Master Data using API Call */
|
/**
|
||||||
|
* TO Inactive the Master Datas using API Call
|
||||||
|
* Note : Which means To delete The records
|
||||||
|
* 1st argument is "PrimaryKeyWithValue" : any - Primarykey and its value
|
||||||
|
* 2nd argument is "MasterName" :string - Table Name
|
||||||
|
*/
|
||||||
deleteMasterDetails(PrimaryKeyWithValue:any,MasterName:string): Observable<any> {
|
deleteMasterDetails(PrimaryKeyWithValue:any,MasterName:string): Observable<any> {
|
||||||
//console.log(' DeletedID IN Service Argument ONLY',id);
|
|
||||||
console.log(' DeletedID IN Service Argument ONLY',PrimaryKeyWithValue);
|
|
||||||
|
|
||||||
|
//This "otherDatas" Array is common Argument For All Master
|
||||||
let otherDatas:any = {isactive:0,
|
let otherDatas:any = {isactive:0,
|
||||||
fk_updatedby:this._aws.getlocale(),
|
fk_updatedby:this._aws.getlocale(),
|
||||||
updatedon:currentdate}
|
updatedon:currentdate}
|
||||||
|
|
||||||
|
//This "dataWithPrimaryKey" Array is Mergeing The 'PrimaryKeyWithValue' argument with otherDatas
|
||||||
let dataWithPrimaryKey = Object.assign(otherDatas,PrimaryKeyWithValue);
|
let dataWithPrimaryKey = Object.assign(otherDatas,PrimaryKeyWithValue);
|
||||||
|
|
||||||
var ArrayData = { "master_name":MasterName,
|
var ArrayData = { "master_name":MasterName,
|
||||||
"records":JSON.parse(JSON.stringify(dataWithPrimaryKey))
|
"records":JSON.parse(JSON.stringify(dataWithPrimaryKey))
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('DeletedID IN Service Array',ArrayData);
|
var data = this._http.post(this.apiUrl+'saveMaster',ArrayData);
|
||||||
|
|
||||||
var data = this._http.post(this.apiUrl+'saveMaster',ArrayData,{headers:this.headers});
|
|
||||||
//var data = this._http.post<any>(this.storeUrl,ArrayData,httpOptions);
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// OldFunction_getAllMasterData(): Observable<Master[]> {
|
/**
|
||||||
// var CityArr = {
|
* TO Get the Master Datas using API Call
|
||||||
// "master_name":"LISTOFMASTERS",
|
* 1st argument is "TableName" :string - Table Name
|
||||||
// }
|
*/
|
||||||
// return this._http.post(this.serviceUrl,CityArr,{headers:this.headers})
|
getAllMasterData(TableName:string): Observable<any> {
|
||||||
// .map(this.extractData)
|
|
||||||
// .catch(this.handleError);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// getAllMasterData(TableName:string): Observable<any> {
|
|
||||||
// var MasterTableName = { "master_name":TableName }
|
|
||||||
// //return this._http.post(this.serviceUrl,CityArr,httpOptions)
|
|
||||||
// //return this._http.post(this.serviceUrl,CityArr,{headers:this.headers})
|
|
||||||
// return this._http.post(this.apiUrl+'getListOfMaster',MasterTableName)
|
|
||||||
// // .map(this.extractData)
|
|
||||||
// // .catchError(this.handleError);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ++++++++++++++++++++++
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getAllMasterData(TableName:string): Observable<any> {
|
|
||||||
return this._http.post<any>(this.apiUrl+"getListOfMaster", { "master_name":TableName })
|
return this._http.post<any>(this.apiUrl+"getListOfMaster", { "master_name":TableName })
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.handleError('role', []))
|
catchError(this.handleError('role', []))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private handleError<T>(operation = 'operation', result?: T) {
|
|
||||||
//alert();
|
|
||||||
console.log('handleError');
|
|
||||||
return (error: any): Observable<T> => {
|
|
||||||
return of(result as T);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// +++++++++++++++++++++++++++++
|
|
||||||
/** Get All Branch Data using API call With master Keyword */
|
|
||||||
// OldFunction_getAllBranch(): Observable<Branch[]> {
|
|
||||||
|
|
||||||
// let tab = {'master_name':'BRANCH'};
|
|
||||||
// return this._http.post(this.serviceUrl,tab,{headers:this.headers})
|
|
||||||
// .map(this.extractData)
|
|
||||||
// .catch(this.handleError);
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
/** Get All Branch Datas using API call With master Keyword */
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TO get Branch Data For Listing Screen
|
||||||
|
*/
|
||||||
getAllBranch(): Observable<any> {
|
getAllBranch(): Observable<any> {
|
||||||
return this._http.get(this.apiUrl+'getListOfBranches')
|
return this._http.get(this.apiUrl+'getListOfBranches')
|
||||||
.pipe(
|
.pipe(
|
||||||
@ -211,26 +118,11 @@ private handleError<T>(operation = 'operation', result?: T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get All City Datas for city dropdown using API call With master Keyword
|
|
||||||
* 1) Branch dialog box
|
|
||||||
* 2) Company dialog box
|
/**
|
||||||
|
* TO get Subproduct Data For Listing Screen
|
||||||
*/
|
*/
|
||||||
getAllCityData(): Observable<any> {
|
|
||||||
var CityArr = {
|
|
||||||
"master_name":"CITY",
|
|
||||||
}
|
|
||||||
//return this._http.post(this.serviceUrl,CityArr,httpOptions)
|
|
||||||
return this._http.post(this.apiUrl+'getListOfMaster',CityArr)
|
|
||||||
.pipe(
|
|
||||||
catchError(this.handleError('role', []))
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** Get All City Data For Branch SCrenn City Dropdown using API call With master Keyword */
|
|
||||||
|
|
||||||
getAllSubProduct(): Observable<any> {
|
getAllSubProduct(): Observable<any> {
|
||||||
|
|
||||||
return this._http.get(this.apiUrl+'getListOfSubProduct')
|
return this._http.get(this.apiUrl+'getListOfSubProduct')
|
||||||
@ -238,24 +130,12 @@ private handleError<T>(operation = 'operation', result?: T) {
|
|||||||
catchError(this.handleError('role', []))
|
catchError(this.handleError('role', []))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get All Product Datas for Product dropdown using API call With master Keyword
|
|
||||||
* 1) Sub product dialog box
|
/**
|
||||||
|
* TO get State Data For Listing Screen
|
||||||
*/
|
*/
|
||||||
getAllProductData(): Observable<any> {
|
|
||||||
var ProductArr = {
|
|
||||||
"master_name":"PRODUCTS",
|
|
||||||
}
|
|
||||||
//return this._http.post(this.serviceUrl,CityArr,httpOptions)
|
|
||||||
return this._http.post(this.apiUrl+'getListOfMaster',ProductArr)
|
|
||||||
.pipe(
|
|
||||||
catchError(this.handleError('role', []))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
getAllState(): Observable<any> {
|
getAllState(): Observable<any> {
|
||||||
|
|
||||||
return this._http.get(this.apiUrl+'getListOfState')
|
return this._http.get(this.apiUrl+'getListOfState')
|
||||||
@ -266,21 +146,9 @@ private handleError<T>(operation = 'operation', result?: T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get All Region Datas for Region dropdown using API call With master Keyword
|
/**
|
||||||
* 1) state dialog box
|
* TO get Company Data For Listing Screen
|
||||||
*/
|
*/
|
||||||
getAllRegionData(): Observable<any> {
|
|
||||||
var RegionArr = {
|
|
||||||
"master_name":"REGIONS",
|
|
||||||
}
|
|
||||||
//return this._http.post(this.serviceUrl,CityArr,httpOptions)
|
|
||||||
return this._http.post(this.apiUrl+'getListOfMaster',RegionArr)
|
|
||||||
.pipe(
|
|
||||||
catchError(this.handleError('role', []))
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
getAllCompany(): Observable<any> {
|
getAllCompany(): Observable<any> {
|
||||||
|
|
||||||
return this._http.get(this.apiUrl+'getListOfCompany')
|
return this._http.get(this.apiUrl+'getListOfCompany')
|
||||||
@ -288,53 +156,26 @@ private handleError<T>(operation = 'operation', result?: T) {
|
|||||||
catchError(this.handleError('role', []))
|
catchError(this.handleError('role', []))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get All State Datas for State dropdown using API call With master Keyword
|
|
||||||
* 1) Branch dialog box
|
|
||||||
* 2) Company dialog box
|
|
||||||
*/
|
|
||||||
getAllStateData(): Observable<any> {
|
|
||||||
var stateArr = {
|
|
||||||
"master_name":"STATE",
|
|
||||||
}
|
|
||||||
//return this._http.post(this.serviceUrl,CityArr,httpOptions)
|
|
||||||
return this._http.post(this.apiUrl+'getListOfMaster',stateArr)
|
|
||||||
.pipe(
|
|
||||||
catchError(this.handleError('role', []))
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Get All EntityType Data using API call With master Keyword */
|
/** Get All EntityType Data using API call With master Keyword */
|
||||||
getAllEntityType(): Observable<any> {
|
// getAllEntityType(): Observable<any> {
|
||||||
|
// var EntityTypeArr = {
|
||||||
var EntityTypeArr = {
|
// "master_name":"ENTITYTYPE",
|
||||||
"master_name":"ENTITYTYPE",
|
|
||||||
}
|
|
||||||
return this._http.post(this.apiUrl+'getListOfMaster',EntityTypeArr,{headers:this.headers})
|
|
||||||
.pipe(
|
|
||||||
catchError(this.handleError('role', []))
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** Using Above .map() Method. We check the Response's array Status and return to the component */
|
|
||||||
// private extractData(res : Response) {
|
|
||||||
// console.log('extractData',res);
|
|
||||||
// if (res['dataStatus'] === true) {
|
|
||||||
// let Records = res['records'];
|
|
||||||
// return Records;
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// return []; // return empty array if there is no data
|
|
||||||
// }
|
// }
|
||||||
|
// return this._http.post(this.apiUrl+'getListOfMaster',EntityTypeArr,{headers:this.headers})
|
||||||
|
// .pipe(
|
||||||
|
// catchError(this.handleError('role', []))
|
||||||
|
// )
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Seperated Records from the res
|
||||||
|
* argument 'res' : Response
|
||||||
|
*/
|
||||||
private extractData(res : Response) {
|
private extractData(res : Response) {
|
||||||
|
|
||||||
let Response = res['_body'];
|
let Response = res['_body'];
|
||||||
@ -344,32 +185,16 @@ private handleError<T>(operation = 'operation', result?: T) {
|
|||||||
? Response['records']
|
? Response['records']
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
/* Checking Data Status is true or false.,
|
|
||||||
TRUE means Return Arraydata
|
|
||||||
FALSE means Return empty array.
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TO Handle The Error
|
||||||
|
*/
|
||||||
|
private handleError<T>(operation = 'operation', result?: T) {
|
||||||
|
|
||||||
|
return (error: any): Observable<T> => {
|
||||||
|
return of(result as T);
|
||||||
// private parseData(Response) {
|
};
|
||||||
// //console.log('parseData called',Response);
|
}
|
||||||
// if(Response.dataStatus == true){
|
|
||||||
// console.log('true part',Response.records);
|
|
||||||
// return Response.records;
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// return Response;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// private handleError(error: any): Promise<any> {
|
|
||||||
// console.error('An error occurred', error);
|
|
||||||
// return Promise.reject(error.message || error);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user