master detail active and Inactive changes
This commit is contained in:
parent
17a78672a1
commit
bbb45f197f
@ -74,38 +74,28 @@ export class BranchDialogComponent implements OnInit {
|
|||||||
|
|
||||||
//Add BRANCH data with help Service File
|
//Add BRANCH data with help Service File
|
||||||
this._mastersService.addMasterDetails(BranchFormValues,'BRANCH').subscribe(
|
this._mastersService.addMasterDetails(BranchFormValues,'BRANCH').subscribe(
|
||||||
dataresult=>{ if (dataresult.status == 200) {
|
dataresult=>{
|
||||||
console.log(dataresult);
|
if (dataresult.dataStatus == true){
|
||||||
alert("sample alert for Saving");
|
this.dialogRef.close();//After Saving the BRANCH data then popup close
|
||||||
|
alert("Data Saved Successfully");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
alert("Some Thing Wents Wrong Try Again !");
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//After Saving the BRANCH data then popup close
|
|
||||||
this.dialogRef.close();
|
|
||||||
//Need To Dispaly saving Datas
|
|
||||||
alert("Saved Successfully");
|
|
||||||
} else {
|
} else {
|
||||||
this._mastersService.editMasterDetails(BranchFormValues,'BRANCH').subscribe(
|
this._mastersService.editMasterDetails(BranchFormValues,'BRANCH').subscribe(
|
||||||
dataresult=>{ if (dataresult.status == 200) {
|
dataresult=>{
|
||||||
console.log(dataresult);
|
if (dataresult.dataStatus == true){
|
||||||
alert("sample alert for edited");
|
|
||||||
|
this.dialogRef.close();//After Editing the BRANCH data then popup close
|
||||||
|
alert("Data Edited Successfully");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
console.log("");
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
alert("Some Thing Wents Wrong Try Again !");
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
//After Editing the BRANCH data then popup close
|
|
||||||
this.dialogRef.close();
|
|
||||||
//Need To Display saving Datas
|
|
||||||
alert("Edit Successfully");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,27 +30,61 @@
|
|||||||
<mat-cell *matCellDef="let row">{{row.name}} </mat-cell>
|
<mat-cell *matCellDef="let row">{{row.name}} </mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container matColumnDef="cityname">
|
<ng-container matColumnDef="city_name">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> City Name </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> City Name </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"> {{row.cityname}} </mat-cell>
|
<mat-cell *matCellDef="let row"> {{row.city_name}} </mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container matColumnDef="isactive">
|
<!-- <ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<!--{{row.isactive}}-->
|
<!-{{row.isactive}}->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
<ng-template #notactive>
|
<ng-template #notactive>
|
||||||
<mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon>
|
<mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container> -->
|
||||||
|
|
||||||
<ng-container matColumnDef="actions">
|
<ng-container matColumnDef="actions">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editBranch(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button [color]="color" class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editBranch(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteBranch(row.branch_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteBranch(row.branch_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
|
</mat-cell>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container matColumnDef="isactive">
|
||||||
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveBranch(row.branch_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveBranch(row.branch_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
|
<!-- <mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
[color]="color"
|
||||||
|
[checked]="checked"
|
||||||
|
[disabled]="disabled"
|
||||||
|
(change)="changed(row.branch_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle> -->
|
||||||
|
<!-- <mat-slide-toggle (change)="changed()"> Slide me!</mat-slide-toggle> -->
|
||||||
|
<!-- <button mat-icon-button class="active" matTooltip="Active" matTooltipPosition="above" (click)="isactiveBranch(row.branch_id,row.isactive)" *ngIf="row.isactive == 1;else notactive;"><mat-icon>done</mat-icon></button>
|
||||||
|
<ng-template #notactive ><button mat-icon-button class="deactive" matTooltip="Inactive" matTooltipPosition="above" (click)="isactiveBranch(row.branch_id,row.isactive)"><mat-icon>clear</mat-icon></button></ng-template> -->
|
||||||
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="active" matTooltip="Active" matTooltipPosition="above" (click)="isactiveBranch(row.branch_id,row.isactive)"><mat-icon>done</mat-icon></button>
|
||||||
|
<button *ngIf="row.isactive == 0;" mat-icon-button class="deactive" matTooltip="Inactive" matTooltipPosition="above" (click)="isactiveBranch(row.branch_id,row.isactive)"><mat-icon>close</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -61,7 +95,7 @@
|
|||||||
|
|
||||||
<!-- <div *ngIf="dataSource.length === 0">No records found</div> -->
|
<!-- <div *ngIf="dataSource.length === 0">No records found</div> -->
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Selection styles
|
Selection styles
|
||||||
.example-selection-header {
|
.example-selection-header {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
background: rgba(255, 64, 129, 0.3);
|
background: rgba(255, 64, 129, 0.3);
|
||||||
@ -54,7 +54,7 @@
|
|||||||
.mat-table {
|
.mat-table {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
}*/
|
}
|
||||||
/*** Structure *
|
/*** Structure *
|
||||||
.example-container {
|
.example-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -69,33 +69,6 @@
|
|||||||
padding: 8px 24px 0;
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button{
|
|
||||||
padding-left: 6px;
|
|
||||||
font-size: 20px;
|
|
||||||
}**/
|
|
||||||
|
|
||||||
.example-container {
|
.example-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -107,6 +80,18 @@ padding-left: 6px;
|
|||||||
padding: 8px 24px 0;
|
padding: 8px 24px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// .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-form-field {
|
.mat-form-field {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -116,7 +101,6 @@ padding-left: 6px;
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nocontent {
|
.nocontent {
|
||||||
color: red;
|
color: red;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
@ -126,3 +110,36 @@ padding-left: 6px;
|
|||||||
// max-height: 56px;
|
// max-height: 56px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
// mat-cell{
|
||||||
|
// display:flex !important;
|
||||||
|
// justify-content:center!important;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// mat-header-cell {
|
||||||
|
// display:flex;
|
||||||
|
// justify-content:center;
|
||||||
|
// }
|
||||||
|
|
||||||
|
.example-h2 {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.example-section {
|
||||||
|
display: flex;
|
||||||
|
align-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|||||||
@ -3,8 +3,6 @@ import { Component,
|
|||||||
ViewChild } from '@angular/core';
|
ViewChild } from '@angular/core';
|
||||||
|
|
||||||
import { MatDialog,
|
import { MatDialog,
|
||||||
MatDialogRef,
|
|
||||||
MatDialogConfig,
|
|
||||||
MatPaginator,
|
MatPaginator,
|
||||||
MatSort,
|
MatSort,
|
||||||
MatTableDataSource } from '@angular/material';
|
MatTableDataSource } from '@angular/material';
|
||||||
@ -31,11 +29,17 @@ export class BranchListComponent implements OnInit {
|
|||||||
BranchList: any = [];
|
BranchList: any = [];
|
||||||
userData = null;
|
userData = null;
|
||||||
|
|
||||||
|
//color = 'primary';
|
||||||
|
// changed(id: number,isactive : number) {
|
||||||
|
// console.log('Id',id);
|
||||||
|
// console.log('Isactive',isactive)
|
||||||
|
// }
|
||||||
|
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
|
|
||||||
//displayedColumns = ['SerialNo','BranchName','CityName', 'IsActive','Actions'];
|
//displayedColumns = ['SerialNo','BranchName','CityName', 'IsActive','Actions'];
|
||||||
displayedColumns = ['serialno','name','cityname','isactive','actions'];
|
displayedColumns = ['serialno','name','city_name','actions','isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -51,7 +55,7 @@ export class BranchListComponent implements OnInit {
|
|||||||
getBranch(){
|
getBranch(){
|
||||||
this._mastersService.getAllBranch()
|
this._mastersService.getAllBranch()
|
||||||
.subscribe(dataresult => {
|
.subscribe(dataresult => {
|
||||||
if(dataresult.status === 200){
|
if(dataresult.dataStatus == true){
|
||||||
this.noRecordFound = false;
|
this.noRecordFound = false;
|
||||||
this.userData = dataresult.records;
|
this.userData = dataresult.records;
|
||||||
this.dataLength = dataresult.records.length;
|
this.dataLength = dataresult.records.length;
|
||||||
@ -93,14 +97,38 @@ export class BranchListComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** To delete Branch Datas */
|
/** For delete Branch Datas which means Inactive Only */
|
||||||
deleteBranch(id: number) {
|
deleteBranch(id: number) {
|
||||||
var PrimaryKeyWithValue ={'branch_id':id};
|
var PrimaryKeyWithValue ={'branch_id':id};
|
||||||
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'BRANCH')
|
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'BRANCH')
|
||||||
.subscribe(dataresult=>{});
|
.subscribe(dataresult=>{
|
||||||
alert('Deleted');
|
if (dataresult.dataStatus == true){
|
||||||
this.getBranch();
|
this.getBranch();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** For Changing active States which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveBranch(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'branch_id':id,'isactive': '1'}
|
||||||
|
: { 'branch_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._mastersService.editMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getBranch();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** Common Imports */
|
||||||
import { Component,
|
import { Component,
|
||||||
OnInit,
|
OnInit,
|
||||||
Inject } from '@angular/core';
|
Inject } from '@angular/core';
|
||||||
@ -40,6 +41,7 @@ export class CityDialogComponent implements OnInit {
|
|||||||
fk_state_id: [this.data.fk_state_id, Validators.compose([Validators.required])]
|
fk_state_id: [this.data.fk_state_id, Validators.compose([Validators.required])]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/** For Drop Datas*/
|
||||||
this._mastersService.getAllMasterData('STATE')
|
this._mastersService.getAllMasterData('STATE')
|
||||||
.subscribe(
|
.subscribe(
|
||||||
dataresult => {
|
dataresult => {
|
||||||
@ -76,19 +78,33 @@ export class CityDialogComponent implements OnInit {
|
|||||||
//To Remove The "Null" With Key also
|
//To Remove The "Null" With Key also
|
||||||
Object.keys(CityFormValues).forEach((key) => ( CityFormValues[key] == null) && delete CityFormValues[key]);
|
Object.keys(CityFormValues).forEach((key) => ( CityFormValues[key] == null) && delete CityFormValues[key]);
|
||||||
|
|
||||||
this._mastersService.addMasterDetails(CityFormValues,'CITY').subscribe();
|
this._mastersService.addMasterDetails(CityFormValues,'CITY').subscribe(
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
this.dialogRef.close();//After Saving the City data then popup close
|
||||||
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
//After Saving the CITY data then popup close
|
|
||||||
this.dialogRef.close();
|
|
||||||
//Need To Display saving Datas
|
|
||||||
alert("Saved Successfully");
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this._mastersService.editMasterDetails(CityFormValues,'CITY').subscribe();
|
this._mastersService.editMasterDetails(CityFormValues,'CITY').subscribe(
|
||||||
//After Editing the BRANCH data then popup close
|
dataresult=>{
|
||||||
this.dialogRef.close();
|
if (dataresult.dataStatus == true){
|
||||||
//Need To Dispaly saving Datas
|
|
||||||
alert("Edited Successfully");
|
this.dialogRef.close();//After Editing the City data then popup close
|
||||||
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,3 +113,4 @@ export class CityDialogComponent implements OnInit {
|
|||||||
this._cityForm.reset();
|
this._cityForm.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** End Of CityDialogComponent */
|
||||||
@ -71,6 +71,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br>-->
|
<br>-->
|
||||||
|
|
||||||
<div *ngIf="!noRecordFound" class="example-container mat-elevation-z8">
|
<div *ngIf="!noRecordFound" class="example-container mat-elevation-z8">
|
||||||
<div class="example-header">
|
<div class="example-header">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
@ -80,7 +81,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<mat-table [dataSource]="dataSource" matSort >
|
<mat-table [dataSource]="dataSource" matSort>
|
||||||
|
|
||||||
<ng-container matColumnDef="serialno">
|
<ng-container matColumnDef="serialno">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||||
@ -97,19 +98,50 @@
|
|||||||
<mat-cell *matCellDef="let row"> {{row.state_name}} </mat-cell>
|
<mat-cell *matCellDef="let row"> {{row.state_name}} </mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container matColumnDef="isactive">
|
<!--<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container matColumnDef="isactive">
|
||||||
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
|
<mat-cell *matCellDef="let row"><!-{{row.isactive}}->
|
||||||
|
<button *ngIf="row.isactive == 1;" mat-icon-button class="active" matTooltip="Active" matTooltipPosition="above" (click)="isactiveBranch(row.city_id,row.isactive)"><mat-icon>done</mat-icon></button>
|
||||||
|
<button *ngIf="row.isactive == 0;" mat-icon-button class="deactive" matTooltip="Inactive" matTooltipPosition="above" (click)="isactiveBranch(row.city_id,row.isactive)"><mat-icon>close</mat-icon></button>
|
||||||
|
</mat-cell>
|
||||||
|
</ng-container> -->
|
||||||
|
|
||||||
<ng-container matColumnDef="actions">
|
<ng-container matColumnDef="actions">
|
||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCity(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCity(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteCity(row.city_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteCity(row.city_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
|
</mat-cell>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container matColumnDef="isactive">
|
||||||
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveCity(row.city_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveCity(row.city_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
|
<!-- <button mat-icon-button class="active" matTooltip="Active" matTooltipPosition="above" (click)="isactiveCity(row.city_id,row.isactive)" *ngIf="row.isactive == 1;else notactive;"><mat-icon>done</mat-icon></button>
|
||||||
|
<ng-template #notactive><button mat-icon-button class="deactive" matTooltip="Inactive" matTooltipPosition="above" (click)="isactiveCity(row.city_id,row.isactive)"><mat-icon>clear</mat-icon></button></ng-template> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -118,7 +150,9 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div> -->
|
<!-- <div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div> -->
|
||||||
|
|||||||
@ -94,3 +94,14 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|||||||
@ -2,14 +2,10 @@ import { Component,
|
|||||||
OnInit,
|
OnInit,
|
||||||
ViewChild } from '@angular/core';
|
ViewChild } from '@angular/core';
|
||||||
import { MatDialog,
|
import { MatDialog,
|
||||||
MatDialogRef,
|
|
||||||
MatDialogConfig,
|
|
||||||
MatPaginator,
|
MatPaginator,
|
||||||
MatSort,
|
MatSort,
|
||||||
MatTableDataSource } from '@angular/material';
|
MatTableDataSource } from '@angular/material';
|
||||||
|
|
||||||
import { Observable } from 'rxjs';
|
|
||||||
|
|
||||||
import 'rxjs/add/operator/map';
|
import 'rxjs/add/operator/map';
|
||||||
/** Service */
|
/** Service */
|
||||||
import { MastersService } from '../../../../service/masters/masters.service';
|
import { MastersService } from '../../../../service/masters/masters.service';
|
||||||
@ -23,6 +19,7 @@ import { City } from '../../../model/city';
|
|||||||
templateUrl: './city-list.component.html',
|
templateUrl: './city-list.component.html',
|
||||||
styleUrls: ['./city-list.component.scss']
|
styleUrls: ['./city-list.component.scss']
|
||||||
})
|
})
|
||||||
|
|
||||||
export class CityListComponent implements OnInit {
|
export class CityListComponent implements OnInit {
|
||||||
|
|
||||||
isPopupOpened: boolean = true;
|
isPopupOpened: boolean = true;
|
||||||
@ -36,7 +33,7 @@ export class CityListComponent implements OnInit {
|
|||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
|
|
||||||
//displayedColumns = ['SerialNo','CityName','StateName', 'IsActive','Actions'];
|
//displayedColumns = ['SerialNo','CityName','StateName', 'IsActive','Actions'];
|
||||||
displayedColumns = ['serialno','name','state_name','isactive','actions'];
|
displayedColumns = ['serialno','name','state_name','actions','isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -52,7 +49,7 @@ export class CityListComponent implements OnInit {
|
|||||||
getCity() {
|
getCity() {
|
||||||
this._mastersService.getAllCity().subscribe(
|
this._mastersService.getAllCity().subscribe(
|
||||||
dataresult => {
|
dataresult => {
|
||||||
if(dataresult.status === 200){
|
if(dataresult.dataStatus == true){
|
||||||
this.noRecordFound = false;
|
this.noRecordFound = false;
|
||||||
this.userData = dataresult.records;
|
this.userData = dataresult.records;
|
||||||
this.dataLength = dataresult.records.length;
|
this.dataLength = dataresult.records.length;
|
||||||
@ -96,7 +93,7 @@ export class CityListComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** To delete City Datas */
|
/** For delete City Datas which means Inactive Only */
|
||||||
deleteCity(id: number) {
|
deleteCity(id: number) {
|
||||||
var PrimaryKeyWithValue ={'city_id':id};
|
var PrimaryKeyWithValue ={'city_id':id};
|
||||||
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'CITY')
|
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'CITY')
|
||||||
@ -106,6 +103,26 @@ export class CityListComponent implements OnInit {
|
|||||||
this.getCity();
|
this.getCity();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveCity(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'city_id':id,'isactive': '1'}
|
||||||
|
: { 'city_id':id,'isactive': '0'};
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'CITY')
|
||||||
|
this._mastersService.editMasterDetails(ActiveDatas,'CITY')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
this.getCity();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.dataSource.paginator = this.paginator;
|
this.dataSource.paginator = this.paginator;
|
||||||
@ -120,3 +137,4 @@ export class CityListComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/** End of CityListComponent */
|
||||||
@ -16,9 +16,8 @@
|
|||||||
<div class="ml-xs mr-xs" style="width: 100%;"
|
<div class="ml-xs mr-xs" style="width: 100%;"
|
||||||
fxLayout="row"
|
fxLayout="row"
|
||||||
fxLayoutAlign="center">
|
fxLayoutAlign="center">
|
||||||
<h2 mat-dialog-title style="width: 30%;"> Comment On Locality </h2>
|
<h2 mat-dialog-title style="width: 70%;"> Comment On Locality </h2>
|
||||||
<div style="width: 40%;"></div>
|
<div style="width: 25%;text-align:right;">
|
||||||
<div style="width: 30%;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>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** Common Imports */
|
||||||
import { Component,
|
import { Component,
|
||||||
OnInit,
|
OnInit,
|
||||||
Inject } from '@angular/core';
|
Inject } from '@angular/core';
|
||||||
@ -46,21 +47,37 @@ export class CommentsOnLocalityDialogComponent implements OnInit {
|
|||||||
/** To Save/Edited Popup Data */
|
/** To Save/Edited Popup Data */
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
var CommentOnLocalityForm = this._CommentOnLocalityForm.value;
|
var CommentOnLocalityForm = this._CommentOnLocalityForm.value;
|
||||||
if(isNaN(this.data.comments_on_locality_id)) {
|
|
||||||
|
|
||||||
|
if(isNaN(this.data.comments_on_locality_id)) {
|
||||||
|
//To Remove The "Null" With Key also
|
||||||
Object.keys(CommentOnLocalityForm).forEach((key) => ( CommentOnLocalityForm[key] == null) && delete CommentOnLocalityForm[key]);
|
Object.keys(CommentOnLocalityForm).forEach((key) => ( CommentOnLocalityForm[key] == null) && delete CommentOnLocalityForm[key]);
|
||||||
|
|
||||||
//After Saving the Comment On Locality data then popup close
|
//After Saving the Comment On Locality data then popup close
|
||||||
this._mastersService.addMasterDetails(CommentOnLocalityForm,'COMMENTSONLOCALITY').subscribe();
|
this._mastersService.addMasterDetails(CommentOnLocalityForm,'COMMENTSONLOCALITY').subscribe(
|
||||||
this.dialogRef.close();
|
dataresult=>{
|
||||||
//Need To Dispaly saving Datas
|
if (dataresult.dataStatus == true){
|
||||||
alert("Saved Successfully");
|
this.dialogRef.close();//After Saving the City data then popup close
|
||||||
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this._mastersService.editMasterDetails(this._CommentOnLocalityForm.value,'COMMENTSONLOCALITY').subscribe();
|
this._mastersService.editMasterDetails(this._CommentOnLocalityForm.value,'COMMENTSONLOCALITY').subscribe(
|
||||||
//After Editing the Comment On Locality data then popup close
|
dataresult=>{
|
||||||
this.dialogRef.close();
|
if (dataresult.dataStatus == true){
|
||||||
//Need To Dispaly saving Datas
|
|
||||||
alert("Edited Successfully");
|
this.dialogRef.close();//After Editing the City data then popup close
|
||||||
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,3 +86,4 @@ export class CommentsOnLocalityDialogComponent implements OnInit {
|
|||||||
this._CommentOnLocalityForm.reset();
|
this._CommentOnLocalityForm.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** End Of Comment On Locality Component*/
|
||||||
@ -82,19 +82,40 @@
|
|||||||
<mat-cell *matCellDef="let row"> {{row.rating}} </mat-cell>
|
<mat-cell *matCellDef="let row"> {{row.rating}} </mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container matColumnDef="isactive">
|
<!-- <ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container> -->
|
||||||
|
|
||||||
<ng-container matColumnDef="actions">
|
<ng-container matColumnDef="actions">
|
||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCommentsOnLocality(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCommentsOnLocality(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteCommentsOnLocality(row.comments_on_locality_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteCommentsOnLocality(row.comments_on_locality_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
|
</mat-cell>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container matColumnDef="isactive">
|
||||||
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveCommentsOnLocality(row.comments_on_locality_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveCommentsOnLocality(row.comments_on_locality_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
|||||||
@ -116,3 +116,15 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ export class CommentsOnLocalityListComponent implements OnInit {
|
|||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
//displayedColumns = ['SerialNo','CommentsOnLocalityName', 'IsActive','Actions'];
|
//displayedColumns = ['SerialNo','CommentsOnLocalityName', 'IsActive','Actions'];
|
||||||
displayedColumns = ['serialno','rating','isactive','actions'];
|
displayedColumns = ['serialno','rating','actions','isactive'];
|
||||||
|
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ -50,11 +50,11 @@ export class CommentsOnLocalityListComponent implements OnInit {
|
|||||||
//To get data for listing
|
//To get data for listing
|
||||||
getCommentsOnLocality() {
|
getCommentsOnLocality() {
|
||||||
this._mastersService.getAllMasterData('COMMENTSONLOCALITY').subscribe(
|
this._mastersService.getAllMasterData('COMMENTSONLOCALITY').subscribe(
|
||||||
data => {
|
dataresult => {
|
||||||
if(data.status === 200){
|
if(dataresult.dataStatus == true){
|
||||||
this.noRecordFound = false;
|
this.noRecordFound = false;
|
||||||
this.userData = data.records;
|
this.userData = dataresult.records;
|
||||||
this.dataLength = data.records.length;
|
this.dataLength = dataresult.records.length;
|
||||||
this.dataSource.data = this.userData;
|
this.dataSource.data = this.userData;
|
||||||
}else{
|
}else{
|
||||||
this.noRecordFound = true;
|
this.noRecordFound = true;
|
||||||
@ -92,7 +92,7 @@ export class CommentsOnLocalityListComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** For delete Comments On Locality Datas which means Inactive Only */
|
||||||
deleteCommentsOnLocality(id: number) {
|
deleteCommentsOnLocality(id: number) {
|
||||||
var PrimaryKeyWithValue ={'comments_on_locality_id':id};
|
var PrimaryKeyWithValue ={'comments_on_locality_id':id};
|
||||||
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'COMMENTSONLOCALITY').subscribe(dataresult=>{
|
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'COMMENTSONLOCALITY').subscribe(dataresult=>{
|
||||||
@ -102,6 +102,26 @@ export class CommentsOnLocalityListComponent implements OnInit {
|
|||||||
//this._MastersService.deleteMasterDetails('',id,'');
|
//this._MastersService.deleteMasterDetails('',id,'');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** For Changing active Comments On Locality which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveCommentsOnLocality(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'comments_on_locality_id':id,'isactive': '1'}
|
||||||
|
: { 'comments_on_locality_id':id,'isactive': '0'};
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'CITY')
|
||||||
|
this._mastersService.editMasterDetails(ActiveDatas,'COMMENTSONLOCALITY')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
this.getCommentsOnLocality();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.dataSource.paginator = this.paginator;
|
this.dataSource.paginator = this.paginator;
|
||||||
|
|||||||
@ -103,7 +103,7 @@ export class CompanyDialogComponent implements OnInit {
|
|||||||
// if (this.files) {
|
// if (this.files) {
|
||||||
// this.data.logo = this.files;
|
// this.data.logo = this.files;
|
||||||
// }
|
// }
|
||||||
if(isNaN(this.data .company_id)) {
|
if(isNaN(this.data.company_id)) {
|
||||||
console.log(CompanyFormValue);
|
console.log(CompanyFormValue);
|
||||||
Object.keys(CompanyFormValue).forEach((key) => ( CompanyFormValue[key] == null) && delete CompanyFormValue[key]);
|
Object.keys(CompanyFormValue).forEach((key) => ( CompanyFormValue[key] == null) && delete CompanyFormValue[key]);
|
||||||
console.log(CompanyFormValue);
|
console.log(CompanyFormValue);
|
||||||
|
|||||||
@ -136,7 +136,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div> -->
|
<!-- <div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div> -->
|
||||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||||
|
|||||||
@ -18,11 +18,12 @@ import { DataSource } from '@angular/cdk/collections';
|
|||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { of as observableOf, merge } from 'rxjs';
|
import { of as observableOf, merge } from 'rxjs';
|
||||||
|
|
||||||
|
/** Service */
|
||||||
import { CompanyDialogComponent } from '../company-dialog/company-dialog.component';
|
|
||||||
import { Company } from '../../../model/company';
|
|
||||||
import { MastersService } from '../../../../service/masters/masters.service';
|
import { MastersService } from '../../../../service/masters/masters.service';
|
||||||
|
/** Dialog Component */
|
||||||
|
import { CompanyDialogComponent } from '../company-dialog/company-dialog.component';
|
||||||
|
/** Model */
|
||||||
|
import { Company } from '../../../model/company';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-company-list',
|
selector: 'app-company-list',
|
||||||
@ -62,7 +63,7 @@ export class CompanyListComponent implements OnInit {
|
|||||||
getCompany() {
|
getCompany() {
|
||||||
this._MastersService.getAllCompany().subscribe(
|
this._MastersService.getAllCompany().subscribe(
|
||||||
data => {
|
data => {
|
||||||
if(data.status === 200){
|
if(data.dataStatus == true){
|
||||||
this.noRecordFound = false;
|
this.noRecordFound = false;
|
||||||
this.userData = data.records;
|
this.userData = data.records;
|
||||||
this.dataLength = data.records.length;
|
this.dataLength = data.records.length;
|
||||||
@ -105,7 +106,7 @@ export class CompanyListComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** For delete Company Datas which means Inactive Only */
|
||||||
deleteCompany(id: number) {
|
deleteCompany(id: number) {
|
||||||
var PrimaryKeyWithValue ={'company_id':id};
|
var PrimaryKeyWithValue ={'company_id':id};
|
||||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'COMPANY').subscribe(result => {});
|
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'COMPANY').subscribe(result => {});
|
||||||
@ -125,3 +126,4 @@ export class CompanyListComponent implements OnInit {
|
|||||||
this.dataSource.filter = filterValue;
|
this.dataSource.filter = filterValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** End of CompanyListComponent */
|
||||||
@ -16,9 +16,8 @@
|
|||||||
<div class="ml-xs mr-xs" style="width: 100%;"
|
<div class="ml-xs mr-xs" style="width: 100%;"
|
||||||
fxLayout="row"
|
fxLayout="row"
|
||||||
fxLayoutAlign="center">
|
fxLayoutAlign="center">
|
||||||
<h2 mat-dialog-title style="width: 30%;"> Customer Behaviour </h2>
|
<h2 mat-dialog-title> Customer Behaviour </h2>
|
||||||
<div style="width: 40%;"></div>
|
<div style="text-align:right;">
|
||||||
<div style="width: 30%;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>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** Common Imports */
|
||||||
import { Component,
|
import { Component,
|
||||||
OnInit,
|
OnInit,
|
||||||
Inject } from '@angular/core';
|
Inject } from '@angular/core';
|
||||||
@ -49,36 +50,56 @@ export class CustomerBehaviourDialogComponent implements OnInit {
|
|||||||
// this.dialogRef.close();
|
// this.dialogRef.close();
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/** For Popup Close Button */
|
/** For Popup Close Button */
|
||||||
onNoClick(): void {
|
onNoClick(): void {
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
}
|
}
|
||||||
/** To Save/Edited Popup Data */
|
/** To Save/Edited Popup Data */
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
|
|
||||||
var CustomerBehaviourFormValues = this._customerBehaviourForm.value;
|
var CustomerBehaviourFormValues = this._customerBehaviourForm.value;
|
||||||
|
|
||||||
if(isNaN(this.data.customer_behaviour_id)) {
|
if(isNaN(this.data.customer_behaviour_id)) {
|
||||||
//To Remove The "Null" With Key also
|
//To Remove The "Null" With Key also
|
||||||
Object.keys(CustomerBehaviourFormValues).forEach((key) => ( CustomerBehaviourFormValues[key] == null) && delete CustomerBehaviourFormValues[key]);
|
Object.keys(CustomerBehaviourFormValues).forEach((key) => ( CustomerBehaviourFormValues[key] == null) && delete CustomerBehaviourFormValues[key]);
|
||||||
//console.log(CustomerBehaviourFormValues);
|
|
||||||
this._MastersService.addMasterDetails(CustomerBehaviourFormValues,'CUSTOMERBEHAVIOUR').subscribe();
|
//Add CustomerBehaviour data with help Service File
|
||||||
//After Saving the data then popup close
|
this._MastersService.addMasterDetails(CustomerBehaviourFormValues,'CUSTOMERBEHAVIOUR').subscribe(
|
||||||
this.dialogRef.close();
|
dataresult=>{
|
||||||
//Need To Dispaly saving Datas
|
if (dataresult.dataStatus == true){
|
||||||
alert("Saved Successfully");
|
this.dialogRef.close();//After Saving the data then popup close
|
||||||
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this._MastersService.editMasterDetails(this._customerBehaviourForm.value,'CUSTOMERBEHAVIOUR').subscribe();
|
this._MastersService.editMasterDetails(this._customerBehaviourForm.value,'CUSTOMERBEHAVIOUR').subscribe(
|
||||||
//After Editing the data then popup close
|
dataresult=>{
|
||||||
this.dialogRef.close();
|
if (dataresult.dataStatus == true){
|
||||||
//Need To Display saving Datas
|
|
||||||
alert("Edit Successfully");
|
this.dialogRef.close();//After Editing the City data then popup close
|
||||||
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//After Editing the data then popup close
|
||||||
|
// this.dialogRef.close();
|
||||||
|
//Need To Display saving Datas
|
||||||
|
// alert("Edit Successfully");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** To Reset Popup Data */
|
||||||
/** To Reset Popup Data */
|
|
||||||
onReset(){
|
onReset(){
|
||||||
this._customerBehaviourForm.reset();
|
this._customerBehaviourForm.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** End of CustomerBehaviour Component */
|
||||||
@ -81,19 +81,42 @@
|
|||||||
<mat-cell *matCellDef="let row"> {{row.description}} </mat-cell>
|
<mat-cell *matCellDef="let row"> {{row.description}} </mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container matColumnDef="isactive">
|
<!--<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>-->
|
||||||
|
|
||||||
<ng-container matColumnDef="actions">
|
<ng-container matColumnDef="actions">
|
||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCustomerBehaviour(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCustomerBehaviour(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteCustomerBehaviour(row.city_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteCustomerBehaviour(row.city_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
|
</mat-cell>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container matColumnDef="isactive">
|
||||||
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
|
<!-- <button mat-icon-button class="active" matTooltip="Active" matTooltipPosition="above" (click)="isactiveCustomerBehaviour(row.customer_behaviour_id,row.isactive)" *ngIf="row.isactive == 1;else notactive;"><mat-icon>done</mat-icon></button>
|
||||||
|
<ng-template #notactive><button mat-icon-button class="deactive" matTooltip="Inactive" matTooltipPosition="above" (click)="isactiveCustomerBehaviour(row.customer_behaviour_id,row.isactive)"><mat-icon>clear</mat-icon></button></ng-template> -->
|
||||||
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveCustomerBehaviour(row.customer_behaviour_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveCustomerBehaviour(row.customer_behaviour_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -102,7 +125,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||||
<!-- <div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div> -->
|
<!-- <div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div> -->
|
||||||
|
|||||||
@ -117,3 +117,14 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|||||||
@ -33,7 +33,7 @@ export class CustomerBehaviourListComponent implements OnInit {
|
|||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
|
|
||||||
displayedColumns = ['serialno','description', 'isactive','actions'];
|
displayedColumns = ['serialno','description','actions','isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -51,11 +51,11 @@ export class CustomerBehaviourListComponent implements OnInit {
|
|||||||
/** To get data for listing */
|
/** To get data for listing */
|
||||||
getCustomerBehaviour() {
|
getCustomerBehaviour() {
|
||||||
this._MastersService.getAllMasterData('CUSTOMERBEHAVIOUR').subscribe(
|
this._MastersService.getAllMasterData('CUSTOMERBEHAVIOUR').subscribe(
|
||||||
data => {
|
dataresult => {
|
||||||
if(data.status === 200){
|
if(dataresult.status === 200){
|
||||||
this.noRecordFound = false;
|
this.noRecordFound = false;
|
||||||
this.userData = data.records;
|
this.userData = dataresult.records;
|
||||||
this.dataLength = data.records.length;
|
this.dataLength = dataresult.records.length;
|
||||||
this.dataSource.data = this.userData;
|
this.dataSource.data = this.userData;
|
||||||
}else{
|
}else{
|
||||||
this.noRecordFound = true;
|
this.noRecordFound = true;
|
||||||
@ -102,6 +102,26 @@ export class CustomerBehaviourListComponent implements OnInit {
|
|||||||
this.getCustomerBehaviour();
|
this.getCustomerBehaviour();
|
||||||
//this._MastersService.deleteMasterDetails('customer_behaviour_id',id,'CUSTOMERBEHAVIOUR');
|
//this._MastersService.deleteMasterDetails('customer_behaviour_id',id,'CUSTOMERBEHAVIOUR');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveCustomerBehaviour(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'customer_behaviour_id':id,'isactive': '1'}
|
||||||
|
: { 'customer_behaviour_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._MastersService.editMasterDetails(ActiveDatas,'CUSTOMERBEHAVIOUR')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getCustomerBehaviour();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.dataSource.paginator = this.paginator;
|
this.dataSource.paginator = this.paginator;
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** Common Imports */
|
||||||
import { Component,
|
import { Component,
|
||||||
OnInit,
|
OnInit,
|
||||||
Inject } from '@angular/core';
|
Inject } from '@angular/core';
|
||||||
@ -57,23 +58,39 @@ export class CustomerSegmentDialogComponent implements OnInit {
|
|||||||
|
|
||||||
/** To Save/Edited Popup Data */
|
/** To Save/Edited Popup Data */
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
|
|
||||||
var CustomerSegmentFormValues = this._customerSegmentForm.value;
|
var CustomerSegmentFormValues = this._customerSegmentForm.value;
|
||||||
|
|
||||||
if(isNaN(this.data.customer_segment_id)) {
|
if(isNaN(this.data.customer_segment_id)) {
|
||||||
|
|
||||||
//To Remove The "Null" With Key also
|
//To Remove The "Null" With Key also
|
||||||
Object.keys(CustomerSegmentFormValues).forEach((key) => ( CustomerSegmentFormValues[key] == null) && delete CustomerSegmentFormValues[key]);
|
Object.keys(CustomerSegmentFormValues).forEach((key) => ( CustomerSegmentFormValues[key] == null) && delete CustomerSegmentFormValues[key]);
|
||||||
//console.log(CustomerSegmentFormValues);
|
|
||||||
this._MastersService.addMasterDetails(CustomerSegmentFormValues,'CUSTOMERSEGMENT').subscribe();
|
//Add BRANCH data with help Service File
|
||||||
//After Saving the data then popup close
|
this._MastersService.addMasterDetails(CustomerSegmentFormValues,'CUSTOMERSEGMENT').subscribe(
|
||||||
this.dialogRef.close();
|
dataresult=>{
|
||||||
//Need To Dispaly saving Datas
|
if (dataresult.dataStatus == true){
|
||||||
alert("Saved Successfully");
|
this.dialogRef.close();//After Saving the BRANCH data then popup close
|
||||||
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this._MastersService.editMasterDetails(this._customerSegmentForm.value,'CUSTOMERSEGMENT').subscribe();
|
this._MastersService.editMasterDetails(this._customerSegmentForm.value,'CUSTOMERSEGMENT').subscribe(
|
||||||
//After Editing the data then popup close
|
dataresult=>{
|
||||||
this.dialogRef.close();
|
if (dataresult.dataStatus == true){
|
||||||
//Need To Display saving Datas
|
|
||||||
alert("Edit Successfully");
|
this.dialogRef.close();//After Editing the BRANCH data then popup close
|
||||||
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,3 +100,4 @@ export class CustomerSegmentDialogComponent implements OnInit {
|
|||||||
this._customerSegmentForm.reset();
|
this._customerSegmentForm.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** End Of Customer Segment Component */
|
||||||
@ -86,28 +86,46 @@
|
|||||||
<mat-cell *matCellDef="let row"> {{row.name}} </mat-cell>
|
<mat-cell *matCellDef="let row"> {{row.name}} </mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container matColumnDef="isactive">
|
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
|
||||||
</mat-cell>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<ng-container matColumnDef="actions">
|
<ng-container matColumnDef="actions">
|
||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCustomerSegment(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editCustomerSegment(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteCustomerSegment(row.city_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteCustomerSegment(row.city_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
|
|
||||||
|
<ng-container matColumnDef="isactive">
|
||||||
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
|
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
|
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
|
||||||
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveCustomerSegment(row.customer_segment_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveCustomerSegment(row.customer_segment_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
|
</mat-cell>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
|
||||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||||
<mat-row *matRowDef="let row; columns: displayedColumns;">
|
<mat-row *matRowDef="let row; columns: displayedColumns;">
|
||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||||
|
|
||||||
|
|||||||
@ -117,3 +117,14 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@ export class CustomerSegmentListComponent implements OnInit {
|
|||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
// displayedColumns = ['SerialNo','BranchName','CityName', 'IsActive','Actions'];
|
// displayedColumns = ['SerialNo','BranchName','CityName', 'IsActive','Actions'];
|
||||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
displayedColumns = ['serialno','name','actions','isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -103,6 +103,26 @@ displayedColumns = ['serialno','name', 'isactive','actions'];
|
|||||||
this.getCustomerSegment();
|
this.getCustomerSegment();
|
||||||
//this._MastersService.deleteMasterDetails('customer_segment_id',id,'CUSTOMERSEGMENT');
|
//this._MastersService.deleteMasterDetails('customer_segment_id',id,'CUSTOMERSEGMENT');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveCustomerSegment(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'customer_segment_id':id,'isactive': '1'}
|
||||||
|
: { 'customer_segment_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._MastersService.editMasterDetails(ActiveDatas,'CUSTOMERSEGMENT')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getCustomerSegment();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.dataSource.paginator = this.paginator;
|
this.dataSource.paginator = this.paginator;
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** Common Imports */
|
||||||
import { Component,
|
import { Component,
|
||||||
OnInit,
|
OnInit,
|
||||||
Inject } from '@angular/core';
|
Inject } from '@angular/core';
|
||||||
@ -36,7 +37,6 @@ export class DesignationDialogComponent implements OnInit {
|
|||||||
name: [this.data.name, Validators.compose([Validators.required])],
|
name: [this.data.name, Validators.compose([Validators.required])],
|
||||||
short_name: [this.data.short_name, Validators.compose([Validators.required])]
|
short_name: [this.data.short_name, Validators.compose([Validators.required])]
|
||||||
});
|
});
|
||||||
//console.log(this._designationForm);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// onSubmit() {
|
// onSubmit() {
|
||||||
@ -57,21 +57,36 @@ export class DesignationDialogComponent implements OnInit {
|
|||||||
onSubmit() {
|
onSubmit() {
|
||||||
var DesignationFormValues = this._designationForm.value;
|
var DesignationFormValues = this._designationForm.value;
|
||||||
if(isNaN(this.data.designation_id)) {
|
if(isNaN(this.data.designation_id)) {
|
||||||
|
//To Remove The "Null" With Key
|
||||||
Object.keys(DesignationFormValues).forEach((key) => ( DesignationFormValues[key] == null) && delete DesignationFormValues[key]);
|
Object.keys(DesignationFormValues).forEach((key) => ( DesignationFormValues[key] == null) && delete DesignationFormValues[key]);
|
||||||
console.log(DesignationFormValues);
|
//Add Designation data with help Service File
|
||||||
this._MastersService.addMasterDetails(DesignationFormValues,'DESIGNATION').subscribe();
|
this._MastersService.addMasterDetails(DesignationFormValues,'DESIGNATION').subscribe(
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
//After Saving the data then popup close
|
//After Saving the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Dispaly saving Datas
|
||||||
alert("Saved Successfully");
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this._MastersService.editMasterDetails(this._designationForm.value,'DESIGNATION').subscribe();
|
this._MastersService.editMasterDetails(this._designationForm.value,'DESIGNATION').subscribe(
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
//After Editing the data then popup close
|
//After Editing the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Display saving Datas
|
//Need To Display saving Datas
|
||||||
alert("Edit Successfully");
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,3 +96,4 @@ export class DesignationDialogComponent implements OnInit {
|
|||||||
this._designationForm.reset();
|
this._designationForm.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** End Of Designation Component */
|
||||||
@ -89,8 +89,23 @@
|
|||||||
<ng-container matColumnDef="isactive">
|
<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
|
||||||
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveDesignation(row.designation_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveDesignation(row.designation_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -98,7 +113,7 @@
|
|||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editDesignation(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editDesignation(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteDesignation(row.designation_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteDesignation(row.designation_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -107,7 +122,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||||
|
|||||||
@ -118,3 +118,14 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
@ -33,7 +33,7 @@ export class DesignationListComponent implements OnInit {
|
|||||||
|
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
displayedColumns = ['serialno','name','actions','isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -99,6 +99,25 @@ export class DesignationListComponent implements OnInit {
|
|||||||
.subscribe( data => { });
|
.subscribe( data => { });
|
||||||
this.getDesignation();
|
this.getDesignation();
|
||||||
}
|
}
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveDesignation(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'designation_id':id,'isactive': '1'}
|
||||||
|
: { 'designation_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._MastersService.editMasterDetails(ActiveDatas,'DESIGNATION')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getDesignation();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.dataSource.paginator = this.paginator;
|
this.dataSource.paginator = this.paginator;
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** Common Imports */
|
||||||
import { Component,
|
import { Component,
|
||||||
OnInit,
|
OnInit,
|
||||||
Inject } from '@angular/core';
|
Inject } from '@angular/core';
|
||||||
@ -45,21 +46,33 @@ export class FrequencyDialogComponent implements OnInit {
|
|||||||
onSubmit() {
|
onSubmit() {
|
||||||
var FrequencyFormValues = this._frequencyForm.value;
|
var FrequencyFormValues = this._frequencyForm.value;
|
||||||
if(isNaN(this.data.frequency_id)) {
|
if(isNaN(this.data.frequency_id)) {
|
||||||
|
//To Remove The "Null" With Key
|
||||||
Object.keys(FrequencyFormValues).forEach((key) => ( FrequencyFormValues[key] == null) && delete FrequencyFormValues[key]);
|
Object.keys(FrequencyFormValues).forEach((key) => ( FrequencyFormValues[key] == null) && delete FrequencyFormValues[key]);
|
||||||
//console.log(FrequencyFormValues);
|
//Add Designation data with help Service File
|
||||||
this._MastersService.addMasterDetails(FrequencyFormValues,'FREQUENCY').subscribe();
|
this._MastersService.addMasterDetails(FrequencyFormValues,'FREQUENCY').subscribe( dataresult=>{
|
||||||
this.dialogRef.close();
|
if (dataresult.dataStatus == true){
|
||||||
//After Saving the BRANCH data then popup close
|
//After Saving the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Dispaly saving Datas
|
||||||
alert("Saved Successfully");
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this._MastersService.editMasterDetails( this._frequencyForm.value,'FREQUENCY').subscribe();
|
this._MastersService.editMasterDetails( this._frequencyForm.value,'FREQUENCY').subscribe(dataresult=>{
|
||||||
//After Editing the data then popup close
|
if (dataresult.dataStatus == true){
|
||||||
this.dialogRef.close();
|
//After Editing the data then popup close
|
||||||
//Need To Display saving Datas
|
this.dialogRef.close();
|
||||||
alert("Edit Successfully");
|
//Need To Display saving Datas
|
||||||
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,4 +91,4 @@ alert("Edit Successfully");
|
|||||||
this._frequencyForm.reset();
|
this._frequencyForm.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** End Of Frequency Component */
|
||||||
@ -98,8 +98,21 @@
|
|||||||
<ng-container matColumnDef="isactive">
|
<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveFrequency(row.frequency_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveFrequency(row.frequency_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -107,7 +120,7 @@
|
|||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editFrequency(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editFrequency(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteFrequency(row.frequency_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteFrequency(row.frequency_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -116,7 +129,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||||
|
|
||||||
|
|||||||
@ -147,3 +147,14 @@ th {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|||||||
@ -36,7 +36,7 @@ export class FrequencyListComponent implements OnInit {
|
|||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
// displayedColumns = ['SerialNo','BranchName','CityName', 'IsActive','Actions'];
|
// displayedColumns = ['SerialNo','BranchName','CityName', 'IsActive','Actions'];
|
||||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
displayedColumns = ['serialno','name','actions','isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -111,6 +111,25 @@ export class FrequencyListComponent implements OnInit {
|
|||||||
|
|
||||||
//this._MastersService.deleteMasterDetails('frequency_id',id,'FREQUENCY');
|
//this._MastersService.deleteMasterDetails('frequency_id',id,'FREQUENCY');
|
||||||
}
|
}
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveFrequency(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'frequency_id':id,'isactive': '1'}
|
||||||
|
: { 'frequency_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._MastersService.editMasterDetails(ActiveDatas,'FREQUENCY')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getFrequency();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.dataSource.paginator = this.paginator;
|
this.dataSource.paginator = this.paginator;
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
/** Common Imports */
|
||||||
import { Component,
|
import { Component,
|
||||||
OnInit,
|
OnInit,
|
||||||
Inject } from '@angular/core';
|
Inject } from '@angular/core';
|
||||||
@ -57,18 +58,35 @@ onNoClick(): void {
|
|||||||
var IndustryClassificationFormValues = this._IndustryClassificationForm.value;
|
var IndustryClassificationFormValues = this._IndustryClassificationForm.value;
|
||||||
|
|
||||||
if(isNaN(this.data.industry_classification_id)) {
|
if(isNaN(this.data.industry_classification_id)) {
|
||||||
|
//To Remove The "Null" With Key
|
||||||
Object.keys(IndustryClassificationFormValues).forEach((key) => (IndustryClassificationFormValues[key] == null) && delete IndustryClassificationFormValues[key]);
|
Object.keys(IndustryClassificationFormValues).forEach((key) => (IndustryClassificationFormValues[key] == null) && delete IndustryClassificationFormValues[key]);
|
||||||
// console.log(IndustryClassificationFormValues);
|
//Add Designation data with help Service File
|
||||||
this._contactService.addMasterDetails(IndustryClassificationFormValues,'INDUSTRYCLASSIFICATION').subscribe();
|
this._contactService.addMasterDetails(IndustryClassificationFormValues,'INDUSTRYCLASSIFICATION').subscribe(
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Saving the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Dispaly saving Datas
|
||||||
alert("Saved Successfully");
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this._contactService.editMasterDetails(this._IndustryClassificationForm.value,'INDUSTRYCLASSIFICATION').subscribe();
|
this._contactService.editMasterDetails(this._IndustryClassificationForm.value,'INDUSTRYCLASSIFICATION').subscribe(
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Editing the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Display saving Datas
|
//Need To Display saving Datas
|
||||||
alert("Edit Successfully");
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** To Reset Popup Data */
|
/** To Reset Popup Data */
|
||||||
@ -76,3 +94,4 @@ onNoClick(): void {
|
|||||||
this._IndustryClassificationForm.reset();
|
this._IndustryClassificationForm.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** End Of Industry Classification Dialog Component */
|
||||||
@ -29,8 +29,22 @@
|
|||||||
<ng-container matColumnDef="isactive">
|
<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
|
||||||
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveIndustryClassification(row.industry_classification_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')"></mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveIndustryClassification(row.industry_classification_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -38,7 +52,7 @@
|
|||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editIndustryClassification(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editIndustryClassification(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteIndustryClassification(row.industry_classification_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteIndustryClassification(row.industry_classification_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -47,7 +61,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div *ngIf="noRecordFound" class="example-container mat-elevation-z8">
|
<!-- <div *ngIf="noRecordFound" class="example-container mat-elevation-z8">
|
||||||
|
|||||||
@ -143,3 +143,14 @@ th {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|||||||
@ -41,7 +41,7 @@ export class IndustryClassificationListComponent implements OnInit {
|
|||||||
|
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
displayedColumns = ['serialno','name','actions','isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -119,6 +119,25 @@ export class IndustryClassificationListComponent implements OnInit {
|
|||||||
this.getIndustryClassification();
|
this.getIndustryClassification();
|
||||||
//this._IMService.deleteMasterDetails('industry_classification_id',id,'INDUSTRYCLASSIFICATION');
|
//this._IMService.deleteMasterDetails('industry_classification_id',id,'INDUSTRYCLASSIFICATION');
|
||||||
}
|
}
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveIndustryClassification(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'industry_classification_id':id,'isactive': '1'}
|
||||||
|
: { 'industry_classification_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._IMService.editMasterDetails(ActiveDatas,'INDUSTRYCLASSIFICATION')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getIndustryClassification();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
|
|||||||
@ -57,21 +57,39 @@ export class LenderHierarchyDialogComponent implements OnInit {
|
|||||||
onSubmit() {
|
onSubmit() {
|
||||||
var LenderHierarchyFormValues = this._lenderHierarchyForm.value;
|
var LenderHierarchyFormValues = this._lenderHierarchyForm.value;
|
||||||
if(isNaN(this.data.lender_hierarchy_id)) {
|
if(isNaN(this.data.lender_hierarchy_id)) {
|
||||||
|
//To Remove The "Null" With Key
|
||||||
Object.keys(LenderHierarchyFormValues).forEach((key) => ( LenderHierarchyFormValues[key] == null) && delete LenderHierarchyFormValues[key]);
|
Object.keys(LenderHierarchyFormValues).forEach((key) => ( LenderHierarchyFormValues[key] == null) && delete LenderHierarchyFormValues[key]);
|
||||||
console.log(LenderHierarchyFormValues);
|
//Add Designation data with help Service File
|
||||||
this._MastersService.addMasterDetails(LenderHierarchyFormValues,'LENDERHIERARCHY').subscribe();
|
this._MastersService.addMasterDetails(LenderHierarchyFormValues,'LENDERHIERARCHY').subscribe(
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Saving the data then popup close
|
||||||
|
this.dialogRef.close();
|
||||||
|
//Need To Dispaly saving Datas
|
||||||
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
//After Saving the data then popup close
|
//After Saving the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Dispaly saving Datas
|
||||||
alert("Saved Successfully");
|
alert("Saved Successfully");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this._MastersService.editMasterDetails(LenderHierarchyFormValues,'LENDERHIERARCHY').subscribe();
|
this._MastersService.editMasterDetails(LenderHierarchyFormValues,'LENDERHIERARCHY').subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
//After Editing the data then popup close
|
//After Editing the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Display saving Datas
|
//Need To Display saving Datas
|
||||||
alert("Edit Successfully");
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,3 +99,4 @@ export class LenderHierarchyDialogComponent implements OnInit {
|
|||||||
this._lenderHierarchyForm.reset();
|
this._lenderHierarchyForm.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** End of lender hierarchy Component*/
|
||||||
@ -88,8 +88,21 @@
|
|||||||
<ng-container matColumnDef="isactive">
|
<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveLenderHierarchy(row.lender_hierarchy_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveLenderHierarchy(row.lender_hierarchy_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -97,7 +110,7 @@
|
|||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editLenderHierarchy(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editLenderHierarchy(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteLenderHierarchy(row.lender_hierarchy_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteLenderHierarchy(row.lender_hierarchy_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -106,7 +119,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||||
|
|||||||
@ -118,4 +118,15 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ export class LenderHierarchyListComponent implements OnInit {
|
|||||||
|
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
displayedColumns = ['serialno','lender_hierarchy','isactive','actions'];
|
displayedColumns = ['serialno','lender_hierarchy','actions','isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -122,6 +122,25 @@ export class LenderHierarchyListComponent implements OnInit {
|
|||||||
this.getLenderHierarchy();
|
this.getLenderHierarchy();
|
||||||
//this._MastersService.deleteMasterDetails('lender_hierarchy_id',id,'LENDERHIERARCHY');
|
//this._MastersService.deleteMasterDetails('lender_hierarchy_id',id,'LENDERHIERARCHY');
|
||||||
}
|
}
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveLenderHierarchy(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'lender_hierarchy_id':id,'isactive': '1'}
|
||||||
|
: { 'lender_hierarchy_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._MastersService.editMasterDetails(ActiveDatas,'LENDERHIERARCHY')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getLenderHierarchy();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.dataSource.paginator = this.paginator;
|
this.dataSource.paginator = this.paginator;
|
||||||
|
|||||||
@ -45,20 +45,35 @@ export class MembersOccupationDialogComponent implements OnInit {
|
|||||||
onSubmit() {
|
onSubmit() {
|
||||||
var OccupationFormValues = this._occupationForm.value;
|
var OccupationFormValues = this._occupationForm.value;
|
||||||
if(isNaN(this.data.occupation_non_earning_member_id)) {
|
if(isNaN(this.data.occupation_non_earning_member_id)) {
|
||||||
|
//To Remove The "Null" With Key
|
||||||
Object.keys(OccupationFormValues).forEach((key) => ( OccupationFormValues[key] == null) && delete OccupationFormValues[key]);
|
Object.keys(OccupationFormValues).forEach((key) => ( OccupationFormValues[key] == null) && delete OccupationFormValues[key]);
|
||||||
console.log(OccupationFormValues);
|
|
||||||
this._memberService.addMasterDetails(OccupationFormValues,'OCCUPATIONMEMBERS').subscribe();
|
this._memberService.addMasterDetails(OccupationFormValues,'OCCUPATIONMEMBERS').subscribe(
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
//After Saving the data then popup close
|
//After Saving the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Dispaly saving Datas
|
||||||
alert("Saved Successfully");
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this._memberService.editMasterDetails(this._occupationForm.value,'OCCUPATIONMEMBERS').subscribe();
|
this._memberService.editMasterDetails(this._occupationForm.value,'OCCUPATIONMEMBERS').subscribe(
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
//After Editing the data then popup close
|
//After Editing the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Display saving Datas
|
//Need To Display saving Datas
|
||||||
alert("Edit Successfully");
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,3 +93,4 @@ export class MembersOccupationDialogComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** End Of Occupation Dialog Component */
|
||||||
@ -105,8 +105,23 @@
|
|||||||
<ng-container matColumnDef="isactive">
|
<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveMemberOccupations(row.occupation_non_earning_member_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveMemberOccupations(row.occupation_non_earning_member_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
|
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
|
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -114,7 +129,7 @@
|
|||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editMemberOccupation(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editMemberOccupation(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteMemberOccupation(row.occupation_non_earning_member_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteMemberOccupation(row.occupation_non_earning_member_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -123,7 +138,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||||
|
|
||||||
|
|||||||
@ -85,3 +85,14 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
@ -36,7 +36,7 @@ export class MembersOccupationListComponent implements OnInit {
|
|||||||
|
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
displayedColumns = ['serialno','name','actions', 'isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -125,6 +125,25 @@ export class MembersOccupationListComponent implements OnInit {
|
|||||||
this.getMemberOccupation();
|
this.getMemberOccupation();
|
||||||
//this._memberService.deleteMasterDetails('occupation_non_earning_member_id',id,'OCCUPATIONMEMBERS');
|
//this._memberService.deleteMasterDetails('occupation_non_earning_member_id',id,'OCCUPATIONMEMBERS');
|
||||||
}
|
}
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveMemberOccupations(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'occupation_non_earning_member_id':id,'isactive': '1'}
|
||||||
|
: { 'occupation_non_earning_member_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._memberService.editMasterDetails(ActiveDatas,'OCCUPATIONMEMBERS')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getMemberOccupation();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.dataSource.paginator = this.paginator;
|
this.dataSource.paginator = this.paginator;
|
||||||
|
|||||||
@ -113,7 +113,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||||
|
|
||||||
|
|||||||
@ -118,3 +118,11 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
@ -59,34 +59,42 @@ export class PdLocationApproachDialogComponent implements OnInit {
|
|||||||
|
|
||||||
Object.keys(pdLocationApproachFormValue).forEach((key) => ( pdLocationApproachFormValue[key] == null) && delete pdLocationApproachFormValue[key]);
|
Object.keys(pdLocationApproachFormValue).forEach((key) => ( pdLocationApproachFormValue[key] == null) && delete pdLocationApproachFormValue[key]);
|
||||||
|
|
||||||
this._MastersService.addMasterDetails(pdLocationApproachFormValue,'PDLOCATIONAPPROACH').subscribe();
|
this._MastersService.addMasterDetails(pdLocationApproachFormValue,'PDLOCATIONAPPROACH').subscribe(
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
//After Saving the data then popup close
|
//After Saving the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Dispaly saving Datas
|
||||||
alert("Saved Successfully");
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this._MastersService.editMasterDetails(pdLocationApproachFormValue,'PDLOCATIONAPPROACH').subscribe();
|
this._MastersService.editMasterDetails(pdLocationApproachFormValue,'PDLOCATIONAPPROACH').subscribe(
|
||||||
|
|
||||||
//After Saving the data then popup close
|
//After Saving the data then popup close
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Editing the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Display saving Datas
|
||||||
alert("Edited Successfully");
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** To Reset Popup Data */
|
||||||
onReset(){
|
onReset(){
|
||||||
this._pdLocationApproachForm.reset();
|
this._pdLocationApproachForm.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** End Of Pd Location DIalog COmponent */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -84,8 +84,23 @@
|
|||||||
<ng-container matColumnDef="isactive">
|
<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactivePdLocationApproach(row.pd_location_approach_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactivePdLocationApproach(row.pd_location_approach_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
|
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
|
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -93,7 +108,7 @@
|
|||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editPdLocationApproach(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editPdLocationApproach(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deletePdLocationApproach(row.pd_location_approach_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deletePdLocationApproach(row.pd_location_approach_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -102,7 +117,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||||
|
|||||||
@ -118,3 +118,14 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
@ -41,7 +41,7 @@ export class PdLocationApproachListComponent implements OnInit {
|
|||||||
noRecordFound: boolean = false;
|
noRecordFound: boolean = false;
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
displayedColumns = ['serialno','description','isactive','actions'];
|
displayedColumns = ['serialno','description','actions', 'isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -89,7 +89,6 @@ export class PdLocationApproachListComponent implements OnInit {
|
|||||||
this.isPopupOpened = false;
|
this.isPopupOpened = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//To get data for listing
|
//To get data for listing
|
||||||
getPdLocationApproach() {
|
getPdLocationApproach() {
|
||||||
this._MastersService.getAllMasterData('PDLOCATIONAPPROACH').subscribe(
|
this._MastersService.getAllMasterData('PDLOCATIONAPPROACH').subscribe(
|
||||||
@ -106,13 +105,34 @@ export class PdLocationApproachListComponent implements OnInit {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
deletePdLocationApproach(id: number) {
|
// deletePdLocationApproach(id: number) {
|
||||||
var PrimaryKeyWithValue ={'pd_allocation_type_id':id};
|
// var PrimaryKeyWithValue ={'pd_allocation_type_id':id};
|
||||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'PDLOCATIONAPPROACH').subscribe( data => { });
|
// this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'PDLOCATIONAPPROACH').subscribe( data => { });
|
||||||
|
// this.getPdLocationApproach();
|
||||||
|
// //this._MastersService.deleteMasterDetails('pd_allocation_type_id',id,'PDLOCATIONAPPROACH');
|
||||||
|
// }
|
||||||
|
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactivePdLocationApproach(id: number,isactive: number){
|
||||||
|
|
||||||
|
let pdLocationApproachFormValue = isactive == 0
|
||||||
|
? { 'pd_allocation_type_id':id,'isactive': '1'}
|
||||||
|
: { 'pd_allocation_type_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
//this._MastersService.editMasterDetails(ActiveDatas,'PDLOCATIONAPPROACH')
|
||||||
|
this._MastersService.editMasterDetails(pdLocationApproachFormValue,'PDLOCATIONAPPROACH')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
this.getPdLocationApproach();
|
this.getPdLocationApproach();
|
||||||
//this._MastersService.deleteMasterDetails('pd_allocation_type_id',id,'PDLOCATIONAPPROACH');
|
|
||||||
}
|
}
|
||||||
//sdffsadfasf
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.dataSource.paginator = this.paginator;
|
this.dataSource.paginator = this.paginator;
|
||||||
|
|||||||
@ -28,6 +28,7 @@ export class PdTypeDialogComponent implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
|
/** Pd Type Form Datas */
|
||||||
this._pdTypeForm = this._formBuilder.group({
|
this._pdTypeForm = this._formBuilder.group({
|
||||||
//branch_id: any; fk_city_id: any;pd_type_id, type_name, createdon, fk_createdby, updatedon, fk_updatedby, isactive
|
//branch_id: any; fk_city_id: any;pd_type_id, type_name, createdon, fk_createdby, updatedon, fk_updatedby, isactive
|
||||||
pd_type_id: [this.data.pd_type_id],
|
pd_type_id: [this.data.pd_type_id],
|
||||||
@ -57,18 +58,35 @@ export class PdTypeDialogComponent implements OnInit {
|
|||||||
|
|
||||||
Object.keys(PdTypeFormValues).forEach((key) => ( PdTypeFormValues[key] == null) && delete PdTypeFormValues[key]);
|
Object.keys(PdTypeFormValues).forEach((key) => ( PdTypeFormValues[key] == null) && delete PdTypeFormValues[key]);
|
||||||
//console.log(PdTypeFormValues);
|
//console.log(PdTypeFormValues);
|
||||||
this._pdTypeService.addMasterDetails(PdTypeFormValues,'PDTYPE').subscribe();
|
this._pdTypeService.addMasterDetails(PdTypeFormValues,'PDTYPE').subscribe(
|
||||||
|
//After Saving the data then popup close
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
//After Saving the data then popup close
|
//After Saving the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Dispaly saving Datas
|
||||||
alert("Saved Successfully");
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this._pdTypeService.editMasterDetails(PdTypeFormValues,'PDTYPE').subscribe();
|
this._pdTypeService.editMasterDetails(PdTypeFormValues,'PDTYPE').subscribe(
|
||||||
|
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
//After Editing the data then popup close
|
//After Editing the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Display saving Datas
|
||||||
alert("Saved Successfully");
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,3 +96,4 @@ export class PdTypeDialogComponent implements OnInit {
|
|||||||
this._pdTypeForm.reset();
|
this._pdTypeForm.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** End Of PD Type Dialog Component */
|
||||||
@ -83,8 +83,23 @@
|
|||||||
<ng-container matColumnDef="isactive">
|
<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
|
||||||
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactivePDType(row.pd_type_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactivePDType(row.pd_type_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -92,7 +107,7 @@
|
|||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editPDType(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editPDType(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deletePDType(row.pd_type_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deletePDType(row.pd_type_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -101,7 +116,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||||
|
|||||||
@ -119,3 +119,14 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
@ -34,7 +34,7 @@ export class PdTypeListComponent implements OnInit {
|
|||||||
|
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
displayedColumns = ['serialno','type_name', 'isactive','actions'];
|
displayedColumns = ['serialno','type_name','actions', 'isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -82,7 +82,6 @@ export class PdTypeListComponent implements OnInit {
|
|||||||
this.isPopupOpened = false;
|
this.isPopupOpened = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//To get data for listing
|
//To get data for listing
|
||||||
getPDType() {
|
getPDType() {
|
||||||
this._PDTypeService.getAllMasterData('PDTYPE').subscribe(
|
this._PDTypeService.getAllMasterData('PDTYPE').subscribe(
|
||||||
@ -106,6 +105,26 @@ export class PdTypeListComponent implements OnInit {
|
|||||||
this.getPDType();
|
this.getPDType();
|
||||||
//this._PDTypeService.deleteMasterDetails('pd_type_id',id,'PDTYPE');
|
//this._PDTypeService.deleteMasterDetails('pd_type_id',id,'PDTYPE');
|
||||||
}
|
}
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactivePDType(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'pd_type_id':id,'isactive': '1'}
|
||||||
|
: { 'pd_type_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._PDTypeService.editMasterDetails(ActiveDatas,'PDTYPE')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getPDType();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.dataSource.paginator = this.paginator;
|
this.dataSource.paginator = this.paginator;
|
||||||
|
|||||||
@ -52,18 +52,32 @@ export class ProductDialogComponent implements OnInit {
|
|||||||
//console.log(ProductFormValues);
|
//console.log(ProductFormValues);
|
||||||
//this._MastersService.addProductMaster(this._productMasterForm.value);
|
//this._MastersService.addProductMaster(this._productMasterForm.value);
|
||||||
//this._MastersService.addProd(this._productMasterForm.value).subscribe(data=>this.array=data);
|
//this._MastersService.addProd(this._productMasterForm.value).subscribe(data=>this.array=data);
|
||||||
this._MastersService.addMasterDetails(ProductFormValues,'PRODUCTS').subscribe();
|
this._MastersService.addMasterDetails(ProductFormValues,'PRODUCTS').subscribe(
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
//After Saving the data then popup close
|
//After Saving the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Dispaly saving Datas
|
||||||
alert("Saved Successfully");
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
//this._MastersService.editProductMaster(this._productMasterForm.value);
|
//this._MastersService.editProductMaster(this._productMasterForm.value);
|
||||||
this._MastersService.editMasterDetails(this._productMasterForm.value,'PRODUCTS').subscribe();
|
this._MastersService.editMasterDetails(this._productMasterForm.value,'PRODUCTS').subscribe( dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
//After Editing the data then popup close
|
//After Editing the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
|
//Need To Display saving Datas
|
||||||
alert("Edited Successfully");
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** To Reset Popup Data */
|
/** To Reset Popup Data */
|
||||||
@ -72,3 +86,4 @@ export class ProductDialogComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/** End Of Product Master Component*/
|
||||||
@ -32,8 +32,23 @@
|
|||||||
<ng-container matColumnDef="isactive">
|
<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon> -->
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
<!-- <ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
|
||||||
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveProductMaster(row.product_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveProductMaster(row.product_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -41,7 +56,7 @@
|
|||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editProductMaster(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editProductMaster(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteProductMaster(row.product_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteProductMaster(row.product_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -50,7 +65,8 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<!-- <mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator> -->
|
||||||
|
<mat-paginator [pageSizeOptions]="[5, 10, 15, 20, 25]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||||
|
|
||||||
|
|||||||
@ -118,3 +118,14 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
@ -33,7 +33,7 @@ export class ProductListComponent implements OnInit {
|
|||||||
|
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
displayedColumns = ['serialno','name','abbr', 'isactive','actions'];
|
displayedColumns = ['serialno','name','abbr','actions', 'isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -113,6 +113,25 @@ export class ProductListComponent implements OnInit {
|
|||||||
this.getProductMaster();
|
this.getProductMaster();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveProductMaster(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'product_id':id,'isactive': '1'}
|
||||||
|
: { 'product_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._ProductService.editMasterDetails(ActiveDatas,'PRODUCTS')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getProductMaster();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
|
|||||||
@ -29,6 +29,7 @@ export class RegionsDialogComponent implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
|
/** Region Form Datas */
|
||||||
this._regionsForm = this._formBuilder.group({
|
this._regionsForm = this._formBuilder.group({
|
||||||
//Regions_id: any; fk_city_id: any;
|
//Regions_id: any; fk_city_id: any;
|
||||||
region_id: [this.data.region_id],
|
region_id: [this.data.region_id],
|
||||||
@ -58,22 +59,39 @@ onNoClick(): void {
|
|||||||
|
|
||||||
Object.keys(RegionFormValues).forEach((key) => ( RegionFormValues[key] == null) && delete RegionFormValues[key]);
|
Object.keys(RegionFormValues).forEach((key) => ( RegionFormValues[key] == null) && delete RegionFormValues[key]);
|
||||||
// console.log(RegionFormValues);
|
// console.log(RegionFormValues);
|
||||||
this._regionsService.addMasterDetails(RegionFormValues,'REGIONS').subscribe();
|
this._regionsService.addMasterDetails(RegionFormValues,'REGIONS').subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Saving the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Dispaly saving Datas
|
||||||
alert("Saved Successfully");
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this._regionsService.editMasterDetails(RegionFormValues,'REGIONS').subscribe();
|
this._regionsService.editMasterDetails(RegionFormValues,'REGIONS').subscribe(
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Editing the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Display saving Datas
|
//Need To Display saving Datas
|
||||||
alert("Edited Successfully");
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** To Reset Popup Data */
|
||||||
onReset(){
|
onReset(){
|
||||||
this._regionsForm.reset();
|
this._regionsForm.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**End Of Region Dialog Component*/
|
||||||
@ -86,8 +86,23 @@
|
|||||||
<ng-container matColumnDef="isactive">
|
<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
|
||||||
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveregions(row.regions_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveregions(row.regions_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -95,7 +110,7 @@
|
|||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editregions(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editregions(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteregions(row.regions_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteregions(row.regions_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -104,7 +119,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -119,3 +119,14 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
@ -35,7 +35,7 @@ export class RegionsListComponent implements OnInit {
|
|||||||
|
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
displayedColumns = ['serialno','name','actions', 'isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -81,6 +81,25 @@ this.getregions();
|
|||||||
this.isPopupOpened = false;
|
this.isPopupOpened = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveregions(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'region_id':id,'isactive': '1'}
|
||||||
|
: { 'region_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._regionsService.editMasterDetails(ActiveDatas,'REGIONS')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getregions();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//To get data for listing
|
//To get data for listing
|
||||||
getregions() {
|
getregions() {
|
||||||
|
|||||||
@ -31,6 +31,7 @@ export class RelationShipDialogComponent implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
|
/** RelationShip Form Datas */
|
||||||
this._relationShipForm = this._formBuilder.group({
|
this._relationShipForm = this._formBuilder.group({
|
||||||
relationship_id: [this.data.relationship_id],
|
relationship_id: [this.data.relationship_id],
|
||||||
name: [this.data.name, Validators.compose([Validators.required])]
|
name: [this.data.name, Validators.compose([Validators.required])]
|
||||||
@ -57,18 +58,36 @@ onNoClick(): void {
|
|||||||
onSubmit() {
|
onSubmit() {
|
||||||
var RelationshipFormValues = this._relationShipForm.value;
|
var RelationshipFormValues = this._relationShipForm.value;
|
||||||
if(isNaN(this.data.relationship_id)) {
|
if(isNaN(this.data.relationship_id)) {
|
||||||
|
//To Remove The "Null" With Key
|
||||||
Object.keys(RelationshipFormValues).forEach((key) => ( RelationshipFormValues[key] == null) && delete RelationshipFormValues[key]);
|
Object.keys(RelationshipFormValues).forEach((key) => ( RelationshipFormValues[key] == null) && delete RelationshipFormValues[key]);
|
||||||
console.log(RelationshipFormValues);
|
//Add data with help Service File
|
||||||
this._MastersService.addMasterDetails(RelationshipFormValues,'RELATIONSHIPS').subscribe();
|
this._MastersService.addMasterDetails(RelationshipFormValues,'RELATIONSHIPS').subscribe(
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Saving the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Dispaly saving Datas
|
||||||
alert("Saved Successfully");
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this._MastersService.editMasterDetails(this._relationShipForm.value,'RELATIONSHIPS').subscribe();
|
this._MastersService.editMasterDetails(this._relationShipForm.value,'RELATIONSHIPS').subscribe(
|
||||||
|
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Editing the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Display saving Datas
|
//Need To Display saving Datas
|
||||||
alert("Edited Successfully");
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,3 +96,4 @@ onNoClick(): void {
|
|||||||
this._relationShipForm.reset();
|
this._relationShipForm.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** End Of Relationship Dialog Component */
|
||||||
@ -105,8 +105,23 @@
|
|||||||
<ng-container matColumnDef="isactive">
|
<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
|
||||||
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveRelationShip(row.relationship_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveRelationShip(row.relationship_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -114,7 +129,7 @@
|
|||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editRelationShip(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editRelationShip(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteRelationShip(row.relationship_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteRelationShip(row.relationship_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -123,7 +138,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||||
|
|||||||
@ -144,3 +144,14 @@ th {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|||||||
@ -36,7 +36,7 @@ export class RelationShipListComponent implements OnInit {
|
|||||||
|
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
displayedColumns = ['serialno','name','actions', 'isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -90,6 +90,25 @@ export class RelationShipListComponent implements OnInit {
|
|||||||
this.isPopupOpened = false;
|
this.isPopupOpened = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveRelationShip(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'relationship_id':id,'isactive': '1'}
|
||||||
|
: { 'relationship_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._MastersService.editMasterDetails(ActiveDatas,'RELATIONSHIPS')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getRelationShip();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//To get data for listing
|
//To get data for listing
|
||||||
getRelationShip() {
|
getRelationShip() {
|
||||||
|
|||||||
@ -78,17 +78,33 @@ export class StatesDialogComponent implements OnInit {
|
|||||||
|
|
||||||
Object.keys(StatesFormValues).forEach((key) => ( StatesFormValues[key] == null) && delete StatesFormValues[key]);
|
Object.keys(StatesFormValues).forEach((key) => ( StatesFormValues[key] == null) && delete StatesFormValues[key]);
|
||||||
|
|
||||||
this._MastersService.addMasterDetails(StatesFormValues,'STATE').subscribe();
|
this._MastersService.addMasterDetails(StatesFormValues,'STATE').subscribe(
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Saving the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Dispaly saving Datas
|
||||||
alert("Saved Successfully");
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this._MastersService.editMasterDetails(StatesFormValues,'STATE').subscribe();
|
this._MastersService.editMasterDetails(StatesFormValues,'STATE').subscribe(
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
//After Editing the data then popup close
|
//After Editing the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Display saving Datas
|
//Need To Display saving Datas
|
||||||
alert("Edit Successfully");
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,3 +115,4 @@ export class StatesDialogComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** End Of State Dialog Component */
|
||||||
@ -129,8 +129,23 @@
|
|||||||
<ng-container matColumnDef="isactive">
|
<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
|
||||||
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveState(row.state_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveState(row.state_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -138,7 +153,7 @@
|
|||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editState(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editState(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteState(row.state_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteState(row.state_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -147,7 +162,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -119,3 +119,14 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.active:hover{
|
||||||
|
color: green;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.deactive:hover{
|
||||||
|
color: red;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
@ -38,7 +38,7 @@ export class StatesListComponent implements OnInit {
|
|||||||
|
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
displayedColumns = ['serialno','name','region_name', 'isactive','actions'];
|
displayedColumns = ['serialno','name','region_name','actions', 'isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -87,7 +87,25 @@ export class StatesListComponent implements OnInit {
|
|||||||
this.isPopupOpened = false;
|
this.isPopupOpened = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveState(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'state_id':id,'isactive': '1'}
|
||||||
|
: { 'state_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._statesService.editMasterDetails(ActiveDatas,'STATE')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getState();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
//To get data for listing
|
//To get data for listing
|
||||||
getState() {
|
getState() {
|
||||||
this._statesService.getAllState().subscribe(
|
this._statesService.getAllState().subscribe(
|
||||||
|
|||||||
@ -70,18 +70,36 @@ export class SubProductDialogComponent implements OnInit {
|
|||||||
onSubmit() {
|
onSubmit() {
|
||||||
var SubProductFormValues = this._subProductMasterForm.value;
|
var SubProductFormValues = this._subProductMasterForm.value;
|
||||||
if(isNaN(this.data.subproduct_id)) {
|
if(isNaN(this.data.subproduct_id)) {
|
||||||
|
//To Remove The "Null" With Key
|
||||||
Object.keys(SubProductFormValues).forEach((key) => ( SubProductFormValues[key] == null) && delete SubProductFormValues[key]);
|
Object.keys(SubProductFormValues).forEach((key) => ( SubProductFormValues[key] == null) && delete SubProductFormValues[key]);
|
||||||
console.log(SubProductFormValues);
|
|
||||||
this._MastersService.addMasterDetails(SubProductFormValues,'SUBPRODUCTS').subscribe();
|
this._MastersService.addMasterDetails(SubProductFormValues,'SUBPRODUCTS').subscribe(
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Saving the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Dispaly saving Datas
|
||||||
alert("Saved Successfully");
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this._MastersService.editMasterDetails(this._subProductMasterForm.value,'SUBPRODUCTS').subscribe();
|
this._MastersService.editMasterDetails(this._subProductMasterForm.value,'SUBPRODUCTS').subscribe(
|
||||||
|
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Editing the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Display saving Datas
|
//Need To Display saving Datas
|
||||||
alert("Edit Successfully");
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** To Reset Popup Data */
|
/** To Reset Popup Data */
|
||||||
@ -90,3 +108,4 @@ export class SubProductDialogComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/** End Of SubProductMaster Dialog Component */
|
||||||
@ -119,8 +119,23 @@
|
|||||||
<ng-container matColumnDef="isactive">
|
<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
|
||||||
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveSubProductMaster(row.subproduct_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveSubProductMaster(row.subproduct_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -128,7 +143,7 @@
|
|||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editSubProductMaster(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editSubProductMaster(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteSubProductMaster(row.subproduct_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteSubProductMaster(row.subproduct_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -137,7 +152,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||||
|
|||||||
@ -146,3 +146,6 @@ th {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
@ -35,7 +35,7 @@ export class SubProductListComponent implements OnInit {
|
|||||||
|
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
displayedColumns = ['serialno','product_name','name','isactive','actions'];
|
displayedColumns = ['serialno','product_name','name','actions','isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -120,6 +120,25 @@ getSubProductMaster() {
|
|||||||
this.getSubProductMaster();
|
this.getSubProductMaster();
|
||||||
//this._MastersService.deleteMasterDetails('subproduct_id',id,'SUBPRODUCTS');
|
//this._MastersService.deleteMasterDetails('subproduct_id',id,'SUBPRODUCTS');
|
||||||
}
|
}
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveSubProductMaster(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'subproduct_id':id,'isactive': '1'}
|
||||||
|
: { 'subproduct_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._MastersService.editMasterDetails(ActiveDatas,'SUBPRODUCTS')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getSubProductMaster();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.dataSource.paginator = this.paginator;
|
this.dataSource.paginator = this.paginator;
|
||||||
|
|||||||
@ -55,21 +55,37 @@ export class TitleDialogComponent implements OnInit {
|
|||||||
|
|
||||||
/** To Save/Edited Popup Data */
|
/** To Save/Edited Popup Data */
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
if(isNaN(this.data.title_id)) {
|
|
||||||
var TitleFormValues = this._titleForm.value;
|
var TitleFormValues = this._titleForm.value;
|
||||||
|
if(isNaN(this.data.title_id)) {
|
||||||
|
//To Remove The "Null" With Key
|
||||||
Object.keys(TitleFormValues).forEach((key) => ( TitleFormValues[key] == null) && delete TitleFormValues[key]);
|
Object.keys(TitleFormValues).forEach((key) => ( TitleFormValues[key] == null) && delete TitleFormValues[key]);
|
||||||
|
//Add Designation data with help Service File
|
||||||
this._MastersService.addMasterDetails(TitleFormValues,'TITLES').subscribe();
|
this._MastersService.addMasterDetails(TitleFormValues,'TITLES').subscribe(
|
||||||
//After Saving the BRANCH data then popup close
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Saving the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Dispaly saving Datas
|
||||||
alert("Saved Successfully");
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this._MastersService.editMasterDetails(this._titleForm.value,'TITLES').subscribe();
|
this._MastersService.editMasterDetails(this._titleForm.value,'TITLES').subscribe(
|
||||||
this.dialogRef.close();
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Editing the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Display saving Datas
|
//Need To Display saving Datas
|
||||||
alert("Edit Successfully");
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** To Reset Popup Data */
|
/** To Reset Popup Data */
|
||||||
@ -77,3 +93,4 @@ export class TitleDialogComponent implements OnInit {
|
|||||||
this._titleForm.reset();
|
this._titleForm.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** End Of Title Dialog Component */
|
||||||
@ -104,8 +104,23 @@
|
|||||||
<ng-container matColumnDef="isactive">
|
<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
|
||||||
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveTitle(row.title_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveTitle(row.title_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -113,7 +128,7 @@
|
|||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editTitle(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editTitle(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteTitle(row.title_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteTitle(row.title_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -122,7 +137,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||||
|
|||||||
@ -145,3 +145,6 @@ th {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
@ -33,7 +33,7 @@ export class TitleListComponent implements OnInit {
|
|||||||
|
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
displayedColumns = ['serialno','name','actions', 'isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -107,6 +107,25 @@ export class TitleListComponent implements OnInit {
|
|||||||
|
|
||||||
//this._MastersService.deleteMasterDetails('title_id',id,'TITLES');
|
//this._MastersService.deleteMasterDetails('title_id',id,'TITLES');
|
||||||
}
|
}
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveTitle(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'title_id':id,'isactive': '1'}
|
||||||
|
: { 'title_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._MastersService.editMasterDetails(ActiveDatas,'TITLES')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getTitle();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.dataSource.paginator = this.paginator;
|
this.dataSource.paginator = this.paginator;
|
||||||
|
|||||||
@ -32,6 +32,7 @@ export class ActivityDialogComponent implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
|
/** ActivityMaster Form Datas */
|
||||||
this._activityMasterForm = this._formBuilder.group({
|
this._activityMasterForm = this._formBuilder.group({
|
||||||
type_of_activity_id: [this.data.type_of_activity_id],
|
type_of_activity_id: [this.data.type_of_activity_id],
|
||||||
name: [this.data.name, Validators.compose([Validators.required])]
|
name: [this.data.name, Validators.compose([Validators.required])]
|
||||||
@ -48,21 +49,36 @@ onNoClick(): void {
|
|||||||
onSubmit() {
|
onSubmit() {
|
||||||
var ActivityFormValues = this._activityMasterForm.value;
|
var ActivityFormValues = this._activityMasterForm.value;
|
||||||
if(isNaN(this.data.type_of_activity_id)) {
|
if(isNaN(this.data.type_of_activity_id)) {
|
||||||
|
//To Remove The "Null" With Key
|
||||||
Object.keys(ActivityFormValues).forEach((key) => ( ActivityFormValues[key] == null) && delete ActivityFormValues[key]);
|
Object.keys(ActivityFormValues).forEach((key) => ( ActivityFormValues[key] == null) && delete ActivityFormValues[key]);
|
||||||
console.log(ActivityFormValues);
|
|
||||||
this._MastersService.addMasterDetails(ActivityFormValues,'TYPEOFACTIVITY').subscribe();
|
this._MastersService.addMasterDetails(ActivityFormValues,'TYPEOFACTIVITY').subscribe(
|
||||||
//After Saving the BRANCH data then popup close
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Saving the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Dispaly saving Datas
|
||||||
alert("Saved Successfully");
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this._MastersService.editMasterDetails(ActivityFormValues,'TYPEOFACTIVITY').subscribe();
|
this._MastersService.editMasterDetails(ActivityFormValues,'TYPEOFACTIVITY').subscribe(
|
||||||
//After Editing the BRANCH data then popup close
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Editing the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Display saving Datas
|
//Need To Display saving Datas
|
||||||
alert("Edited Successfully");
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,8 +91,9 @@ onSubmit() {
|
|||||||
// this.dialogRef.close();
|
// this.dialogRef.close();
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
/** To Reset Popup Data */
|
||||||
onReset(){
|
onReset(){
|
||||||
this._activityMasterForm.reset();
|
this._activityMasterForm.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** End Of Activit Dialog Component */
|
||||||
@ -97,8 +97,23 @@
|
|||||||
<ng-container matColumnDef="isactive">
|
<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
|
||||||
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveActivity(row.type_of_activity_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveActivity(row.type_of_activity_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -106,7 +121,7 @@
|
|||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editActivity(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editActivity(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteActivity(row.type_of_activity_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteActivity(row.type_of_activity_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -115,7 +130,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -144,3 +144,6 @@ th {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
@ -34,7 +34,7 @@ export class ActivityListComponent implements OnInit {
|
|||||||
noRecordFound: boolean = false;
|
noRecordFound: boolean = false;
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
displayedColumns = ['serialno','name','isactive','actions'];
|
displayedColumns = ['serialno','name','actions', 'isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -115,6 +115,25 @@ export class ActivityListComponent implements OnInit {
|
|||||||
this.getActivity();
|
this.getActivity();
|
||||||
//this._MastersService.deleteMasterDetails('type_of_activity_id',id,'TYPEOFACTIVITY').subscribe();
|
//this._MastersService.deleteMasterDetails('type_of_activity_id',id,'TYPEOFACTIVITY').subscribe();
|
||||||
}
|
}
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveActivity(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'type_of_activity_id':id,'isactive': '1'}
|
||||||
|
: { 'type_of_activity_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._MastersService.editMasterDetails(ActiveDatas,'TYPEOFACTIVITY')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getActivity();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
|
|||||||
@ -63,17 +63,34 @@ export class UomDialogComponent implements OnInit {
|
|||||||
|
|
||||||
Object.keys(UOMFormValues).forEach((key) => ( UOMFormValues[key] == null) && delete UOMFormValues[key]);
|
Object.keys(UOMFormValues).forEach((key) => ( UOMFormValues[key] == null) && delete UOMFormValues[key]);
|
||||||
console.log(UOMFormValues);
|
console.log(UOMFormValues);
|
||||||
this._mastersService.addMasterDetails(UOMFormValues,'UOM').subscribe();
|
this._mastersService.addMasterDetails(UOMFormValues,'UOM').subscribe(
|
||||||
//After Saving the BRANCH data then popup close
|
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Saving the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Dispaly saving Datas
|
//Need To Dispaly saving Datas
|
||||||
alert("Saved Successfully");
|
alert("Data Saved Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
this._mastersService.editMasterDetails(this._uomForm.value,'UOM').subscribe();
|
this._mastersService.editMasterDetails(this._uomForm.value,'UOM').subscribe(
|
||||||
//After Editing the BRANCH data then popup close
|
|
||||||
|
dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//After Editing the data then popup close
|
||||||
this.dialogRef.close();
|
this.dialogRef.close();
|
||||||
//Need To Display saving Datas
|
//Need To Display saving Datas
|
||||||
alert("Edit Successfully");
|
alert("Data Edited Successfully");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** To Reset Popup Data */
|
/** To Reset Popup Data */
|
||||||
@ -81,3 +98,4 @@ export class UomDialogComponent implements OnInit {
|
|||||||
this._uomForm.reset();
|
this._uomForm.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/** End of UOM dialog Component*/
|
||||||
@ -100,8 +100,23 @@
|
|||||||
<ng-container matColumnDef="isactive">
|
<ng-container matColumnDef="isactive">
|
||||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
<mat-cell *matCellDef="let row"><!--{{row.isactive}}-->
|
||||||
<mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
<!-- <mat-icon *ngIf="row.isactive == 1;else notactive;" class="hover-icon" matTooltip="Active" matTooltipPosition="above">done</mat-icon>
|
||||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template> -->
|
||||||
|
<mat-slide-toggle *ngIf="row.isactive == 1;else notactive;"
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Active" matTooltipPosition="above"
|
||||||
|
checked="true"
|
||||||
|
(change)="isactiveUOM(row.uom_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle>
|
||||||
|
<ng-template #notactive >
|
||||||
|
<mat-slide-toggle
|
||||||
|
class="example-margin"
|
||||||
|
matTooltip="Inactive" matTooltipPosition="above"
|
||||||
|
checked="false"
|
||||||
|
(change)="isactiveUOM(row.uom_id,row.isactive)"
|
||||||
|
onclick="return confirm('Are you sure?')">
|
||||||
|
</mat-slide-toggle></ng-template>
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -109,7 +124,7 @@
|
|||||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||||
<mat-cell *matCellDef="let row">
|
<mat-cell *matCellDef="let row">
|
||||||
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editUOM(row)"><mat-icon>edit</mat-icon></button>
|
<button mat-icon-button class="hover-icon" matTooltip="Edit" matTooltipPosition="above" (click)="editUOM(row)"><mat-icon>edit</mat-icon></button>
|
||||||
<button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteUOM(row.uom_id)"><mat-icon>delete_outline</mat-icon></button>
|
<!-- <button *ngIf="row.isactive == 1;" mat-icon-button class="hover-icon" matTooltip="Delete" matTooltipPosition="above" (click)="deleteUOM(row.uom_id)"><mat-icon>delete_outline</mat-icon></button> -->
|
||||||
</mat-cell>
|
</mat-cell>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
@ -118,7 +133,7 @@
|
|||||||
</mat-row>
|
</mat-row>
|
||||||
</mat-table>
|
</mat-table>
|
||||||
|
|
||||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
<div *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||||
|
|||||||
@ -143,3 +143,6 @@ th {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
.example-margin {
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
@ -40,7 +40,7 @@ export class UomListComponent implements OnInit {
|
|||||||
|
|
||||||
public dataLength: number;
|
public dataLength: number;
|
||||||
public dataSource = new MatTableDataSource();
|
public dataSource = new MatTableDataSource();
|
||||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
displayedColumns = ['serialno','name','actions', 'isactive'];
|
||||||
|
|
||||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||||
@ViewChild(MatSort) sort: MatSort;
|
@ViewChild(MatSort) sort: MatSort;
|
||||||
@ -130,6 +130,25 @@ export class UomListComponent implements OnInit {
|
|||||||
this.getUOM();
|
this.getUOM();
|
||||||
//this._MastersService.deleteMasterDetails('uom_id',id,'UOM');
|
//this._MastersService.deleteMasterDetails('uom_id',id,'UOM');
|
||||||
}
|
}
|
||||||
|
/** For Changing Active States., which means both Changing Active And Inactive alternatively */
|
||||||
|
isactiveUOM(id: number,isactive : number) {
|
||||||
|
|
||||||
|
let ActiveDatas = isactive == 0
|
||||||
|
? { 'uom_id':id,'isactive': '1'}
|
||||||
|
: { 'uom_id':id,'isactive': '0'}
|
||||||
|
|
||||||
|
//this._mastersService.IsactiveMasterDetails(ActiveDatas,'BRANCH')
|
||||||
|
this._MastersService.editMasterDetails(ActiveDatas,'UOM')
|
||||||
|
.subscribe(dataresult=>{
|
||||||
|
if (dataresult.dataStatus == true){
|
||||||
|
//alert("my check");
|
||||||
|
this.getUOM();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
alert("SomeThing Wents Wrong Try Again !");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
/** For Display Tables Pagination And Sorting */
|
/** For Display Tables Pagination And Sorting */
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
this.dataSource.paginator = this.paginator;
|
this.dataSource.paginator = this.paginator;
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import {
|
|||||||
MatDialogModule,
|
MatDialogModule,
|
||||||
MatProgressBarModule,MatToolbarModule,
|
MatProgressBarModule,MatToolbarModule,
|
||||||
MatTableModule,MatPaginatorModule,MatSortModule} from '@angular/material';
|
MatTableModule,MatPaginatorModule,MatSortModule} from '@angular/material';
|
||||||
|
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
|
||||||
|
|
||||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
|
|
||||||
@ -107,6 +108,7 @@ import { MastersService } from '../service/masters/masters.service';
|
|||||||
NgxMatSelectSearchModule,
|
NgxMatSelectSearchModule,
|
||||||
NgxDatatableModule,
|
NgxDatatableModule,
|
||||||
MatSortModule,
|
MatSortModule,
|
||||||
|
MatSlideToggleModule,
|
||||||
MatTooltipModule
|
MatTooltipModule
|
||||||
],
|
],
|
||||||
declarations: [MastersComponent,
|
declarations: [MastersComponent,
|
||||||
|
|||||||
@ -107,6 +107,22 @@ return this._http.post<any>(this.apiUrl+"saveMaster", ArrayData)
|
|||||||
// return data;
|
// return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IsactiveMasterDetails(Records:any,MasterName:string): Observable<any> {
|
||||||
|
console.log('FromServiceRecords',Records);
|
||||||
|
Records.fk_updatedby = this._aws.getlocale();//to get user id for who is update the record
|
||||||
|
Records.updatedon = currentdate;//to get Current date and Time for when the Record is updated
|
||||||
|
|
||||||
|
var ArrayData = { "master_name":MasterName,
|
||||||
|
"records": Records }
|
||||||
|
console.log('FromServiceArrayData',ArrayData);
|
||||||
|
return this._http.post<any>(this.apiUrl+"saveMaster", ArrayData)
|
||||||
|
.pipe(
|
||||||
|
catchError(this.handleError('role', []))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TO Get the Master Datas using API Call
|
* TO Get the Master Datas using API Call
|
||||||
* 1st argument is "TableName" :string - Table Name
|
* 1st argument is "TableName" :string - Table Name
|
||||||
@ -219,5 +235,4 @@ return this._http.post<any>(this.apiUrl+"saveMaster", ArrayData)
|
|||||||
return of(result as T);
|
return of(result as T);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
addCompanyDetails
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user