Merge branch 'master' of https://bitbucket.org/sriramv18/sparqsineedge
This commit is contained in:
commit
c6d86dd52e
@ -74,38 +74,28 @@ export class BranchDialogComponent implements OnInit {
|
||||
|
||||
//Add BRANCH data with help Service File
|
||||
this._mastersService.addMasterDetails(BranchFormValues,'BRANCH').subscribe(
|
||||
dataresult=>{ if (dataresult.status == 200) {
|
||||
console.log(dataresult);
|
||||
alert("sample alert for Saving");
|
||||
dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
this.dialogRef.close();//After Saving the BRANCH data then popup close
|
||||
alert("Data Saved Successfully");
|
||||
}
|
||||
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(
|
||||
dataresult=>{ if (dataresult.status == 200) {
|
||||
console.log(dataresult);
|
||||
alert("sample alert for edited");
|
||||
}
|
||||
else{
|
||||
console.log("");
|
||||
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");
|
||||
|
||||
dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
|
||||
this.dialogRef.close();//After Editing the BRANCH data then popup close
|
||||
alert("Data Edited Successfully");
|
||||
}
|
||||
else{
|
||||
alert("SomeThing Wents Wrong Try Again !");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -30,27 +30,61 @@
|
||||
<mat-cell *matCellDef="let row">{{row.name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="cityname">
|
||||
<ng-container matColumnDef="city_name">
|
||||
<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 matColumnDef="isactive">
|
||||
<!-- <ng-container matColumnDef="isactive">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Is Active </mat-header-cell>
|
||||
<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>
|
||||
<ng-template #notactive>
|
||||
<mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon>
|
||||
</ng-template>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
</ng-container> -->
|
||||
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header> Actions </mat-header-cell>
|
||||
<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 *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 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> -->
|
||||
</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>
|
||||
</ng-container>
|
||||
|
||||
@ -61,7 +95,7 @@
|
||||
|
||||
<!-- <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>
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/** Selection styles
|
||||
Selection styles
|
||||
.example-selection-header {
|
||||
font-size: 18px;
|
||||
background: rgba(255, 64, 129, 0.3);
|
||||
@ -54,7 +54,7 @@
|
||||
.mat-table {
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}*/
|
||||
}
|
||||
/*** Structure *
|
||||
.example-container {
|
||||
display: flex;
|
||||
@ -69,33 +69,6 @@
|
||||
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 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -107,6 +80,18 @@ padding-left: 6px;
|
||||
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 {
|
||||
font-size: 14px;
|
||||
width: 100%;
|
||||
@ -116,7 +101,6 @@ padding-left: 6px;
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.nocontent {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
@ -125,4 +109,37 @@ padding-left: 6px;
|
||||
// min-height: 56px;
|
||||
// max-height: 56px;
|
||||
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';
|
||||
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
@ -30,12 +28,18 @@ export class BranchListComponent implements OnInit {
|
||||
noRecordFound: boolean = false;
|
||||
BranchList: any = [];
|
||||
userData = null;
|
||||
|
||||
//color = 'primary';
|
||||
// changed(id: number,isactive : number) {
|
||||
// console.log('Id',id);
|
||||
// console.log('Isactive',isactive)
|
||||
// }
|
||||
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
|
||||
//displayedColumns = ['SerialNo','BranchName','CityName', 'IsActive','Actions'];
|
||||
displayedColumns = ['serialno','name','cityname','isactive','actions'];
|
||||
displayedColumns = ['serialno','name','city_name','actions','isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -51,7 +55,7 @@ export class BranchListComponent implements OnInit {
|
||||
getBranch(){
|
||||
this._mastersService.getAllBranch()
|
||||
.subscribe(dataresult => {
|
||||
if(dataresult.status === 200){
|
||||
if(dataresult.dataStatus == true){
|
||||
this.noRecordFound = false;
|
||||
this.userData = dataresult.records;
|
||||
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) {
|
||||
var PrimaryKeyWithValue ={'branch_id':id};
|
||||
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'BRANCH')
|
||||
.subscribe(dataresult=>{});
|
||||
alert('Deleted');
|
||||
this.getBranch();
|
||||
.subscribe(dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
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 */
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/** Common Imports */
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
@ -33,13 +34,14 @@ export class CityDialogComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
/** City Form Datas*/
|
||||
/** City Form Datas*/
|
||||
this._cityForm = this._formBuilder.group({
|
||||
city_id: [this.data.city_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])],
|
||||
fk_state_id: [this.data.fk_state_id, Validators.compose([Validators.required])]
|
||||
});
|
||||
|
||||
|
||||
/** For Drop Datas*/
|
||||
this._mastersService.getAllMasterData('STATE')
|
||||
.subscribe(
|
||||
dataresult => {
|
||||
@ -76,19 +78,33 @@ export class CityDialogComponent implements OnInit {
|
||||
//To Remove The "Null" With Key also
|
||||
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 {
|
||||
|
||||
this._mastersService.editMasterDetails(CityFormValues,'CITY').subscribe();
|
||||
//After Editing the BRANCH data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Edited Successfully");
|
||||
this._mastersService.editMasterDetails(CityFormValues,'CITY').subscribe(
|
||||
dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
|
||||
this.dialogRef.close();//After Editing the City data then popup close
|
||||
alert("Data Edited Successfully");
|
||||
}
|
||||
else{
|
||||
alert("SomeThing Wents Wrong Try Again !");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,4 +112,5 @@ export class CityDialogComponent implements OnInit {
|
||||
onReset(){
|
||||
this._cityForm.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
/** End Of CityDialogComponent */
|
||||
@ -71,6 +71,7 @@
|
||||
</div>
|
||||
|
||||
<br>-->
|
||||
|
||||
<div *ngIf="!noRecordFound" class="example-container mat-elevation-z8">
|
||||
<div class="example-header">
|
||||
<mat-form-field>
|
||||
@ -80,7 +81,7 @@
|
||||
|
||||
|
||||
|
||||
<mat-table [dataSource]="dataSource" matSort >
|
||||
<mat-table [dataSource]="dataSource" matSort>
|
||||
|
||||
<ng-container matColumnDef="serialno">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header>Sl </mat-header-cell>
|
||||
@ -97,28 +98,61 @@
|
||||
<mat-cell *matCellDef="let row"> {{row.state_name}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="isactive">
|
||||
<!--<ng-container matColumnDef="isactive">
|
||||
<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>
|
||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
||||
</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 *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">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;">
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div> -->
|
||||
|
||||
@ -93,4 +93,15 @@
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
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,
|
||||
ViewChild } from '@angular/core';
|
||||
import { MatDialog,
|
||||
MatDialogRef,
|
||||
MatDialogConfig,
|
||||
MatPaginator,
|
||||
MatSort,
|
||||
MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import 'rxjs/add/operator/map';
|
||||
/** Service */
|
||||
import { MastersService } from '../../../../service/masters/masters.service';
|
||||
@ -23,6 +19,7 @@ import { City } from '../../../model/city';
|
||||
templateUrl: './city-list.component.html',
|
||||
styleUrls: ['./city-list.component.scss']
|
||||
})
|
||||
|
||||
export class CityListComponent implements OnInit {
|
||||
|
||||
isPopupOpened: boolean = true;
|
||||
@ -36,7 +33,7 @@ export class CityListComponent implements OnInit {
|
||||
public dataSource = new MatTableDataSource();
|
||||
|
||||
//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(MatSort) sort: MatSort;
|
||||
@ -52,7 +49,7 @@ export class CityListComponent implements OnInit {
|
||||
getCity() {
|
||||
this._mastersService.getAllCity().subscribe(
|
||||
dataresult => {
|
||||
if(dataresult.status === 200){
|
||||
if(dataresult.dataStatus == true){
|
||||
this.noRecordFound = false;
|
||||
this.userData = dataresult.records;
|
||||
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) {
|
||||
var PrimaryKeyWithValue ={'city_id':id};
|
||||
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'CITY')
|
||||
@ -106,6 +103,26 @@ export class CityListComponent implements OnInit {
|
||||
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 */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
@ -119,4 +136,5 @@ export class CityListComponent implements OnInit {
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/** End of CityListComponent */
|
||||
@ -16,9 +16,8 @@
|
||||
<div class="ml-xs mr-xs" style="width: 100%;"
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="center">
|
||||
<h2 mat-dialog-title style="width: 30%;"> Comment On Locality </h2>
|
||||
<div style="width: 40%;"></div>
|
||||
<div style="width: 30%;text-align:right;">
|
||||
<h2 mat-dialog-title style="width: 70%;"> Comment On Locality </h2>
|
||||
<div style="width: 25%;text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/** Common Imports */
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
@ -46,21 +47,37 @@ export class CommentsOnLocalityDialogComponent implements OnInit {
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
var CommentOnLocalityForm = this._CommentOnLocalityForm.value;
|
||||
|
||||
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]);
|
||||
|
||||
//After Saving the Comment On Locality data then popup close
|
||||
this._mastersService.addMasterDetails(CommentOnLocalityForm,'COMMENTSONLOCALITY').subscribe();
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
this._mastersService.addMasterDetails(CommentOnLocalityForm,'COMMENTSONLOCALITY').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 !");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
this._mastersService.editMasterDetails(this._CommentOnLocalityForm.value,'COMMENTSONLOCALITY').subscribe();
|
||||
//After Editing the Comment On Locality data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Edited Successfully");
|
||||
this._mastersService.editMasterDetails(this._CommentOnLocalityForm.value,'COMMENTSONLOCALITY').subscribe(
|
||||
dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
|
||||
this.dialogRef.close();//After Editing the City data then popup close
|
||||
alert("Data Edited Successfully");
|
||||
}
|
||||
else{
|
||||
alert("SomeThing Wents Wrong Try Again !");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,4 +85,5 @@ export class CommentsOnLocalityDialogComponent implements OnInit {
|
||||
onReset(){
|
||||
this._CommentOnLocalityForm.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
/** End Of Comment On Locality Component*/
|
||||
@ -82,21 +82,42 @@
|
||||
<mat-cell *matCellDef="let row"> {{row.rating}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="isactive">
|
||||
<!-- <ng-container matColumnDef="isactive">
|
||||
<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>
|
||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
</ng-container> -->
|
||||
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;">
|
||||
|
||||
@ -115,4 +115,16 @@
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
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 dataSource = new MatTableDataSource();
|
||||
//displayedColumns = ['SerialNo','CommentsOnLocalityName', 'IsActive','Actions'];
|
||||
displayedColumns = ['serialno','rating','isactive','actions'];
|
||||
displayedColumns = ['serialno','rating','actions','isactive'];
|
||||
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ -50,11 +50,11 @@ export class CommentsOnLocalityListComponent implements OnInit {
|
||||
//To get data for listing
|
||||
getCommentsOnLocality() {
|
||||
this._mastersService.getAllMasterData('COMMENTSONLOCALITY').subscribe(
|
||||
data => {
|
||||
if(data.status === 200){
|
||||
dataresult => {
|
||||
if(dataresult.dataStatus == true){
|
||||
this.noRecordFound = false;
|
||||
this.userData = data.records;
|
||||
this.dataLength = data.records.length;
|
||||
this.userData = dataresult.records;
|
||||
this.dataLength = dataresult.records.length;
|
||||
this.dataSource.data = this.userData;
|
||||
}else{
|
||||
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) {
|
||||
var PrimaryKeyWithValue ={'comments_on_locality_id':id};
|
||||
this._mastersService.deleteMasterDetails(PrimaryKeyWithValue,'COMMENTSONLOCALITY').subscribe(dataresult=>{
|
||||
@ -102,6 +102,26 @@ export class CommentsOnLocalityListComponent implements OnInit {
|
||||
//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 */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
|
||||
@ -103,7 +103,7 @@ export class CompanyDialogComponent implements OnInit {
|
||||
// if (this.files) {
|
||||
// this.data.logo = this.files;
|
||||
// }
|
||||
if(isNaN(this.data .company_id)) {
|
||||
if(isNaN(this.data.company_id)) {
|
||||
console.log(CompanyFormValue);
|
||||
Object.keys(CompanyFormValue).forEach((key) => ( CompanyFormValue[key] == null) && delete CompanyFormValue[key]);
|
||||
console.log(CompanyFormValue);
|
||||
|
||||
@ -136,7 +136,7 @@
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" style="color: red; font-size: 16px;">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 { of as observableOf, merge } from 'rxjs';
|
||||
|
||||
|
||||
import { CompanyDialogComponent } from '../company-dialog/company-dialog.component';
|
||||
import { Company } from '../../../model/company';
|
||||
/** 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({
|
||||
selector: 'app-company-list',
|
||||
@ -62,7 +63,7 @@ export class CompanyListComponent implements OnInit {
|
||||
getCompany() {
|
||||
this._MastersService.getAllCompany().subscribe(
|
||||
data => {
|
||||
if(data.status === 200){
|
||||
if(data.dataStatus == true){
|
||||
this.noRecordFound = false;
|
||||
this.userData = data.records;
|
||||
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) {
|
||||
var PrimaryKeyWithValue ={'company_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'COMPANY').subscribe(result => {});
|
||||
@ -125,3 +126,4 @@ export class CompanyListComponent implements OnInit {
|
||||
this.dataSource.filter = filterValue;
|
||||
}
|
||||
}
|
||||
/** End of CompanyListComponent */
|
||||
@ -16,9 +16,8 @@
|
||||
<div class="ml-xs mr-xs" style="width: 100%;"
|
||||
fxLayout="row"
|
||||
fxLayoutAlign="center">
|
||||
<h2 mat-dialog-title style="width: 30%;"> Customer Behaviour </h2>
|
||||
<div style="width: 40%;"></div>
|
||||
<div style="width: 30%;text-align:right;">
|
||||
<h2 mat-dialog-title> Customer Behaviour </h2>
|
||||
<div style="text-align:right;">
|
||||
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" matTooltip="Close" matTooltipPosition="above" (click)="onNoClick()"><mat-icon>close</mat-icon></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/** Common Imports */
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
@ -49,36 +50,56 @@ export class CustomerBehaviourDialogComponent implements OnInit {
|
||||
// this.dialogRef.close();
|
||||
// }
|
||||
// }
|
||||
|
||||
/** For Popup Close Button */
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
|
||||
var CustomerBehaviourFormValues = this._customerBehaviourForm.value;
|
||||
|
||||
|
||||
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]);
|
||||
//console.log(CustomerBehaviourFormValues);
|
||||
this._MastersService.addMasterDetails(CustomerBehaviourFormValues,'CUSTOMERBEHAVIOUR').subscribe();
|
||||
//After Saving the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
|
||||
//Add CustomerBehaviour data with help Service File
|
||||
this._MastersService.addMasterDetails(CustomerBehaviourFormValues,'CUSTOMERBEHAVIOUR').subscribe(
|
||||
dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
this.dialogRef.close();//After Saving the data then popup close
|
||||
alert("Data Saved Successfully");
|
||||
}
|
||||
else{
|
||||
alert("SomeThing Wents Wrong Try Again !");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(this._customerBehaviourForm.value,'CUSTOMERBEHAVIOUR').subscribe();
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
this._MastersService.editMasterDetails(this._customerBehaviourForm.value,'CUSTOMERBEHAVIOUR').subscribe(
|
||||
dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
|
||||
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(){
|
||||
this._customerBehaviourForm.reset();
|
||||
}
|
||||
}
|
||||
/** End of CustomerBehaviour Component */
|
||||
@ -81,19 +81,42 @@
|
||||
<mat-cell *matCellDef="let row"> {{row.description}} </mat-cell>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="isactive">
|
||||
<!--<ng-container matColumnDef="isactive">
|
||||
<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>
|
||||
<ng-template #notactive ><mat-icon class="hover-icon" matTooltip="Inactive" matTooltipPosition="above">clear</mat-icon></ng-template>
|
||||
</mat-cell>
|
||||
</ng-container>
|
||||
</ng-container>-->
|
||||
|
||||
<ng-container matColumnDef="actions">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
@ -102,7 +125,7 @@
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
<!-- <div *ngIf="noRecordFound" style="color: red; font-size: 16px;">No records found</div> -->
|
||||
|
||||
@ -116,4 +116,15 @@
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
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 dataSource = new MatTableDataSource();
|
||||
|
||||
displayedColumns = ['serialno','description', 'isactive','actions'];
|
||||
displayedColumns = ['serialno','description','actions','isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -51,15 +51,15 @@ export class CustomerBehaviourListComponent implements OnInit {
|
||||
/** To get data for listing */
|
||||
getCustomerBehaviour() {
|
||||
this._MastersService.getAllMasterData('CUSTOMERBEHAVIOUR').subscribe(
|
||||
data => {
|
||||
if(data.status === 200){
|
||||
dataresult => {
|
||||
if(dataresult.status === 200){
|
||||
this.noRecordFound = false;
|
||||
this.userData = data.records;
|
||||
this.dataLength = data.records.length;
|
||||
this.userData = dataresult.records;
|
||||
this.dataLength = dataresult.records.length;
|
||||
this.dataSource.data = this.userData;
|
||||
}else{
|
||||
this.noRecordFound = true;
|
||||
this.dataLength = 0
|
||||
this.dataLength = 0
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -102,6 +102,26 @@ export class CustomerBehaviourListComponent implements OnInit {
|
||||
this.getCustomerBehaviour();
|
||||
//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 */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/** Common Imports */
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
@ -57,23 +58,39 @@ export class CustomerSegmentDialogComponent implements OnInit {
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
|
||||
var CustomerSegmentFormValues = this._customerSegmentForm.value;
|
||||
|
||||
if(isNaN(this.data.customer_segment_id)) {
|
||||
|
||||
//To Remove The "Null" With Key also
|
||||
Object.keys(CustomerSegmentFormValues).forEach((key) => ( CustomerSegmentFormValues[key] == null) && delete CustomerSegmentFormValues[key]);
|
||||
//console.log(CustomerSegmentFormValues);
|
||||
this._MastersService.addMasterDetails(CustomerSegmentFormValues,'CUSTOMERSEGMENT').subscribe();
|
||||
//After Saving the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
|
||||
//Add BRANCH data with help Service File
|
||||
this._MastersService.addMasterDetails(CustomerSegmentFormValues,'CUSTOMERSEGMENT').subscribe(
|
||||
dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
this.dialogRef.close();//After Saving the BRANCH data then popup close
|
||||
alert("Data Saved Successfully");
|
||||
}
|
||||
else{
|
||||
alert("SomeThing Wents Wrong Try Again !");
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(this._customerSegmentForm.value,'CUSTOMERSEGMENT').subscribe();
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
this._MastersService.editMasterDetails(this._customerSegmentForm.value,'CUSTOMERSEGMENT').subscribe(
|
||||
dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
/** End Of Customer Segment Component */
|
||||
@ -86,28 +86,46 @@
|
||||
<mat-cell *matCellDef="let row"> {{row.name}} </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-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">
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</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-row *matRowDef="let row; columns: displayedColumns;">
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
|
||||
@ -116,4 +116,15 @@
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
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 dataSource = new MatTableDataSource();
|
||||
// displayedColumns = ['SerialNo','BranchName','CityName', 'IsActive','Actions'];
|
||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
||||
displayedColumns = ['serialno','name','actions','isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -103,6 +103,26 @@ displayedColumns = ['serialno','name', 'isactive','actions'];
|
||||
this.getCustomerSegment();
|
||||
//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 */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/** Common Imports */
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
@ -36,7 +37,6 @@ export class DesignationDialogComponent implements OnInit {
|
||||
name: [this.data.name, Validators.compose([Validators.required])],
|
||||
short_name: [this.data.short_name, Validators.compose([Validators.required])]
|
||||
});
|
||||
//console.log(this._designationForm);
|
||||
}
|
||||
|
||||
// onSubmit() {
|
||||
@ -57,21 +57,36 @@ export class DesignationDialogComponent implements OnInit {
|
||||
onSubmit() {
|
||||
var DesignationFormValues = this._designationForm.value;
|
||||
if(isNaN(this.data.designation_id)) {
|
||||
|
||||
//To Remove The "Null" With Key
|
||||
Object.keys(DesignationFormValues).forEach((key) => ( DesignationFormValues[key] == null) && delete DesignationFormValues[key]);
|
||||
console.log(DesignationFormValues);
|
||||
this._MastersService.addMasterDetails(DesignationFormValues,'DESIGNATION').subscribe();
|
||||
//After Saving the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
//Add Designation data with help Service File
|
||||
this._MastersService.addMasterDetails(DesignationFormValues,'DESIGNATION').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 !");
|
||||
}
|
||||
|
||||
});
|
||||
} 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
|
||||
this.dialogRef.close();
|
||||
//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();
|
||||
}
|
||||
}
|
||||
/** End Of Designation Component */
|
||||
@ -89,8 +89,23 @@
|
||||
<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-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)="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>
|
||||
</ng-container>
|
||||
|
||||
@ -98,7 +113,7 @@
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
@ -107,7 +122,7 @@
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
@ -117,4 +117,15 @@
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
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 dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
||||
displayedColumns = ['serialno','name','actions','isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -99,6 +99,25 @@ export class DesignationListComponent implements OnInit {
|
||||
.subscribe( data => { });
|
||||
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 */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/** Common Imports */
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
@ -45,21 +46,33 @@ export class FrequencyDialogComponent implements OnInit {
|
||||
onSubmit() {
|
||||
var FrequencyFormValues = this._frequencyForm.value;
|
||||
if(isNaN(this.data.frequency_id)) {
|
||||
|
||||
//To Remove The "Null" With Key
|
||||
Object.keys(FrequencyFormValues).forEach((key) => ( FrequencyFormValues[key] == null) && delete FrequencyFormValues[key]);
|
||||
//console.log(FrequencyFormValues);
|
||||
this._MastersService.addMasterDetails(FrequencyFormValues,'FREQUENCY').subscribe();
|
||||
this.dialogRef.close();
|
||||
//After Saving the BRANCH data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
this._MastersService.editMasterDetails( this._frequencyForm.value,'FREQUENCY').subscribe();
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
//Add Designation data with help Service File
|
||||
this._MastersService.addMasterDetails(FrequencyFormValues,'FREQUENCY').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 !");
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
this._MastersService.editMasterDetails( this._frequencyForm.value,'FREQUENCY').subscribe(dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//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();
|
||||
}
|
||||
}
|
||||
|
||||
/** End Of Frequency Component */
|
||||
@ -98,8 +98,21 @@
|
||||
<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)="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>
|
||||
</ng-container>
|
||||
|
||||
@ -107,7 +120,7 @@
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
@ -116,7 +129,7 @@
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
|
||||
@ -147,3 +147,14 @@ th {
|
||||
font-size: 16px;
|
||||
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 dataSource = new MatTableDataSource();
|
||||
// displayedColumns = ['SerialNo','BranchName','CityName', 'IsActive','Actions'];
|
||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
||||
displayedColumns = ['serialno','name','actions','isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -111,6 +111,25 @@ export class FrequencyListComponent implements OnInit {
|
||||
|
||||
//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 */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
/** Common Imports */
|
||||
import { Component,
|
||||
OnInit,
|
||||
Inject } from '@angular/core';
|
||||
@ -57,18 +58,35 @@ onNoClick(): void {
|
||||
var IndustryClassificationFormValues = this._IndustryClassificationForm.value;
|
||||
|
||||
if(isNaN(this.data.industry_classification_id)) {
|
||||
|
||||
//To Remove The "Null" With Key
|
||||
Object.keys(IndustryClassificationFormValues).forEach((key) => (IndustryClassificationFormValues[key] == null) && delete IndustryClassificationFormValues[key]);
|
||||
// console.log(IndustryClassificationFormValues);
|
||||
this._contactService.addMasterDetails(IndustryClassificationFormValues,'INDUSTRYCLASSIFICATION').subscribe();
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
//Add Designation data with help Service File
|
||||
this._contactService.addMasterDetails(IndustryClassificationFormValues,'INDUSTRYCLASSIFICATION').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 !");
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
this._contactService.editMasterDetails(this._IndustryClassificationForm.value,'INDUSTRYCLASSIFICATION').subscribe();
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
this._contactService.editMasterDetails(this._IndustryClassificationForm.value,'INDUSTRYCLASSIFICATION').subscribe(
|
||||
dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Data Edited Successfully");
|
||||
}
|
||||
else{
|
||||
alert("SomeThing Wents Wrong Try Again !");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/** To Reset Popup Data */
|
||||
@ -76,3 +94,4 @@ onNoClick(): void {
|
||||
this._IndustryClassificationForm.reset();
|
||||
}
|
||||
}
|
||||
/** End Of Industry Classification Dialog Component */
|
||||
@ -29,8 +29,22 @@
|
||||
<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-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)="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>
|
||||
</ng-container>
|
||||
|
||||
@ -38,7 +52,7 @@
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
@ -47,7 +61,7 @@
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" class="example-container mat-elevation-z8">
|
||||
|
||||
@ -143,3 +143,14 @@ th {
|
||||
font-size: 16px;
|
||||
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 dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
||||
displayedColumns = ['serialno','name','actions','isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -119,6 +119,25 @@ export class IndustryClassificationListComponent implements OnInit {
|
||||
this.getIndustryClassification();
|
||||
//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 */
|
||||
ngAfterViewInit() {
|
||||
|
||||
@ -57,21 +57,39 @@ export class LenderHierarchyDialogComponent implements OnInit {
|
||||
onSubmit() {
|
||||
var LenderHierarchyFormValues = this._lenderHierarchyForm.value;
|
||||
if(isNaN(this.data.lender_hierarchy_id)) {
|
||||
|
||||
//To Remove The "Null" With Key
|
||||
Object.keys(LenderHierarchyFormValues).forEach((key) => ( LenderHierarchyFormValues[key] == null) && delete LenderHierarchyFormValues[key]);
|
||||
console.log(LenderHierarchyFormValues);
|
||||
this._MastersService.addMasterDetails(LenderHierarchyFormValues,'LENDERHIERARCHY').subscribe();
|
||||
//Add Designation data with help Service File
|
||||
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
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(LenderHierarchyFormValues,'LENDERHIERARCHY').subscribe();
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
this._MastersService.editMasterDetails(LenderHierarchyFormValues,'LENDERHIERARCHY').subscribe(dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Data Edited Successfully");
|
||||
}
|
||||
else{
|
||||
alert("SomeThing Wents Wrong Try Again !");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,4 +98,5 @@ export class LenderHierarchyDialogComponent implements OnInit {
|
||||
onReset(){
|
||||
this._lenderHierarchyForm.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
/** End of lender hierarchy Component*/
|
||||
@ -86,10 +86,23 @@
|
||||
</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-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)="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>
|
||||
</ng-container>
|
||||
|
||||
@ -97,7 +110,7 @@
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
@ -106,7 +119,7 @@
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
@ -118,4 +118,15 @@
|
||||
font-size: 16px;
|
||||
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 dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['serialno','lender_hierarchy','isactive','actions'];
|
||||
displayedColumns = ['serialno','lender_hierarchy','actions','isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -122,6 +122,25 @@ export class LenderHierarchyListComponent implements OnInit {
|
||||
this.getLenderHierarchy();
|
||||
//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 */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
|
||||
@ -45,20 +45,35 @@ export class MembersOccupationDialogComponent implements OnInit {
|
||||
onSubmit() {
|
||||
var OccupationFormValues = this._occupationForm.value;
|
||||
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]);
|
||||
console.log(OccupationFormValues);
|
||||
this._memberService.addMasterDetails(OccupationFormValues,'OCCUPATIONMEMBERS').subscribe();
|
||||
//After Saving the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
|
||||
this._memberService.addMasterDetails(OccupationFormValues,'OCCUPATIONMEMBERS').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 !");
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
this._memberService.editMasterDetails(this._occupationForm.value,'OCCUPATIONMEMBERS').subscribe();
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
this._memberService.editMasterDetails(this._occupationForm.value,'OCCUPATIONMEMBERS').subscribe(
|
||||
dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
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">
|
||||
<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)="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>
|
||||
</ng-container>
|
||||
|
||||
@ -114,7 +129,7 @@
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
@ -123,7 +138,7 @@
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
|
||||
@ -84,4 +84,15 @@
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
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 dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
||||
displayedColumns = ['serialno','name','actions', 'isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -125,6 +125,25 @@ export class MembersOccupationListComponent implements OnInit {
|
||||
this.getMemberOccupation();
|
||||
//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 */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
|
||||
@ -113,7 +113,7 @@
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
|
||||
@ -117,4 +117,12 @@
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
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]);
|
||||
|
||||
this._MastersService.addMasterDetails(pdLocationApproachFormValue,'PDLOCATIONAPPROACH').subscribe();
|
||||
//After Saving the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
} else {
|
||||
this._MastersService.addMasterDetails(pdLocationApproachFormValue,'PDLOCATIONAPPROACH').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 !");
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(pdLocationApproachFormValue,'PDLOCATIONAPPROACH').subscribe();
|
||||
this._MastersService.editMasterDetails(pdLocationApproachFormValue,'PDLOCATIONAPPROACH').subscribe(
|
||||
|
||||
//After Saving the data then popup close
|
||||
dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Edited Successfully");
|
||||
//Need To Display saving Datas
|
||||
alert("Data Edited Successfully");
|
||||
}
|
||||
else{
|
||||
alert("SomeThing Wents Wrong Try Again !");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** To Reset Popup Data */
|
||||
onReset(){
|
||||
this._pdLocationApproachForm.reset();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/** End Of Pd Location DIalog COmponent */
|
||||
@ -84,8 +84,23 @@
|
||||
<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)="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>
|
||||
</ng-container>
|
||||
|
||||
@ -93,7 +108,7 @@
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
@ -102,7 +117,7 @@
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
@ -117,4 +117,15 @@
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
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;
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['serialno','description','isactive','actions'];
|
||||
displayedColumns = ['serialno','description','actions', 'isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -89,7 +89,6 @@ export class PdLocationApproachListComponent implements OnInit {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
//To get data for listing
|
||||
getPdLocationApproach() {
|
||||
this._MastersService.getAllMasterData('PDLOCATIONAPPROACH').subscribe(
|
||||
@ -106,13 +105,34 @@ export class PdLocationApproachListComponent implements OnInit {
|
||||
})
|
||||
}
|
||||
|
||||
deletePdLocationApproach(id: number) {
|
||||
var PrimaryKeyWithValue ={'pd_allocation_type_id':id};
|
||||
this._MastersService.deleteMasterDetails(PrimaryKeyWithValue,'PDLOCATIONAPPROACH').subscribe( data => { });
|
||||
this.getPdLocationApproach();
|
||||
//this._MastersService.deleteMasterDetails('pd_allocation_type_id',id,'PDLOCATIONAPPROACH');
|
||||
}
|
||||
//sdffsadfasf
|
||||
// deletePdLocationApproach(id: number) {
|
||||
// var PrimaryKeyWithValue ={'pd_allocation_type_id':id};
|
||||
// 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();
|
||||
}
|
||||
else{
|
||||
alert("SomeThing Wents Wrong Try Again !");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** For Display Tables Pagination And Sorting */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
|
||||
@ -28,6 +28,7 @@ export class PdTypeDialogComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
/** Pd Type Form Datas */
|
||||
this._pdTypeForm = this._formBuilder.group({
|
||||
//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],
|
||||
@ -57,18 +58,35 @@ export class PdTypeDialogComponent implements OnInit {
|
||||
|
||||
Object.keys(PdTypeFormValues).forEach((key) => ( PdTypeFormValues[key] == null) && delete PdTypeFormValues[key]);
|
||||
//console.log(PdTypeFormValues);
|
||||
this._pdTypeService.addMasterDetails(PdTypeFormValues,'PDTYPE').subscribe();
|
||||
this._pdTypeService.addMasterDetails(PdTypeFormValues,'PDTYPE').subscribe(
|
||||
//After Saving the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
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 !");
|
||||
}
|
||||
|
||||
});
|
||||
} 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
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
//Need To Display saving Datas
|
||||
alert("Data Edited Successfully");
|
||||
}
|
||||
else{
|
||||
alert("SomeThing Wents Wrong Try Again !");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,4 +95,5 @@ export class PdTypeDialogComponent implements OnInit {
|
||||
onReset(){
|
||||
this._pdTypeForm.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
/** End Of PD Type Dialog Component */
|
||||
@ -83,8 +83,23 @@
|
||||
<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-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)="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>
|
||||
</ng-container>
|
||||
|
||||
@ -92,7 +107,7 @@
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
@ -101,7 +116,7 @@
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
@ -118,4 +118,15 @@
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
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 dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['serialno','type_name', 'isactive','actions'];
|
||||
displayedColumns = ['serialno','type_name','actions', 'isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -82,7 +82,6 @@ export class PdTypeListComponent implements OnInit {
|
||||
this.isPopupOpened = false;
|
||||
});
|
||||
}
|
||||
|
||||
//To get data for listing
|
||||
getPDType() {
|
||||
this._PDTypeService.getAllMasterData('PDTYPE').subscribe(
|
||||
@ -106,6 +105,26 @@ export class PdTypeListComponent implements OnInit {
|
||||
this.getPDType();
|
||||
//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 */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
|
||||
@ -52,18 +52,32 @@ export class ProductDialogComponent implements OnInit {
|
||||
//console.log(ProductFormValues);
|
||||
//this._MastersService.addProductMaster(this._productMasterForm.value);
|
||||
//this._MastersService.addProd(this._productMasterForm.value).subscribe(data=>this.array=data);
|
||||
this._MastersService.addMasterDetails(ProductFormValues,'PRODUCTS').subscribe();
|
||||
//After Saving the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
this._MastersService.addMasterDetails(ProductFormValues,'PRODUCTS').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 !");
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
//this._MastersService.editProductMaster(this._productMasterForm.value);
|
||||
this._MastersService.editMasterDetails(this._productMasterForm.value,'PRODUCTS').subscribe();
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
|
||||
alert("Edited Successfully");
|
||||
this._MastersService.editMasterDetails(this._productMasterForm.value,'PRODUCTS').subscribe( dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Data Edited Successfully");
|
||||
}
|
||||
else{
|
||||
alert("SomeThing Wents Wrong Try Again !");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/** To Reset Popup Data */
|
||||
@ -71,4 +85,5 @@ export class ProductDialogComponent implements OnInit {
|
||||
this._productMasterForm.reset();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/** End Of Product Master Component*/
|
||||
@ -32,8 +32,23 @@
|
||||
<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-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)="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>
|
||||
</ng-container>
|
||||
|
||||
@ -41,7 +56,7 @@
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
@ -50,7 +65,8 @@
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
|
||||
@ -117,4 +117,15 @@
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
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 dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['serialno','name','abbr', 'isactive','actions'];
|
||||
displayedColumns = ['serialno','name','abbr','actions', 'isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -113,6 +113,25 @@ export class ProductListComponent implements OnInit {
|
||||
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 */
|
||||
ngAfterViewInit() {
|
||||
|
||||
@ -29,6 +29,7 @@ export class RegionsDialogComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
/** Region Form Datas */
|
||||
this._regionsForm = this._formBuilder.group({
|
||||
//Regions_id: any; fk_city_id: any;
|
||||
region_id: [this.data.region_id],
|
||||
@ -58,22 +59,39 @@ onNoClick(): void {
|
||||
|
||||
Object.keys(RegionFormValues).forEach((key) => ( RegionFormValues[key] == null) && delete RegionFormValues[key]);
|
||||
// console.log(RegionFormValues);
|
||||
this._regionsService.addMasterDetails(RegionFormValues,'REGIONS').subscribe();
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
this._regionsService.addMasterDetails(RegionFormValues,'REGIONS').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 !");
|
||||
}
|
||||
|
||||
});
|
||||
} 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();
|
||||
//Need To Display saving Datas
|
||||
alert("Edited Successfully");
|
||||
//Need To Display saving Datas
|
||||
alert("Data Edited Successfully");
|
||||
}
|
||||
else{
|
||||
alert("SomeThing Wents Wrong Try Again !");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** To Reset Popup Data */
|
||||
onReset(){
|
||||
this._regionsForm.reset();
|
||||
}
|
||||
}
|
||||
/**End Of Region Dialog Component*/
|
||||
@ -86,8 +86,23 @@
|
||||
<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-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)="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>
|
||||
</ng-container>
|
||||
|
||||
@ -95,7 +110,7 @@
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
@ -104,7 +119,7 @@
|
||||
</mat-row>
|
||||
</mat-table>
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -118,4 +118,15 @@
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
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 dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
||||
displayedColumns = ['serialno','name','actions', 'isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -81,6 +81,25 @@ this.getregions();
|
||||
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
|
||||
getregions() {
|
||||
|
||||
@ -31,6 +31,7 @@ export class RelationShipDialogComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
/** RelationShip Form Datas */
|
||||
this._relationShipForm = this._formBuilder.group({
|
||||
relationship_id: [this.data.relationship_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])]
|
||||
@ -57,18 +58,36 @@ onNoClick(): void {
|
||||
onSubmit() {
|
||||
var RelationshipFormValues = this._relationShipForm.value;
|
||||
if(isNaN(this.data.relationship_id)) {
|
||||
|
||||
//To Remove The "Null" With Key
|
||||
Object.keys(RelationshipFormValues).forEach((key) => ( RelationshipFormValues[key] == null) && delete RelationshipFormValues[key]);
|
||||
console.log(RelationshipFormValues);
|
||||
this._MastersService.addMasterDetails(RelationshipFormValues,'RELATIONSHIPS').subscribe();
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
//Add data with help Service File
|
||||
this._MastersService.addMasterDetails(RelationshipFormValues,'RELATIONSHIPS').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 !");
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
this._MastersService.editMasterDetails(this._relationShipForm.value,'RELATIONSHIPS').subscribe();
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Edited Successfully");
|
||||
this._MastersService.editMasterDetails(this._relationShipForm.value,'RELATIONSHIPS').subscribe(
|
||||
|
||||
dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Data Edited Successfully");
|
||||
}
|
||||
else{
|
||||
alert("SomeThing Wents Wrong Try Again !");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,3 +96,4 @@ onNoClick(): void {
|
||||
this._relationShipForm.reset();
|
||||
}
|
||||
}
|
||||
/** End Of Relationship Dialog Component */
|
||||
@ -105,8 +105,23 @@
|
||||
<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-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)="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>
|
||||
</ng-container>
|
||||
|
||||
@ -114,7 +129,7 @@
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
@ -123,7 +138,7 @@
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
@ -144,3 +144,14 @@ th {
|
||||
font-size: 16px;
|
||||
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 dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
||||
displayedColumns = ['serialno','name','actions', 'isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -90,6 +90,25 @@ export class RelationShipListComponent implements OnInit {
|
||||
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
|
||||
getRelationShip() {
|
||||
|
||||
@ -78,17 +78,33 @@ export class StatesDialogComponent implements OnInit {
|
||||
|
||||
Object.keys(StatesFormValues).forEach((key) => ( StatesFormValues[key] == null) && delete StatesFormValues[key]);
|
||||
|
||||
this._MastersService.addMasterDetails(StatesFormValues,'STATE').subscribe();
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
this._MastersService.addMasterDetails(StatesFormValues,'STATE').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 !");
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(StatesFormValues,'STATE').subscribe();
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
this._MastersService.editMasterDetails(StatesFormValues,'STATE').subscribe(
|
||||
dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
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">
|
||||
<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-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)="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>
|
||||
</ng-container>
|
||||
|
||||
@ -138,7 +153,7 @@
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
@ -147,7 +162,7 @@
|
||||
</mat-row>
|
||||
</mat-table>
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -118,4 +118,15 @@
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
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 dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['serialno','name','region_name', 'isactive','actions'];
|
||||
displayedColumns = ['serialno','name','region_name','actions', 'isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -87,7 +87,25 @@ export class StatesListComponent implements OnInit {
|
||||
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
|
||||
getState() {
|
||||
this._statesService.getAllState().subscribe(
|
||||
|
||||
@ -70,18 +70,36 @@ export class SubProductDialogComponent implements OnInit {
|
||||
onSubmit() {
|
||||
var SubProductFormValues = this._subProductMasterForm.value;
|
||||
if(isNaN(this.data.subproduct_id)) {
|
||||
|
||||
//To Remove The "Null" With Key
|
||||
Object.keys(SubProductFormValues).forEach((key) => ( SubProductFormValues[key] == null) && delete SubProductFormValues[key]);
|
||||
console.log(SubProductFormValues);
|
||||
this._MastersService.addMasterDetails(SubProductFormValues,'SUBPRODUCTS').subscribe();
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
|
||||
this._MastersService.addMasterDetails(SubProductFormValues,'SUBPRODUCTS').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 !");
|
||||
}
|
||||
|
||||
});
|
||||
} 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();
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
alert("Data Edited Successfully");
|
||||
}
|
||||
else{
|
||||
alert("SomeThing Wents Wrong Try Again !");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/** To Reset Popup Data */
|
||||
@ -89,4 +107,5 @@ export class SubProductDialogComponent implements OnInit {
|
||||
this._subProductMasterForm.reset();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/** End Of SubProductMaster Dialog Component */
|
||||
@ -119,8 +119,23 @@
|
||||
<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-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)="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>
|
||||
</ng-container>
|
||||
|
||||
@ -128,7 +143,7 @@
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
@ -137,7 +152,7 @@
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
@ -145,4 +145,7 @@ th {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
.example-margin {
|
||||
margin: 10px;
|
||||
}
|
||||
@ -35,7 +35,7 @@ export class SubProductListComponent implements OnInit {
|
||||
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['serialno','product_name','name','isactive','actions'];
|
||||
displayedColumns = ['serialno','product_name','name','actions','isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -120,6 +120,25 @@ getSubProductMaster() {
|
||||
this.getSubProductMaster();
|
||||
//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 */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
|
||||
@ -55,25 +55,42 @@ export class TitleDialogComponent implements OnInit {
|
||||
|
||||
/** To Save/Edited Popup Data */
|
||||
onSubmit() {
|
||||
var TitleFormValues = this._titleForm.value;
|
||||
if(isNaN(this.data.title_id)) {
|
||||
var TitleFormValues = this._titleForm.value;
|
||||
//To Remove The "Null" With Key
|
||||
Object.keys(TitleFormValues).forEach((key) => ( TitleFormValues[key] == null) && delete TitleFormValues[key]);
|
||||
|
||||
this._MastersService.addMasterDetails(TitleFormValues,'TITLES').subscribe();
|
||||
//After Saving the BRANCH data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
//Add Designation data with help Service File
|
||||
this._MastersService.addMasterDetails(TitleFormValues,'TITLES').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 !");
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
this._MastersService.editMasterDetails(this._titleForm.value,'TITLES').subscribe();
|
||||
this.dialogRef.close();
|
||||
this._MastersService.editMasterDetails(this._titleForm.value,'TITLES').subscribe(
|
||||
dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
alert("Data Edited Successfully");
|
||||
}
|
||||
else{
|
||||
alert("SomeThing Wents Wrong Try Again !");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/** To Reset Popup Data */
|
||||
onReset(){
|
||||
this._titleForm.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
/** End Of Title Dialog Component */
|
||||
@ -104,8 +104,23 @@
|
||||
<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-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)="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>
|
||||
</ng-container>
|
||||
|
||||
@ -113,7 +128,7 @@
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
@ -122,7 +137,7 @@
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
@ -144,4 +144,7 @@ th {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
.example-margin {
|
||||
margin: 10px;
|
||||
}
|
||||
@ -33,7 +33,7 @@ export class TitleListComponent implements OnInit {
|
||||
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
||||
displayedColumns = ['serialno','name','actions', 'isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -107,6 +107,25 @@ export class TitleListComponent implements OnInit {
|
||||
|
||||
//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 */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
|
||||
@ -32,6 +32,7 @@ export class ActivityDialogComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
/** ActivityMaster Form Datas */
|
||||
this._activityMasterForm = this._formBuilder.group({
|
||||
type_of_activity_id: [this.data.type_of_activity_id],
|
||||
name: [this.data.name, Validators.compose([Validators.required])]
|
||||
@ -48,21 +49,36 @@ onNoClick(): void {
|
||||
onSubmit() {
|
||||
var ActivityFormValues = this._activityMasterForm.value;
|
||||
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]);
|
||||
console.log(ActivityFormValues);
|
||||
this._MastersService.addMasterDetails(ActivityFormValues,'TYPEOFACTIVITY').subscribe();
|
||||
//After Saving the BRANCH data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
|
||||
this._MastersService.addMasterDetails(ActivityFormValues,'TYPEOFACTIVITY').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 !");
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
|
||||
this._MastersService.editMasterDetails(ActivityFormValues,'TYPEOFACTIVITY').subscribe();
|
||||
//After Editing the BRANCH data then popup close
|
||||
this._MastersService.editMasterDetails(ActivityFormValues,'TYPEOFACTIVITY').subscribe(
|
||||
dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//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();
|
||||
// }
|
||||
// }
|
||||
|
||||
/** To Reset Popup Data */
|
||||
onReset(){
|
||||
this._activityMasterForm.reset();
|
||||
}
|
||||
}
|
||||
/** End Of Activit Dialog Component */
|
||||
@ -97,8 +97,23 @@
|
||||
<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-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)="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>
|
||||
</ng-container>
|
||||
|
||||
@ -106,7 +121,7 @@
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
@ -115,7 +130,7 @@
|
||||
</mat-row>
|
||||
</mat-table>
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]"></mat-paginator>
|
||||
<mat-paginator [pageSizeOptions]="[5, 10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -143,4 +143,7 @@ th {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
.example-margin {
|
||||
margin: 10px;
|
||||
}
|
||||
@ -34,7 +34,7 @@ export class ActivityListComponent implements OnInit {
|
||||
noRecordFound: boolean = false;
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['serialno','name','isactive','actions'];
|
||||
displayedColumns = ['serialno','name','actions', 'isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -115,6 +115,25 @@ export class ActivityListComponent implements OnInit {
|
||||
this.getActivity();
|
||||
//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 */
|
||||
ngAfterViewInit() {
|
||||
|
||||
@ -63,17 +63,34 @@ export class UomDialogComponent implements OnInit {
|
||||
|
||||
Object.keys(UOMFormValues).forEach((key) => ( UOMFormValues[key] == null) && delete UOMFormValues[key]);
|
||||
console.log(UOMFormValues);
|
||||
this._mastersService.addMasterDetails(UOMFormValues,'UOM').subscribe();
|
||||
//After Saving the BRANCH data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Dispaly saving Datas
|
||||
alert("Saved Successfully");
|
||||
this._mastersService.addMasterDetails(UOMFormValues,'UOM').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 !");
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
this._mastersService.editMasterDetails(this._uomForm.value,'UOM').subscribe();
|
||||
//After Editing the BRANCH data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Edit Successfully");
|
||||
this._mastersService.editMasterDetails(this._uomForm.value,'UOM').subscribe(
|
||||
|
||||
dataresult=>{
|
||||
if (dataresult.dataStatus == true){
|
||||
//After Editing the data then popup close
|
||||
this.dialogRef.close();
|
||||
//Need To Display saving Datas
|
||||
alert("Data Edited Successfully");
|
||||
}
|
||||
else{
|
||||
alert("SomeThing Wents Wrong Try Again !");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/** To Reset Popup Data */
|
||||
@ -81,3 +98,4 @@ export class UomDialogComponent implements OnInit {
|
||||
this._uomForm.reset();
|
||||
}
|
||||
}
|
||||
/** End of UOM dialog Component*/
|
||||
@ -100,8 +100,23 @@
|
||||
<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-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)="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>
|
||||
</ng-container>
|
||||
|
||||
@ -109,7 +124,7 @@
|
||||
<mat-header-cell *matHeaderCellDef> Actions </mat-header-cell>
|
||||
<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 *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>
|
||||
</ng-container>
|
||||
|
||||
@ -118,7 +133,7 @@
|
||||
</mat-row>
|
||||
</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 *ngIf="noRecordFound" class="nocontent">No records found</div>
|
||||
|
||||
@ -142,4 +142,7 @@ th {
|
||||
color: red;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
.example-margin {
|
||||
margin: 10px;
|
||||
}
|
||||
@ -40,7 +40,7 @@ export class UomListComponent implements OnInit {
|
||||
|
||||
public dataLength: number;
|
||||
public dataSource = new MatTableDataSource();
|
||||
displayedColumns = ['serialno','name', 'isactive','actions'];
|
||||
displayedColumns = ['serialno','name','actions', 'isactive'];
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
@ -130,6 +130,25 @@ export class UomListComponent implements OnInit {
|
||||
this.getUOM();
|
||||
//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 */
|
||||
ngAfterViewInit() {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
|
||||
@ -12,6 +12,7 @@ import {
|
||||
MatDialogModule,
|
||||
MatProgressBarModule,MatToolbarModule,
|
||||
MatTableModule,MatPaginatorModule,MatSortModule} from '@angular/material';
|
||||
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
|
||||
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
|
||||
@ -107,6 +108,7 @@ import { MastersService } from '../service/masters/masters.service';
|
||||
NgxMatSelectSearchModule,
|
||||
NgxDatatableModule,
|
||||
MatSortModule,
|
||||
MatSlideToggleModule,
|
||||
MatTooltipModule
|
||||
],
|
||||
declarations: [MastersComponent,
|
||||
|
||||
@ -106,7 +106,23 @@ return this._http.post<any>(this.apiUrl+"saveMaster", ArrayData)
|
||||
// alert(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
|
||||
* 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);
|
||||
};
|
||||
}
|
||||
addCompanyDetails
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user