masterdetail changes

This commit is contained in:
venbatechnologies@gmail.com 2018-09-20 14:37:24 +05:30
parent f9410a50ea
commit 39bf3181b7
43 changed files with 63 additions and 910 deletions

View File

@ -17,7 +17,7 @@
<th style="text-align: center;">Isactive</th>
<th style="text-align: center;">Action</th>
</thead>
<tr *ngIf="BranchList.length === 0" > <td colspan="5" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let BL of BranchList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{BL.name}}</td>

View File

@ -19,6 +19,7 @@
<th style="text-align: center;">Action</th>
</thead>
<tr *ngIf="CityList.length === 0" > <td colspan="5" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let CL of CityList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{CL.name}}</td>

View File

@ -16,6 +16,7 @@
<th style="text-align: center;">Action</th>
</thead>
<tr *ngIf="CommentsOnLocalityList.length === 0" > <td colspan="5" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let CLL of CommentsOnLocalityList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{CLL.comments_on_locality_id}}</td>

View File

@ -17,6 +17,7 @@
<th style="text-align: center;">Action</th>
</thead>
<tr *ngIf="CompanyList.length === 0" > <td colspan="5" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let CL of CompanyList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{CL.name}}</td>

View File

@ -6,8 +6,8 @@
<div *ngIf="loader">
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
</div>
<div class="example-container mat-elevation-z8">
<table>
<div datatable>
<table style="border-collapse: collapse">
<thead>
<th style="text-align: center;">#</th>
<th style="text-align: center;">CustomerBehaviour ID</th>
@ -16,6 +16,7 @@
<th style="text-align: center;">Action</th>
</thead>
<tr *ngIf="CustomerBehaviourList.length === 0" > <td colspan="5" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let CBL of CustomerBehaviourList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{CBL.customer_behaviour_id}}</td>

View File

@ -17,6 +17,7 @@
<th style="text-align: center;">Action</th>
</thead>
<tr *ngIf="CustomerSegmentList.length === 0" > <td colspan="5" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let CSL of CustomerSegmentList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{CSL.name}}</td>

View File

@ -15,6 +15,7 @@
<th style="text-align: center;">Action</th>
</thead>
<tr *ngIf="DesignationList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let DL of DesignationList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{DL.designation_id}} {{DL.name}}</td>

View File

@ -1,44 +0,0 @@
<div class="mb-1">
<h2 mat-dialog-title>Entity Type &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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>
</h2>
</div>
<div class="container"
fxLayout
fxLayout.xs="column"
fxLayoutAlign="center"
fxLayoutGap="35px"
fxLayoutGap.xs="0">
<div class="mat-dialog-title" fxFlex="15px">Branch</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>
<form [formGroup]="_entityTypeForm" (submit)="onSubmit()">
<div class="form-group">
<mat-dialog-content>
<div class="mb-1">
<mat-form-field style="width: 100%">
<input matInput type="text" placeholder="Name" required [formControl]="_entityTypeForm.controls['name']">
</mat-form-field>
<small *ngIf="!_entityTypeForm.controls['name'].valid && _entityTypeForm.controls['name'].touched" class="mat-text-warn">You must include a Name.</small>
</div>
<!-- //entity_type_id, name, createdon, fk_createdby, updatedon, fk_updatedby, isactive -->
<!-- //EntityType_id, name, short_name, createdon, fk_createdby, updatedon, fk_updatedby, isactive -->
<br>
<div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset" ><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_entityTypeForm.valid"><mat-icon>save</mat-icon></button>
<!-- <button mat-button >RESET</button> -->
</div>
</mat-dialog-content>
</div>
</form>

View File

@ -1,25 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { EntityTypeDialogComponent } from './entity-type-dialog.component';
describe('EntityTypeDialogComponent', () => {
let component: EntityTypeDialogComponent;
let fixture: ComponentFixture<EntityTypeDialogComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EntityTypeDialogComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(EntityTypeDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -1,73 +0,0 @@
import { Component, OnInit, Inject } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { MastersService } from '../../../service/master/masters.service';
@Component({
selector: 'app-designation-dialog',
templateUrl: './entity-type-dialog.component.html',
styleUrls: ['./entity-type-dialog.component.scss']
})
export class EntityTypeDialogComponent implements OnInit {
public _entityTypeForm: FormGroup;
constructor(private _formBuilder: FormBuilder,
private dialogRef: MatDialogRef<EntityTypeDialogComponent>,
private _ETService: MastersService,
@Inject(MAT_DIALOG_DATA) public data: any) { }
onNoClick(): void {
this.dialogRef.close();
}
ngOnInit() {
this._entityTypeForm = this._formBuilder.group({
//Designation_id: any; fk_city_id: any;
entity_type_id: [this.data.entity_type_id],
name: [this.data.name, Validators.compose([Validators.required])]
});
//console.log(this._entityTypeForm);
}
// onSubmit() {
// if (isNaN(this.data.ID)) {
// this._MastersService.addDesignation(this._entityTypeForm.value);
// this.dialogRef.close();
// } else {
// this._MastersService.editDesignation(this._entityTypeForm.value);
// this.dialogRef.close();
// }
// }
onSubmit() {
if(isNaN(this.data.entity_type_id)) {
var my_array = this._entityTypeForm.value;
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
console.log(my_array);
this._ETService.addMasterDetails(my_array,'ENTITYTYPE').subscribe();
//addEntityType(my_array)
this.dialogRef.close();
alert("saved");
} else {
this._ETService.editMasterDetails(this._entityTypeForm.value,'ENTITYTYPE').subscribe();
this.dialogRef.close();
alert("edited");
}
}
onReset(){
this._entityTypeForm.reset();
}
}

View File

@ -1,66 +0,0 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button color="primary" (click)="addEntityType()" [disabled]="dialogRef"> + Add EntityType</button>
</div>
<br>
<div *ngIf="loader">
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
</div>
<div class="example-container mat-elevation-z8">
<table>
<thead>
<th style="text-align: center;">#</th>
<!-- <th style="text-align: center;">EntityType ID</th> -->
<th style="text-align: center;">EntityType Name</th>
<th style="text-align: center;">IsActive</th>
<th style="text-align: center;">Action</th>
</thead>
<tr *ngFor="let EL of EntityTypeList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{EL.entity_type_id}} {{EL.name}}</td>
<td style="text-align: center;">{{EL.isactive}}</td>
<td style="text-align: center;">
<a (click)="editEntityType(EL)"><mat-icon>edit</mat-icon></a>
<a (click)="deleteEntityType(EL.entity_type_id)"><mat-icon>delete_outline</mat-icon></a>
</td>
</tr>
</table>
</div>
<!--<div>
<mat-table [dataSource]="dataSource"> ->
<mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="entity_type_id">
<mat-header-cell *matHeaderCellDef mat-sort-header> ID </mat-header-cell>
<mat-cell *matCellDef="let user"> {{user.entity_type_id}} </mat-cell>
</ng-container>
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
<mat-cell *matCellDef="let user"> {{user.name}} </mat-cell>
</ng-container>
<ng-container matColumnDef="isactive">
<mat-header-cell *matHeaderCellDef mat-sort-header> isactive </mat-header-cell>
<mat-cell *matCellDef="let user"> {{user.isactive}} </mat-cell>
</ng-container>
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef></mat-header-cell>
<mat-cell *matCellDef="let user">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editEntityType(user)"><mat-icon>edit</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteEntityType(user.entity_type_id)"><mat-icon>delete_outline</mat-icon></button>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
</mat-table>
</div>
<br>-->
</mat-card-content>

View File

@ -1,93 +0,0 @@
/* Structure
.example-container {
display: flex;
flex-direction: column;
min-width: 300px;
}
.example-header {
min-height: 56px;
max-height: 56px;
display: flex;
align-items: center;
padding: 8px 24px 0;
font-size: 20px;
justify-content: space-between;
border-bottom: 1px solid transparent;
}
.mat-input-container {
font-size: 14px;
flex-grow: 1;
margin-left: 32px;
margin-top: 8px;
}
.example-no-results {
display: flex;
justify-content: center;
padding: 24px;
font-size: 12px;
font-style: italic;
}
/** Selection styles
.example-selection-header {
font-size: 18px;
background: rgba(255, 64, 129, 0.3);
border-bottom: 1px solid #d696ac;
}
.mat-column-select {
max-width: 54px;
}
.mat-row:hover, .example-selected-row {
background: #f5f5f5;
}
.mat-row:active, .mat-row.example-selected-row {
background: #eaeaea;
}
.mat-table {
overflow: auto;
max-height: 500px;
}*/
/* Structure */
.example-container {
display: flex;
flex-direction: column;
min-width: 30px;
width : 80%;
margin : 20px auto;
}
.example-header {
min-height: 64px;
padding: 8px 24px 0;
}
//mat-cell{
.cell{
display:flex !important;
justify-content:center!important;
}
// mat-header-cell {
.header-cell{
display:flex;
justify-content:center;
}
table {
width: 100%;
}
th {
text-align: left;
}

View File

@ -1,25 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { EntityTypeListComponent } from './entity-type-list.component';
describe('EntityTypeListComponent', () => {
let component: EntityTypeListComponent;
let fixture: ComponentFixture<EntityTypeListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ EntityTypeListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(EntityTypeListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -1,107 +0,0 @@
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
import { Observable, Subject } from 'rxjs';
import { Http, Response } from '@angular/http';
import 'rxjs/add/operator/map';
import { DataSource } from '@angular/cdk/collections';
import { map } from 'rxjs/operators';
import { of as observableOf, merge } from 'rxjs';
import { MastersService } from '../../../service/master/masters.service';
import { EntityTypeDialogComponent } from '../entity-type-dialog/entity-type-dialog.component';
import { EntityType } from '../../../model/entity-type';
@Component({
selector: 'app-entity-type-list',
templateUrl: './entity-type-list.component.html',
styleUrls: ['./entity-type-list.component.scss']
})
export class EntityTypeListComponent implements OnInit {
isPopupOpened = true;
loader: boolean = false;
EntityTypeList: any = [];
displayedColumns = ['entity_type_id', 'name','isactive','actions'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
constructor(private dialog: MatDialog,
private _EtService: MastersService) { }
// get EntityTypeList() {
// return this._EtService. getAllEntityType();
// }
dataSource = new UserDataSource(this._EtService);
ngOnInit() {
this.getEntityType();
}
addEntityType() {
this.isPopupOpened = true;
const dialogRef = this.dialog.open(EntityTypeDialogComponent, {
data: {}
});
dialogRef.afterClosed().subscribe(result => {
this.isPopupOpened = false;
});
}
editEntityType(arr: any) {
this.isPopupOpened = true;
//const contact = this._EtService.getAllEntityType().find(c => c.ID === id);
const dialogRef = this.dialog.open(EntityTypeDialogComponent, {
data: arr
});
dialogRef.afterClosed().subscribe(result => {
this.isPopupOpened = false;
});
}
//To get data for listing
getEntityType() {
this.loader = true;
this._EtService.getAllMasterData('ENTITYTYPE').subscribe(dataresult => {
this.loader = false;
if (dataresult.status == 200) {
this.EntityTypeList = dataresult.records;
}
})
}
deleteEntityType(id: number) {
//this._EtService.deleteMasterDetails('',id,'ENTITYTYPE');
//deleteMasterDetails(id,'ENTITYTYPE');
}
}
export class UserDataSource extends DataSource<any> {
//jkj
constructor(private _ets: MastersService ) {
super();
}
connect(): Observable<EntityType[]> {
//return this.userService.getUser();
//return this._ets.getAllEntityType();
return this._ets.getAllMasterData('ENTITYTYPE');
}
disconnect() {}
}

View File

@ -15,6 +15,7 @@
<th style="text-align: center;">Action</th>
</thead>
<tr *ngIf="FrequencyList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let FL of FrequencyList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{FL.name}}</td>

View File

@ -15,16 +15,19 @@
<th style="text-align: center;">IsActive</th>
<th style="text-align: center;">Action</th>
</thead>
<tr *ngFor="let IM of IndustryClassificationList ; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{IM.name}}</td>
<td style="text-align: center;">{{IM.isactive}}</td>
<td style="text-align: center;">
<a (click)="editIndustryMaster(IM.ID)"><mat-icon>edit</mat-icon></a>
<a (click)="deleteIndustryMaster(IM.ID)"><mat-icon>delete_outline</mat-icon></a>
</td>
</tr>
<tr *ngIf="IndustryClassificationList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let IM of IndustryClassificationList ; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{IM.name}}</td>
<td style="text-align: center;">{{IM.isactive}}</td>
<td style="text-align: center;">
<a (click)="editIndustryClassification(IM)"><mat-icon>edit</mat-icon></a>
<a (click)="deleteIndustryClassification(IM.industry_classification_id)"><mat-icon>delete_outline</mat-icon></a>
</td>
</tr>
</table>
</div>

View File

@ -91,6 +91,9 @@ export class IndustryClassificationListComponent implements OnInit {
if (dataresult.status == 200) {
this.IndustryClassificationList = dataresult.records;
}
else{
this.IndustryClassificationList = [];
}
})
}

View File

@ -15,6 +15,7 @@
<th style="text-align: center;">Action</th>
</thead>
<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">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{LHL.lender_hierarchy_id}} {{LHL.lender_hierarchy}} </td>

View File

@ -102,29 +102,23 @@
<app-pd-allocation-type-list></app-pd-allocation-type-list>
</div>
<div *ngIf="masterCtrl.value =='master-17'">
<app-pd-status-list></app-pd-status-list>
</div>
<div *ngIf="masterCtrl.value =='master-18'">
<app-pd-type-list></app-pd-type-list>
</div>
<div *ngIf="masterCtrl.value =='master-19'">
<div *ngIf="masterCtrl.value =='master-18'">
<app-company-list></app-company-list>
</div>
<div *ngIf="masterCtrl.value =='master-20'">
<div *ngIf="masterCtrl.value =='master-19'">
<app-city-list></app-city-list>
</div>
<div *ngIf="masterCtrl.value =='master-21'">
<div *ngIf="masterCtrl.value =='master-20'">
<app-states-list></app-states-list>
</div>
<div *ngIf="masterCtrl.value =='master-22'">
<div *ngIf="masterCtrl.value =='master-21'">
<app-regions-list></app-regions-list>
</div>
<div *ngIf="masterCtrl.value =='master-23'">
<div *ngIf="masterCtrl.value =='master-22'">
<app-lender-hierarchy-list></app-lender-hierarchy-list>
</div>
<div *ngIf="masterCtrl.value =='master-24'">
<!-- <app-entity-type-list></app-entity-type-list> -->
</div>
<!-- <div *ngIf="masterCtrl.value =='datatable'">
<data-table></data-table></div>
<div *ngIf="masterCtrl.value =='usertable'">

View File

@ -115,16 +115,12 @@ export class MastersComponent implements OnInit {
{id: 'master-14',name: 'Customer Segment'},
{id: 'master-15',name: 'Designation'},
{id: 'master-16',name: 'PD Allocation Type'},
{id: 'master-17',name: 'PD Status'},
{id: 'master-18',name: 'PD Type'},
{id: 'master-19',name: 'Company Details'},
{id: 'master-20',name: 'City'},
{id: 'master-21',name: 'States'},
{id: 'master-22',name: 'Regions'},
{id: 'master-23',name: 'Lender Hierarchy'},
{id: 'master-24',name: 'm_entity_type'},
{id: 'datatable',name: 'datatable'},
{id: 'usertable',name: 'usertable'}
{id: 'master-17',name: 'PD Type'},
{id: 'master-18',name: 'Company Details'},
{id: 'master-19',name: 'City'},
{id: 'master-20',name: 'States'},
{id: 'master-21',name: 'Regions'},
{id: 'master-22',name: 'Lender Hierarchy'}
];
/** list of masters filtered by search keyword */

View File

@ -16,6 +16,7 @@
<th style="text-align: center;">Action</th>
</thead>
<tr *ngIf="MemberOccupationList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let ML of MemberOccupationList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{ML.name}}</td>

View File

@ -15,6 +15,7 @@
<th style="text-align: center;">Action</th>
</thead>
<tr *ngIf="PDAllocationTypeList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let PAT of PDAllocationTypeList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{PAT.pd_allocation_type_name}}</td>
@ -26,7 +27,7 @@
</tr>
</table>
</div> -->
</div>
<!--<div>
<mat-table [dataSource]="dataSource"> ->

View File

@ -17,6 +17,7 @@
<!-- , createdon, fk_createdby, updatedon, fk_updatedby, isactive -->
<tr *ngIf="MemberOccupationList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let PAL of PdLocationApproachList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{PAL.pd_location_approach_id}} {{PAL.description}}</td>

View File

@ -1,43 +0,0 @@
<!-- <div class="mb-1">
<h2 mat-dialog-title>PD Status &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<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>
</h2>
</div> -->
<div class="container"
fxLayout
fxLayout.xs="column"
fxLayoutAlign="center"
fxLayoutGap="35px"
fxLayoutGap.xs="0">
<div class="mat-dialog-title" fxFlex="15px">PD Status</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>
<form [formGroup]="_PdStatusForm" (submit)="onSubmit()">
<div class="form-group">
<mat-dialog-content>
<div class="mb-1">
<mat-form-field style="width: 100%">
<input matInput type="text" placeholder="Name" required [formControl]="_PdStatusForm.controls['pd_status_name']">
<mat-error *ngIf="!_PdStatusForm.controls['pd_status_name'].valid && _PdStatusForm.controls['pd_status_name'].touched" class="mat-text-warn">You must include a PD Status Name.</mat-error>
</mat-form-field>
</div>
<br>
<div class="row" style="text-align:right;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Reset" matTooltipPosition="above" type="reset" ><mat-icon>settings_backup_restore</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Save" matTooltipPosition="above" type="submit" [disabled]="!_PdStatusForm.valid"><mat-icon>save</mat-icon></button>
<!-- <button mat-button >RESET</button> -->
</div>
</mat-dialog-content>
</div>
</form>

View File

@ -1,3 +0,0 @@
mat-form-field{
width:100%;
}

View File

@ -1,25 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { PdStatusDialogComponent } from './pd-status-dialog.component';
describe('PdStatusDialogComponent', () => {
let component: PdStatusDialogComponent;
let fixture: ComponentFixture<PdStatusDialogComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ PdStatusDialogComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(PdStatusDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -1,66 +0,0 @@
import { Component, OnInit, Inject } from '@angular/core';
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { MastersService } from '../../../service/master/masters.service';
@Component({
selector: 'app-jazz-dialog',
templateUrl: './pd-status-dialog.component.html',
styleUrls: ['./pd-status-dialog.component.scss']
})
export class PdStatusDialogComponent implements OnInit {
public _PdStatusForm: FormGroup;
constructor(private _formBuilder: FormBuilder,
private dialogRef: MatDialogRef<PdStatusDialogComponent>,
private _PdStatusService: MastersService,
@Inject(MAT_DIALOG_DATA) public data: any) { }
onNoClick(): void {
this.dialogRef.close();
}
ngOnInit() {
this._PdStatusForm = this._formBuilder.group({
pd_status_id: [this.data.pd_status_id],
pd_status_name: [this.data.pd_status_name, Validators.compose([Validators.required])],
});
//console.log(this._PdStatusForm);
}
// onSubmit() {
// if (isNaN(this.data.ID)) {
// this._PdStatusService.addPdStatus(this._PdStatusForm.value);
// this.dialogRef.close();
// } else {
// this._PdStatusService.editPdStatus(this._PdStatusForm.value);
// this.dialogRef.close();
// }
// }
onSubmit() {
if(isNaN(this.data.pd_status_id)) {
var my_array = this._PdStatusForm.value;
Object.keys(my_array).forEach((key) => ( my_array[key] == null) && delete my_array[key]);
console.log(my_array);
this._PdStatusService.addMasterDetails(my_array,'PDSTATUS').subscribe();
this.dialogRef.close();
alert("saved");
} else {
this._PdStatusService.editMasterDetails(this._PdStatusForm.value,'PDSTATUS').subscribe();
this.dialogRef.close();
alert("edited");
}
}
onReset(){
this._PdStatusForm.reset();
}
}

View File

@ -1,61 +0,0 @@
<mat-card-content>
<div style="text-align: right;">
<button mat-raised-button color="primary" (click)="addPdStatus()" [disabled]="dialogRef"> + Add Pd Status</button>
</div>
<br>
<div *ngIf="loader">
<mat-progress-bar mode="indeterminate" color="accent" class="mb-1"></mat-progress-bar>
</div>
<div datatable>
<table style="border-collapse: collapse">
<thead>
<th style="text-align: center;">#</th>
<th style="text-align: center;">PD Status Name</th>
<th style="text-align: center;">Isactive</th>
<th style="text-align: center;">Action</th>
</thead>
<!-- pd_status_id, pd_status_name, createdon, fk_createdby, updatedon, isactive -->
<tr *ngFor="let BL of PdStatusList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{BL.pd_status_id}} {{BL.pd_status_name}}</td>
<td style="text-align: center;">{{BL.isactive}}</td>
<td style="text-align: center;">
<a (click)="editPdStatus(BL)"><mat-icon>edit</mat-icon></a>
<a (click)="deletePdStatus(BL.pd_status_id)"><mat-icon>delete_outline</mat-icon></a>
</td>
</tr>
</table>
</div>
<!-- <div>
<!- <mat-table [dataSource]="dataSource"> ->
<mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="pd_status_id">
<mat-header-cell *matHeaderCellDef mat-sort-header> ID </mat-header-cell>
<mat-cell *matCellDef="let user"> {{user.pd_status_id}} </mat-cell>
</ng-container>
<ng-container matColumnDef="pd_status_name">
<mat-header-cell *matHeaderCellDef mat-sort-header> Name </mat-header-cell>
<mat-cell *matCellDef="let user"> {{user.pd_status_name}} </mat-cell>
</ng-container>
<ng-container matColumnDef="isactive">
<mat-header-cell *matHeaderCellDef mat-sort-header> isactive </mat-header-cell>
<mat-cell *matCellDef="let user"> {{user.isactive}} </mat-cell>
</ng-container>
<ng-container matColumnDef="actions">
<mat-header-cell *matHeaderCellDef></mat-header-cell>
<mat-cell *matCellDef="let user">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editPdStatus(user)"><mat-icon>edit</mat-icon></button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deletePdStatus(user.pd_status_id)"><mat-icon>delete_outline</mat-icon></button>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
</mat-table>
</div>
<br>-->
</mat-card-content>

View File

@ -1,93 +0,0 @@
/* Structure
.example-container {
display: flex;
flex-direction: column;
min-width: 300px;
}
.example-header {
min-height: 56px;
max-height: 56px;
display: flex;
align-items: center;
padding: 8px 24px 0;
font-size: 20px;
justify-content: space-between;
border-bottom: 1px solid transparent;
}
.mat-input-container {
font-size: 14px;
flex-grow: 1;
margin-left: 32px;
margin-top: 8px;
}
.example-no-results {
display: flex;
justify-content: center;
padding: 24px;
font-size: 12px;
font-style: italic;
}
/** Selection styles
.example-selection-header {
font-size: 18px;
background: rgba(255, 64, 129, 0.3);
border-bottom: 1px solid #d696ac;
}
.mat-column-select {
max-width: 54px;
}
.mat-row:hover, .example-selected-row {
background: #f5f5f5;
}
.mat-row:active, .mat-row.example-selected-row {
background: #eaeaea;
}
.mat-table {
overflow: auto;
max-height: 500px;
}*/
/* Structure */
.example-container {
display: flex;
flex-direction: column;
min-width: 30px;
width : 80%;
margin : 20px auto;
}
.example-header {
min-height: 64px;
padding: 8px 24px 0;
}
//mat-cell{
.cell{
display:flex !important;
justify-content:center!important;
}
// mat-header-cell {
.header-cell{
display:flex;
justify-content:center;
}
table {
width: 100%;
}
th {
text-align: left;
}

View File

@ -1,25 +0,0 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { PdStatusListComponent } from './pd-status-list.component';
describe('PdStatusListComponent', () => {
let component: PdStatusListComponent;
let fixture: ComponentFixture<PdStatusListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ PdStatusListComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(PdStatusListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -1,110 +0,0 @@
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { MatDialog, MatDialogRef, MatDialogConfig,MatPaginator, MatSort,MatTableDataSource } from '@angular/material';
import { Observable, Subject } from 'rxjs';
import { Http, Response } from '@angular/http';
import 'rxjs/add/operator/map';
import { DataSource } from '@angular/cdk/collections';
import { map } from 'rxjs/operators';
import { of as observableOf, merge } from 'rxjs';
import { MastersService } from '../../../service/master/masters.service';
import { PdStatusDialogComponent } from '../pd-status-dialog/pd-status-dialog.component';
import { PdStatus } from '../../../model/pd';
@Component({
selector: 'app-pd-status-list',
templateUrl: './pd-status-list.component.html',
styleUrls: ['./pd-status-list.component.scss']
})
export class PdStatusListComponent implements OnInit {
isPopupOpened = true;
loader: boolean = false;
PdStatusList: any = [];
displayedColumns = ['pd_status_id', 'pd_status_name','isactive','actions'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
constructor(private dialog: MatDialog,
private _PdStatusService: MastersService) { }
// get PdStatusList() {
// return this._PdStatusService.getAllPdStatus();
// }
dataSource = new UserDataSource(this._PdStatusService);
ngOnInit() {
this.getPdStatus();
}
addPdStatus() {
this.isPopupOpened = true;
const dialogRef = this.dialog.open(PdStatusDialogComponent, {
data: {}
});
dialogRef.afterClosed().subscribe(result => {
this.isPopupOpened = false;
});
}
editPdStatus(arr: any[]) {
this.isPopupOpened = true;
//const contact = this._PdStatusService.getAllPdStatus().find(c => c.ID === id);
const dialogRef = this.dialog.open(PdStatusDialogComponent, {
data: arr
});
dialogRef.afterClosed().subscribe(result => {
this.isPopupOpened = false;
});
}
//To get data for listing
getPdStatus() {
this.loader = true;
this._PdStatusService.getAllMasterData('PDSTATUS').subscribe(dataresult => {
this.loader = false;
if (dataresult.status == 200) {
this.PdStatusList = dataresult.records;
}
})
}
deletePdStatus(id: number) {
var PrimaryKeyWithValue ={'pd_status_id':id};
this._PdStatusService.deleteMasterDetails(PrimaryKeyWithValue,'PDSTATUS');
}
}
export class UserDataSource extends DataSource<any> {
constructor(private _bs: MastersService) {
super();
}
connect(): Observable<PdStatus[]> {
//return this.userService.getUser();
//return this._bs.getAllPDStatus();
return this._bs.getAllMasterData('PDSTATUS');
}
disconnect() {}
}

View File

@ -15,6 +15,7 @@
<th style="text-align: center;">Action</th>
</thead>
<tr *ngIf="MemberOccupationList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let BL of PDTypeList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{BL.pd_type_id}} {{BL.type_name}}</td>

View File

@ -211,6 +211,7 @@
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteProductMaster(PM.ID)"><mat-icon>delete_outline</mat-icon></button>
</td>
</tr> -->
<tr *ngIf="ProductMasterList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let PM of ProductMasterList; let i=index" class="body-cell">
<td style="text-align: center;">{{i+1}}</td>
@ -221,7 +222,7 @@
<td style="text-align: center;">
<!-- <td style="text-align: center;font-size: 20px"><a (click)="editUserDetails(us.userid,us.aws_name)"><i class="fa fa-pencil"></i></a></td> -->
<a (click)="editProductMaster(PM)"><mat-icon>edit</mat-icon></a>
<a mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon button" matTooltip="Delete" matTooltipPosition="above" (click)="deleteProductMaster(PM.product_id)"><mat-icon>delete_outline</mat-icon></a>
<a (click)="deleteProductMaster(PM.product_id)"><mat-icon>delete_outline</mat-icon></a>
</td>
</tr>
</table>

View File

@ -15,14 +15,15 @@
<th style="text-align: center;">Action</th>
</thead>
<tr *ngFor="let RL of RegionsList; let i=index">
<tr *ngIf="regionsList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let RL of regionsList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{RL.name}}</td>
<td style="text-align: center;">{{RL.isactive}}</td>
<td style="text-align: center;">
<a (click)="editregions(RL)"><mat-icon>edit</mat-icon></a>
<a (click)="deleteregions(RL.region_id)"><mat-icon>delete_outline</mat-icon></a>
</td>
</td>
</tr>
</table>

View File

@ -16,7 +16,8 @@
<th style="text-align: center;">Action</th>
</thead>
<tr *ngFor="let RL of RelationShipList; let i=index">
<tr *ngIf="RelationShipList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let RL of RelationShipList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{RL.name}}</td>

View File

@ -15,7 +15,7 @@
<th style="text-align: center;">Isactive</th>
<th style="text-align: center;">Action</th>
</thead>
<tr *ngIf="StateList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let SL of StateList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{SL.name}}</td>

View File

@ -17,7 +17,7 @@
<th style="text-align: center;">Isactive</th>
<th style="text-align: center;">Action</th>
</thead>
<tr *ngIf="SubProductMasterList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let SPM of SubProductMasterList; let i=index">
<td style="text-align: center;" >{{i+1}}</td>
<td style="text-align: center;">{{SPM.product_name}}</td>

View File

@ -16,6 +16,7 @@
<th style="text-align: center;">Action</th>
</thead>
<tr *ngIf="TitleList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let TL of TitleList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{TL.name}}</td>

View File

@ -16,6 +16,7 @@
<th style="text-align: center;">Action</th>
</thead>
<tr *ngIf="ActivityList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let AL of ActivityList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{AL.name}}</td>

View File

@ -16,6 +16,7 @@
<th style="text-align: center;">Action</th>
</thead>
<tr *ngIf="UOMList.length === 0" > <td colspan="4" style="text-align: center;"> No Records </td></tr>
<tr *ngFor="let UL of UOMList; let i=index">
<td style="text-align: center;">{{i+1}}</td>
<td style="text-align: center;">{{UL.name}}</td>

View File

@ -181,7 +181,8 @@ getAllMasterData(TableName:string): Observable<any> {
}
private handleError<T>(operation = 'operation', result?: T) {
alert();
//alert();
console.log('handleError');
return (error: any): Observable<T> => {
return of(result as T);
};

View File

@ -53,7 +53,7 @@ import { CommentsOnLocalityListComponent } from './component/comments-on-localit
import { PdAllocationTypeListComponent } from './component/pd/pd-allocation-type-list/pd-allocation-type-list.component';
import { PdLocationApproachListComponent } from './component/pd/pd-location-approach-list/pd-location-approach-list.component';
import { PdTypeListComponent } from './component/pd/pd-type-list/pd-type-list.component';
import { PdStatusListComponent } from './component/pd/pd-status-list/pd-status-list.component';
// import { PdStatusListComponent } from './component/pd/pd-status-list/pd-status-list.component';
import { LenderHierarchyListComponent } from './component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component';
/** Master Child Component - For Dialogboxes*/
@ -70,7 +70,7 @@ import { FrequencyDialogComponent } from './component/frequency/frequency-dialog
import { PdTypeDialogComponent } from './component/pd/pd-type-dialog/pd-type-dialog.component';
import { PdLocationApproachDialogComponent } from './component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component';
import { PdAllocationTypeDialogComponent } from './component/pd/pd-allocation-type-dialog/pd-allocation-type-dialog.component';
import { PdStatusDialogComponent } from './component/pd/pd-status-dialog/pd-status-dialog.component';
//import { PdStatusDialogComponent } from './component/pd/pd-status-dialog/pd-status-dialog.component';
import { LenderHierarchyDialogComponent } from './component/lender-hierarchy/lender-hierarchy-dialog/lender-hierarchy-dialog.component';
import { CommentsOnLocalityDialogComponent } from './component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component';
import { DesignationDialogComponent } from './component/designation/designation-dialog/designation-dialog.component';
@ -136,7 +136,7 @@ import { MastersService } from './service/master/masters.service';
CommentsOnLocalityListComponent,
PdAllocationTypeListComponent,
PdLocationApproachListComponent,
PdStatusListComponent,
// PdStatusListComponent,
PdTypeListComponent,
LenderHierarchyListComponent,
ProductDialogComponent,
@ -152,7 +152,7 @@ import { MastersService } from './service/master/masters.service';
PdTypeDialogComponent,
PdLocationApproachDialogComponent,
PdAllocationTypeDialogComponent,
PdStatusDialogComponent,
// PdStatusDialogComponent,
// //EntityTypeDialogComponent,
LenderHierarchyDialogComponent,
CommentsOnLocalityDialogComponent,
@ -180,8 +180,8 @@ entryComponents: [
PdTypeDialogComponent,
PdLocationApproachDialogComponent,
PdAllocationTypeDialogComponent,
PdStatusDialogComponent,
//EntityTypeDialogComponent,
// PdStatusDialogComponent,
// EntityTypeDialogComponent,
LenderHierarchyDialogComponent,
CommentsOnLocalityDialogComponent,
DesignationDialogComponent,