From bbb45f197f623af1010dab597a9835fefd0215a1 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Tue, 25 Sep 2018 16:36:30 +0530 Subject: [PATCH] master detail active and Inactive changes --- .../branch-dialog/branch-dialog.component.ts | 44 ++++------- .../branch-list/branch-list.component.html | 50 ++++++++++-- .../branch-list/branch-list.component.scss | 79 +++++++++++-------- .../branch-list/branch-list.component.ts | 44 +++++++++-- .../city/city-dialog/city-dialog.component.ts | 43 +++++++--- .../city/city-list/city-list.component.html | 44 +++++++++-- .../city/city-list/city-list.component.scss | 13 ++- .../city/city-list/city-list.component.ts | 34 ++++++-- ...comments-on-locality-dialog.component.html | 5 +- .../comments-on-locality-dialog.component.ts | 40 +++++++--- .../comments-on-locality-list.component.html | 29 ++++++- .../comments-on-locality-list.component.scss | 14 +++- .../comments-on-locality-list.component.ts | 32 ++++++-- .../company-dialog.component.ts | 2 +- .../company-list/company-list.component.html | 2 +- .../company-list/company-list.component.ts | 14 ++-- .../customer-behaviour-dialog.component.html | 5 +- .../customer-behaviour-dialog.component.ts | 51 ++++++++---- .../customer-behaviour-list.component.html | 33 ++++++-- .../customer-behaviour-list.component.scss | 13 ++- .../customer-behaviour-list.component.ts | 32 ++++++-- .../customer-segment-dialog.component.ts | 40 +++++++--- .../customer-segment-list.component.html | 38 ++++++--- .../customer-segment-list.component.scss | 13 ++- .../customer-segment-list.component.ts | 22 +++++- .../designation-dialog.component.ts | 36 ++++++--- .../designation-list.component.html | 23 +++++- .../designation-list.component.scss | 11 +++ .../designation-list.component.ts | 21 ++++- .../frequency-dialog.component.ts | 43 ++++++---- .../frequency-list.component.html | 21 ++++- .../frequency-list.component.scss | 11 +++ .../frequency-list.component.ts | 21 ++++- ...ndustry_classification-dialog.component.ts | 39 ++++++--- ...ndustry_classification-list.component.html | 22 +++++- ...ndustry_classification-list.component.scss | 11 +++ .../industry_classification-list.component.ts | 21 ++++- .../lender-hierarchy-dialog.component.ts | 37 ++++++--- .../lender-hierarchy-list.component.html | 25 ++++-- .../lender-hierarchy-list.component.scss | 11 +++ .../lender-hierarchy-list.component.ts | 21 ++++- .../members-occupation-dialog.component.ts | 40 +++++++--- .../members-occupation-list.component.html | 23 +++++- .../members-occupation-list.component.scss | 11 +++ .../members-occupation-list.component.ts | 21 ++++- .../pd-allocation-type-list.component.html | 2 +- .../pd-allocation-type-list.component.scss | 8 ++ .../pd-location-approach-dialog.component.ts | 48 ++++++----- .../pd-location-approach-list.component.html | 23 +++++- .../pd-location-approach-list.component.scss | 11 +++ .../pd-location-approach-list.component.ts | 38 ++++++--- .../pd-type-dialog.component.ts | 35 ++++++-- .../pd-type-list/pd-type-list.component.html | 23 +++++- .../pd-type-list/pd-type-list.component.scss | 11 +++ .../pd/pd-type-list/pd-type-list.component.ts | 23 +++++- .../product-dialog.component.ts | 37 ++++++--- .../product-list/product-list.component.html | 24 +++++- .../product-list/product-list.component.scss | 11 +++ .../product-list/product-list.component.ts | 21 ++++- .../regions-dialog.component.ts | 34 ++++++-- .../regions-list/regions-list.component.html | 23 +++++- .../regions-list/regions-list.component.scss | 11 +++ .../regions-list/regions-list.component.ts | 21 ++++- .../relation-ship-dialog.component.ts | 40 +++++++--- .../relation-ship-list.component.html | 23 +++++- .../relation-ship-list.component.scss | 11 +++ .../relation-ship-list.component.ts | 21 ++++- .../states-dialog/states-dialog.component.ts | 35 +++++--- .../states-list/states-list.component.html | 23 +++++- .../states-list/states-list.component.scss | 11 +++ .../states-list/states-list.component.ts | 20 ++++- .../sub-product-dialog.component.ts | 37 ++++++--- .../sub-product-list.component.html | 23 +++++- .../sub-product-list.component.scss | 3 + .../sub-product-list.component.ts | 21 ++++- .../title-dialog/title-dialog.component.ts | 39 ++++++--- .../title-list/title-list.component.html | 23 +++++- .../title-list/title-list.component.scss | 3 + .../title/title-list/title-list.component.ts | 21 ++++- .../activity-dialog.component.ts | 39 ++++++--- .../activity-list.component.html | 23 +++++- .../activity-list.component.scss | 3 + .../activity-list/activity-list.component.ts | 21 ++++- .../uom/uom-dialog/uom-dialog.component.ts | 38 ++++++--- .../uom/uom-list/uom-list.component.html | 23 +++++- .../uom/uom-list/uom-list.component.scss | 3 + .../uom/uom-list/uom-list.component.ts | 21 ++++- .../app/settings/masters/masters.module.ts | 2 + .../service/masters/masters.service.ts | 17 +++- 89 files changed, 1715 insertions(+), 438 deletions(-) diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.ts index a9e63125b..4a727e520 100644 --- a/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-dialog/branch-dialog.component.ts @@ -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 !"); + } + }); } } diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html index 283f6ba2f..31947f667 100644 --- a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.html @@ -30,27 +30,61 @@ {{row.name}} - + City Name - {{row.cityname}} + {{row.city_name}} - + + done clear - + --> Actions - - + + + + + + + Is Active + + + + + + + + + + @@ -61,7 +95,7 @@ - + diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.scss b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.scss index 2acbb309e..9e586d5a6 100644 --- a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.scss @@ -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; -} \ No newline at end of file +} +.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; +} diff --git a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.ts b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.ts index 7cd974b3a..20f8b46bb 100644 --- a/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/branch/branch-list/branch-list.component.ts @@ -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 */ diff --git a/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.ts index 5ba306973..a6b7630a3 100644 --- a/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/city/city-dialog/city-dialog.component.ts @@ -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(); } -} \ No newline at end of file +} +/** End Of CityDialogComponent */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.html b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.html index 1836e7747..86ae13944 100644 --- a/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.html @@ -71,6 +71,7 @@
--> +
@@ -80,7 +81,7 @@ - + Sl @@ -97,28 +98,61 @@ {{row.state_name}} - + + Actions - + + + + Is Active + + + + + + + + + - + + +
diff --git a/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.scss b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.scss index edf0e2861..187a8d571 100644 --- a/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.scss @@ -93,4 +93,15 @@ color: red; font-size: 16px; text-align: center; -} \ No newline at end of file +} +.active:hover{ + color: green; + font-size: 20px; +} +.deactive:hover{ + color: red; + font-size: 20px; +} +.example-margin { + margin: 10px; +} diff --git a/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.ts b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.ts index 5cdd22386..b512b4318 100644 --- a/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/city/city-list/city-list.component.ts @@ -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; } -} \ No newline at end of file +} +/** End of CityListComponent */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html index b6ac23634..5998b987a 100644 --- a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.html @@ -16,9 +16,8 @@
-

Comment On Locality                                                 

-
-
+

Comment On Locality            

+
diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.ts index 0e05d4fe7..596159f08 100644 --- a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-dialog/comments-on-locality-dialog.component.ts @@ -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(); } -} \ No newline at end of file +} +/** End Of Comment On Locality Component*/ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.html b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.html index 8f31554a0..6d5842063 100644 --- a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.html @@ -82,21 +82,42 @@ {{row.rating}} - + + Actions - + + + + Is Active + + + + + + + + diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.scss b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.scss index 1c7cbb292..115d871ff 100644 --- a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.scss @@ -115,4 +115,16 @@ color: red; font-size: 16px; text-align: center; - } \ No newline at end of file + } + .active:hover{ + color: green; + font-size: 20px; + } + .deactive:hover{ + color: red; + font-size: 20px; + } + .example-margin { + margin: 10px; + } + \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.ts b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.ts index 9b24a7ad6..df343d366 100644 --- a/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/comments-on-locality/comments-on-locality-list/comments-on-locality-list.component.ts @@ -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; diff --git a/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.ts index 15b506997..d7c8b0da8 100644 --- a/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/company/company-dialog/company-dialog.component.ts @@ -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); diff --git a/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.html b/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.html index 34a9ecb29..11ac932ed 100644 --- a/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.html @@ -136,7 +136,7 @@ - +
diff --git a/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.ts b/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.ts index 17faae42b..f1ada0b57 100644 --- a/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/company/company-list/company-list.component.ts @@ -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 */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html index 118352ce3..eac08918d 100644 --- a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.html @@ -16,9 +16,8 @@
-

Customer Behaviour                                                 

-
-
+

Customer Behaviour                                                 

+
diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.ts index adb3f33ac..257e570c3 100644 --- a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-dialog/customer-behaviour-dialog.component.ts @@ -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 */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.html b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.html index cd64aab4a..6c1530ed4 100644 --- a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.html @@ -81,19 +81,42 @@ {{row.description}} - + + Actions - + + + + + + Is Active + + + + + + + @@ -102,7 +125,7 @@ - +
diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.scss b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.scss index a3293d070..45a02ba8f 100644 --- a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.scss @@ -116,4 +116,15 @@ color: red; font-size: 16px; text-align: center; -} \ No newline at end of file +} +.active:hover{ + color: green; + font-size: 20px; +} +.deactive:hover{ + color: red; + font-size: 20px; +} +.example-margin { + margin: 10px; +} diff --git a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.ts b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.ts index 908ca988e..b1b548a4b 100644 --- a/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/customer-behaviour/customer-behaviour-list/customer-behaviour-list.component.ts @@ -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; diff --git a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.ts index 25eb8211f..fa83b951f 100644 --- a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-dialog/customer-segment-dialog.component.ts @@ -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 */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.html b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.html index 9c03fd7e5..7dced45bf 100644 --- a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.html @@ -86,28 +86,46 @@ {{row.name}} - - Is Active - - done - clear - - - + Actions - + + + + + Is Active + + + + + + + + + + - +
diff --git a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.scss b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.scss index 6e42570ec..98c5a2faf 100644 --- a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.scss @@ -116,4 +116,15 @@ color: red; font-size: 16px; text-align: center; -} \ No newline at end of file +} +.active:hover{ + color: green; + font-size: 20px; +} +.deactive:hover{ + color: red; + font-size: 20px; +} +.example-margin { + margin: 10px; +} diff --git a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.ts b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.ts index 80bbaaf38..bdb1c7e21 100644 --- a/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/customer-segment/customer-segment-list/customer-segment-list.component.ts @@ -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; diff --git a/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.ts index 6888b34bc..a2582b9a8 100644 --- a/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/designation/designation-dialog/designation-dialog.component.ts @@ -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 */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.html b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.html index a667d96b0..d880637ee 100644 --- a/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.html @@ -89,8 +89,23 @@ Is Active - done - clear + + + + + + @@ -98,7 +113,7 @@ Actions - + @@ -107,7 +122,7 @@ - + diff --git a/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.scss b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.scss index de2d6bf7e..d2a39133c 100644 --- a/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.scss @@ -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; } \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.ts b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.ts index 052a4f1f6..eadc34b9d 100644 --- a/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/designation/designation-list/designation-list.component.ts @@ -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; diff --git a/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.ts index 0ba9bc029..f36d4b167 100644 --- a/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/frequency/frequency-dialog/frequency-dialog.component.ts @@ -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 */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.html b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.html index 165405cfe..91ea8cb5a 100644 --- a/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.html @@ -98,8 +98,21 @@ Is Active - done - clear + + + + + @@ -107,7 +120,7 @@ Actions - + @@ -116,7 +129,7 @@ - + diff --git a/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.scss b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.scss index b02181100..bef4a3bab 100644 --- a/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.scss @@ -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; +} diff --git a/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.ts b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.ts index 43f19497a..2b8089cce 100644 --- a/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/frequency/frequency-list/frequency-list.component.ts @@ -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; diff --git a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.ts index e449ee849..2c2963fe0 100644 --- a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-dialog/industry_classification-dialog.component.ts @@ -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 */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.html b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.html index befe1501f..3820b5bc1 100644 --- a/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/industry_classification/industry_classification-list/industry_classification-list.component.html @@ -29,8 +29,22 @@ Is Active - done - clear + + + + + @@ -38,7 +52,7 @@ Actions - + @@ -47,7 +61,7 @@ - + - done - clear + Is Active + + + + + + @@ -97,7 +110,7 @@ Actions - + @@ -106,7 +119,7 @@ - + diff --git a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.scss b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.scss index a5a36e351..79309cc02 100644 --- a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.scss @@ -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; +} diff --git a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.ts b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.ts index 0c12f37b1..70a57c090 100644 --- a/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/lender-hierarchy/lender-hierarchy-list/lender-hierarchy-list.component.ts @@ -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; diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.ts index 9baba37d3..09f40e51c 100644 --- a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-dialog/members-occupation-dialog.component.ts @@ -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 */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.html b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.html index 8bd6940ac..ef4a74013 100644 --- a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.html @@ -105,8 +105,23 @@ Is Active - done - clear + + + + + + @@ -114,7 +129,7 @@ Actions - + @@ -123,7 +138,7 @@ - + diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.scss b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.scss index 5266fec6e..5c4e9d53e 100644 --- a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.scss @@ -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; } \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.ts b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.ts index 6e2385c8f..ddec6a778 100644 --- a/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/members-occupation/members-occupation-list/members-occupation-list.component.ts @@ -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; diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.html b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.html index b54514943..adce34a0c 100644 --- a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.html @@ -113,7 +113,7 @@ - + diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.scss b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.scss index 0eaee99e0..9a6e69625 100644 --- a/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-allocation-type-list/pd-allocation-type-list.component.scss @@ -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; } \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.ts index a0496306a..59ca111cc 100644 --- a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-dialog/pd-location-approach-dialog.component.ts @@ -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 */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.html b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.html index 39086e10c..920dcd91f 100644 --- a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.html @@ -84,8 +84,23 @@ Is Active - done - clear + + + + + + @@ -93,7 +108,7 @@ Actions - + @@ -102,7 +117,7 @@ - + diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.scss b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.scss index 0eaee99e0..12d41abc6 100644 --- a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.scss @@ -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; } \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.ts index 316add488..b2280fb66 100644 --- a/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-location-approach-list/pd-location-approach-list.component.ts @@ -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; diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.ts index 6dc3038ef..9ff5063bf 100644 --- a/ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-type-dialog/pd-type-dialog.component.ts @@ -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(); } -} \ No newline at end of file +} +/** End Of PD Type Dialog Component */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.html b/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.html index cfd2502b7..cd2a20317 100644 --- a/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.html @@ -83,8 +83,23 @@ Is Active - done - clear + + + + + + @@ -92,7 +107,7 @@ Actions - + @@ -101,7 +116,7 @@ - + diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.scss b/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.scss index 2035efc84..382f2e683 100644 --- a/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.scss @@ -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; } \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.ts b/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.ts index 5866ab402..912243bac 100644 --- a/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/pd/pd-type-list/pd-type-list.component.ts @@ -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; diff --git a/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.ts index 93f79d02e..003817798 100644 --- a/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/product/product-dialog/product-dialog.component.ts @@ -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(); } -} \ No newline at end of file +} +/** End Of Product Master Component*/ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.html b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.html index c5212144e..e8b2937b4 100644 --- a/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.html @@ -32,8 +32,23 @@ Is Active - done - clear + + + + + + + @@ -41,7 +56,7 @@ Actions - + @@ -50,7 +65,8 @@ - + + diff --git a/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.scss b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.scss index de2d6bf7e..d2a39133c 100644 --- a/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.scss @@ -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; } \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.ts b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.ts index 2643bec10..1b27bbfdd 100644 --- a/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/product/product-list/product-list.component.ts @@ -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() { diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.ts index a45877b6e..f55a3f70f 100644 --- a/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/regions/regions-dialog/regions-dialog.component.ts @@ -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*/ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.html b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.html index 9a6305050..e05d318df 100644 --- a/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.html @@ -86,8 +86,23 @@ Is Active - done - clear + + + + + + @@ -95,7 +110,7 @@ Actions - + @@ -104,7 +119,7 @@ - + diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.scss b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.scss index 2035efc84..382f2e683 100644 --- a/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.scss @@ -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; } \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.ts b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.ts index 37ec60e87..03b6189c5 100644 --- a/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/regions/regions-list/regions-list.component.ts @@ -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() { diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.ts index 0f6fa8aa0..23f1f6b08 100644 --- a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-dialog/relation-ship-dialog.component.ts @@ -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 */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.html b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.html index a79985d90..4b039c6e9 100644 --- a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.html @@ -105,8 +105,23 @@ Is Active - done - clear + + + + + + @@ -114,7 +129,7 @@ Actions - + @@ -123,7 +138,7 @@ - + diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.scss b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.scss index 866150c32..2fb88a800 100644 --- a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.scss @@ -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; +} diff --git a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.ts b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.ts index 1cb1fdf10..90eee0ba2 100644 --- a/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/relation-ship/relation-ship-list/relation-ship-list.component.ts @@ -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() { diff --git a/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.ts index ab6244126..89962c3a0 100644 --- a/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/states/states-dialog/states-dialog.component.ts @@ -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 */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.html b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.html index 310e47308..3afaf871c 100644 --- a/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.html @@ -129,8 +129,23 @@ Is Active - done - clear + + + + + + @@ -138,7 +153,7 @@ Actions - + @@ -147,7 +162,7 @@ - + diff --git a/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.scss b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.scss index 2035efc84..382f2e683 100644 --- a/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.scss @@ -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; } \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.ts b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.ts index 26f258de5..b06843e3a 100644 --- a/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/states/states-list/states-list.component.ts @@ -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( diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.ts index 2a0f8b831..f9c463683 100644 --- a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-dialog/sub-product-dialog.component.ts @@ -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(); } -} \ No newline at end of file +} +/** End Of SubProductMaster Dialog Component */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.html b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.html index cd2918b0b..0fbfa25e6 100644 --- a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.html @@ -119,8 +119,23 @@ Is Active - done - clear + + + + + + @@ -128,7 +143,7 @@ Actions - + @@ -137,7 +152,7 @@ - + diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.scss b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.scss index 336568e4b..cb9d4cd47 100644 --- a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.scss @@ -145,4 +145,7 @@ th { color: red; font-size: 16px; text-align: center; +} +.example-margin { + margin: 10px; } \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.ts b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.ts index 25312b528..7cda85dda 100644 --- a/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/sub-product/sub-product-list/sub-product-list.component.ts @@ -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; diff --git a/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.ts index b007b56d1..7adc7a4b5 100644 --- a/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/title/title-dialog/title-dialog.component.ts @@ -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(); } -} \ No newline at end of file +} +/** End Of Title Dialog Component */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.html b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.html index ab1438d90..0f707f3af 100644 --- a/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.html @@ -104,8 +104,23 @@ Is Active - done - clear + + + + + + @@ -113,7 +128,7 @@ Actions - + @@ -122,7 +137,7 @@ - + diff --git a/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.scss b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.scss index 80aaab10a..30e06d236 100644 --- a/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.scss @@ -144,4 +144,7 @@ th { color: red; font-size: 16px; text-align: center; +} +.example-margin { + margin: 10px; } \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.ts b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.ts index b20f495dc..d030054a3 100644 --- a/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/title/title-list/title-list.component.ts @@ -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; diff --git a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.ts index dab4f0e85..c0b676091 100644 --- a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-dialog/activity-dialog.component.ts @@ -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 */ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.html b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.html index 580c059bd..e9a2f8943 100644 --- a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.html @@ -97,8 +97,23 @@ Is Active - done - clear + + + + + + @@ -106,7 +121,7 @@ Actions - + @@ -115,7 +130,7 @@ - + diff --git a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.scss b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.scss index ab8c9a0c8..2262bf296 100644 --- a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.scss @@ -143,4 +143,7 @@ th { color: red; font-size: 16px; text-align: center; +} +.example-margin { + margin: 10px; } \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.ts b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.ts index 7a769bbf8..946bb8d44 100644 --- a/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/type-of-activity/activity-list/activity-list.component.ts @@ -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() { diff --git a/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.ts b/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.ts index 1ebe6d4b0..fe7ae9e89 100644 --- a/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.ts +++ b/ng6-seed/src/app/settings/masters/component/uom/uom-dialog/uom-dialog.component.ts @@ -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*/ \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.html b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.html index 9fb1c3c2a..1ca40c400 100644 --- a/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.html +++ b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.html @@ -100,8 +100,23 @@ Is Active - done - clear + + + + + + @@ -109,7 +124,7 @@ Actions - + @@ -118,7 +133,7 @@ - + diff --git a/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.scss b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.scss index 8948e11d4..147e64ad8 100644 --- a/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.scss +++ b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.scss @@ -142,4 +142,7 @@ th { color: red; font-size: 16px; text-align: center; +} +.example-margin { + margin: 10px; } \ No newline at end of file diff --git a/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.ts b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.ts index fb3c6ef07..075d79682 100644 --- a/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.ts +++ b/ng6-seed/src/app/settings/masters/component/uom/uom-list/uom-list.component.ts @@ -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; diff --git a/ng6-seed/src/app/settings/masters/masters.module.ts b/ng6-seed/src/app/settings/masters/masters.module.ts index d60a543a4..1da14799b 100644 --- a/ng6-seed/src/app/settings/masters/masters.module.ts +++ b/ng6-seed/src/app/settings/masters/masters.module.ts @@ -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, diff --git a/ng6-seed/src/app/settings/service/masters/masters.service.ts b/ng6-seed/src/app/settings/service/masters/masters.service.ts index 0448504d2..e1d62c335 100644 --- a/ng6-seed/src/app/settings/service/masters/masters.service.ts +++ b/ng6-seed/src/app/settings/service/masters/masters.service.ts @@ -106,7 +106,23 @@ return this._http.post(this.apiUrl+"saveMaster", ArrayData) // alert(data); // return data; } + + + IsactiveMasterDetails(Records:any,MasterName:string): Observable { + 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(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(this.apiUrl+"saveMaster", ArrayData) return of(result as T); }; } -addCompanyDetails } \ No newline at end of file